Compare commits

...

1982 Commits

Author SHA1 Message Date
Chih-Wei Huang
559a79ff87 Merge remote-tracking branch 'x86/froyo-x86' into froyo-next 2011-04-07 16:50:48 +08:00
Chia-I Wu
e87d4d2e31 egl_android: assorted fixes 2011-03-29 06:31:15 +08:00
Chia-I Wu
0c1c261c2d gralloc: glFlush() should suffice for page flipping 2011-03-28 22:33:38 +08:00
Chia-I Wu
f27a8a3321 gralloc: improve page flip blocking
Use DRM_MODE_PAGE_FLIP_EVENT.
2011-03-28 22:20:29 +08:00
Chia-I Wu
98e1078d71 gralloc: boost radeon performance
Allocate buffer from GTT for 2D apps.
2011-03-26 15:59:05 +08:00
Chia-I Wu
1e21885cde gralloc: improve radeon sync issue 2011-03-26 15:46:32 +08:00
Chia-I Wu
7492794ef5 glsl: add missing generated files 2011-03-26 15:20:15 +08:00
Chia-I Wu
16ca82773e gralloc: kernel module name is i915 2011-03-25 16:50:37 +08:00
Chia-I Wu
f84d946322 android: fix building 2011-03-25 03:30:43 +08:00
Chia-I Wu
66c6b2520d st/egl: add support for loading radeon 2011-03-25 03:30:43 +08:00
Chia-I Wu
f3837c7094 egl_android: add support for loading radeon
For completeness.  Not used.
2011-03-25 03:30:43 +08:00
Chia-I Wu
d8ebb254c2 android: use __mmap2 for winsys/r600 2011-03-25 03:30:43 +08:00
Chia-I Wu
dd4929b30b gralloc: add radeon support 2011-03-25 03:30:43 +08:00
Chia-I Wu
0b9a9c408f gralloc: rename i915 to intel 2011-03-25 03:30:43 +08:00
Chia-I Wu
5dddfa8591 gralloc: add multiple driver support 2011-03-25 03:30:43 +08:00
Chia-I Wu
7baac8d734 mesa: fix glDrawTex*
As the case with _mesa_DrawPixels, the driver may install its vertex
shader and the vp override flag should be set.
2011-03-25 03:29:54 +08:00
Chia-I Wu
887b78bb5b auxiliary: disable SSE translate
It does not support FIXED.
2011-03-25 03:29:04 +08:00
Chia-I Wu
d175f38bc3 mesa: one more missing pre-generated file 2011-03-17 15:59:23 +08:00
Chia-I Wu
eeb3391bd5 mesa: add more pre-generated files 2011-03-17 14:46:57 +08:00
Chia-I Wu
06608674d0 egl_android: update surface geometry 2011-03-16 20:18:40 +08:00
Chia-I Wu
9f119b3c51 intel: advertise GL_OES_point_sprite 2011-03-16 20:18:40 +08:00
Chia-I Wu
c4d9c4f7f1 i965c: add MESA_FORMAT_RGBA8888_REV to brw_format_for_mesa_format
The framebuffer uses

  PIXEL_FORMAT_BGRA_8888 -> MESA_FORMAT_ARGB8888

while applications use

  PIXEL_FORMAT_RGBA_8888 -> MESA_FORMAT_RGBA8888_REV
  PIXEL_FORMAT_RGB_565   -> MESA_FORMAT_RGB565
2011-03-16 20:18:40 +08:00
Chia-I Wu
e4706d5cc8 mesa: advertise GL_ARB_texture_non_power_of_two
It maps to DisplayHardware::NPOT_EXTENSION in SurfaceFlinger.
2011-03-16 20:18:40 +08:00
Chia-I Wu
9a3759c3dd android: Add Android.mk's. 2011-03-16 20:18:40 +08:00
Chia-I Wu
f547fef2d0 android: Add pre-generated files.
make -C src/glsl builtin_function.cpp
  make -C src/es1api
  make -C src/es2api
  make -C src/shared-glapi
  make -C src/mesa/mai/api_exec_es{12}.c
2011-03-16 20:18:39 +08:00
Chia-I Wu
73d3113849 android: Add __DRI_IMAGE_FORMAT_RGBA8888_REV. 2011-03-16 20:18:39 +08:00
Chia-I Wu
2b1f1af17f android: Add DRM-based gralloc. 2011-03-16 20:18:39 +08:00
Chia-I Wu
8e698931d7 android: Make egl_android load DRI drivers. 2011-03-16 20:18:39 +08:00
Chia-I Wu
f60af24be7 android: Add new classic EGL driver for Android. 2011-03-16 20:18:39 +08:00
Chia-I Wu
17cd318e41 android: Add android backend for st/egl. 2011-03-16 20:18:39 +08:00
Chia-I Wu
f2d8241f01 android: Add Android EGL extensions. 2011-03-16 20:18:39 +08:00
Chia-I Wu
f9172081ca android: Add _EGL_PLATFORM_ANDROID. 2011-03-16 20:18:39 +08:00
Chia-I Wu
cb4afed922 android: Enable extensions required by ES1 for i915c. 2011-03-16 20:18:39 +08:00
Chia-I Wu
5d1e2165f7 android: Fix depth/stencil with i915c/i965c. 2011-03-16 20:18:39 +08:00
Chia-I Wu
39d1094301 android: Fix GL_OES_EGL_image with SurfaceFlinger. 2011-03-16 20:18:39 +08:00
Chia-I Wu
fb3c3f3079 android: Use __mmap2 in winsys/svga. 2011-03-16 20:18:39 +08:00
Chia-I Wu
c60978b2e0 android: Fix build with bionic. 2011-03-16 20:18:39 +08:00
Chia-I Wu
80a8e7d3d1 i965c: Fix a declaration in for loop. 2011-03-16 20:18:39 +08:00
Chia-I Wu
a0f0662e0c i965c: Add support for GL_FIXED.
Quick and dirty..
2011-03-16 20:18:29 +08:00
Chia-I Wu
d5d833a353 i915c: Add GL_OES_draw_texture support. 2011-03-16 14:17:52 +08:00
Chia-I Wu
32197c0094 i915: Free with FREE. 2011-03-16 14:17:43 +08:00
Brian Paul
11150e4667 mesa: use BITFIELD64_BIT() macro 2011-03-15 18:21:36 -06:00
Brian Paul
aa878f94ab st/mesa: use BITFIELD64_BIT() macro in a few more places 2011-03-15 18:21:35 -06:00
Brian Paul
d350ef1682 glsl: add cast to silence signed/unsigned comparison warning 2011-03-15 18:21:35 -06:00
Brian Paul
d029ba9ec0 mesa: use 1UL for 64-bit unsigned constant for C++
This fixes C++ warnings where BITFIELD64_BIT() is used.
2011-03-15 18:21:35 -06:00
Ian Romanick
85caea29c1 glsl: Only allow unsized array assignment in an initializer
It should have been a tip when the spec says "However, implicitly
sized arrays cannot be assigned to. Note, this is a rare case that
*initializers and assignments appear to have different semantics*."
(empahsis mine)

Fixes bugzilla #34367.

NOTE: This is a candidate for stable release branches.
2011-03-15 16:41:23 -07:00
Daniel Vetter
d04348aaf6 i915g: fix braino in the static state rework
For mip-map level rendering, both draw offset and size tend to change ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 21:49:25 +01:00
Daniel Vetter
11ee41fe7f i915g: implement early z
v2: Make it actually work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 18:36:25 +01:00
Daniel Vetter
288504fac7 i915g: split up static state
Early Z support is set in the DST_VARS command. Hence split up static
state emission to avoid reissuing to much on fragment shader changes,
especially the costly dst buffer relocations.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 18:36:00 +01:00
Eric Anholt
a99447314c i965: Fix alpha testing when there is no color buffer in the FBO.
We were alpha testing against an unwritten value, resulting in garbage.
(part of) Bug #35073.
2011-03-15 10:14:52 -07:00
Eric Anholt
b60651a17b i965: Do our lowering passes before the loop of optimization.
The optimization loop won't reinsert noise instructions or quadop
vectors, so we were traversing the tree for nothing.  Lowering vector
indexing was in the loop after do_common_optimization() to avoid the
work if it ended up that the index was actually constant, but that has
been called already in the core.
2011-03-15 10:14:52 -07:00
Eric Anholt
c75427f4c8 glsl: Skip processing the first function's body in do_dead_functions().
It can't call anything, so there's no point.
2011-03-15 10:14:51 -07:00
Eric Anholt
11af045ea8 glsl: Whitespace fixup in opt_dead_functions.cpp. 2011-03-15 10:14:51 -07:00
Eric Anholt
2b13e13594 glsl: Skip processing of expression trees in discard simplification.
It only cares about "if", "loop", and "discard".
2011-03-15 09:49:01 -07:00
Eric Anholt
05cf1ad82e glsl: Reduce processing of expression trees in do_structure_splitting.
Most of the time we don't have a non-uniform struct variable in the
shader, so this cuts the time spent in do_structure_splitting during
glean texCombine by about 2/3.
2011-03-15 09:49:01 -07:00
Eric Anholt
991fa4d3d0 glsl: Skip processing expression trees in do_if_simplification().
Reduces time spent in this during glean texCombine by about 2/3.
2011-03-15 09:49:00 -07:00
Eric Anholt
d3a444af2d glsl: Skip processing expression trees in optimize_redundant_jumps()
Cuts the time spent in this function during glean texCombine by 2/3.
2011-03-15 09:49:00 -07:00
José Fonseca
b0fff8d17e svga: Tell the host to discard when doing writes without FLUSH_EXPLICIT. 2011-03-15 15:44:03 +00:00
José Fonseca
147ca90bd3 svga: Update svga_winsys_screen::buffer_map comments. 2011-03-15 15:43:33 +00:00
José Fonseca
ef33c82bfd svga: Ensure DMA commands are serialized with unsynchronized flag is unset. 2011-03-15 15:38:18 +00:00
Jose Fonseca
a946e84071 scons: copy hash_table.c, symbol_table.c to glsl directory
This fixes an issue where the .obj files wound up in the src/
directory rather than the build/ directory.  That prevented
combined 32-bit and 64-bit builds from working.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-15 15:32:00 +00:00
Marek Olšák
d0e805ebd8 mesa: fix scons build 2011-03-15 16:25:16 +01:00
Marek Olšák
79ddcb93fb r300g: implement the texture barrier 2011-03-15 15:58:12 +01:00
Marek Olšák
aea4ed41ed gallium: add texture barrier support to the interface and st/mesa (v2)
v2: change the gallium entry point to texture_barrier.
2011-03-15 15:58:12 +01:00
Marek Olšák
9a9c1e1ae1 mesa: add display list support for NV_texture_barrier 2011-03-15 15:58:12 +01:00
Marek Olšák
7fa53f37e6 mesa: regenerate glapi files
Be sure to type "make clean" after this commit, otherwise your binaries
will segfault.
2011-03-15 15:58:00 +01:00
Marek Olšák
867f9b07d4 mesa: add NV_texture_barrier 2011-03-15 15:47:27 +01:00
Mathias Fröhlich
65942e141f gallium/util: Use PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write.
Additionally, to discarding the whole buffer, use
PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write when the
write covers only part of the buffer.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-03-15 15:39:38 +01:00
Mathias Fröhlich
baab835a1f st/mesa: Make use of the new PIPE_TRANSFER_DISCARD_* for buffer object.
In memory mapping buffer objects make use of
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE and PIPE_TRANSFER_DISCARD_RANGE
when appropriate.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-03-15 15:39:31 +01:00
Dave Airlie
fedc5b03db glx: add ARB_create_context functions/ops to glx xml 2011-03-15 14:27:27 +10:00
Henri Verbeet
df3d11f6ca r600g: FLT_TO_INT_FLOOR and FLT_TO_INT_RPI are vector-only instructions on Evergreen.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-15 01:15:50 +01:00
Alex Deucher
39d60610e8 r600g: fix logic error in 028987c803
Spotted by Henri on IRC.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 18:07:15 -04:00
Alex Deucher
3e30148900 r600g: don't set per-MRT blend bits on R600
It doesn't support them.  Also, we shouldn't be
emitting CB_BLENDx_CONTROL on R600 as the regs don't
exist there, but I'm not sure of the best way to deal
with this in the current r600 winsys.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:53:00 -04:00
Alex Deucher
d6fea4a985 r600g: Original R600 does not support per-MRT blends
Only rv6xx+ support them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:47:21 -04:00
Alex Deucher
028987c803 r600g: emit SURFACE_BASE_UPDATE packet on rv6xx
This packet is required when updating the DB, CB,
or STRMOUT base addresses on rv6xx for the surface
sync logic to work correctly.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:42:19 -04:00
Henri Verbeet
1a8dc1539b r600g: Properly update MULTIWRITE_ENABLE in r600_pipe_shader_ps().
This sort of worked because blend state setup cleared MULTIWRITE_ENABLE again,
but that's not something we want to depend on.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
ab1a2e454e r600g: Fix the DB_SHADER_CONTROL mask in create_ds_state().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
2342e89979 r600g: Properly update DB_SHADER_CONTROL in evergreen_pipe_shader_ps().
Disable Z_EXPORT / STENCIL_EXPORT / KILL_ENABLE again if a shader doesn't
use those. This is similar to 0a6f09a76a.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
a2ef38368b r600g: Move fetch shader register setup to r600_state.c / evergreen_state.c.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
f262ba26f0 r600g: Move r600_pipe_shader_ps() to r600_state.c.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
c0ca43e507 r600g: Move r600_pipe_shader_vs() to r600_state.c.
The idea behind this is that anything touching registers should be in
r600_state.c or evergreen_state.c. This is also consistent with
evergreen_pipe_shader_vs().

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Rafael Monica
112ffdfd07 r600g: Evergreen add support for log opcode.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
José Fonseca
202c345c7c autoconf/make: Don't specify individual llvm libraries.
We need more and more of these, and it is difficult and prone to version
incompatability issues trying to single out every one of them.

This mimicks what was done in SCons.
2011-03-14 20:05:56 +00:00
Kenneth Graunke
25e3114095 i965: Enable texture lookups whose return type is 'float'
This enables the new shadow texture functions in GLSL 1.30.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-14 13:03:50 -07:00
Chad Versace
1842b89f77 i965: Fix tex_swizzle when depth mode is GL_RED
Change swizzle from (x000) to (x001).

Signed-off-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-03-14 13:03:50 -07:00
Chad Versace
e0cbb154f2 i965: Remove dead assignment
The assignment on line 368, `tex_swizzles[i] = SWIZZLE_NOOP`, is rendered
dead by the reassignment on line 392.

Signed-off-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-03-14 13:03:50 -07:00
Kenneth Graunke
233b88eab9 glsl: Explicitly specify a type when reading/printing ir_texture.
This is necessary for GLSL 1.30+ shadow sampling functions, which return
a single float rather than splatting the value to a vec4 based on
GL_DEPTH_TEXTURE_MODE.
2011-03-14 13:03:50 -07:00
Kenneth Graunke
cb3317b85a texture_builtins.py: Add support for 130-style Shadow sampler variants. 2011-03-14 13:03:50 -07:00
Marek Olšák
bb0910bfa6 mesa: rename _mesa_texstore_a8 -> _mesa_texstore_unorm8
It's a generic function capable of storing A8, L8, I8, R8.
2011-03-14 18:51:29 +01:00
Marek Olšák
c0110d5450 mesa: fix up assertion in _mesa_source_buffer_exists
This was probably missed when implementing luminance and luminance alpha
render targets.

_mesa_get_format_bits checks for both GL_*_BITS and GL_TEXTURE_*_SIZE.

This fixes:
main/framebuffer.c:892: _mesa_source_buffer_exists: Assertion `....' failed.
2011-03-14 10:24:24 +01:00
Marek Olšák
23ccab39cd r300g: clamp after blending for fixed-point formats only 2011-03-14 10:09:34 +01:00
Dave Airlie
340e15c79b glx: the server still needs __GLXcontext.
This file generates code for the X server and it still uses
the __GLXcontext structure name.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-14 15:03:53 +10:00
Marek Olšák
0f84ddad29 ir_to_mesa: do not check the number of uniforms against hw limits
The r300 compiler can eliminate unused uniforms and remap uniform locations
if their number surpasses hardware limits, so the limit is actually
NumParameters + NumUnusedParameters. This is important for some apps
under Wine to run.

Wine sometimes declares a uniform array of 256 vec4's and some Wine-specific
constants on top of that, so in total there is more uniforms than r300 can
handle. This was the main motivation for implementing the elimination
of unused constants.

We should allow drivers to implement fail & recovery paths where it makes
sense, so giving up too early especially when comes to uniforms is not
so good idea, though I agree there should be some hard limit for all drivers.

This patch fixes:
- glsl-fs-uniform-array-5
- glsl-vs-large-uniform-array
on drivers which can eliminate unused uniforms.
2011-03-14 03:12:34 +01:00
Dave Airlie
110f5e2056 autoconf/llvm: fix build for disassembler
tested by okias on irc
2011-03-14 09:37:08 +10:00
José Fonseca
c27e58c109 gallivm: Fix build with llvm 2.6 on 32bit platforms 2011-03-13 19:49:21 +00:00
José Fonseca
e6314db0ac gallivm: Use LLVM MC disassembler, instead of udis86.
Included in LLVM 2.7+. Unlink udis86, should support all instructions that
LLVM can emit.
2011-03-13 19:24:26 +00:00
José Fonseca
d2332569d2 util: Silence gcc unitialized member warning 2011-03-13 18:56:19 +00:00
José Fonseca
b79b05e17e draw: Fix draw_variant_output::format's type. 2011-03-13 18:56:07 +00:00
Christoph Bumiller
c448a556e9 nv50,nvc0: don't assert on cso with 0 vertex elements 2011-03-13 18:19:22 +01:00
Jakob Bornecrantz
07838ff990 rbug: Use the call mutex
Fixes crashes in [soft|llvm]pipe when replacing shaders
2011-03-13 18:13:55 +01:00
Mathias Fröhlich
0a6f09a76a r600g: Only update DB_SHADER_CONTROL once in r600_pipe_shader_ps().
Avoid setting the same gpu register several times in a r600_pipe_state.
Compute the final value of the register and set that one time. This avoids
some overhead in r600_context_pipe_state_set().

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-13 17:25:16 +01:00
Jakob Bornecrantz
629bc76b75 tgsi: Fix parsing of properties with digits in the name 2011-03-13 15:35:35 +01:00
Jakob Bornecrantz
f4e6061d88 rbug: Skip drawing on disabled shaders 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
dfac72208d rbug: Remove flags from flush 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
c7894dfad9 i915g: Lie more so we get GLSL
Lots of piglit tests are lazy and wants GLSL
2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
c03be14d42 i915g: Point sprite cap could be supported 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
6d86429bd9 i915g: Sort cap list 2011-03-13 13:36:21 +01:00
Christoph Bumiller
07f73577af nvc0: support edge flags 2011-03-13 13:23:55 +01:00
Christoph Bumiller
c0f53fe8aa nvc0: fix POLYGON_MODE_BACK macro copy/paste error 2011-03-13 13:23:55 +01:00
Christoph Bumiller
e864ccb3f2 nv50,nvc0: fix pipe context switch 2011-03-13 13:23:55 +01:00
Christoph Bumiller
4388817a67 nv50,nvc0: clean up flushes 2011-03-13 13:23:55 +01:00
Christoph Bumiller
26a199efac nv50,nvc0: add some missing resource referencing 2011-03-13 13:23:55 +01:00
Christoph Bumiller
259efc90e7 nvc0: mask out centroid bit for writing FP header
It's only 2 bit per input, centroid is set in the instruction.
2011-03-13 13:23:55 +01:00
Christoph Bumiller
0abaaac872 nvc0: identify VERTEX_QUARANTINE
Well, not sure what exactly it is, but it certainly doesn't contain
the control flow stack, but vertex data.

Not sure about size, I've only seen the first few KiB written, but
the binary driver seems to allocate more.
2011-03-13 13:23:55 +01:00
Christoph Bumiller
f0ee7d8bb4 nvc0: don't enable early-z if alpha test is enabled
Depth values are also written before the shader is executed, so if
early tests are enabled, fragments that failed the alpha test were
modifying the depth buffer, but they shouldn't.
2011-03-13 13:23:54 +01:00
Christoph Bumiller
d9f1310e51 nvc0: move sprite coord replace state into cso
It's not dependent on any other state anymore now.
2011-03-13 13:23:54 +01:00
Christoph Bumiller
11f07a35f4 nvc0: s/nblocksx/nblocksy for height in resource_copy_region 2011-03-13 13:23:54 +01:00
Christoph Bumiller
d7a23cfb88 nvc0: fix unitialized variable in TGSI sysval decl processing 2011-03-13 13:23:54 +01:00
Christoph Bumiller
f10b2021c1 nvc0: update/fix supported instruction src modifiers 2011-03-13 13:23:54 +01:00
Chad Versace
dedc81e1dc glsl: Document glsl_type::sampler_dimensionality 2011-03-12 17:39:48 -08:00
Eric Anholt
098f9c5325 Revert "mesa: Convert fixed function fragment program generator to GLSL IR."
This reverts commit 7cb87dffce.
There were regressions (Bug #35244) and more review has been requested.
2011-03-12 15:11:01 -08:00
Eric Anholt
07c420a3c6 Revert "mesa: Track a computed _CurrentFragmentProgram for current gl_shader_program"
This reverts commit b4452c3baa.
2011-03-12 15:11:00 -08:00
Eric Anholt
403be11111 Revert "i965: Use the fixed function GLSL program instead of the ARB program."
This reverts commit 81b34a4e3a.  There
were regressions in the core change that this depends on.
2011-03-12 15:11:00 -08:00
Daniel Vetter
7735f8c6e5 i915g: fix transfer coherency
The kernel drm takes care of all coherency as long as we don't forget
to submit all outstanding commands in the batchbuffer ...

Also move batchbuffer initialization up because otherwise transfers
for some helper textures fail with a segmentation fault.

And kill the dead code, flushes should now be correct everywhere.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 22:58:19 +01:00
Daniel Vetter
f608795588 i915g: don't recalculate fb dimension
The statetracker should do this for us correctly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:32:30 +01:00
Daniel Vetter
d46c6084ce i915g: use y-tiling when the blitter is not used
The blitter is broken. Who'd have guessed?

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:32:29 +01:00
Daniel Vetter
f0c56e2a23 i915g: implement copy_region using u_blitter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>works
2011-03-12 20:32:29 +01:00
Daniel Vetter
06713a4079 i915g: fix use after free
Pipe templates should be copied if still needed after the create
call completes.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:31:30 +01:00
Jakob Bornecrantz
1a79064da1 gallium: Delay the creation of simple helper shaders 2011-03-12 19:39:45 +01:00
Carl-Philip Hänsch
7339915a4b r600g: Fix VS sampler view offsets for r600/r700.
077c448d18 missed this.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-12 19:33:16 +01:00
Henri Verbeet
656c314573 r600g: Fix an unused variable warning. 2011-03-12 16:43:58 +01:00
Henri Verbeet
ab21147c89 u_blitter: Do blits in linear color space.
Blits between sRGB and linear formats should happen in linear color space.
This fixes piglit fbo/fbo-srgb-blit.
2011-03-12 16:43:58 +01:00
Marek Olšák
6da4866ffd r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500
The docs say it can be set for direct texture lookups, but even that
causes problems.

This fixes the wireframe bug:
https://bugs.freedesktop.org/show_bug.cgi?id=32688

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 11:54:23 +01:00
Marek Olšák
1e97b4dd10 r300/compiler: TEX instructions don't support negation on source arguments
This fixes piglit:
- glsl-fs-texture2d-dependent-4

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 10:22:18 +01:00
Marek Olšák
589d835dfd r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)
NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 10:18:45 +01:00
Marek Olšák
d96305e4fc r300/compiler: fix translating the src negate bits in pair_translate
(1, -_, ...) was converted to (-1, ...) because of the negation
in the second component.
Masking out the unused bits fixes this.

Piglit:
- glsl-fs-texture2d-branching

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 09:39:46 +01:00
Marek Olšák
1868d21c8e st/dri: fix warning: ‘bind’ may be used uninitialized in this function 2011-03-12 08:49:54 +01:00
Marek Olšák
f1e160f89b llvmpipe: fix warning: ‘t0’ may be used uninitialized in this function 2011-03-12 08:48:43 +01:00
Marek Olšák
4b92c688a4 r300g: implement fragment color clamping in the shader
This finishes the implementation of the fragment color clamp control
for ARB_color_buffer_float. I don't wanna keep this stuff in a branch...
2011-03-12 07:56:33 +01:00
Marek Olšák
e4707604ab r300/compiler: fix the saturate modifier when applied to TEX instructions
This bug can only be triggered if the source texture is either signed or float.
2011-03-12 07:54:23 +01:00
Adam Jackson
cbcb84fccf r600g: revert unintentional commit 2011-03-11 17:46:03 -05:00
Adam Jackson
02725bc8b0 nouveau: Build fix
nouveau_vieux_dri.so.tmp: undefined reference to `_mesa_need_secondary_color'
2011-03-11 17:37:21 -05:00
Adam Jackson
b5872cdda0 r600: Build fix
r600_dri.so.tmp: undefined reference to `_mesa_rgba_logicop_enabled'
2011-03-11 17:24:47 -05:00
Vinson Lee
4faa95e74d st/python: Remove flags from flush function. 2011-03-11 14:00:32 -08:00
Vinson Lee
9c366ceedb st/python: Remove the geom_flags param from is_format_supported. 2011-03-11 13:37:30 -08:00
Vinson Lee
d17ef8636d st/python: Clean up fence_finish. 2011-03-11 13:35:06 -08:00
Vinson Lee
dee6eafbd2 scons: Move texenvprogram.c to ff_fragment_shader.cpp. 2011-03-11 13:32:41 -08:00
Eric Anholt
81b34a4e3a i965: Use the fixed function GLSL program instead of the ARB program.
This gets one more piece of the pipeline onto the new codegen backend.
Once ARB_fragment_program can generate GLSL programs, we can nuke the
old backend.
2011-03-11 12:55:14 -08:00
Eric Anholt
b4452c3baa mesa: Track a computed _CurrentFragmentProgram for current gl_shader_program
This is like how we track FragmentProgram._Current for the computed
ARB fragment program for fixed function texenv, but this gives direct
access to the gl_shader_program for drivers to codegen from, skipping
ARB_fp.
2011-03-11 12:55:14 -08:00
Eric Anholt
7cb87dffce mesa: Convert fixed function fragment program generator to GLSL IR.
This is a step towards providing a direct route for drivers accepting
GLSL IR for codegen.  Perhaps more importantly, it runs the fixed
function fragment program through the GLSL IR optimization.  Having
seen how easy it is to make ugly fixed function texenv code that can
do unnecessary work, this may improve real applicatinos.
2011-03-11 12:55:14 -08:00
Eric Anholt
29e013e58b mesa: Add gl_MESAFogParamsOptimized for our special pre-computed fog params.
It would be nice if we handled optimized uniform math like this in
some generic way, since people often end up doing uniform expressions
in shaders, but for now keep this hard-coded like it was in the
texenvprogram code.
2011-03-11 12:55:14 -08:00
Eric Anholt
20f7a6f11a mesa: Add a builtin uniform for the ATI_envmap_bumpmap rotation matrix.
For fixed function fragment processing in GLSL IR, we want to be able
to reference this state value.  gl_* not explicitly permitted is
reserved, so using this variable name internally shouldn't be any
issue.
2011-03-11 12:55:14 -08:00
Eric Anholt
cdacca4868 mesa: Move texenvprogram.c to ff_fragment_shader.cpp.
This file is about to change to generating a shader program instead of
a fragment program.
2011-03-11 12:55:13 -08:00
Eric Anholt
e1cb12bfff prog_cache: Add some support for shader_programs in prog_cache.
This is used in the upcoming fixed function shader_program generation,
and shader_program and ARB programs are together in this code until
both fragment and vertex ff get converted.
2011-03-11 12:55:13 -08:00
Eric Anholt
9c7231c1d9 mesa: Don't try to remove an internal shader_program from the hash.
It fails on assertions if the key isn't actually present.
2011-03-11 12:55:13 -08:00
Eric Anholt
5ae1d19506 i965: Use ffs() on a 32-bit int value instad of ffsll(). 2011-03-11 12:55:13 -08:00
Marek Olšák
7e02303497 gallium: remove flags from the flush function
The drivers have been changed so that they behave as if all of the flags
were set. This is already implicit in most hardware drivers and required
for multiple contexts.

Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag
to decide whether flush_frontbuffer should be called.
New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement.
2011-03-11 21:39:31 +01:00
Marek Olšák
e968975cb5 gallium: remove the geom_flags param from is_format_supported 2011-03-11 21:39:30 +01:00
Marek Olšák
bfe88e6998 gallium: cleanup fence_signalled and fence_finish
So that they don't have the driver-specific param and return type.
2011-03-11 21:39:30 +01:00
Marek Olšák
25485f4b69 gallium: kill is_resource_referenced
Only st/xorg used it and even incorrectly with regards to pipelined transfers.
2011-03-11 21:39:30 +01:00
Adam Jackson
2b64886c81 swrastg: Add __DRI_TEX_BUFFER support
Without this, EXT_texture_from_pixmap is trivially broken.  With it,
it's merely subtly broken.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-11 14:49:28 -05:00
Brian Paul
d7db14ab7d mesa: test against MaxUniformComponents in check_resources()
Since we're compiling/linking GLSL shaders we should check against
the shader uniform limits, not the legacy vertex/fragment program
parameter limits which are usually lower.
2011-03-11 10:04:17 -07:00
Brian Paul
e0e94026a0 mesa: move location of some geometry program limits
The gl_program_constants struct is for limits that are applicable to
any/all shader stages.  Move the geometry shader-only fields into the
gl_constants struct.
Remove redundant MaxGeometryUniformComponents field too.
2011-03-11 09:25:22 -07:00
Brian Paul
8cc84b3e45 mesa: use check_resources() to check program against limits
Without these checks we could create shaders with more samplers,
constants than the driver could handle.  Fail linking rather than
dying later.
2011-03-11 09:25:22 -07:00
Brian Paul
decc6e2a32 mesa: replace NEED_SECONDARY_COLOR(), RGBA_LOGICOP_ENABLED() with inlines
and rename them.
2011-03-11 09:25:21 -07:00
Brian Paul
4293a12c7f mesa: call FLUSH_VERTICES() before deleting shaders, buffers, query objects
Need to flush rendering (or at least indicate that the rug might be getting
pulled out from underneath us) when a shader, buffer object or query object
is about to be deleted.

Also, this helps to tell the VBO module to unmap its current vertex buffer.
2011-03-11 09:25:21 -07:00
Brian Paul
a4a5d7e0dd vega: remove unused pipe var 2011-03-11 09:25:21 -07:00
José Fonseca
530ad1ff6f svga: Propagate discard/unsynchronized flags to the host when doing texture DMAs. 2011-03-11 15:03:21 +00:00
José Fonseca
f0ea6395b6 util: Fix typo in u_upload_flush().
upload->offset is how much we used. upload->size is the whole buffer size.
2011-03-11 11:54:26 +00:00
Nicolas Peninguy
b6c9c78bff r300g: fix alignement for NPOT values in hyperz setup
With 3 pipes cards we need to align with NPOT values. This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=32945

Signed-off-by: Nicolas Peninguy <nico@lostgeeks.org>
2011-03-11 04:36:37 +01:00
Marek Olšák
8a01cb8793 draw: remove unnecessary flush 2011-03-11 02:02:16 +01:00
Marek Olšák
cb06f180e3 st/vega: remove unnecessary flushes
I don't see a reason we need them.
2011-03-11 02:02:16 +01:00
Marek Olšák
bdf1038940 st/mesa: remove unnecessary flushes
The framebuffer cache flush should be implicit when calling
set_framebuffer_state.

There is no need to flush the command stream either.
2011-03-11 02:02:16 +01:00
Thomas Hellstrom
ded1e315a4 Revert "gallium/svga: Only upload parts of vertexarrays that are actually used"
This reverts commit 6d4e337f38.

The commit is incorrect. I'll rework it. Revert for now.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-10 23:31:42 +01:00
Daniel Vetter
fb3b712b84 i915g: implement surface clear functions using hw-clear
Tested by temporarily using util_clear even when not using the blitter.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:20 +01:00
Daniel Vetter
6ad4a11b3e i915g: make set_framebuffer_state more robust
u_blitter is lazy and doesn't fully clear it's stack-allocated fb.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:19 +01:00
Daniel Vetter
6358e6371b i915g: implement hw clear
Benefits:
- spares us a relocation.
- needed for zone rendering (if that ever happens).
- just awesome.

v2: Rename the debug option. Completely disabling the blitter is
required for Y tiling to work, so this option will cover other
code paths in the future.

v3: Implement suggestions by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:10 +01:00
Daniel Vetter
8c420db1c4 i915g: blitter handles overlapping blits
No need to assert.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:50 +01:00
Daniel Vetter
55d2d7fb3a i915g: enable separate depth/stencil clears
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:49 +01:00
Daniel Vetter
9070879a79 i915g: streamline derived state updates of the driver pipeline
Flushing the batch/hw backend doesn't invalidate the derived state.
So kill the unnecessary function calls and add an assert in
emit_hardware_state for paranoia.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:48 +01:00
Daniel Vetter
b0dd74aaf7 i915g: don't validate a NULL vbo
With the new clear code this is possible (if the app call glClear
before drawing the first primitive).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:47 +01:00
Brian Paul
7dcf019af2 gallium/util: new polygon stipple utility helper
The polygon stipple fallback does not have to be implemented in the
draw module (it doesn't need window coords, etc).  Drivers can use
this utility and avoid sw vertex fallbacks if pstipple is enabled.
Note: this is WIP and not used by any driver yet.
2011-03-10 09:44:32 -07:00
Brian Paul
0eab3a8a97 glsl: silence warning in printf() with a cast 2011-03-10 09:29:00 -07:00
Brian Paul
76a43c5fba glx: fix null pointer deref in __glXGenerateError()
The gc var would be NULL if called from line 238.  Instead, get
the opcode from __glXSetupForCommand(dpy) as done in other places.
And remove the unused gc parameter.

Fixes a bug reported by "John Doe" on 3/9/2011.

NOTE: This is a candidate for the 7.10 branch.
2011-03-10 08:50:52 -07:00
Thomas Hellstrom
6d4e337f38 gallium/svga: Only upload parts of vertexarrays that are actually used
Make sure we only upload parts of vertex arrays that are actually used
by a draw command.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-10 14:30:50 +01:00
Dave Airlie
9b7f377635 r600: don't close fd on failed load
This fd gets passed in from outside, closing it causes the X.org server
to crap out when the driver doesn't identify the chipset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-10 12:01:43 +10:00
Eric Anholt
f6ca4a304b intel: Don't complain when getparam fails due to a missing param.
This is an expected behavior when we're testing for the presence of
new kernel features.
2011-03-09 12:54:47 -08:00
Chris Wilson
ea004a3aed i965: Pack the tracked state atoms into separate arrays for prepare/emit.
Improves performance of a hacked-up scissor-many (to reuse a small set
of scissors instead of blowing out the cache, and then to run 100x
more iterations so it actually took some time) by 3.6% +/- 1.2% (n=10)
2011-03-09 10:18:29 -08:00
Christoph Bumiller
caaa7fdd6f nv50: add back initialization of redefine_user_buffer
Got lost in f80c03e187.
2011-03-09 17:26:33 +01:00
Christian König
bb4f2a0f35 r600g: remove some now unneeded code from r600_bc_vtx_build 2011-03-09 14:49:03 +01:00
Christian König
2ed56d3170 r600g: R700+ can do more than 8 tex and vtx clause in one CF inst
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-09 14:49:03 +01:00
Christian König
8dc1dfc9f0 r600g: split R600 and R700 CF generation for VTX and TEX
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-09 14:49:03 +01:00
José Fonseca
8308272291 svga: Add a new winsys entry point to query the hw version. 2011-03-09 13:34:21 +00:00
José Fonseca
d5249b7d89 util: Use PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in pipe_buffer_write. 2011-03-09 11:17:45 +00:00
Keith Whitwell
05efcee46e util: add ensure_sanity checks, fix a bug
Add ensure_sanity checks.
Fix a bug which caused us to misplace entries adding to a full cache.
2011-03-09 11:17:14 +00:00
Keith Whitwell
20962bf547 util: improve cache collision behaviour
Add linear probing on collisions.

Expand entry array by a fixed scale (currently 2) to help avoid
collisions.

Use a LRU approach to ensure that the number of entries stored in the
cache doesn't exceed the requested size.
2011-03-09 11:16:53 +00:00
Alex Corscadden
d00cbf46cd util: Add remove to util_cache
I need to be able to remove entries from util_cache caches.  This change
enables that functionality.
2011-03-09 11:16:49 +00:00
Alex Corscadden
eb2e8167fa util: Allow util_draw_texquad to draw quads with non-integer coordinates. 2011-03-09 11:16:49 +00:00
José Fonseca
0ffd603e17 wgl: Force framebuffer validation on glViewport. 2011-03-09 09:58:35 +00:00
Thomas Hellstrom
52e598d200 gallium/svga: Don't replace user vertex buffer with uploaded copy
Do that later on when we set up the hwtnl state instead.
This addresses a problem when we drop the uploaded copy due to a vb
size change, it will remain referenced in svga->curr.vb[], and the
new contents of the vb will never be uploaded.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-09 08:49:33 +01:00
Vinson Lee
c0d3fb4b6c scons: Fix immediate Python exceptions with SCons on SunOS.
The build still fails.
2011-03-08 17:59:57 -08:00
Vinson Lee
67f61199c2 st/python: Add timeout parameter to fence_finish.
This is a follow-up to commit b39bccbd4e.

Fixes Linux SCons build.
2011-03-08 16:18:16 -08:00
Marek Olšák
ac8821ffe2 r300g: handle timeout parameter in fence_finish 2011-03-08 23:52:37 +01:00
Marek Olšák
b39bccbd4e gallium: add timeout parameter to fence_finish
This is a follow-up to the ARB_sync patch for st/mesa and completes
the ARB_sync implementation.
2011-03-08 23:52:37 +01:00
Marek Olšák
5257a6dbc6 st/mesa: implement ARB_sync
The ServerWaitSync implementation matches Intel's driver.

The extension is advertised when pipe_screen::fence_finish is set.
2011-03-08 23:52:37 +01:00
Marek Olšák
5ef807c036 r300g: add LATC support 2011-03-08 23:52:37 +01:00
Marek Olšák
b0ec461954 st/mesa: cleanup checking for signed compressed formats in generate_mipmaps 2011-03-08 23:52:37 +01:00
Marek Olšák
384845f335 st/mesa: add LATC and 3DC support
softpipe passes all tests.
2011-03-08 23:52:37 +01:00
Marek Olšák
23f92c20d7 gallium/util: add LATC support
Again, a lot of code is shared with RGTC.

The layout is UTIL_FORMAT_LAYOUT_RGTC, because LATC is just swizzled RGTC.
2011-03-08 23:52:37 +01:00
Marek Olšák
69f16accd0 mesa: add ATI_texture_compression_3dc
LUMINANCE_ALPHA_LATC2 = LUMINANCE_ALPHA_3DC, so this is easy.

Note that there is no specification for 3DC, just a few white papers
from ATI.
2011-03-08 23:52:37 +01:00
Marek Olšák
7d16e2c0cd mesa: add EXT_texture_compression_latc
The encoding/decoding algorithms are shared with RGTC.
Thanks to some magic with the base format, the RGTC texstore functions work
for LATC too.

swrast passes the related piglit tests besides two things:
- The alpha channel is wrong (it's always 1), however the incorrect alpha
  channel makes some other tests fail too, so I guess it's unrelated to LATC.
- Signed LATC fetches aren't correct yet (signed values are clamped to [0,1]),
  however RGTC has the same problem.

Further testing (with other of my patches) shows that hardware drivers
and softpipe work.

BTW, ETQW uses this extension.
2011-03-08 23:52:37 +01:00
Thomas Hellstrom
12fa91b675 st/mesa: Fix an incorrect user vertex buffer reference
st->user_vb[attr] was always pointing to the same user vb, regardless
of the value of attr. Together with reverting the temporary workaround
for bug 34378, and a fix in the svga driver, this fixes googleearth on svga.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-08 22:15:50 +01:00
Marek Olšák
ef58598c1c vbo: mark vertex arrays as dirty when re-binding
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=34378
2011-03-08 22:14:47 +01:00
Marek Olšák
ff8baec5bc r300/compiler: remove unused variables 2011-03-08 22:13:29 +01:00
Ian Romanick
bdb6a6ef83 glsl: Use insert_before for lists instead of open coding it 2011-03-08 11:47:25 -08:00
Ian Romanick
60f898a90e linker: Add imported functions to the linked IR
Fixes piglit test glsl-function-chain16 and bugzilla #34203.

NOTE: This is a candidate for stable release branches.
2011-03-08 11:47:25 -08:00
Ian Romanick
8bbfbb14ee glsl: Add several function / call related validations
The signature list in a function must contain only ir_function_signature nodes.

The target of an ir_call must be an ir_function_signature.

These were added while trying to debug Mesa bugzilla #34203.
2011-03-08 11:47:25 -08:00
Ian Romanick
2df56b002d glsl: Function signatures cannot have NULL return type
The return type can be void, and this is the case where a `_ret_val'
variable should not be declared.
2011-03-08 11:47:25 -08:00
Christian König
719f07e45a r600g: set start instance correctly 2011-03-08 16:57:47 +01:00
Brian Paul
4a802738b0 swrast: flip the conditionals in shadow_compare4() for readability 2011-03-08 08:31:43 -07:00
Philip Taylor
d9f584e663 swrast: add coord clamping, fix comparisons for shadow testing
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=31159 for swrast
and piglit depth-tex-compare.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-08 08:31:43 -07:00
Brian Paul
9181a75c4d docs: added Depth format cube textures to GL3.txt list 2011-03-08 08:31:42 -07:00
Marek Olšák
5650a719f0 r300g: decide whether a flush should be asynchronous when calling it
Thread offloading is not sometimes desirable, e.g. when mapping a buffer.
2011-03-08 08:23:29 +01:00
Marek Olšák
6051f26b78 r300g: use pipelined transfers for RGTC textures 2011-03-08 08:17:12 +01:00
Marek Olšák
4dfcf3c4fe r300/compiler: fix equal and notequal shadow compare functions 2011-03-08 07:36:40 +01:00
Marek Olšák
94818d4c6a r300/compiler: detect constants harder 2011-03-08 06:54:14 +01:00
Marek Olšák
4f38261179 r300/compiler: improve the detection of constants for constant folding
Now the expression V==0 generates one instruction instead of two.
2011-03-08 06:37:50 +01:00
Marek Olšák
eb1acd1613 r300/compiler: saturate Z before the shadow comparison
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31159

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-08 05:13:45 +01:00
Brian Paul
2c1ef65a04 llvmpipe: clamp texcoords in lp_build_sample_compare()
See previous commit for more info.

NOTE: This is a candidate for the 7.10 branch.
2011-03-07 18:59:42 -07:00
Philip Taylor
0eef561a5b softpipe: clamp texcoords in sample_compare()
This fixes http://bugs.freedesktop.org/show_bug.cgi?id=31159 for softpipe
and fixes the piglit depth-tex-compare test.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-07 18:56:54 -07:00
Marek Olšák
a674ef7814 mesa: return after invalidating renderbuffer 2011-03-07 23:33:36 +01:00
Marek Olšák
fb5d9e1199 st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails
This fixes:
  state_tracker/st_format.c:401:st_pipe_format_to_mesa_format:
  Assertion `0' failed.
2011-03-07 23:27:35 +01:00
Marek Olšák
df818d572e mesa: invalidate framebuffer if internal format of renderbuffer is changed
RenderTexture doesn't have to be called in invalidate_rb, I guess.
2011-03-07 23:27:35 +01:00
Brian Paul
f4ca12c4f1 mesa: initialize DummyBufferObject's mutex
The mutex's fields were all zeros.  That's OK on Linux, but not Windows.

NOTE: This is a candidate for the 7.10 branch.
2011-03-07 14:58:39 -07:00
Brian Paul
ce6f16d382 st/mesa: fix incorrect version checking code 2011-03-07 14:58:39 -07:00
Brian Paul
8329f4db61 st/glx: whitespace, 80-column fixes 2011-03-07 14:58:39 -07:00
Brian Paul
51db2045b4 mesa: remove stray _mesa_finish() call in _mesa_CopyPixels()
Leftover debug code from 6364d75008.
2011-03-07 14:01:09 -07:00
Henri Verbeet
0e4750a84d r600g: Simplify some swizzle lookups. 2011-03-07 21:48:21 +01:00
Henri Verbeet
eac50295fc r600g: Constant buffers can contain up to 4096 constants. 2011-03-07 21:48:21 +01:00
Henri Verbeet
a8bde5c47e i915: Only invert wpos when rendering to the system framebuffer. 2011-03-07 21:48:21 +01:00
Henri Verbeet
a99b23752b i915: Derive the gl_fragment_program from i915_fragment_program.
Instead of using the current gl_fragment_program. These aren't necessarily
the same, for example when translate_program() is called by
i915ValidateFragmentProgram().
2011-03-07 21:48:21 +01:00
Henri Verbeet
c3c91a0fe5 glx: Take GLPROTO_CFLAGS into account. 2011-03-07 21:48:20 +01:00
Chris Wilson
6547253bd1 intel: check for miptree allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:09 +00:00
Chris Wilson
de7678ef52 intel: Add some defense against buffer allocation failure for subimage blits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:05 +00:00
Chris Wilson
f627d429bd intel: Add some defense against bo allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:00 +00:00
Benjamin Franzke
4f6fbfa0ed egl_dri2: Add attribute map for __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE
Broken since 6538b5824e.
Thanks to iskren on #wayland for helping on finding this.
2011-03-07 00:32:05 +01:00
Christian König
e0cf8471a1 r600g: use long long integers for instance addr calculation
Using a long for instance addr calculation isn't
big enough on 32bit systems, use a long long int instead.

Thanks to Rafael Monica for fixing this.
2011-03-06 23:37:47 +01:00
Dave Airlie
6538b5824e glx/dri: add initial dri interface for GLX_EXT_framebuffer_sRGB.
This realigns the name of the glx bit to align with the core mesa names.
2011-03-06 20:06:42 +10:00
Dave Airlie
b09b3e5c8f glx: add initial GLX_EXT_framebuffer_sRGB support.
this doesn't bind to drivers yet, just enough to in theory make indirect
work against other servers.

I'm really not sure what the rules for adding extensions to the known_gl_extensions list as it looks to be missing a few. are these GL extensions that have GLX
protocol??

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-06 19:56:22 +10:00
José Fonseca
7cb17862c6 pb: Add is_buffer_busy for malloc buffers. 2011-03-06 09:12:58 +00:00
José Fonseca
e1510d4816 st/wgl: No need to initialize OneTimeLock anymore. 2011-03-06 09:12:30 +00:00
José Fonseca
b531b01b70 mapi: _glthread_DECLARE_STATIC_MUTEX is not broken on Windows. 2011-03-06 09:11:59 +00:00
José Fonseca
e640eec9ba trace: Use pipe_static_mutex. 2011-03-06 09:11:13 +00:00
José Fonseca
db6d0d9ebf os: Fix pipe_static_mutex on Windows. 2011-03-06 09:10:38 +00:00
José Fonseca
5e1b31066b graw-gdi: Silence gcc missing initialization warning. 2011-03-06 09:10:03 +00:00
Daniel Vetter
f95892b46a i915g: update TODO
Comments about the deleted stuff:
- openaren hang: likely caused by the vertex corruptions, fixed by Jakob.
- tiling: Y-tiling works with my hw-clear branch. X-tiling works as
  merged to master a while ago (execbuf2 version).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-06 00:39:18 +01:00
Marek Olšák
b6a9675b2f r300g/swtcl: advertise draw_instanced and primitive_restart 2011-03-05 17:41:12 +01:00
Marek Olšák
65482f2c2b r300g: implement instanced arrays 2011-03-05 17:41:11 +01:00
Marek Olšák
95c7881ac8 gallium: split CAP_INSTANCE_DRAWING into INSTANCEID and INSTANCE_DIVISOR
ARB_instanced_arrays is a subset of D3D9.
ARB_draw_instanced is a subset of D3D10.

The point of this change is to allow D3D9-level drivers to enable
ARB_instanced_arrays without ARB_draw_instanced.
2011-03-05 17:40:19 +01:00
Marek Olšák
307408a4f8 r300g: cleanup parameters of draw functions 2011-03-05 16:13:43 +01:00
Christoph Bumiller
533bf171d4 nv50: support the InstanceID system value 2011-03-05 14:53:23 +01:00
Christian König
17b9b757b7 r600g: simplify instance addr calculation
Use MULHI_UINT instead of the more complex
INT_TO_FLT->MUL->TRUNC->FLT_TO_INT
2011-03-05 13:42:51 +01:00
Vinson Lee
19355a461a nvc0: Update SConscript. 2011-03-04 17:15:21 -08:00
Vinson Lee
dbf4970b69 nv50: Update SConscript. 2011-03-04 17:11:35 -08:00
Christian König
fd2409ca27 r600g: fix fragment shader size calculation
bc.ndw is altered in r600_bc_build, respect that
in fragment shader size calculation.
2011-03-05 01:52:44 +01:00
Ian Romanick
09a4ba0fc3 glsl: Process redeclarations before initializers
If an array redeclaration includes an initializer, the initializer
would previously be dropped on the floor.  Instead, directly apply the
initializer to the correct ir_variable instance and append the
generated instructions.

Fixes bugzilla #34374 and piglit tests glsl-{vs,fs}-array-redeclaration.

NOTE: This is a candidate for stable release branches.  0292ffb8 and
8e6cb9fe are also necessary.
2011-03-04 16:33:31 -08:00
Ian Romanick
0292ffb85c glsl: Refactor AST-to-HIR code handling variable initializers 2011-03-04 16:32:37 -08:00
Ian Romanick
8e6cb9fe51 glsl: Refactor AST-to-HIR code handling variable redeclarations 2011-03-04 16:32:37 -08:00
Christoph Bumiller
b0698396dc nv50,nvc0: get format desc for TIC entry from sampler view format
Fixes piglit/tex-srgb.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
1f5d6fc59b nv50,nvc0: share sampler state creation 2011-03-05 00:51:07 +01:00
Christoph Bumiller
e4c968cdbb nv50,nvc0: update the format tables
Removed sampler view support for USCALED/SSCALED, the texture unit
refuses to convert to non-normalized float. The enums are treated
like UNORM.

Removed duplicate format related headers.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
f556b897eb nvc0: use m2mf for resource_copy_region if formats are equal
Which is always the case, but we'll keep the 2D engine blitter
nonetheless.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
4fae7da9a3 nv50,nvc0: fix texture layer issues 2011-03-05 00:51:07 +01:00
Jakob Bornecrantz
9f0acfe138 i915g: Use tgsi_info from fragment shader instead 2011-03-05 00:23:27 +01:00
Daniel Vetter
98b418e56e i915g: use passthough shader for empty fragment programs
The hw doesn't like it - demos/shadowtex is broken. The emitted shader
isn't totally empty though, the depth write fixup gets emitted instead.
Maybe that one is somewhat fishy, too?

Idea for this patch from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-04 23:46:20 +01:00
Benjamin Franzke
22d9ae11bc egl_dri2: Fix incompatible vfunc-pointer warning 2011-03-04 16:36:37 -05:00
Benjamin Franzke
e71920929e egl/wayland: Move wayland-egl into a subdir
This hopefully fixes wayland-egl's dependency
resolution for autogenerated wayland-drm headers.
2011-03-04 16:36:37 -05:00
Eric Anholt
1a57717bbe i965: Apply a workaround for the Ironlake "vertex flashing".
This is an awful hack and will hurt performance on Ironlake, but we're
at a loss as to what's going wrong otherwise.  This is the only common
variable we've found that avoids the problem on 4 applications
(CelShading, gnome-shell, Pill Popper, and my GLSL demo), while other
variables we've tried appear to only be confounding.  Neither the
specifications nor the hardware team have been able to provide any
enlightenment, despite much searching.

https://bugs.freedesktop.org/show_bug.cgi?id=29172
Tested by:	Chris Lord <chris@linux.intel.com> (Pill Popper)
Tested by:	Ryan Lortie <desrt@desrt.ca> (gnome-shell)
2011-03-04 12:04:42 -08:00
Marek Olšák
bdb811772f r300g: preliminary implementation of clamping controls 2011-03-04 17:47:56 +01:00
Marek Olšák
10a893106b r300g: implement FP16 alpha test 2011-03-04 17:47:56 +01:00
Marek Olšák
910bac63df r300g: implement blending for some of non-RGBA8 formats
Blending is now fully supported with:
- R8_UNORM
- R8G8_UNORM
- B8G8R8A8_UNORM
- R16G16B16A16_FLOAT (r500-only)

Blending is partially supported (DST_ALPHA not working) with:
- L8A8_UNORM
- I8_UNORM
- B5G5R5A1_UNORM
- B10G10R10A2_UNORM

The other formats can't do blending.
2011-03-04 17:47:56 +01:00
José Fonseca
4a4f6a3901 draw: Silence tgsi_emit_sse2 failed messages. 2011-03-04 16:29:13 +00:00
José Fonseca
6838c9ce74 tgsi: Disable SSE2 code generation.
It's broken now that tgsi_exec_machine::Inputs/Ouputs are pointers.

Temporary if anybody still cares about tgsi_sse2.c. Permanent otherwise.
2011-03-04 14:54:24 +00:00
José Fonseca
c8e904e159 scons: Unbreak mingw cross compilation. 2011-03-04 14:44:39 +00:00
Marek Olšák
ba48811fa8 st/mesa: set PIPE_BIND_RENDER_TARGET for sRGB formats if UNORM is supported
Because the format can be changed to UNORM in a surface.

This fixes:
state_tracker/st_atom_framebuffer.c:163:update_framebuffer_state:
Assertion `framebuffer->cbufs[i]->texture->bind & (1 << 1)' failed.
2011-03-04 14:52:45 +01:00
José Fonseca
5378983417 scons: Get glsl2 and glcpp programs building correctly. 2011-03-04 13:11:49 +00:00
José Fonseca
12d17bcadf glsl/glcpp: Use stdio.h instead of unistd.h. 2011-03-04 12:53:14 +00:00
José Fonseca
f52660c3dc glsl: Define YY_NO_UNISTD_H on MSVC. 2011-03-04 12:49:55 +00:00
José Fonseca
d40b868db5 gallium: Define __func__ on MSVC. 2011-03-04 11:55:36 +00:00
Christoph Bumiller
cf143c1f4d Merge remote branch 'origin/nvc0' 2011-03-04 11:02:10 +01:00
Chris Wilson
9d31138f53 i965: Fix extending VB packets
Computation of the delta of this array from the last had a silly little
bug and ignored any initial delta==0 causing grief in Nexuiz and
friends.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
18dd7932c7 i965: Handle URB_FENCE erratum for Broadwater
There is a silicon bug which causes unpredictable behaviour if the
URB_FENCE command should cross a cache-line boundary. Pad before the
command to avoid such occurrences. As this command only applies to
gen4/5, do the fixup unconditionally as the specs do not actually state
for which chip it was fixed (and the cost is negligible)...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
1546291e5b i965: Align index to type size and flush if the type changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
1c0d09cd4e intel: Add couple of missing gen6 commands to decode
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
b93684f5f3 i965: Prevent using a zero sized (or of unknown type) vertex array
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:30 +00:00
Dave Airlie
137d44e0f2 r600g: disable tiling by default again.
we still have a lot of corner cases that aren't working.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-04 08:47:10 +10:00
José Fonseca
9f3c59a350 tgsi: Update assert.
Elements(mach->Inputs) is wrong now that mach->Inputs is dynamically
allocated.
2011-03-03 19:23:04 +00:00
Kenneth Graunke
09e1bebc25 glcpp: Remove trailing contexts from #if rules.
These are now unnecessary.
2011-03-03 10:42:37 -08:00
Kenneth Graunke
f20656e944 glcpp: Rework lexer to use a SKIP state rather than REJECT.
Previously, the rule deleted by this commit was matched every single
time (being the longest match).  If not skipping, it used REJECT to
continue on to the actual correct rule.

The flex manual advises against using REJECT where possible, as it is
one of the most expensive lexer features.  So using it on every match
seems undesirable. Perhaps more importantly, it made it necessary for
the #if directive rules to contain a look-ahead pattern to make them
as long as the (now deleted) "skip the whole line" rule.

This patch introduces an exclusive start state, SKIP, to avoid REJECTs.
Each time the lexer is called, the code at the top of the rules section
will run, implicitly switching the state to the correct one.

Fixes piglit tests 16384-consecutive-chars.frag and
16385-consecutive-chars.frag.
2011-03-03 10:42:37 -08:00
Kenneth Graunke
b56f30c2b2 glcpp/tests: Update 063-comments.c.expected to match output.
The expected result has been out of sync with what glcpp produces for
some time; glcpp's actual result seems to be correct and is very close to
GCC's cpp.  Updating this will make it easier to catch regressions in
upcoming commits.
2011-03-03 10:42:37 -08:00
Jakob Bornecrantz
4bd27cfecc rbug: Fix depth stencil surface not being sent to the client 2011-03-03 18:29:17 +00:00
José Fonseca
5d0e8beaa2 scons: More tweaks to fix MinGW build. 2011-03-03 16:57:38 +00:00
José Fonseca
dbfbb8cf6d scons: Ensure generated headers are in the include path. 2011-03-03 15:43:18 +00:00
José Fonseca
54d8c5e3c2 scons: Add human friendlier build messages for lex/yacc. 2011-03-03 15:42:58 +00:00
José Fonseca
8987109c27 scons: Always load lex/yacc tool.
lex/yacc is not loaded by default when toolchain is not default either,
e.g., when toolchain=crossmingw.
2011-03-03 15:28:36 +00:00
Christoph Bumiller
3bf92a281b nv50: check grclass instead of chipset for 3D caps 2011-03-03 12:32:40 +01:00
Christoph Bumiller
7048ad62f8 nv50: increase size of shader code bo
512 KiB should be quite enough, but dynamic resize might be nicer.
2011-03-03 12:32:40 +01:00
Ben Skeggs
6b4e3e8941 nouveau: allow pipe driver to define which buffers should start in sysmem
PIPE_BIND_CONSTANT_BUFFER alone was OK for nv50/nvc0, but nv30 will need
to be able to set others on certain chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-03 15:56:20 +10:00
Zou Nan hai
118ecb1a22 i965: SNB GT1 has only 32k urb and max 128 urb entries.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-03 10:30:06 +08:00
Kenneth Graunke
2e756f3d6f glsl: Remove unused glcpp/Makefile.am.
This is a remnant of when glsl2 lived in its own repository.
2011-03-02 15:25:49 -08:00
Kenneth Graunke
8be828c3b3 glsl: Remove 'tests' subfolder.
These have long since moved to piglit and aren't useful to have here.
2011-03-02 15:25:49 -08:00
Christian König
8d9ea4c4e7 r600g: correct mega_fetch_count in fetch shader 2011-03-03 00:23:15 +01:00
Zack Rusin
ff2a0faba0 tgsi: defer allocation of huge inputs/outputs until we have a gs 2011-03-02 17:45:22 -05:00
Ian Romanick
d569cc4d44 docs: added news item for 7.9.2 and 7.10.1 releases 2011-03-02 14:37:59 -08:00
Ian Romanick
910820daf4 docs: All links to 7.9.2 and 7.10.1 release notes 2011-03-02 14:37:59 -08:00
Ian Romanick
8010c35852 docs: Import 7.10.1 release notes from 7.10 branch 2011-03-02 14:37:59 -08:00
Ian Romanick
198e9bb5b0 docs: Import 7.9.2 release notes from 7.9 branch 2011-03-02 14:37:59 -08:00
Christoph Bumiller
0c0e996d59 nv50: fix IB index buffer path
Add missing VERTEX_END and treat unaligned offsets correctly.
2011-03-02 22:37:56 +01:00
Christoph Bumiller
fa94f8b209 nv50: fix POINT_COORD_REPLACE_MAP method size
Introduced in 223d98bb8d.
2011-03-02 21:07:33 +01:00
Christoph Bumiller
47a62b1ca1 nv50: primitive restart trick for vertex data through FIFO mode
Also, on nv50 the VERTEX_BEGIN method doesn't follow VERTEX_END,
which was erroneously taken over from nvc0 and is fixed now.
2011-03-02 20:59:54 +01:00
Christoph Bumiller
b8646bc2af nv50: fix depth clamp for disabled primitive clipping 2011-03-02 20:59:53 +01:00
Christoph Bumiller
ddcb90248f nv50: implement independent blend functions for nva3+ and fix cap 2011-03-02 20:59:53 +01:00
Christoph Bumiller
669de7016c nv50: fix tile size calculations 2011-03-02 20:59:53 +01:00
Christoph Bumiller
223d98bb8d nv50: fix point sprite state validation
Wasn't updated if the FP didn't change, and coordinate replacement
wasn't disabled anymore.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
dbdbbce066 nv50: allow accidentally disabled IB index buffers again
Must have sneaked in from debugging.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
908013b737 nv50: apply relocations to shader code
On nv50, branches are absolute, so we need to adjust them according
to the shader's position in the code buffer.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
040ff18a21 nv50: fix wrong miptree tile flags taken over from nvc0 2011-03-02 20:59:53 +01:00
Benjamin Franzke
4ca075ac4f egl_dri2 x11: Workaround device_name xcb-dri2 bug
This commit is basically a copy-over of the fix
Chia-I Wu's commited to wayland:
   http://cgit.freedesktop.org/wayland/wayland-demos/commit/?id=1b6c0ed95
   "Workaround an xcb-dri2 bug.
    xcb_dri2_connect_device_name generated by xcb-proto 1.6 is broken.
    It only works when the length of the driver name is a multiple of 4."
2011-03-02 20:41:38 +01:00
Benjamin Franzke
648a16d079 egl/wayland: build subdirs (wayland-drm) before depend
Autogenerated files need to be generated first.
2011-03-02 20:17:26 +01:00
Marek Olšák
a6314eb47f r300g: require DRM 2.3.0 (kernel 2.6.34)
Running any older kernel is not recommended anyway.
2011-03-02 17:54:36 +01:00
Marek Olšák
f6dbcb92bf r300g: do not use ioctl thread offloading on single-core machines 2011-03-02 17:54:36 +01:00
Brian Paul
8ad821df0a mesa: added gl_program_constants::MaxAddressOffset
See https://bugs.freedesktop.org/show_bug.cgi?id=29418
2011-03-02 09:32:47 -07:00
Brian Paul
41208bf047 mesa: increase INST_INDEX_BITS to 12
For more info see fd.o bug 29418.
2011-03-02 09:20:59 -07:00
Brian Paul
5f4d0cc6bc Revert "mesa: reduce calls to _mesa_test_framebuffer_completeness()"
This reverts commit 1f9a0a4e6e.

This caused trouble with Lightsmark w/ i965 driver and fbo/fbo-blit-d24s8
(see bug 34894).  It's probably something simple but no time to debug now.
2011-03-02 09:11:43 -07:00
Brian Paul
69c6e21ceb vbo: fix error parameter
Spotted by Ian.
2011-03-02 09:10:49 -07:00
Vinson Lee
bbd9616838 r300g: Silence 'control reaches end of non-void function' warning.
Fixes this GCC warning.
r300_hyperz.c: In function 'r300_get_hiz_func':
r300_hyperz.c:65: warning: control reaches end of non-void function
2011-03-02 00:43:09 -08:00
Vinson Lee
0f29d394a4 gallium: Add u_format_rgtc.c to SConscript. 2011-03-01 23:02:50 -08:00
Zou Nan hai
f1824905fa i965: Maxinum the usage of urb space on SNB.
SNB has 64k urb space, we only use piece of them.
      The more urb space we alloc,
      the more concurrent vs threads we can run.
      push the urb space usage to the limit.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-02 14:23:17 +08:00
Dave Airlie
e8d061fd74 mesa/st: fix softpipe npot compressed mipmaps.
this fixes fbo-generatemipmap-formats rgtc and s3tc in NPOT mode
with softpipe.

r600g fails to even get level 0 correct so have to look into that
a bit further.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 16:13:59 +10:00
Dave Airlie
e80bfc8515 softpipe: enable RGTC now that we have u_format support. 2011-03-02 15:30:17 +10:00
Dave Airlie
64f19b90d7 mesa/st: fix generate mipmap for signed compressed formats.
This was always converting to 8-bit per channel unsigned formats,
which isn't suitable for RGTC signed formats, this special cases
those two formats and converts to floats for those.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 15:30:17 +10:00
Dave Airlie
8d62b2aca9 gallium: add RGTC UNORM support to u_format.
SNORM needs a bit of work in the state tracker in order for mipmap
generation to work I believe.

I'm also not sure that having unorm fetches for an snorm format is
sane.
2011-03-02 15:30:16 +10:00
Dave Airlie
59cae3eee1 rgtc: remove GL types from this file.
I'd like to share this file with gallium u_format stuff.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:33:35 +10:00
Dave Airlie
531c336fa3 rgtc: move the texel fetch into common unsigned/signed code.
This function can be done in the include file also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:16:39 +10:00
Dave Airlie
fb6ecca0a5 rgtc: fix issues with compressor and signed types.
With signed types we weren't hitting this test however the comment
stating this doesn't happen often doesn't apply when using signed
types since an all 0 block is quite common which isn't abs min or max.

this fixes the limits correctly again also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:08:59 +10:00
Dave Airlie
521394a204 rgtc: don't try to access off the end of the block.
if the values are all in the last dword, the high bits can be 0,

This fixes a valgrind warning I saw when playing with mipmaps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 13:14:34 +10:00
Dave Airlie
5f714c2aaf rgtc: move to using ubyte for fetch instead of chan + fix limit
My previous fix to the byte max was incorrect.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 13:02:20 +10:00
Marek Olšák
c37e283423 st/mesa: use RGTC for GL_COMPRESSED_RED/RG if possible
With proper fallback formats.
2011-03-02 03:46:27 +01:00
Brian Paul
e118fdc9e2 svga: reduce MAX_DMA_SIZE to 4MB 2011-03-01 17:40:27 -07:00
Brian Paul
8731f0363f vbo: add vbo_always_unmap_buffers()
Drivers can call this function as needed.  It tells the VBO module to
always unmap the current glBegin/glEnd VBO when we flush.  Otherwise
it's possible to be in a flushed state but still have the VBO mapped.
2011-03-01 17:16:53 -07:00
Brian Paul
a2924b488b vbo: generate GL_INVALID_VALUE for bad glVertexAttrib index 2011-03-01 17:16:02 -07:00
Brian Paul
1c9ca21adb i915g: remove extra semicolon 2011-03-01 17:09:15 -07:00
Ian Romanick
3ff4974f22 mesa: Revert most of 3158cc7d because it causes other breakage 2011-03-01 15:57:32 -08:00
Marek Olšák
30600e3dab r300g: accelerate resoure_copy_region for rgtc 2011-03-02 00:54:06 +01:00
Kenneth Graunke
8be58df67a scons: Use Flex and Bison to generate lexer/parser files.
This gets it building again here; I'll leave it up to the SCons
maintainers to make further improvements.
2011-03-01 15:49:29 -08:00
Kenneth Graunke
80ec97af79 glsl: Rename .lpp to .ll and .ypp to .yy.
SCons has built-in support for .ll and .yy, but not .lpp and .ypp. Since
there's no real benefit to using the old names, change them.
2011-03-01 15:49:29 -08:00
Dave Airlie
ff0f36f59d rgtc: fix fetch function limits for signed types 2011-03-02 09:52:53 +10:00
Dave Airlie
8eebd216dd rgtc: fixup mipmap generation
this allows swrast to pass mipmap generation for these formats.
2011-03-02 09:48:40 +10:00
Dave Airlie
01d5d1e80e swrast/rgtc: fix rendering issues introduced when fix constants
The max value was wrong and this showed up in the piglit tests.
2011-03-02 09:41:38 +10:00
Dave Airlie
c7d239c43b r600g: change the cross over point for 2d->1d
this fixes some rendering in the fbo-generatemipmap-formats test on
my rv610.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 09:30:24 +10:00
Ian Romanick
3158cc7df8 mesa: Fix build breakage caused by c73e6ce 2011-03-01 15:22:43 -08:00
Benjamin Franzke
6b369c4c7c egl: Add EGL_WL_bind_wayland_display 2011-03-01 17:23:50 -05:00
Ian Romanick
654adaabc9 Generate lexer and parser files for tarball creation process 2011-03-01 13:43:12 -08:00
Ian Romanick
6dd0a2ed40 Add generated parser / lexer files to gitignore lists 2011-03-01 13:43:12 -08:00
Ian Romanick
1034284596 mesa: Fix some quirkiness of make tarballs
Among other benefits, parallel makes now work.  Since many people have
parallel builds by default (via MAKEFLAGS environment variable), this
sames some irritation at release time...when there's usually not any
other irritation already.
2011-03-01 13:43:12 -08:00
Ian Romanick
8170684fbe mesa: Remove nonexistent files from distribution list 2011-03-01 13:43:12 -08:00
Ian Romanick
c73e6ce7e2 mesa: Remove files generated by flex and bison from GIT
These files were for the ARB_vertex_program / ARB_fragement_program assembler.
2011-03-01 13:43:12 -08:00
Ian Romanick
cb48207e4b glcpp: Remove files generated by flex and bison from GIT 2011-03-01 13:43:12 -08:00
Ian Romanick
8864b38783 glsl: Remove files generated by flex and bison from GIT 2011-03-01 13:43:12 -08:00
Daniel Vetter
8f9e546fde i915g: kill relocs accouting
No one ever cared. libdrm does dynamic resizing of its reloc-table,
anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:11 +01:00
Daniel Vetter
ee7acf6493 i915g: switch to the exact batch space reservation code
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:10 +01:00
Daniel Vetter
179cb58795 i915g: split up hw state emission into small atoms
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:09 +01:00
Christian König
4c4ab5668c st/mesa: probably handle instanced drawing
Remove the previous workaround for instanced drawing and implement it correctly.
2011-03-01 21:42:16 +01:00
Daniel Vetter
583eb13948 i915g: fix i915_winsys_batchbuffer_write
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 20:57:57 +01:00
Kenneth Graunke
d1fc920f61 intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.
Nexuiz was hitting a software fallback.
2011-03-01 11:21:48 -08:00
Chris Wilson
faf1ddacfb configure: Bump libdrm requirements
In my last commit I introduced a build dependency upon a new libdrm.
Add the associated autoconf checks. As the headers are part of the core
libdrm, we need to bump that version and so may as well bump the chipset
specific versions simultaneously.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 18:42:23 +00:00
Marek Olšák
952222e4bf r300g: initialize some r500 PS3 regs 2011-03-01 19:10:30 +01:00
Marek Olšák
a5ee80a264 r300g: document some more DRM 2.8.0 features 2011-03-01 19:10:30 +01:00
Chris Wilson
900a5c91ee i965: Use negative relocation deltas to minimse vertex uploads
With relaxed relocation checking in the kernel, we can specify a
negative delta (i.e. pointing outside of the target bo) in order to fake
a range in a large buffer. We only then need to upload the elements used
and adjust the buffer offset such that they correspond with the indices
used in the DrawArrays.

(Depends on libdrm 0209428b3918c4336018da9293cdcbf7f8fedfb6)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 16:34:50 +00:00
Chris Wilson
9fa380ccdc i965: Undo 'continuation of vb packets'
This breaks nexuiz for unknown reason; disable until a true fix can be
found.
2011-03-01 16:33:49 +00:00
Chris Wilson
69b3f24658 i965: Fix uploading of shortened vertex packets
... handle all cases and not just the interleaved upload.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 16:33:40 +00:00
Chris Wilson
6ddfb322f5 i965: Upload all vertices used
... and take advantage of start_vertex_bias to trim to [min_index,
max_index] where possible (i.e. when we need to upload all arrays).

Fixes half_float_vertex(misc.fillmode.wireframe)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34595
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 09:42:52 +00:00
Thomas Hellstrom
8b145e2302 st/egl: Implement swapbuffer throttling
When doing copy swapbuffers using drm, throttle on outstanding copy operations.
Introduces a new environment variable, EGL_THROTTLE_FENCES that the
user can use to indicate the desired number of outstanding swapbuffers, or
disable throttling using EGL_THROTTLE_FENCES=0.

This can and perhaps should be extended to the pageflip case as well, since
with some hardware pageflips can be pipelined. In case the pageflip syncs, the
throttle operation will be a no-op anyway.

Update copyright notices.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
c9febff31f st/egl/drm: Rework swapbuffers
Use the pageflip ioctl when available.
Otherwise, or when the backbuffer contents need to be preserved,
fall back to a copy operation.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
2b079485f6 st/egl: Add a helper to perform a copy swap on a resource surface
The copy swap can be used when we need to preserve the contents of
the back buffer or when there is no way to do native page-flipping.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
d1e4117355 st/egl: Move the copy context to the native display structure
This makes it usable also for native helpers.
Also add inline functions to access the context and to
uninit the native display structure.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:18 +01:00
Kenneth Graunke
186d3bc7a3 Revert "i965/fs: Correctly set up gl_FragCoord.w on Sandybridge."
This reverts commit 4a3b28113c, as it
caused a regression on Ironlake (bug #34646).
2011-03-01 01:09:15 -08:00
Dave Airlie
b1ceda5cbd st/dri: one more missing array size
whats one more between friends.

again bnf on irc.
2011-03-01 18:32:33 +10:00
Dave Airlie
02448f2241 st/dri: fix missing array size init.
Init array size to 1,

reported by bnf on irc.
2011-03-01 18:29:24 +10:00
Dave Airlie
2d62e39c62 egl/st: add array size initialisor
reported by bnf on irc.
2011-03-01 18:24:15 +10:00
Ben Skeggs
450aa241bf nouveau: remove nouveau_stateobj.h
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:43:13 +10:00
Ben Skeggs
28eb7214db nvc0: fix a crash on context destruction
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:23:31 +10:00
Ben Skeggs
1ba8e95108 nouveau: ensure vbo_dirty is set when buffer write transfer complete
This introduces a shared nouveau_context struct to track such things.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:23:31 +10:00
Ben Skeggs
96d57722fd nouveau: fix leak of nouveau_mman structs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:22:53 +10:00
Ben Skeggs
4826cd0f61 nvc0: port to common fence/mm/buffer code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:22:49 +10:00
Dave Airlie
a44b65312e r600g: add NV_conditional_render support.
This is reliant on a drm patch that I posted on the list + a version bump.

These will appear in drm-next today.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:09:00 +10:00
Dave Airlie
929be6eb95 r600g: start using drm minor version to enable things.
If the drm minor version is > 9 (i.e. whats in drm-next),
we enable s3tc + texture tiling by default now.

this changes R600_FORCE_TILING to R600_TILING which can
be set to false to disable tiling on working drm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:08:50 +10:00
Ben Skeggs
40d7a87a8e nv50: multiply polygon offset units by 2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
be68782d9a nv50: sync textures with render targets ourselves
Port of the nvc0 commit doing the same.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
79079141fa nv50: move onto common linear buffer manager
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
5c1c4f8593 nouveau: common linear buffer manager, ported from nv50/nvc0 drivers
nv50_resource is being called nv04_resource now temporarily, to avoid
a naming conflict with nouveau_resource from libdrm.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
cd24fcedec nouveau: create linear gart/vram mman in common screen init
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
3a38a4b0a8 nouveau: fix fence_ref() where fence and *ref are the same fence
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
d6bdf1f6ae nouveau: fix compiler complaint
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
2f30a5bdaa nv50: make mm available as common code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
7a8ee058a8 nv50: move onto shared fence code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
5a0915870c nouveau: move nv50/nvc0 fencing to common location, and modify slightly
Modified from original to remove chipset-specific code, and to be decoupled
from the mm present in said drivers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
48e191f90c nv50-nvc0: set cur_ctx during init if none currently bound
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Marek Olšák
ea4a19c392 r300g: fix RGTC2_SNORM
ATI engineers have probably chosen those sign bits by a dice roll.
2011-03-01 05:25:33 +01:00
Marek Olšák
66d5de74c4 r300g: reorder parts of translate_texformat 2011-03-01 05:25:33 +01:00
Alex Deucher
1dc204d145 r600g: truncate point sampled texture coordinates
By default the hardware rounds texcoords.  However,
for point sampled textures, the expected behavior is
to truncate.  When we have point sampled textures,
set the truncate bit in the sampler.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=25871

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-28 22:01:59 -05:00
Zou Nan hai
6c324777a6 i965: bump VS thread number to 60 on SNB
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-01 10:39:35 +08:00
Marek Olšák
7a61957424 r300g: fix RGTC1_UNORM and RGTC2_UNORM
Signs don't work the way I'd like...
2011-03-01 03:24:55 +01:00
Dave Airlie
9c16fcc617 rgtc: shared the compressor code between signed/unsigned
No idea why I didn't do it like this the first time, but share
the code like other portions of mesa do using _tmp.h suffix
and some #defines for the types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 11:57:51 +10:00
Brian Paul
7b3bec87df vbo: silence unused var warning 2011-02-28 18:34:06 -07:00
Brian Paul
125b4ac7e6 softpipe: remove redundant draw_flush() call
We'll flush after the same-shader comparison.
2011-02-28 18:25:41 -07:00
Brian Paul
e6f3e24330 draw: setup pipe's draw pointer for the aapoint stage
The other draw stages like aaline and pstipple were already doing this.
If the driver used the aapoint stage but not the others it would crash
because of a null pipe->draw pointer.
2011-02-28 18:25:37 -07:00
Brian Paul
b70610b982 mesa: move PBO-related functions into a new file 2011-02-28 18:24:35 -07:00
Brian Paul
7d8db55148 mesa: always generate error in glColorTableParameter[fi]v()
These were only used by GL_SGI_texture_color_table, which is gone now.
2011-02-28 18:24:30 -07:00
Brian Paul
9d20849516 mesa: remove GL_SGI_texture_color_table support
It was only implemented in the swrast driver and probably not used by
any applications.  A modern app would use a dependent/chained texture
lookup in the fragment shader.
2011-02-28 18:24:30 -07:00
Brian Paul
7e161bcf11 svga: add assertions in svga_shader_type() 2011-02-28 18:24:30 -07:00
Brian Paul
c6991433ef mesa: consolidate framebuffer target lookup code 2011-02-28 18:24:25 -07:00
Brian Paul
fec26193fb mesa: remove some old do-nothing code 2011-02-28 18:24:25 -07:00
Brian Paul
1f9a0a4e6e mesa: reduce calls to _mesa_test_framebuffer_completeness()
when updating/validating framebuffer state.  The _Status field is set
to zero when we need to recompute _Status.  Otherwise, it's up to date.
2011-02-28 18:24:25 -07:00
Brian Paul
b0fceae22f mesa: reduce calls to _mesa_test_framebuffer_completeness()
when doing glCopyTex[Sub]Image() and checking the source buffer's
completeness.
We only need to determine FBO completeness when the status is indeterminate.
2011-02-28 18:24:20 -07:00
Brian Paul
ca1b551562 mesa: s/mesaFormat/attFormat/ 2011-02-28 18:23:23 -07:00
Marek Olšák
790c731409 r300g: set the correct HiZ clear value 2011-03-01 01:46:27 +01:00
Marek Olšák
4609be4410 r300g: update derived state before uploading vertex buffers
The function may invoke blitter, which invalidates vertex buffers.
2011-03-01 00:46:58 +01:00
Marek Olšák
fbedd9c73a u_vbuf_mgr: compute user buffer size for instance data from instance_count 2011-03-01 00:46:58 +01:00
Marek Olšák
2f665885cd r300g: fix printing whether Z compression is enabled 2011-03-01 00:46:58 +01:00
Marek Olšák
ebf69f2c50 r300g: disable HiZ permanently if the the depth function is inverted
Instead of temporarily.

The HiZ function (something like a depth function) is a property
of a HiZ buffer and can only be changed during HiZ clears.
2011-03-01 00:46:54 +01:00
Marek Olšák
d99ec708af r300g: fix HiZ memory size computation and deciding when to use HiZ
I removed the HiZ memory management, because the HiZ RAM is too small
and I also did it in hope that HiZ will be enabled more often.

This also sets aligned strides to HIZ_PITCH and ZMASK_PITCH.
2011-03-01 00:23:11 +01:00
Alex Deucher
5f44fab5a6 r600g: add missing evergreen INT_TO_FLT to r600_bc_get_num_operands
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-28 17:21:26 -05:00
Dave Airlie
3f600047d9 rgtc: fix void pointer arith.
should fix scons build.
2011-03-01 06:47:00 +10:00
Kenneth Graunke
0a163cf56d glsl: Enable GL_OES_texture_3D extension for ES2. 2011-02-28 10:35:57 -08:00
Kenneth Graunke
eb639349e2 glsl: Use reralloc instead of plain realloc.
Plugs a memory leak when compiling shaders with user defined structures.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-28 10:35:40 -08:00
Jerome Glisse
c33e091d17 r600g: indentation fixes
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-28 13:33:13 -05:00
Marek Olšák
ab824a0722 r300g: initialize SC_SCREENDOOR 2011-02-28 12:43:26 +01:00
Christoph Bumiller
f80c03e187 nv50: replace most of it with nvc0 driver ported to nv50
We'll have to do some unification now to reduce code duplication.
2011-02-28 12:41:09 +01:00
Marek Olšák
d1dbbf7bf4 r300g: disable hyper-z on rs6xx+
It doesn't work.
2011-02-28 12:28:07 +01:00
Vinson Lee
93893139a4 mesa: Add texcompress_rgtc.c to SConscript. 2011-02-27 23:17:49 -08:00
Dave Airlie
e107a3aa08 rgtc: update docs 2011-02-28 13:43:32 +10:00
Dave Airlie
83ebc01c1d mesa/st: add RGTC format support.
this just adds a format check + format conversion.
2011-02-28 13:35:35 +10:00
Dave Airlie
903726d285 swrast: add RGTC support 2011-02-28 13:35:35 +10:00
Dave Airlie
8d47c91985 mesa: Add RGTC texture store/fetch support.
This adds support for the RGTC unsigned and signed
texture storage and fetch methods.

the code is a port of the DXT5 alpha compression code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 13:35:34 +10:00
Dave Airlie
e792e79f5a mesa: make_float_temp_image non-static
We need this to do signed stuff for RGTC.
2011-02-28 13:34:25 +10:00
Dave Airlie
e3709c26a6 rgtc: llvmpipe/softpipe refuse RGTC until u_format has support.
So far I haven't implemented the u_format code for these.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 13:34:25 +10:00
Dave Airlie
0495425dc3 r300g: force swizzles for RGTC
still can't get signed to work
2011-02-28 13:21:44 +10:00
Christian König
96bbc627f3 r600g: implement instanced drawing support 2011-02-28 02:19:39 +01:00
Christian König
bce4f9ac39 st/mesa & v_bug_mgr: two small instanced drawing fixes 2011-02-28 02:19:39 +01:00
Dave Airlie
0a17444133 Revert "r600g: Don't negate result of ABS instruction"
This reverts commit b6d4021393.

This actually breaks gears here on my rv670.
2011-02-28 11:10:35 +10:00
Fabian Bieler
0ab7dcddb3 r600g: Process TRUNC with tgis_op2
TRUNC is neither a scalar instruction nor exclusive to the Trans unit.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 09:22:16 +10:00
Fabian Bieler
b6d4021393 r600g: Don't negate result of ABS instruction
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 09:21:41 +10:00
Daniel Vetter
d42c9433b0 i915g: implement cache flushing
With an extremely dumb strategy. But it's the same i915c employs.

Also improve the hw_atom code slightly by statically specifying the
required batch space. For extremely variably stuff (shaders, constants)
it would probably be better to add a new parameter to the hw_atom->validate
function.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 22:10:46 +01:00
Daniel Vetter
f90fa55347 i915g: buffer validation for blitter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 22:03:51 +01:00
Daniel Vetter
342016010a i915g: buffer validation for render state
Also contains the first few bits for hw state atoms.

v2: Implement suggestion by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 21:57:31 +01:00
Daniel Vetter
3c59b3eb4b i915g/winsys: buffer validation support
v2: Add the batch bo to the libdrm validation lost, for otherwise
libdrm won't take previously used buffers into account.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 18:49:56 +01:00
Daniel Vetter
e20c3255e2 i915g: add raw batchbuffer dumping in drm winsys
These files can be decoded with intel_dump_decode from the intel-gpu-tools
available at:

http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 16:32:38 +01:00
Daniel Vetter
f58c11af72 i915g: cleanup static state calculation, part 2
Now also for the DRAW_RECT command

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 15:58:13 +01:00
Daniel Vetter
beaf039f97 i915g: cleanup static state calculation, part 1
Move it to i915_state_static.c This way i915_emit_state.c only emits
state and doesn't (re)calculate it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 15:58:03 +01:00
Kenneth Graunke
a385ac6207 glsl/builtins: Fix return type for textureSize sampler2DArray variants.
A copy and paste error.
2011-02-27 00:44:47 -08:00
Eric Anholt
5f889c5bf5 glx: Adjust the MESA_multithread_makecurrent spec to match implementation.
This came out of discussion at the office today, and we agreed that
solving this for indirect wasn't really interesting, though the
server-side change would be of a similar level of difficulty.
2011-02-26 12:43:15 -08:00
Eric Anholt
dea5e57861 intel: Use the current context rather than last bound context for a drawable.
If another thread bound a context to the drawable then unbound it, the
driContextPriv would end up NULL.

With the previous two fixes, this fixes glx-multithread-makecurrent-2,
despite the issue not being about the multithreaded makecurrent.
2011-02-26 12:43:15 -08:00
Eric Anholt
74cde6505c dri2: Don't call the dri2 flush hook for swapbuffers unless we have a context.
The driver only has one reasonable place to look for its context to
flush anything, which is the current context.  Don't bother it with
having to check.
2011-02-26 12:43:15 -08:00
Eric Anholt
4d01bea808 glx: Don't do the implicit glFlush in SwapBuffers if it's the wrong drawable.
The GLX Spec says you only implicitly glFlush if the drawable being
swapped is the current context's drawable.
2011-02-26 12:43:15 -08:00
Eric Anholt
49d7e48b33 mesa: Add new MESA_multithread_makecurrent extension.
This extension allows a client to bind one context in multiple threads
simultaneously.  It is then up to the client to manage synchronization of
access to the GL, just as normal multithreaded GL from multiple contexts
requires synchronization management to shared objects.
2011-02-26 12:43:15 -08:00
Daniel Vetter
132dc0b6d2 i915g: make dynamic state emission actually lazy
Premature semicolon.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 21:20:03 +01:00
Jakob Bornecrantz
11f9ec5422 gallivm: Initialize stack values
valgrind gives me a warning with llvmpipe with profile builds but
not debug builds, this seems to fix the issue at least.
2011-02-26 20:13:08 +01:00
Arkadiusz Miskiewicz
99b9019716 glsl/Makefile: Remove builtin_function.cpp if generation fails.
Fixes bug #34346.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-02-26 10:28:00 -08:00
Jakob Bornecrantz
052122a8cd i915g: Handle null constants properly 2011-02-26 15:45:47 +01:00
Daniel Vetter
b8e44f648e i915g: fix null deref in draw_rect emission
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 15:35:24 +01:00
Daniel Vetter
1df1e0841d i915g: simplify math in constants emission
The old code even falls apart for nr == 0 (which is caught earlier, but)!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 15:35:24 +01:00
Jakob Bornecrantz
acc290aff0 i915g: Use the same debug env vars in drm and sw winsys 2011-02-26 15:35:13 +01:00
Jakob Bornecrantz
9a371b938c i915g: Use unchecked writes in sw winsys batchbuffer 2011-02-26 15:29:21 +01:00
Alan Hourihane
53fe5b334e Check for out of memory when creating fence 2011-02-26 10:30:19 +00:00
Jakob Bornecrantz
ca8a91ff7e util: Don't destroy shaders null shaders
Fixes regression from a08e612fd8
2011-02-26 02:32:22 +01:00
Jakob Bornecrantz
a08e612fd8 util: Don't create array texture shaders if the driver doesn't support it 2011-02-26 00:50:52 +01:00
Kenneth Graunke
58f7c9c72e i965/fs: Initial plumbing to support TXD.
This adds the opcode and the code to convert ir_txd to OPCODE_TXD;
it doesn't actually add support yet.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
2830b1ae90 i965/fs: Complete TXL support on gen5+.
Initial plumbing existed to turn the ir_txl into OPCODE_TXL, but it was
never handled.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
4ddd11aad6 i965/fs: Complete TXL support on gen4.
Initial plumbing existed to turn the ir_txl into OPCODE_TXL, but it was
never handled.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
e54d62b896 i965/fs: Use a properly named constant in TXB handling.
The old value, BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE makes it sound like we're
doing a non-bias texture lookup.  It has the same value as the new constant
BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_BIAS_COMPARE, so there should be no
functional changes.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
a3cd542894 i965: Add #defines for gen4 SIMD8 TXB/TXL with shadow comparison.
From volume 4, page 161 of the public i965 documentation.
2011-02-25 15:30:45 -08:00
Jerome Glisse
b0e8aec5ab gallium/tgsi: shuffle ureg_src structure to work around gcc4.6.0 issue
There is an issue with gcc 4.6.0 that leads to segfault/assert with mesa
due to ureg_src size, reshuffling the structure member to better better
alignment work around the issue.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47893

7.9 + 7.10 candidate

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-25 12:44:07 -05:00
Jerome Glisse
8e17adfdbd gallium/st: place value check before value is use
7.9 & 7.10 candidate

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-25 11:49:23 -05:00
Dave Airlie
179ff0551c gallium/util: add 1d/2d mipmap generation support
so far only hw mipmap generation is testing on softpipe,
passes test added to piglit.

this requires another patch to mesa to let array textures mipmaps
even start to happen.
2011-02-25 16:06:15 +10:00
Vinson Lee
eb17802386 scons: Reduce all Cygwin platform names to 'cygwin'.
platform.system in SCons on Cygwin includes the OS version number.
Windows XP - CYGWIN_NT-5.1
Windows Vista - CYGWIN_NT-6.0
Windows 7 - CYGWIN_NT-6.1

Reduce all Cygwin platform variants to just 'cygwin' so anything
downstream can simply use 'cygwin' instead of the different full
platform names.
2011-02-24 19:49:37 -08:00
Dave Airlie
b2413de916 r600g: explicity set sign bits for RGTC 2011-02-25 09:18:42 +10:00
Dave Airlie
c9bca01819 r600g: bc 4/5 or rgtc textures need to be tiled as well.
Make the s3tc upload code more generic.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-25 09:18:42 +10:00
Dave Airlie
79ad6f5375 r300g: explicit sign bits on RGTC textures 2011-02-25 09:18:41 +10:00
Kenneth Graunke
e6e5c1f46d i965: Increase Sandybridge point size clamp in the clip state.
255.875 matches the hardware documentation.  Presumably this was a typo.

NOTE: This is a candidate for the 7.10 branch, along with
      commit 2bfc23fb86.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-24 11:23:08 -08:00
Neil Roberts
c0ad70ae31 intel: Try using glCopyTexSubImage2D in _mesa_meta_BlitFramebuffer
In the case where glBlitFramebuffer is being used to copy to a texture
without scaling it is faster if we can use the hardware to do a blit
rather than having to do a texture render. In most of the drivers
glCopyTexSubImage2D will use a blit so this patch makes it check for
when glBlitFramebuffer is doing a simple copy and then divert to
glCopyTexSubImage2D.

This was originally proposed as an extension to the common meta-ops.
However, it was rejected as using the BLT is only advantageous for Intel
hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33934
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 16:43:39 +00:00
Christoph Bumiller
11b9f4439c nvc0: fix PointCoord enable in FP header 2011-02-24 17:35:36 +01:00
Christoph Bumiller
d0caaba370 nvc0: change TGSI CMP translation to use slct
Saves us the explicit compare instruction needed with selp.
2011-02-24 17:35:36 +01:00
Christoph Bumiller
b0bf4ee85f nvc0: sprite coord enable is per GENERIC, not overall index 2011-02-24 17:35:36 +01:00
Christoph Bumiller
9dd7d0803e nvc0: fix new_value calls using type instead of size 2011-02-24 17:35:36 +01:00
Christoph Bumiller
1a82971393 nvc0: set local memory usage info in shader header
Before this, l[] access was a no-op.
2011-02-24 17:35:36 +01:00
Christoph Bumiller
b5f04b2008 nvc0: don't fold loads from local memory 2011-02-24 17:35:36 +01:00
Christoph Bumiller
9612139907 nvc0: presin and preex2 can load from const space 2011-02-24 17:35:36 +01:00
Christoph Bumiller
f017483553 nvc0: kick out empty live ranges
They affect overlap tests even though they're actually empty.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
cd47f10c90 nvc0: preemptively insert branch at ENDIF
Might be necessary if a block sneaks in somewhere, like a common
block for moves of phi sources after a loop break.

This is harmless and normally will be removed before emission.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
4377657f8e nvc0: correct allocation of constrained registers
In linear scan we can't allocate multiple values with different
live ranges at the same time to assign them consecutive regs.

Maybe we should just switch to graph coloring for all values ...
2011-02-24 17:35:35 +01:00
Christoph Bumiller
67c7aefea3 nvc0: sync textures with render targets ourselves
Fixes for example piglit/fbo-flushing and nexuiz' bloom effect.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
a6ea37da4b nvc0: improve userspace fencing
Before, there were situations in which we never checked the fences
for completion (some loading screens for example) and thus never
released memory.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
410a13c5ce nvc0: values for undefined outputs must have file GPR 2011-02-24 17:35:35 +01:00
Christoph Bumiller
1579017b08 nvc0: multiply polygon offset units by 2
Wasn't sure if this still was necessary because the piglit test
started to fail at some point on nv50 where we already do this.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
7d8ff54feb nvc0: fix SSG 2011-02-24 17:35:35 +01:00
Christoph Bumiller
88066d62ae nvc0: don't visit target blocks of a loop break multiple times 2011-02-24 17:35:35 +01:00
Christoph Bumiller
3d190e44de nvc0: don't overwrite phi sources at the end of a loop
Except the reference to its own result.
2011-02-24 17:35:35 +01:00
Fabian Bieler
728695b435 gallium/utils: Fix vertex element setup
Check if element was translated per element instead of per buffer.
2011-02-24 15:05:10 +01:00
José Fonseca
369ece1702 svga: Ensure rendertargets and textures are always rebound at every command buffer start.
The svga_update_state() mechanism is inadequate as it will always end up
flushing the primitives before processing the SVGA_NEW_COMMAND_BUFFER
dirty state flag.
2011-02-24 14:00:13 +00:00
Chris Wilson
f19439940c i965: Remember to pack the constant blend color as floats into the batch
Fixes regression from aac120977d.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 12:59:52 +00:00
Chris Wilson
5ce0f7f109 intel: Reset the buffer offset after releasing reference to packed upload
Fixes oglc/vbo(basic.bufferdata)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34603
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 12:29:51 +00:00
Chris Wilson
135ccb2dae i965: Unmap the correct pointer after discontiguous upload
Fixes piglit/fbo-depth-sample-compare:

==14722== Invalid free() / delete / delete[]
==14722==    at 0x4C240FD: free (vg_replace_malloc.c:366)
==14722==    by 0x84FBBFD: intel_upload_unmap (intel_buffer_objects.c:695)
==14722==    by 0x85205BC: brw_prepare_vertices (brw_draw_upload.c:457)
==14722==    by 0x852F975: brw_validate_state (brw_state_upload.c:394)
==14722==    by 0x851FA24: brw_draw_prims (brw_draw.c:365)
==14722==    by 0x85F2221: vbo_exec_vtx_flush (vbo_exec_draw.c:389)
==14722==    by 0x85EF443: vbo_exec_FlushVertices_internal (vbo_exec_api.c:543)
==14722==    by 0x85EF49B: vbo_exec_FlushVertices (vbo_exec_api.c:973)
==14722==    by 0x86D6A16: _mesa_set_enable (enable.c:351)
==14722==    by 0x42CAD1: render_to_fbo (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42CEE3: piglit_display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42F508: display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==  Address 0xc606310 is 0 bytes after a block of size 18,720 alloc'd
==14722==    at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==14722==    by 0x85202AB: copy_array_to_vbo_array (brw_draw_upload.c:256)
==14722==    by 0x85205BC: brw_prepare_vertices (brw_draw_upload.c:457)
==14722==    by 0x852F975: brw_validate_state (brw_state_upload.c:394)
==14722==    by 0x851FA24: brw_draw_prims (brw_draw.c:365)
==14722==    by 0x85F2221: vbo_exec_vtx_flush (vbo_exec_draw.c:389)
==14722==    by 0x85EF443: vbo_exec_FlushVertices_internal (vbo_exec_api.c:543)
==14722==    by 0x85EF49B: vbo_exec_FlushVertices (vbo_exec_api.c:973)
==14722==    by 0x86D6A16: _mesa_set_enable (enable.c:351)
==14722==    by 0x42CAD1: render_to_fbo (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42CEE3: piglit_display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42F508: display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34604
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 10:58:22 +00:00
Chris Wilson
a2029a78c3 intel: Protect against waiting on a NULL render target bo
If we fall back to software rendering due to the render target being
absent (GPU hang or other error in creating the named target), then we
do not need to nor should we wait upon the results.

Reported-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34656
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 10:12:37 +00:00
Dave Airlie
69d969e8fa r600g: EXT_texture_array support.
This adds EXT_texture_array support to r600g, it passes the piglit
array-texture test but I suspect may not be complete.

It currently requires a kernel patch to fix the CS checker to allow
these, so you need to use R600_ARRAY_TEXTURE=true for now
to enable them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-24 13:26:28 +10:00
Dave Airlie
13f5a4d316 st/mesa: treat 1D ARRAY upload like a depth or 2D array upload.
This is because the HW doesn't always store a 1D array like a
2D texture, it more likely stores it like 2D texture (i.e.
alignments etc).

This means we upload each slice separately and let the driver
work out where to put it.

this might break nvc0 as I can't test it, I have only nv50 here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-24 13:26:16 +10:00
Vinson Lee
100cd214e3 scons: Fix Cygwin platform names.
Fixes immediate Python exceptions with SCons on Cygwin.
2011-02-23 18:21:14 -08:00
Jakob Bornecrantz
8fb0ecd0cf i915g: Lazy emit dynamic state 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
b9baad2aff i915g: Lazy emit immediate state 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
69cfc16cb6 i915g: Disable LIS7 state updates for now 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
42b8b2be85 i915g: Clean up in i915_state_immediate 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
481fad1552 i915g: Remove outdated comment 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
fbd681f1a0 i915g: Use dump function in sw winsys 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
fc77dee0bd i915g: Enable mirror repeat wrap mode 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
4407e5078f i915g: Always set vbo to flush on flushes
Reported-by Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 00:26:02 +00:00
Chris Wilson
671018aa99 intel: gen3 is particular sensitive to batch size
... and prefers a small batch whereas gen4+ prefer a large batch to
carry more state.

Tuning using openarena/padman indicate that a batch size of just 4096 is
best for those cases.

Bugzilla: https://bugs.freedesktop.org/process_bug.cgi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-23 23:11:26 +00:00
Chris Wilson
19ac5fa50d i915: And remember assign the new value to the state reg...
Fixes regression from 298ebb78de.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34589
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-23 22:10:43 +00:00
Tom Fogal
4484297505 Fix GLX_USE_TLS define.
It was only getting set in the case of DRI drivers.
2011-02-23 10:40:26 -07:00
Fabian Bieler
0ed5bf668d r600g: Request DWORD aligned vertex buffers.
The spec says that the offsets in the vertex-fetch instructions need to be byte-aligned and makes no specification with regard to the required alignment of the offset and stride in the vertex resource constant register.

However, testing indicates that all three values need to be DWORD aligned.
2011-02-23 11:42:32 -05:00
Wiktor Janas
b65e2195c4 st/mesa: fix computing the lowest address for interleaved attribs
Ptr can be very well NULL, so when there are two arrays, with one having
offset 0 (and thus NULL Ptr), and the other having a non-zero offset,
the non-zero value is taken as minimum (because of !low_addr ? start ...).
On 32-bit systems, this somehow works. On 64-bit systems, it leads to crashes.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-02-23 15:19:37 +01:00
Brian Paul
6d1f28d6c0 vbo: added vbo_check_buffers_are_unmapped() debug function 2011-02-22 14:32:37 -07:00
Brian Paul
bcd017f16f vbo: removed unused #defines, add comments 2011-02-22 14:23:50 -07:00
Brian Paul
eb24a5a9be mesa: move comment, change debug code 2011-02-22 13:37:30 -07:00
Brian Paul
d7fcb2ac81 vbo: simplify NeedFlush flag clearing 2011-02-22 13:31:09 -07:00
Brian Paul
d8aebc4e4b vbo: use ctx intstead of exec->ctx 2011-02-22 13:24:56 -07:00
Brian Paul
cbe47a2459 r300g: fix missing initializers warning 2011-02-22 12:47:18 -07:00
Brian Paul
7898d2ae16 i915g: remove extra semicolons 2011-02-22 12:47:18 -07:00
Andy Skinner
90e227f079 xlib: pass Display pointer to XMesaGarbageCollect()
Fixes an issue when different displays are used on different threads.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-22 12:47:17 -07:00
Kenneth Graunke
2bfc23fb86 i965: Increase Sandybridge point size clamp.
255.875 matches the hardware documentation.  Presumably this was a typo.

Found by inspection.  Not known to fix any issues.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:45 -08:00
Kenneth Graunke
4a3b28113c i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.
pixel_w is the final result; wpos_w is used on gen4 to compute it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
df2aef0e19 i965/fs: Refactor control flow stack handling.
We can't safely use fixed size arrays since Gen6+ supports unlimited
nesting of control flow.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
2c2686b912 i965/fs: Avoid register coalescing away gen6 MATH workarounds.
The code that generates MATH instructions attempts to work around
the hardware ignoring source modifiers (abs and negate) by emitting
moves into temporaries.  Unfortunately, this pass coalesced those
registers, restoring the original problem.  Avoid doing that.

Fixes several OpenGL ES2 conformance failures on Sandybridge.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
72cd7e87d3 i965/fs: Apply source modifier workarounds to POW as well.
Single-operand math already had these workarounds, but POW (the only two
operand function) did not.  It needs them too - otherwise we can hit
assertion failures in brw_eu_emit.c when code is actually generated.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
3e91070ea8 i965: Fix shaders that write to gl_PointSize on Sandybridge.
gl_PointSize (VERT_RESULT_PSIZ) doesn't take up a message register,
as it's part of the header.  Without this fix, writing to gl_PointSize
would cause the SF to read and use the wrong attributes, leading to all
kinds of random looking failure.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
José Fonseca
c6cedd43fe mesa: Avoid undeclared ffs function warning on mingw. 2011-02-22 14:59:09 +00:00
José Fonseca
7aeb610fe1 gallium: s/PIPE_TRANSFER_CPU_READ/PIPE_TRANSFER_READ/ in comments. 2011-02-22 14:14:45 +00:00
José Fonseca
0562f44625 gallium/docs: Update PIPE_TRANSFER_xx docs. Reformat to use definitions. 2011-02-22 14:14:22 +00:00
Keith Whitwell
fad8497d3b gallium: new transfer flag: DISCARD_WHOLE_RESOURCE 2011-02-22 14:13:07 +00:00
Marek Olšák
695cdee678 st/mesa: fix crash when using both user and vbo buffers with the same stride
If two buffers had the same stride where one buffer is a user one and
the other is a vbo, it was considered to be one interleaved buffer,
resulting in incorrect rendering and crashes.

This patch makes sure that the interleaved buffer is either user or vbo,
not both.
2011-02-20 22:16:22 +01:00
Marek Olšák
7942e6a5ae st/mesa: fix crash when DrawBuffer->_ColorDrawBuffers[0] is NULL
This fixes the game Tiny and Big.
2011-02-20 22:16:22 +01:00
Chris Wilson
3adc108b4a i965: Trim the interleaved upload to the minimum number of vertices
... should have no impact on a properly formatted draw operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:47 +00:00
Chris Wilson
b4cbd2b312 i965: Reinstate max-index paranoia
Don't trust the applications not to reference beyond the end of the
vertex buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:45 +00:00
Chris Wilson
3377faffcd i965: Zero the offset into the vbo when uploading non-interleaved
Fixes regression from 559435d915.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:34 +00:00
Jakob Bornecrantz
94ccc31ba4 st/dri: Track drawable context bindings
Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.
2011-02-20 16:31:48 +01:00
Eric Anholt
9e872a5865 i965: Fix VB packet reuse when offset for the new buffer isn't stride aligned.
Fixes regression in scissor-stencil-clear and 5 other tests.
2011-02-21 16:36:09 -08:00
Brian Paul
12f25eb6d5 Revert "mesa: convert macros to inline functions"
This reverts commit e9ff76aa81.

Need to use macros so __FUNCTION__ reports the caller.
2011-02-21 17:01:00 -07:00
Brian Paul
e2d108ec82 st/mesa: need to translate clear color according to surface's base format
When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-21 16:58:42 -07:00
Brian Paul
c966c6980c st/mesa: fix the default case in st_format_datatype()
Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-21 16:58:42 -07:00
Daniel Vetter
55a3c35243 i915g: add some throttling
Intel classic drivers switched to this, too, so it must be good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:54 +00:00
Daniel Vetter
1e966636d0 i915g: s/bool/boolean/ style-fixup in winsys
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
593ba7b05b i915g: Fix warning 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
43e6fe5549 i915g: Add option to lie about caps 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
27b49e91c9 i915g: Move debug fields to screen 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
fe6800a1bb i915g: Use debug get once options 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
3c74ecf687 i915g: Rework texture tiling a bit 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e7e1fd057e i915g: Anisotropic filtering works 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
a641766576 i915g: TODO about point sprites 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e7cdcefbee i915g: TODO about untested code hidden behind caps
Should be fairly easy to test and fix since you can look at
the code in the classic driver.
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e3c9bf1a67 i915g: Reorg caps 2011-02-21 23:42:53 +00:00
Brian Paul
7dbafea860 st/mesa: fix incorrect texture size allocation in st_finalize_texture()
If finalizing a non-POW mipmapped texture with an odd-sized base texture
image we were allocating the wrong size of gallium texture (off by one).
Need to be more careful about computing the base texture image size.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=34463
2011-02-21 15:15:53 -07:00
Brian Paul
4cdcec08d1 st/mesa: refactor guess_and_alloc_texture() code 2011-02-21 15:15:53 -07:00
Brian Paul
51f9713e39 st/mesa: fix mipmap generation for non-POW textures
This is part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=34463
2011-02-21 15:15:53 -07:00
Brian Paul
e9ff76aa81 mesa: convert macros to inline functions 2011-02-21 15:15:53 -07:00
Brian Paul
da9adb9613 vbo: more comments 2011-02-21 15:15:52 -07:00
Brian Paul
6f027ba20d vbo: make vbo_exec_FlushVertices_internal() static 2011-02-21 15:15:52 -07:00
Brian Paul
bbd756e824 vbo: remove old debug code, add comments 2011-02-21 15:15:52 -07:00
Brian Paul
7cba2df4a6 vbo: rename, document function params 2011-02-21 15:15:52 -07:00
Brian Paul
f0c8e7c327 vbo: comments 2011-02-21 15:15:52 -07:00
Brian Paul
0ba2810e47 vbo: replace assert(0) with proper assertions 2011-02-21 15:15:52 -07:00
Brian Paul
ae4b6e04cd vbo: rename some vars, add new comments, fix formatting, etc. 2011-02-21 15:15:52 -07:00
Brian Paul
8b2598d000 vbo: use ctx instead of exec->ctx 2011-02-21 15:15:52 -07:00
Brian Paul
f9e1542286 radeon: add default switch case to silence unhandled enum warning 2011-02-21 15:15:52 -07:00
Ian Romanick
497baf4e4a Use C-style system headers in C++ code to avoid issues with std:: namespace 2011-02-21 13:07:29 -08:00
Chris Wilson
5a1fbf0f70 intel: Fix insufficient integer width for upload buffer offset
I was being overly miserly and gave the offset of the buffer into the bo
insufficient bits, distracted by the adjacency of the buffer[4096].

Ref: https://bugs.freedesktop.org/show_bug.cgi?id=34541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 20:58:09 +00:00
José Fonseca
dcb21d8b1c svga: Remove some remaining fake S3TC rendering support. 2011-02-21 18:36:51 +00:00
Chris Wilson
a43f20e069 i965: Remove spurious duplicate ADVANCE_BATCH
... a leftover from a bad merge.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 16:02:26 +00:00
Chris Wilson
2c6793fb6b i915: Emit a single relocation per vbo
Reducing the number of relocations has lots of nice knock-on effects,
not least including reducing batch buffer size, auxilliary array sizes
(vmalloced and copied into the kernel), processing of uncached
relocations etc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
298ebb78de i915: Suppress emission of redundant stencil updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
7c97e288fb i915: Separate BLEND from general context state.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
4f82585e27 i915: Only flag context changes if the actual state is changed
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:45 +00:00
Chris Wilson
0b0cad38c5 i915: suppress repeated sampler state emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:41 +00:00
Chris Wilson
87641cffd9 i915: Eliminate redundant CONSTANTS updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
41260a9bf6 i965: Use compiler builtins when available
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
8ea6e98c7b i965: Micro-optimise check_state
Replace the intermediate tests due to the logical or with the bitwise
or.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
50ade6ea69 intel: use throttle ioctl for throttling
Rather than waiting on the first batch after the last swapbuffers to be
retired, call into the kernel to wait upon the retirement of any request
less than 20ms old. This has the twofold advantage of (a) not blocking
any other clients from utilizing the device whilst we wait and (b) we
attain higher throughput without overloading the system.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
46131a824f i965: Remove unused 'next_free_page' member
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
57ca0803b3 intel: Skip the flush before read-pixels via blit
As we will flush when reading the return values of the blit, we can forgo
the earlier flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
c625aa19cb intel: extend current vertex buffers
If the next vertex arrays are a (discontiguous) continuation of the
current arrays, such that the new vertices are simply offset from the
start of the current vertex buffer definitions we can reuse those
defintions and avoid the overhead of relocations and invalidations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
a07e481179 intel: Use specified alignment for writes into the upload buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
d9e591391d i965: Clean up brw_prepare_vertices()
Use a temporary glarray variable to replace the numerous input->glarray.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
3630d5b69a intel: combine short memcpy using a temporary allocated buffer
Using a temporary buffer for large discontiguous uploads into the common
buffer and a single buffered upload is faster than performing the
discontiguous copies through a mapping into the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
dfc6c96e5c i965: upload normal arrays as interleaved
Upload the non-vbo arrays into a single interleaved buffer object, and
so need to just emit a single vertex buffer relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
94d73d700e i965: interleaved vbo
If the user passed in several arrays interleaved in the same vbo, only
emit a single vertex buffer and relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
559435d915 i965: emit one vb packet per vbo
Track reuse of the vertex buffer objects and so minimise the number of
vertex buffers used by the hardware (and their relocations).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
abb5109756 i965: upload transient indices into the same discontiguous buffer
As we now pack the indices into a common upload buffer, we can reuse a
single CMD_INDEX_BUFFER packet and translate each invocation with a
start vertex offset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
60bb3e5614 i965: suppress repeat-emission of identical vertex elements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
aac120977d i965: Move repeat-instruction-suppression to batchbuffer core
Move the tracking of the last emitted instructions into the core
batchbuffer routines and take advantage of the shadow batch copy to
avoid extra memory allocations and copies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
8d68a90e22 intel: use pwrite for batch
It's faster. Not only is the memcpy more efficiently performed in the
kernel (making up for the system call overhead), but by not using mmap
we remove the greater overhead of tracking the vma of every batch.

And it means we can read back from the batch buffer without incurring
the cost of a uncached read through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
3f55683927 i965: drop state_bo references to batch_bo
As we use state relocations and we know that all the state belongs to
the same bo, we can drop the multiple references to the same bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
1be3764dbe i965: directly write wm state to batch
As we write directly into the batch in system memory, we do not need to
write first to the stack (as was to avoid read back through the GTT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
df156549e7 i965: write cc straight to batch
As we write directly into the batch in system memory, we do not need to
write first to the stack (as was to avoid read back through the GTT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
f29606598e i965: switch gen6 to use its own cc state bo
In preparation for a greater change, use the color_calc_state_bo already
provisioned for this purpose.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
8a9e67b8df intel: Buffered upload
Rather than performing lots of little writes to update the common bo
upon each update, write those into a static buffer and flush that when
full (or at the end of the batch). Doing so gives a dramatic performance
improvement over and above using mmaped access.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
40ee15407a intel: Replace the bo for a complete update
Rather than performing a blit to completely overwrite a busy bo, simply
discard it and create a new one with the fresh data.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
abb37861d9 i965: Combine vb upload buffer with the general upload buffer
Reuse the new common upload buffer for uploading temporary indices and
rebuilt vertex arrays.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
e476e12220 intel: Pack dynamic draws together
Dynamic arrays have the tendency to be small and so allocating a bo for
each one is overkill and we can exploit many efficiency gains by packing
them together.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
d0809d7b15 intel: Use system memory for DYNAMIC_DRAW source objects
Dynamic draw buffers are used by clients for temporary arrays and for
uploading normal vertex arrays. By keeping the data in memory, we can
avoid reusing active buffer objects and reallocate them as they are
changed. This is important for Sandybridge which can not issue blits
within a batch and so ends up flushing the batch upon every update, that
is each batch only contains a single draw operation (if using dynamic
arrays or regular arrays from system memory).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
45ba7afbd1 i965: Trim the trailing NOOP from 3DSTATE_INDEX_BUFFER
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:33 +00:00
Chris Wilson
13bab58f04 i965: Fallback on encountering a NULL render buffer
Following a GPU hang, or other error, the render target is not likely to
have an allocated BO and so we must fallback to avoid using it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32534
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:33 +00:00
Vinson Lee
8033700814 i915g: s/__func__/__FUNCTION__/ 2011-02-20 21:23:45 -08:00
Daniel Vetter
c0122daf10 i915g: kill remnants of mmapped batchbuffer support
We're using bo_subdata.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
fa186804a6 i915g: Add winsys/i915/sw to scons build 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
20ff6a2752 i915g: Fix void ptr arith 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
ec3c5ac592 i915g: Add dummy flush_frontbuffer 2011-02-21 00:50:16 +01:00
Jon TURNEY
aa6a5cf1d5 Fix --enable-shared-glapi configure option
Fix a typo which meant that --enable-shared-glapi didn't actually cause a shared glapi to be built

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-02-20 12:53:42 -07:00
Chia-I Wu
bf0c56522e egl_dri2: Return NULL when xcb_get_geometry_reply fails.
This should fix bug #33946.
2011-02-20 12:26:31 -07:00
José Fonseca
91ea60395e scons: Add aliases for the llvmpipe unit tests.
Now one can simply do

  scons lp_test_format
2011-02-19 10:56:05 +00:00
José Fonseca
57d4e922a6 gallivm: Use simple scaling plus casting in more unorm->float cases. 2011-02-19 10:56:05 +00:00
Kenneth Graunke
b1002e4aa5 glsl: Remove $(PWD) from Makefile in favor of .
Hopefully should fix bug #34468.
2011-02-19 00:06:00 -08:00
Marek Olšák
0b436cf511 r300g: fix a possible race when counting contexts
Atomics aren't sufficient here.
2011-02-19 00:17:27 +01:00
Marek Olšák
e9e5380f22 r300g: fix invalid dereference in winsys
radeon_bo_unref may destroy the buffer, so call it after p_atomic_dec, not before.
2011-02-19 00:06:52 +01:00
José Fonseca
e16e70610c svga: Fix NULL dereference.
Probably introduced with the surface view move from screen to context.
2011-02-18 19:03:43 +00:00
Brian Paul
7ea729a185 vbo: add debug code to verify that buffers are unmapped before drawing 2011-02-18 10:34:25 -07:00
Brian Paul
6364d75008 mesa: MESA_VERBOSE logging for glRead/Draw/CopyPixels, glBlitFramebuffer 2011-02-18 10:34:25 -07:00
Brian Paul
633c9fcf78 st/mesa: set renderbuffer _BaseFormat in a few places
NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-02-18 10:28:27 -07:00
Brian Paul
09f14a6086 st/mesa: check buffer orientation in blit_copy_pixels()
Can't invert the region if copying between surfaces with different
orientations.
2011-02-18 10:24:41 -07:00
José Fonseca
0ced789a0b svga: Ensure pending drawing commands other surface operations are emitted before DMAs.
This behavior was last when moving the transfers to the contexts.

This fixes several piglit failures, which were reading the color renderbuffer
before the draw operations were emitted.
2011-02-18 16:43:59 +00:00
José Fonseca
f9b4867846 svga: Cannot use negate or abs on source to dsx/dsy instructions. 2011-02-18 16:43:44 +00:00
José Fonseca
0cb6329e89 svga: Ensure SWTNL is created after HWTNL.
Matches the internal driver layering, and prevents null svga->hwtnl
dereferencing from inside the swtnl.
2011-02-18 16:43:40 +00:00
José Fonseca
15c3e21097 svga: Ensure LRP's restrictions are observed in all uses.
The dst reg must be a temporary, and not be the same as src0 or src2.
2011-02-18 16:43:38 +00:00
José Fonseca
965ab5fed3 svga: Preserve src swizzles in submit_op2/3/4.
Several opcodes require scalar swizzle, and this requirement was
being was not being observed when creating temporaries for other reasons.
2011-02-18 16:43:36 +00:00
Marek Olšák
fd8d4b32ed r300g: remove tracking whether vertex buffers need to be validated
This was getting hard to maintain and didn't really bring any real benefits.
Instead, validate buffers when the vertex array state is dirty.
2011-02-18 16:15:03 +01:00
Marek Olšák
bb46eeade3 st/mesa: fix geometry corruption by always re-binding vertex arrays
This is a temporary workaround. It fixes sauerbrauten with shaders enabled.

I guess we might be changing vertex attribs somewhere and not updating
the appropriate dirty flags, therefore we can't rely on them for now.
Or maybe we need to make this state dependent on some other flags too.

More info:
https://bugs.freedesktop.org/show_bug.cgi?id=34378
2011-02-18 16:01:01 +01:00
Jakob Bornecrantz
e0481cac7d svga: Disable surface cache for textures
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:48 +00:00
Jakob Bornecrantz
912ad88742 svga: Describe svga_sampler_views for refcnt debugging
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:47 +00:00
Jakob Bornecrantz
99d955263b svga: Make sure that refcnt debugger gets the correct backtrace for create
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:46 +00:00
Jakob Bornecrantz
52ad45677d util: Make refcnt and symbol debuggers work on windows
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:23 +00:00
Cyril Brulebois
d252db7af1 Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org
Suggested by a freedesktop.org admin.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-02-18 07:42:41 -07:00
Marek Olšák
449c4f3706 u_vbuf_mgr: initialize flag indicating that buffers have been updated
This fixes r300g errors:
r300: Cannot get a relocation in radeon_drm_cs_write_reloc.
2011-02-18 13:57:31 +01:00
Thomas Hellstrom
8cbd3b5ef1 gallium/svga: Fix unnecessary swtnl fallbacks
When we drop the in_swtnl_draw flag, we must force a rerun of
update_need_swtnl to reset the need_swtnl flag to its correct value outside
of a swtnl vbo draw.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-18 13:25:32 +01:00
Dave Airlie
dfa5928404 r600g: reorganise rgtc pieces.
when the cs checker fixes go upstream a lot of this can disappear
into a drm version check.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 16:00:49 +10:00
Brian Paul
b736b4a2b5 st/mesa: implement blit-based path for glCopyPixels
If doing a simple non-overlapping glCopyPixels with no per-fragment ops
we can use pipe_context::resource_copy_region().
2011-02-17 19:11:32 -07:00
Brian Paul
d44fbd3c9d mesa: fix comments for _mesa_clip_readpixels() 2011-02-17 19:11:32 -07:00
Brian Paul
de2f25de26 st/mesa: indentation fix 2011-02-17 19:11:32 -07:00
Fabian Bieler
8b5119aab3 r600g: Start a new TEX clause if the texture lookup address was fetched in the current clause
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 10:04:41 +10:00
Fabian Bieler
51cc14471c r600g: Add support to dump vertex- and texture-fetch clauses
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 10:04:34 +10:00
Dave Airlie
2a6cce09e3 r600g: add BC4/5 to RGTC conversion
this doesn't do anything much since the rest of mesa doesn't
support RGTC yet.
2011-02-18 09:39:23 +10:00
José Fonseca
262b785ccd util: Fix typo in last commit. 2011-02-17 17:15:57 +00:00
Brian Paul
d1becefb05 st/mesa: fix incorrect glCopyPixels position on fallback path
If we hit the pipe_get/put_tile() path for setting up the glCopyPixels
texture we were passing the wrong x/y position to pipe_get_tile().
The x/y position was already accounted for in the pipe_get_transfer()
call so we were effectively reading from 2*readX, 2*readY.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-17 10:13:33 -07:00
Brian Paul
1fa97ddb25 draw: update comments, rename vars in pstipple code 2011-02-17 10:13:33 -07:00
José Fonseca
0adeaf00e6 svga: Don't use more than one constant per IFC instruction. 2011-02-17 15:29:32 +00:00
José Fonseca
8902c42db4 mesa: Do copy propagation across if-else-endif.
Addresses excessive TEMP allocation in vertex shaders where all CONSTs are
stored into TEMPS at the start, but copy propagation was failing due to
the presence of IFs.

We could do something about loops, but ifs are easy enough.
2011-02-17 15:29:30 +00:00
José Fonseca
6c1fcf8583 util: Cleanup symbol name resolution on Windows.
- Support symbol name resolution on MinGW.
- Use dbghelp.dll (which should allow 64bit support), but untested yet.
- Cleanup.
2011-02-17 15:26:53 +00:00
Brian Paul
1bf9954bb4 docs: updated environment variable list 2011-02-17 07:29:20 -07:00
Brian Paul
f9df46f873 st/mesa: remove unused screen variables 2011-02-17 07:28:58 -07:00
Brian Paul
30ed4ced11 mesa: remove the MESA_NO_DITHER env var
This was sometimes useful back when 16-bit framebuffers were prominent.
2011-02-17 07:28:58 -07:00
Brian Paul
b1d485712f softpipe: rename env vars to be consistent 2011-02-17 07:28:58 -07:00
Haitao Feng
f55d027ac2 egl_dri2: add swrast
This enables the egl_dri2 driver to load swrast driver
for software rendering. It could be used when hardware
dri2 drivers are not available, such as in VM.

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-16 23:06:36 -05:00
Dave Airlie
231bf886da r600g: get s3tc working on cards with crappy 64/128 bit types.
Some cards don't appear to work correctly with the UNORM type,
so switch to the integer type, however since gallium has no
integer types yet from what I can see we need to do a hack to
workaround it for the blitter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-17 10:27:09 +10:00
Dave Airlie
5cc35124b3 r600g: add missing type to color buffer swap. 2011-02-17 10:27:09 +10:00
Brian Paul
5d236d71c8 gallium/util: init key with memset()
To silence missing initializers warning.
2011-02-16 17:10:36 -07:00
Brian Paul
c8f8d7d873 svga: flush when transitioning between HW and SW rendering paths
To avoid mixing HW and SW rendering with the same vertex buffer.
2011-02-16 17:07:02 -07:00
Brian Paul
b5df194923 rtasm: add dummy return statement to silence MSVC warning
And use assert(0) instead of abort() to be consistent with rest
of Gallium.
2011-02-16 17:07:02 -07:00
Brian Paul
2f5032ec1e svga: use TRUE/FALSE instead of 0/1
Some fields are booleans, others are bitmasks.  Use TRUE/FALSE to
clarify what's what.
2011-02-16 17:07:02 -07:00
Brian Paul
64762af008 svga: fix incorrect comment 2011-02-16 17:07:02 -07:00
Brian Paul
d432f462c2 svga: dimension the dirty[] array with SVGA_STATE_MAX 2011-02-16 17:07:02 -07:00
Brian Paul
e162f28228 mesa: make _mesa_write_renderbuffer_image() non-static 2011-02-16 17:07:02 -07:00
Brian Paul
4b6c9b799b svga: disable a debug_printf() call 2011-02-16 17:07:02 -07:00
Sam Hocevar
3e8fb54fb8 docs: add glsl info 2011-02-16 17:05:08 -07:00
Sam Hocevar
fde4943688 docs: fix glsl_compiler name 2011-02-16 17:05:08 -07:00
Brian Paul
aaceca16df mesa: 80-column wrap 2011-02-16 17:05:08 -07:00
José Fonseca
fa05ddca15 svga: Proper redefine_user_buffer implementation.
Unfortunately still not enough to make GoogleEarth happy.
2011-02-16 21:53:10 +00:00
Marek Olšák
fa3f1348e4 r300g: fix a race between CS and SET_TILING ioctls 2011-02-16 22:23:23 +01:00
Marek Olšák
2d1cc27729 r300g: fix blitting NPOT compressed textures 2011-02-16 21:40:54 +01:00
Marek Olšák
8513d3405b mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2 and 4_4
Oops, I copy-pasted a typo from 3_3_2.

The 3_3_2 part is a candidate for 7.9 and 7.10.
The 4_4 part isn't, because AL44 is in neither branches.
2011-02-16 20:44:46 +01:00
Marek Olšák
4d6994e40e mesa: fix mipmap generation for MESA_FORMAT_AL44
This was missed when implementing AL44.
2011-02-16 20:21:40 +01:00
José Fonseca
33d8ff9c31 scons: Recognize 'AMD64' processor as well. 2011-02-16 18:02:08 +00:00
José Fonseca
590c2ee568 scons: Don't get fooled by 32bit python on a 64bit windows. 2011-02-16 18:02:06 +00:00
José Fonseca
9f9d6481de scons: Avoid depending on scons 2.0 in general. 2011-02-16 18:02:01 +00:00
José Fonseca
2a2b156ea5 mesa: Remove the DXT compression via blit path.
No longer used.
2011-02-16 16:50:24 +00:00
José Fonseca
697a3eb832 svga: Don't fake DXT compression ability. 2011-02-16 16:50:24 +00:00
Christoph Bumiller
3903e25a2c nvc0: fix blend factor mapping 2011-02-16 15:45:31 +01:00
Christoph Bumiller
3f1361e060 nvc0: fix emit_dfdx,dfdy 2011-02-16 15:45:31 +01:00
Christoph Bumiller
bb2c8e7099 nvc0: don't swap sources if either value is not in a GPR
The memory / immediate source should already be in the only valid
position.
2011-02-16 15:45:31 +01:00
Christoph Bumiller
2fa35eedd9 nvc0: add missing break statements in constant_operand 2011-02-16 15:45:31 +01:00
Christoph Bumiller
e7845e3196 nvc0: fix clipping and use VIEWPORT instead of SCISSOR 2011-02-16 15:45:31 +01:00
Christoph Bumiller
19f2272e94 nvc0: demagic the clear flags and fix region clears
The CLIP_RECTs always affect dedicated clears, and it's nicer than
having to mark the viewport or scissor state dirty after it.
2011-02-16 15:45:31 +01:00
Christoph Bumiller
293a8d1b60 nvc0: front stencil mask and func mask methods are swapped 2011-02-16 15:45:31 +01:00
Christoph Bumiller
a24e9bd497 nvc0: clone memory values with multiple refs before modifying them 2011-02-16 15:45:30 +01:00
Christoph Bumiller
80a7ae3cc5 nvc0: disable early fragment tests if KIL is used
Early-Z pass raises the occlusion counter.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
17d680cc53 nvc0: force vertex data through FIFO if we need to convert it
We may want to put the converted vertex buffer in persistent
storage instead, but these are rare corner cases.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
bf1ce9c64b nvc0: use format from the template on surface creation
Fixes piglit/fbo-srgb.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
1b4c0c8ea0 nvc0: update the set of formats supported by the 2D engine 2011-02-16 15:45:30 +01:00
Christoph Bumiller
a3c62afa7c nvc0: fix user vertex buffer updates 2011-02-16 15:45:30 +01:00
Brian Paul
fc5ab1b197 mesa: use gl_format type instead of GLuint 2011-02-16 07:08:58 -07:00
Dave Airlie
f53436d821 r600g: fix typo in previous s3tc commit
pointed out by Marek on irc.
2011-02-16 16:51:41 +10:00
Marek Olšák
9e725b9123 r300g: fix texture border color for float formats 2011-02-16 07:46:36 +01:00
Dave Airlie
4ffef88899 Revert "util: fix DXT1 RGBA texture compression if the source color is (0, 0, 0, 0)"
This reverts commit 6e7d782da5.

Oops, I just had this locally for testing and forgot to remove it before pushing.
2011-02-16 16:13:58 +10:00
Dave Airlie
04903d1f63 r600g: add L8A8 SRGB formats.
this fixes the piglit mipmap generation sRGB on my rv730.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:09:43 +10:00
Marek Olšák
6e7d782da5 util: fix DXT1 RGBA texture compression if the source color is (0, 0, 0, 0)
This is a workaround for a bug in libtxc_dxtn.

Fixes:
- piglit/GL_EXT_texture_compression_s3tc/fbo-generatemipmap-formats

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:04:14 +10:00
Dave Airlie
4016a1b4c6 r600g: add L4A4 support.
this fixes piglit fbo-generatemipmap-formats on my rv730.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:01:36 +10:00
Dave Airlie
0863eaf91c r600g: fix s3tc-texsubimage
we need to translate the destination box as well.

fixes piglit's s3tc-texsubimage test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 15:56:11 +10:00
Ian Romanick
25b36e8ff8 linker: Fix off-by-one error implicit array sizing
Arrays are zero based.  If the highest element accessed is 6, the
array needs to have 7 elements.

Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-15 18:22:33 -08:00
Vinson Lee
ae11707b83 st/python: add usage parameter to pipe_buffer_create
This is a follow-up to commit eafb7f234d.

Fixes Linux SCons build.
2011-02-15 17:29:43 -08:00
Marek Olšák
38104a767c r300g: disable linear filtering for float textures 2011-02-16 00:55:39 +01:00
Chad Versace
62c8c77333 glsl: Reinstate constant-folding for division by zero
Fixes regression: https://bugs.freedesktop.org/show_bug.cgi?id=34160

Commit e7c1f058d1 disabled constant-folding
when division-by-zero occured. This was a mistake, because the spec does
allow division by zero. (From section 5.9 of the GLSL 1.20 spec: Dividing
by zero does not cause an exception but does result in an unspecified
value.)

For floating-point division, the original pre-e7c1f05 behavior is
reinstated.

For integer division, constant-fold 1/0 to 0.
2011-02-15 15:46:12 -08:00
Chad Versace
f2e9981e43 Revert "glsl: Fix constant-folding for reciprocal expressions"
This reverts commit b3cf92aa91.

The reverted commit prevented constant-folding of reciprocal expressions
when the reciprocated expression was 0. However, since the spec allows
division by zero, constant-folding *is* permissible in this case.

From Section 5.9 of the GLSL 1.20 spec:
    Dividing by zero does not cause an exception but does result in an
    unspecified value.
2011-02-15 15:46:12 -08:00
Chad Versace
a231ac23f4 tnl: Add support for datatype GL_FIXED in vertex arrays
Before populating the vertex buffer attribute pointer (VB->AttribPtr[]),
convert vertex data in GL_FIXED format to GL_FLOAT.

Fixes bug: http://bugs.freedesktop.org/show_bug.cgi?id=34047

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-15 15:39:22 -08:00
Dave Airlie
632918d3ec r600g: add srgb compressed formats to the list. 2011-02-16 08:54:14 +10:00
Marek Olšák
eafb7f234d gallium: add usage parameter to pipe_buffer_create
And set a reasonable buffer usage flag everywhere instead of
just PIPE_USAGE_DEFAULT.
2011-02-15 22:44:21 +01:00
Fabian Bieler
82a9794a35 r600g: Fix RGB10_A2 format handling 2011-02-15 12:31:30 -05:00
Dave Airlie
4b81c5f6e1 r600g: fix regression in r6/7xx since mipmap rework
I typod this when copy-pasting.
2011-02-15 18:43:56 +10:00
Vinson Lee
cd8af3b60b nvc0: Fix uninitialized variable warning.
Fixes this GCC warning.
nvc0_tgsi_to_nc.c: In function 'bld_tex':
nvc0_tgsi_to_nc.c:1392: warning: 'dim' may be used uninitialized in this function
2011-02-15 00:27:16 -08:00
Marek Olšák
b9e2cde600 r300g: offload the CS ioctl to another thread
This is a multi-threading optimization which hides the kernel overhead
behind a thread. It improves performance in CPU-limited apps by 2-15%.
Of course you must have at least 2 cores for it to make any difference.

It can be disabled with:

export RADEON_THREAD=0
2011-02-15 09:17:39 +01:00
Dave Airlie
8e0437914b r600g: add support for s3tc formats.
On r600, s3tc formats require a 1D tiled texture format,
so we have to do uploads using a blit, via the 64-bit and 128-bit formats

Based on the r600c code we use a 64 and 128-bit type to do the
blits.

Still requires R600_ENABLE_S3TC until the kernel fixes are in,
this has only been tested on evergreen where the kernel doesn't
yet get in the way.
2011-02-15 14:44:09 +10:00
Dave Airlie
a661dacf14 r600g: fix miptree calculations
the miptree setup and pitch storing didn't work so well for block
based things like compressed textures. The CB takes blocks, where
the texture sampler takes pixels, and transfers need bytes,

So now we store blocks/bytes and translate to pixels in the sampler.

This is necessary for s3tc to work properly.
2011-02-15 14:44:08 +10:00
Dave Airlie
ea7a548d07 r600g: drop tiled flag
we can work this out from the array_mode and it makes more sense
to do that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-15 14:44:08 +10:00
Dave Airlie
fdb4373a20 st/mesa: fix compressed mipmap generation.
If the underlying transfer had a stride wider for hw alignment reasons,
the mipmap generation would generate badly strided images.

this fixes a few problems I found while testing r600g with s3tc

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-15 14:44:08 +10:00
Marek Olšák
dc578188fa st/mesa: fix GLES build
Broken since d5062fb3a3.

I wonder why this code is hidden behind #if by default.
2011-02-15 04:56:09 +01:00
Marek Olšák
333d3daf47 r300g: actually implement the is_buffer_busy hook the right way
Ooops.
2011-02-15 04:00:47 +01:00
Marek Olšák
45e1cd522b r300g: handle interaction between UNSYNCHRONIZED and DONTBLOCK flags in bo_map
The VBO module uses both, but they are somewhat opposite to each other.
In this case, we pick UNSYNCHRONIZED and ignore DONTBLOCK.
2011-02-15 04:00:47 +01:00
Marek Olšák
8decb0a96d r300g: fix a possible race condition when mapping a buffer
This is the last one I think.
2011-02-15 04:00:47 +01:00
Marek Olšák
18b4978ac8 r300g: implement fences using dummy relocations
So finally we have them.
2011-02-15 04:00:46 +01:00
Marek Olšák
4faf11ad6c r300g: fix SIGFPE on debug builds 2011-02-15 01:19:54 +01:00
Marek Olšák
56029ce52b r300g: inline some of the pipe_buffer_map/unmap calls 2011-02-15 01:19:54 +01:00
Marek Olšák
20112cca26 r300g: do not track whether occlusion queries have been flushed
The winsys takes care of flushing automatically.
2011-02-14 23:36:12 +01:00
Marek Olšák
89ee0d527c r300g: flush CS in bo_map even if we get USAGE_DONTBLOCK
Because an app may do something like this:

while (!(ptr = bo_map(..., DONT_BLOCK))) {
    /* Do some other work. */
}

And it would be looping endlessly if we didn't flush.
2011-02-14 23:34:45 +01:00
Vinson Lee
ec21eabe2a st/python: remove pipe_vertex_buffer::max_index
This is a follow-up to commit cdca3c58aa.
2011-02-14 14:10:05 -08:00
Vinson Lee
7582448016 graw: remove pipe_vertex_buffer::max_index
This is a follow-up to commit cdca3c58aa.
2011-02-14 13:53:09 -08:00
Fabian Bieler
a476ca1fd1 st/mesa: Use blend equation and function of first render target for all render targets if ARB_draw_buffers_blend is not supported
If EXT_draw_buffers2 is supported but ARB_draw_buffers_blend isn't
_mesa_BlendFuncSeparateEXT only sets up the blend equation and function for the
first render target. This patch makes sure that update_blend doesn't try to use
the data from other rendertargets in such cases.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-14 14:37:18 -07:00
Marek Olšák
a87730ff3f r300g: implement pb_manager::is_buffer_busy 2011-02-14 22:02:40 +01:00
Marek Olšák
49579a4df8 pb_bufmgr_cache: add is_buffer_busy hook and use it instead of non-blocking map
This is cleaner and implementing the hook is optional.
2011-02-14 21:51:01 +01:00
Marek Olšák
588fa884d2 gallium: notify drivers about possible changes in user buffer contents
Also implement the redefine_user_buffer hook in the drivers.
2011-02-14 21:50:08 +01:00
Marek Olšák
2a904fd6a0 st/mesa: set vertex arrays state only when necessary
The vertex arrays state should be set only when (_NEW_ARRAY | _NEW_PROGRAM)
is dirty. This assumes user buffer content is mutable, which will be
sorted out in the next commit. The following usage case should be much faster
now:

for (i = 0; i < 1000; i++) {
   glDrawElements(...);
}

Or even:

for (i = 0; i < 1000; i++) {
   glSomeStateChangeOtherThanArraysOrProgram(...);
   glDrawElements(...);
}

The performance increase from this may be significant in some apps and
negligible in others. It is especially noticable in the Torcs game (r300g):
    Before: 15.4 fps
    After: 20 fps

Also less looping over attribs in st_draw_vbo yields slight speed-up
in apps with lots of glDraw* calls.
2011-02-14 21:50:08 +01:00
Marek Olšák
cdca3c58aa gallium: remove pipe_vertex_buffer::max_index
This is redundant to pipe_draw_info::max_index and doesn't really fit
in the optimizations I plan.
2011-02-14 21:50:08 +01:00
Marek Olšák
d5062fb3a3 gallium: always save and restore vertex buffers using cso_cache 2011-02-14 21:50:07 +01:00
Marek Olšák
cfaf217135 vbo: bind arrays only when necessary
We don't need to call bind_arrays in the vbo module if the states
which the function depends on are not dirty.
2011-02-14 21:50:07 +01:00
Marek Olšák
5a01361cea vbo: notify a driver that we change buffer offsets, strides, etc. 2011-02-14 21:50:07 +01:00
Vinson Lee
d123959ff7 r300g: Remove redundant initialization.
Remove redundant initialization from commit
3b01b52bd7 noticed by tstellar.
2011-02-14 10:47:58 -08:00
Alex Deucher
9e96ea0652 r600g: add alignment cases for linear aligned
Matches the drm and ddx.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-14 13:07:29 -05:00
José Fonseca
07eb660fc9 draw: Don't define the last two mipmap levels in aa lines.
Some hardware needs to make a seperate copy of all levels to obey
max_lod, so simply do not define the last two levels instead of
clamping.
2011-02-14 10:56:48 +00:00
José Fonseca
9305e93114 svga: Set the appropriate flags when creating sampler/surface views. 2011-02-14 10:53:54 +00:00
Marek Olšák
a0c293ec11 r300g: put indices in CS if there's just a few of them and are in user memory 2011-02-14 11:43:14 +01:00
Marek Olšák
437583ea63 r300g: cleanup the draw functions 2011-02-14 11:43:14 +01:00
Marek Olšák
476cec37d6 r300g: do not create a user buffer struct for misaligned ushort indices fallback 2011-02-14 11:43:14 +01:00
Marek Olšák
d173f1ba8a r300g: fix fallback for misaligned ushort indices with num vertices >= 65535 2011-02-14 11:43:14 +01:00
Marek Olšák
3d5ac32f3b r300g: consolidate emission of common draw regs 2011-02-14 11:43:14 +01:00
Sedat Dilek
0f912534fd docs: Fix typo in GL3.txt 2011-02-14 00:45:44 -08:00
Vinson Lee
3b01b52bd7 r300g: Move declaration before code.
Fixes SCons build.
2011-02-14 00:07:07 -08:00
Marek Olšák
e9d993e9b9 r600g: do not destroy the original index buffer when translating indices
Because we only translate a subrange of the buffer.
2011-02-14 07:45:14 +01:00
Marek Olšák
5a6ba08c21 r300g: emit 3D_LOAD_VBPNTR only when necessary
I thought I couldn't skip emitting this packet in some cases.
Well it looks like I can.
2011-02-14 07:45:14 +01:00
Marek Olšák
004dd01583 r300g: fix reference counting when translating indices 2011-02-14 07:45:14 +01:00
Marek Olšák
9a90eeee67 u_index_modify: map buffers with PIPE_TRANSFER_UNSYNCHRONIZED 2011-02-14 07:45:14 +01:00
Marek Olšák
5197b09bee r300g: remove the relocation after AARESOLVE_PITCH 2011-02-14 07:45:14 +01:00
Dave Airlie
1f5b674168 egl_dri2: add nouveau support.
but really wtf? all these PCI IDs need to be ripped out of here, its totally
unscalable and the drivers already have this info so could export it some better way.

tested by Darxus on #wayland.
2011-02-14 07:54:28 +10:00
Marcin Slusarz
8fe5da89e3 nv50: fix query assertion 2011-02-13 22:05:28 +01:00
Marek Olšák
e6e4860555 r300g: correctly determine if a texture is blittable in texture_get_transfer 2011-02-13 08:49:15 +01:00
Marek Olšák
8ab1fcc66a r300g: fixup the handle_compare function
Accidentally negated in 685c3262b9.
2011-02-13 00:31:04 +01:00
Marek Olšák
1fd6bbc881 r300g: when printing shader linker errors to stderr, report it's not a bug 2011-02-12 23:38:00 +01:00
Marek Olšák
9ad9a6861a r300g: add debug options nozmask and nohiz which disable some hyper-z features 2011-02-12 23:37:14 +01:00
Marek Olšák
685c3262b9 r300g: typecast void* to unsigned correctly 2011-02-12 23:36:48 +01:00
Eric Anholt
04521c158f dri: Remove the old metaops code which has been superceded by ../common/ 2011-02-12 12:26:04 -08:00
Eric Anholt
211725eccd radeon: Remove setup of the old dri/ meta code, which is now unused. 2011-02-12 12:23:43 -08:00
Eric Anholt
47589c17b0 intel: Remove setup of the old dri/ meta code, which is now unused. 2011-02-12 12:23:20 -08:00
Dave Airlie
a6b7393eb8 update GL3.txt for GL_EXT_framebuffer_sRGB status 2011-02-12 18:08:04 +10:00
Tom Stellard
9106b98766 r300/compiler: Don't erase sources when converting RGB->Alpha
https://bugs.freedesktop.org/show_bug.cgi?id=34030

NOTE: This is a candidate for the 7.10 branch.
2011-02-11 19:42:35 -08:00
Christopher James Halse Rogers
d1e28b2267 mesa: Optionally build a dricore support library (v3)
This an adds --enable-shared-dricore option to configure.  When enabled,
DRI modules will link against a shared copy of the common mesa routines
rather than statically linking these.

This saves about 30MB on disc with a full complement of classic DRI
drivers.

v2: Only enable with a gcc-compatible compiler that handles rpath
    Handle DRI_CFLAGS without filter-out magic
    Build shared libraries with the full mklib voodoo
    Fix typos
v3: Resolve conflicts with talloc removal patches

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-02-11 18:31:05 -08:00
nobled
b5dc40710d glx: Put null check before use
'dpy' was being checked for null *after* it was already used once.

Also add a null check for psc, and drop gc's redundant initialization.
2011-02-11 18:19:10 -08:00
Marek Olšák
df54b53b7d r300g: improve function radeon_bo_is_referenced_by_cs
This should prevent calling into radeon_get_reloc when there's
only one context.
2011-02-12 03:08:39 +01:00
Marek Olšák
20a78b68a3 u_vbuf_mgr: fix segfault
max_index could have been less than min_index, which later caused integer
underflow followed by a segfault in memcpy.
2011-02-12 03:08:39 +01:00
Ian Romanick
3803295fc2 ir_to_mesa: Don't dereference a NULL pointer during copy propagation
The ACP may already be NULL, so don't try to make it NULL again.

This should fix bugzilla #34119.
2011-02-11 15:44:19 -08:00
Ian Romanick
a0120e6e0f glcpp: regerated files
These should have been committed right after fd1252ab, but they were
missed.  Soon, we'll never have to do this again...
2011-02-11 15:44:19 -08:00
Ian Romanick
afdceede55 glsl: Regenerate files modified by previous commits 2011-02-11 14:12:44 -08:00
Ian Romanick
8842158944 glsl: Finish out the reduce/reduce error fixes
Track variables, functions, and types during parsing.  Use this
information in the lexer to return the currect "type" for identifiers.

Change the handling of structure constructors.  They will now show up
in the AST as constructors (instead of plain function calls).

Fixes piglit tests constructor-18.vert, constructor-19.vert, and
constructor-20.vert.  Also fixes bugzilla #29926.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-11 14:12:43 -08:00
Keith Packard
f4b812e1a6 glsl: Eliminate reduce/reduce conflicts in glsl grammar
This requires lexical disambiguation between variable and type
identifiers (as most C compilers do).

Signed-off-by: Keith Packard <keithp@keithp.com>

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-11 14:12:43 -08:00
Benjamin Franzke
81affb8f4c st/mesa: Fix surfaceless opengl with non-dummy contexts
main/context.c:check_complatible() detecs an incomplete
framebuffer using its pointer, so do not copy it.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=34042
2011-02-11 16:54:04 -05:00
Brian Paul
6c3a82a1a3 svga: disable a debug_printf() call 2011-02-11 14:07:43 -07:00
Brian Paul
396da5df0e svga: comments and debug code 2011-02-11 14:02:30 -07:00
Brian Paul
f7d84c177f svga: more comments for need_pipeline field 2011-02-11 14:02:30 -07:00
José Fonseca
6826d58bbf scons: Need c99 also when cross compiling. 2011-02-11 20:09:26 +00:00
José Fonseca
982609f4cf scons: builtin_glsl_function on windows needs bundled getopt. 2011-02-11 20:09:26 +00:00
José Fonseca
ae760279f1 scons: Try to support building 64bit binaries on 32bit windows. 2011-02-11 20:09:26 +00:00
José Fonseca
051f8bbfee scons: Fix MSVC 64bit build. 2011-02-11 20:09:26 +00:00
Brian Paul
3ee97ead0b mesa: remove some unused gl_shader fields 2011-02-11 12:00:51 -07:00
Brian Paul
413511f796 draw: tweak AA line texture minimum alpha
AA lines drawn as textured quads look a little better with this change.
Conformance/piglit tests still pass.
2011-02-11 12:00:51 -07:00
Brian Paul
da2e541218 svga: add max DMA size check in svga_winsys_buffer_create()
This fixes a problem when trying to use large (2K x 2K) texture
images.  We'll DMA the image in chunks.

Patch written by Jose.
2011-02-11 11:56:45 -07:00
Brian Paul
8c61799051 svga: remove old comment, remove extra whitespace 2011-02-11 11:54:55 -07:00
Tobias Jakobi
11f35aa418 glsl: Fix parallel build.
Broken since e0c1fc3283.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-02-11 10:36:14 -08:00
José Fonseca
6ed0f2ac11 svga: Enable the draw pipeline for smooth lines.
Spotted by Brian Paul.
2011-02-11 11:24:55 +00:00
José Fonseca
57a3d36a68 svga: Don't use the draw pipeline for non-AA lines with a fractional width.
Spotted by Jakob Bornecrantz.
2011-02-11 11:24:55 +00:00
José Fonseca
4586e6c8cb draw: Don't use the pipeline when drawing lines with fractional widths.
Spotted by Jakob Bornecrantz.
2011-02-11 11:24:55 +00:00
José Fonseca
7ac2db893a llvmpipe: Use u_math's round. 2011-02-11 11:24:54 +00:00
José Fonseca
151faa2258 util: Define round and roundf on MSVC. 2011-02-11 11:11:33 +00:00
José Fonseca
f0ca9f7134 svga: Stippled lines can also be drawn with triangles. 2011-02-11 07:48:05 +00:00
Marek Olšák
de22d8f1ee r300g: remove unused function prototypes, update copyright 2011-02-11 06:07:23 +01:00
Haitao Feng
3104e5cb4f egl_dri2: rename loader_extension to dri2_loader_extension
Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-10 23:41:21 -05:00
Benjamin Franzke
9f213f6a4a st/egl wayland: Sync front buffer release 2011-02-10 23:07:01 -05:00
Benjamin Franzke
51f2820922 egl_dri2 wayland: Sync front buffer release 2011-02-10 23:07:01 -05:00
Benjamin Franzke
4e8f95f64d egl_dri2: Always unbind old contexts
This fixes __DRIdrawable refcounting.
Binding a context increases their refcount,
so we need to decrease it.
2011-02-10 23:07:01 -05:00
Benjamin Franzke
87dde5b1cd egl_dri2: Use double buffering for window surfaces 2011-02-10 23:07:01 -05:00
Benjamin Franzke
71fa227029 st/dri: Set render_buffer in dri_fill_st_visual
st/mesa/st_managaer.c needs render_buffer in order
to determinde which buffer should be rendered to.
2011-02-10 23:07:01 -05:00
Benjamin Franzke
fa3283cca8 st/dri: img_from_renderbuf: Fix incorrect usage of dri_context() 2011-02-10 23:07:01 -05:00
Benjamin Franzke
0acb31be17 st/dri: Fix surfaceless gl using contexts with previous bound surfaces
ctx->dPriv might be != NULL then draw which is NULL is accessed:

struct dri_drawable *draw = dri_drawable(driDrawPriv);
[..]
if (ctx->dPriv != driDrawPriv) {
      ctx->dPriv = driDrawPriv;
      draw->texture_stamp = driDrawPriv->lastStamp - 1;
}
2011-02-10 23:07:01 -05:00
Benjamin Franzke
c79a5a7067 st/egl wayland: Set color_format according to wl_visual 2011-02-10 23:07:01 -05:00
Dave Airlie
596684eb93 r600g: get correct height alignment
useful for s3tc
2011-02-11 13:47:35 +10:00
Dave Airlie
9d85aba0e3 r600g: drop two unused | 0 that are actually in word4 anyways.
these were NOPs anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-11 13:47:35 +10:00
Dave Airlie
0d851f6e9c r600g: handle 16/32 u/s norm formats properly
add support for the 32-bit types, also fixup the
export setting to handle types with channels > 11 bits properly

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-11 13:47:34 +10:00
Marek Olšák
9a1fe76a20 r300g: prevent NULL pointer dereference in r300_buffer_create
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=33185
2011-02-11 03:18:05 +01:00
Kenneth Graunke
2e8726f5b1 mesa: Remove empty header file s_trispan.h. 2011-02-10 17:37:01 -08:00
Kenneth Graunke
e0c1fc3283 glsl/Makefile: glcpp doesn't need libglsl.a.
Also, add a 'glcpp' target so you can type 'make glcpp' instead of
'make glcpp/glcpp'.
2011-02-10 17:37:01 -08:00
Marek Olšák
032b162ce8 r300g: plug a memory leak in winsys 2011-02-11 02:34:15 +01:00
Marek Olšák
862ebb411b r300g: remove unneeded code in winsys
We don't need the read/write flags.
2011-02-11 01:32:44 +01:00
Marek Olšák
98f344c504 r300g: fix warning 2011-02-11 01:18:53 +01:00
Marek Olšák
7da5105fb3 configure.ac: remove libdrm_radeon dependency for r300g and r600g 2011-02-11 01:16:06 +01:00
Marek Olšák
6ccab620a0 r300g: import the last bits of libdrm and cleanup the whole thing
Based on Dave's branch.

The majority of this commit is a cleanup, mainly renaming things.
There wasn't much code to import, just ioctl calls.

Also done:
- implemented unsynchronized bo_map (important optimization!)
- radeon_bo_is_referenced_by_cs is no longer a refcount hack
- dropped the libdrm_radeon dependency

I'm surprised that this has resulted in less code in the end.
2011-02-11 01:07:25 +01:00
Marek Olšák
c0beaf6e6d st/mesa: allow rendering to sRGB textures if EXT_fb_srgb is unsupported
In this case, we always use the corresponding linear format in create_surface,
therefore we should check for linear format support as well.
2011-02-11 01:07:21 +01:00
Ian Romanick
4c1dc1c4d7 i915: Force lowering of all types of indirect array accesses in the FS
NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-10 13:26:49 -08:00
Ian Romanick
53b8b68843 i915: Calculate partial result to temp register first
Previously the SNE and SEQ instructions would calculate the partial
result to the destination register.  This would cause problems if the
destination register was also one of the source registers.

Fixes piglit tests glsl-fs-any, glsl-fs-struct-equal,
glsl-fs-struct-notequal, glsl-fs-vec4-operator-equal,
glsl-fs-vec4-operator-notequal.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-10 13:26:49 -08:00
José Fonseca
05a16b8e1c u_upload_mgr: Use PIPE_TRANSFER_FLUSH_EXPLICIT.
This can avoid DMAing the whole buffer when just a fraction was changed.
2011-02-10 20:55:10 +00:00
José Fonseca
d60f07489e scons: Disable -mstackrealign on MinGW again.
It's still broken, however it doesn't show up on debug builds.
2011-02-10 16:29:10 +00:00
Kristian Høgsberg
1a8899d630 configure.ac: Fix typo 2011-02-10 10:45:27 -05:00
Marek Olšák
fea4ad8f66 r300g: implement accelerated copy_region for compressed formats 2011-02-10 11:27:35 +01:00
Marek Olšák
7c24a4c6a8 r300g: add a way to change texture properties arbitrarily
So that we can implement resource_copy on arbitrary data.
2011-02-10 11:27:35 +01:00
Marek Olšák
56ba7e913f r300g: consolidate buffers and textures to r300_resource
Transfers and create/destroy are still handled separately.
2011-02-10 11:27:35 +01:00
Marek Olšák
ce9c0d2801 r300g: simplify WRITE_RELOC API and cleanup 2011-02-10 11:27:35 +01:00
Marek Olšák
ac366af9fd u_blitter: let the driver check whether there's a recursion 2011-02-10 11:27:34 +01:00
Marek Olšák
fc9170d0cf r300g: use format from pipe_surface instead of pipe_resource 2011-02-10 02:11:38 +01:00
Marek Olšák
2314a2f45f Revert "r300g: support sRGB colorbuffers"
This partially reverts commit 91eba2567e.

Conflicts:

	src/gallium/drivers/r300/r300_blit.c
2011-02-10 01:43:27 +01:00
Dave Airlie
21b0996dfc mesa/st: enable GL_EXT_framebuffer_sRGB
If the formats don't match we need to update the surface with the new
format.

if we can render to SRGB formats, enable the extension

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-10 10:14:27 +10:00
José Fonseca
3b8bb7b449 scons: Restrict whole program optimization to release builds.
It just takes forever, so it is inadequate for continuous testings
(i.e., checked and profile build types).
2011-02-09 18:31:21 +00:00
José Fonseca
2d95885308 svga: Don't advertise pixel shader addr register support.
It's not fully supported.
2011-02-09 18:31:21 +00:00
Kristian Høgsberg
04c5cc5b8b eglplatform.h: Define Wayland native platform types
This is conditional on WL_EGL_PLATFORM being #defined, so application
must make sure to include wayland-egl.h before including any egl header.
2011-02-09 10:58:20 -05:00
Christoph Bumiller
b6e3130a3b nvc0: serialize on PIPE_FLUSH_RENDER_CACHE as well
Effects were easily visible in piglit/fbo-generatemipmap-formats.
2011-02-09 16:05:00 +01:00
Christoph Bumiller
fc798dc37d nvc0: fix stride of NVC0_3D_RT methods 2011-02-09 16:05:00 +01:00
Christoph Bumiller
95f0aa0e52 nvc0: correct storage type for 16 bit surface formats 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0bd04cdd12 nvc0: make CSE work for ops with multiple results 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0691530b7f nvc0: replace branching with predicated insns where feasible 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0f776fea43 nvc0: implement local memory load and store ops 2011-02-09 16:05:00 +01:00
Christoph Bumiller
4124feabcb nvc0: make sure phi-ops really have one source per in-block 2011-02-09 16:05:00 +01:00
Christoph Bumiller
7401590ded nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs 2011-02-09 16:05:00 +01:00
Christoph Bumiller
c485368efe nvc0: do not generate a backwards jump if a loop ends with BRK 2011-02-09 16:05:00 +01:00
Christoph Bumiller
8e240e6153 nvc0: store only one value per basic block for TGSI regs 2011-02-09 16:05:00 +01:00
Christoph Bumiller
d5263e4093 nv50,nvc0: fix condition code change when commuting SET sources 2011-02-09 16:04:59 +01:00
Christoph Bumiller
8f05134580 nvc0: set basic block on manual instruction insertion 2011-02-09 16:04:59 +01:00
Christoph Bumiller
92d8af582d nvc0: try to fix register conflicts for vector instructions
Vector here means using multiple 32 bit regs which are forced to be
consecutive in the register file.

This still isn't quite nice.
2011-02-09 16:04:59 +01:00
Christoph Bumiller
c62fc50c88 nvc0: reset texture base address after read transfer 2011-02-09 16:04:59 +01:00
Christoph Bumiller
d3ea15f5ca nvc0: don't combine memory loads across block boundaries 2011-02-09 16:04:59 +01:00
Christoph Bumiller
f0d7429623 nvc0: detect no-op MIN/MAX, do CSE earlier to succeed more often 2011-02-09 16:04:59 +01:00
Thomas Hellstrom
a7293cbe5c mesa/st: Clean up vertex buffer unreferencing
Avoid accessing draw module internal structures outside of the draw module.
Unreference vertex buffers in error path.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-09 09:45:34 +01:00
Marek Olšák
c264786809 gallium/docs: fix typo 2011-02-09 05:21:20 +01:00
Brian Paul
f70c98b6a6 r200: add cast to silence warning 2011-02-08 19:25:04 -07:00
Brian Paul
3b0c2eb07c mesa: remove unused BITFIELD64 macros 2011-02-08 19:25:04 -07:00
Brian Paul
6f2f449414 mesa: remove _mesa_create_context_for_api()
Just add the gl_api parameter to _mesa_create_context().
2011-02-08 19:25:04 -07:00
Brian Paul
5e4ca1ccc9 mesa: remove _mesa_initialize_context_for_api()
Just add the gl_api parameter to _mesa_initialize_context().
2011-02-08 19:25:04 -07:00
Brian Paul
2634e92dc0 mesa: add/update VERBOSE_API logging 2011-02-08 19:20:43 -07:00
Brian Paul
7230e1a228 st/mesa: fix shader deletion regression
Fixes a regression from commit 5cbff0932e.
The problem is *some* glDrawPixels fragment programs need to be deleted,
but not all.  Use an explicit flag to indicate whether or not the program
needs to be deleted.

This should fix http://bugs.freedesktop.org/show_bug.cgi?id=34049
2011-02-08 18:23:59 -07:00
Kenneth Graunke
f6f04ae29c i965: Add missing DEFINE_BITS for brw dirty bits.
These are only used for debugging, but should be there.
Found by inspection.
2011-02-08 16:56:18 -08:00
Kenneth Graunke
58b7e37722 i965: Separate the BRW_NEW_(VS|WM)_CONSTBUF dirty bits.
These were incorrectly defined to the same value - likely due to a cut
and paste error.  Found by inspection.
2011-02-08 16:55:20 -08:00
Kenneth Graunke
71acbb54f4 i965: Rename a few more commands to match the documentation. 2011-02-08 16:06:47 -08:00
Benjamin Franzke
15598fbf42 st/egl: Fix platform selection
A break for case _EGL_PLATFORM_X11 is missing.
introduced by: 381ea0d67a
2011-02-08 15:16:31 -05:00
Eric Anholt
df8ca3e0ec i965: Remove pointless keying of WM state on VUE size. 2011-02-08 11:42:44 -08:00
Eric Anholt
76857e8954 mesa: Fix the Mesa IR copy propagation to not read past writes to the reg.
Fixes glsl-vs-post-increment-01.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-02-08 11:42:35 -08:00
Eric Anholt
60aab5f335 glsl: Disable the new copy propagation pass until it gets fixed.
It apparently regressed a bunch of ES2 cases.
2011-02-08 11:41:05 -08:00
Chad Versace
82f994f386 glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30
From section 5.9 of the GLSL 1.20 spec:
   The operator modulus (%) is reserved for future use.

From section 5.8 of the GLSL 1.20 spec:
   The assignments modulus into (%=), left shift by (<<=), right shift by
   (>>=), inclusive or into ( |=), and exclusive or into ( ^=). These
   operators are reserved for future use.

The GLSL ES 1.00 spec and GLSL 1.10 spec have similiar language.

Fixes bug:
https://bugs.freedesktop.org//show_bug.cgi?id=33916

Fixes Piglit tests:
spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.10/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.10/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.20/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.20/compiler/assignment-operators/modulus-assign-00.frag
2011-02-08 09:37:03 -08:00
Marek Olšák
69e5516308 r600g: fixup assertion 2011-02-08 18:18:13 +01:00
Marek Olšák
71df812146 r600g: add a faster implementation of transfer_inline_write
u_default_transfer_inline_write uses util_copy_rect, which is kinda slow.
2011-02-08 17:47:00 +01:00
Marek Olšák
f0b202ec73 r600g: slab-allocate buffer and transfer structures 2011-02-08 17:30:39 +01:00
Marek Olšák
b541a3c4c0 r300g: use the same upload buffer for vertices and indices 2011-02-08 16:35:02 +01:00
Marek Olšák
467023e808 r600g: use the same upload buffer for vertices, indices, and constants
This should reduce memory consumption.
2011-02-08 16:35:02 +01:00
Thomas Hellstrom
8042470057 mesa/st: Plug a fragment program variant parameter leak
Fixes a minor memory leak with the "engine" mesa demo.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-08 08:13:39 -07:00
Brian Paul
5cbff0932e st/mesa: free the temporary bitmap/drawpix shader code
Fixes a per-shader memory leak when drawing glBitmaps, glDrawPixels
or glCopyPixels.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-08 08:10:22 -07:00
Marek Olšák
1ee71bdc8a u_vbuf_mgr: add a way to specify the BIND flag for the upload buffer 2011-02-08 15:20:11 +01:00
Marek Olšák
7628c4ecb6 u_vbuf_mgr: remove tabs 2011-02-08 15:18:46 +01:00
Marek Olšák
f53cbf8bb0 u_vbuf_mgr: make the uploader public 2011-02-08 15:08:04 +01:00
Marek Olšák
d8d5c2660f Revert "r600g: do not flush the uploader" (with comments)
This reverts commit 1c2a4f0820.
2011-02-08 14:48:12 +01:00
Brian Paterni
4d78dafc84 r600g: silence a few valgrind warnings 2011-02-08 12:48:44 +01:00
Thomas Hellstrom
bb1036aae5 mesa/st: Fix vertex buffer leak
Make sure we unreference the vertex buffer pointers in a local array.
This fixes huge vertex buffer / memory leaks in mesa demos "fire" and "engine".

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-08 11:01:21 +01:00
Kristian Høgsberg
1e1b89103e wayland-egl: Add struct wl_egl_display argument to +wl_egl_window_create() 2011-02-07 20:50:18 -05:00
Henri Verbeet
077c448d18 r600g: Add support for relative addressing on constant buffers.
Relative addressing of constant buffers can't work properly through the
kcache, since you can only address within the currently locked kcache window.
Instead, this patch binds the constant buffer as a shader resource, and then
explicitly fetches the constant using a vertex fetch with fetch type
VTX_FETCH_NO_INDEX_OFFSET from the shader. There's probably still some room
for improvement, doing the fetch right before the instruction that needs the
value may not be quite optimal for example.
2011-02-07 15:22:08 +01:00
Henri Verbeet
871460eb14 r600g: Set the fetch type in r600_bc_vtx_build(). 2011-02-07 15:22:08 +01:00
Henri Verbeet
4c30a80e38 r600g: Handle the ADD_INT instruction in r600_bc_get_num_operands(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
5c59eebfae r600g: Generalize the pipe_add_vertex_attrib() functions.
This allows them to be used for VS or PS buffer resources as well.
2011-02-07 15:22:07 +01:00
Henri Verbeet
b9fd1a1e4b r600g: Remove vs_resource and ps_resource from the pipe context.
These are practically unused, only the vs_resource array is being abused for
fetch shader resources.
2011-02-07 15:22:07 +01:00
Henri Verbeet
7687eabaa0 r600g: Split constants in r600_shader_from_tgsi(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
1fa95c7f9e r600g: Do the tgsi_full_src_register to r600_shader_src conversion in r600_shader_from_tgsi(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
a77e813de3 r600g: Split r600_bc_alu_src.
The r600_bc_alu_src structure is used in two different ways, as a vector and
for the individual channels of that same vector. This is somewhat fragile,
and probably confusing.
2011-02-07 15:22:07 +01:00
Henri Verbeet
3b1c1f0253 r600g: Store literal values in the r600_bc_alu_src structure.
This is much easier to work with, and allows use to get rid of some of the
literal handling hacks.
2011-02-07 15:22:07 +01:00
Henri Verbeet
80235d92e6 r600g: tgsi_dst() can't fail. 2011-02-07 15:22:07 +01:00
Henri Verbeet
d0f2ffad76 r600g: tgsi_src() can't fail. 2011-02-07 15:22:07 +01:00
Kristian Høgsberg
56758c839f wayland-egl: Force roundtrips to get device name and authenticate correctly
If the client hasn't done the initial wl_display_iterate() at the time
we initialize the display, we have to do that in platform_wayland.c.
Make sure we detect that correctly instead of dup()ing fd=0, and use
the sync callback to make sure we don't wait forever for authorization that
won't happen.
2011-02-07 14:01:31 +01:00
Benjamin Franzke
93aea84f47 egl_dri2: Add wayland platform 2011-02-07 14:01:31 +01:00
Benjamin Franzke
9630437fc9 egl_dri2: Export dri2_get_driver_for_fd 2011-02-07 14:01:31 +01:00
Benjamin Franzke
a8128d7d4b egl_dri2: Enable pixmap bind_to_texture according to the extension 2011-02-07 14:01:30 +01:00
Benjamin Franzke
381ea0d67a st/egl: Add wayland platform 2011-02-07 14:01:16 +01:00
Benjamin Franzke
9b6dc9b7a4 st/egl: drm_image: Check for MESA_drm_image
MESA_drm_image isnt limited to drm platform,
others can enable the extension too.
2011-02-07 13:55:29 +01:00
Benjamin Franzke
464cb3a09e st/egl: native_helper: Add resource_surface_import_resource 2011-02-07 13:55:29 +01:00
Benjamin Franzke
214fc6e850 egl: Implement libwayland-egl
This library is required and defined by wayland for
EGL implementations supporting wayland.
2011-02-07 13:55:20 +01:00
Benjamin Franzke
e586c4b763 egl: Add wayland platform 2011-02-07 13:52:29 +01:00
Benjamin Franzke
2adfde3aae intel: Implement dri2::{Allocate,Release}Buffer 2011-02-07 13:52:28 +01:00
Benjamin Franzke
f8e939a3a7 st/dri: Implement dri2::{Allocate,Release}Buffer 2011-02-07 13:52:28 +01:00
Benjamin Franzke
1b8ef9416b Add dri2::{Allocate,Release}Buffer extension 2011-02-07 13:52:28 +01:00
Marek Olšák
a22bda9f80 r600g: correctly report supported vertex formats 2011-02-07 03:51:53 +01:00
Marek Olšák
c95bc1224a r300g: use the new vertex buffer manager 2011-02-07 02:46:23 +01:00
Marek Olšák
aa8a2224a3 r600g: use the new vertex buffer manager 2011-02-07 02:46:17 +01:00
Marek Olšák
975320ab76 util: import a new vertex buffer manager
This code has originally matured in r300g and was ported to r600g several
times. It was obvious it's a code duplication.

See also comments in the header file.
2011-02-07 02:23:46 +01:00
Marek Olšák
1c2a4f0820 r600g: do not flush the uploader 2011-02-06 21:13:58 +01:00
Marek Olšák
529d867207 r300g: do not flush the uploader
We don't have to unmap and recreate the upload buffer when a flush occurs.
This should also prevent buffer allocations from failing.
2011-02-06 21:12:51 +01:00
Marek Olšák
ec96b0ecdb configure.ac: correctly check for libdrm_radeon version 2011-02-06 15:47:00 +01:00
Marek Olšák
4ad3b27cee r300g: RS400 doesn't have ZMASK 2011-02-06 15:46:51 +01:00
Dave Airlie
780c183b8f r600g: use surface format not underlying texture format
This uses the surface format to set the CB up not the underlying texture
format, since these can and do differ.

Fixes piglit fbo-srgb.
2011-02-06 19:00:04 +10:00
Tom Stellard
68b701f5de r300/compiler: Disable register rename pass on r500
The scheduler and the register allocator are not good enough yet to deal
with the effects of the register rename pass.  This was causing a 50%
performance drop in Lightsmark.  The pass can be re-enabled once the
scheduler and the register allocator are more mature.  r300 and r400
still need this pass, because it prevents a lot of shaders from using
too many texture indirections.

NOTE: This is a candidate for the 7.10 branch.
2011-02-05 22:39:58 -08:00
Tom Stellard
19202284c0 r300/compiler: Don't count BEGIN_TEX instructions in the compiler stats 2011-02-05 00:27:24 -08:00
Dave Airlie
88ffa9ce5b mesa/965: add support for GL_EXT_framebuffer_sRGB (v2)
This adds i965 support for GL_EXT_framebuffer_sRGB, it introduces a new
constant to say that the driver can support sRGB enabled FBOs since enabling
the extension doesn't mean the driver can actually support sRGB.

Also adds the suggested state flush in the core code suggested by Brian.

fix the ARB_fbo color encoding.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-05 17:06:30 +10:00
Ian Romanick
5c3f1cdbbe mesa: Fix error checks in GetVertexAttrib functions
Querying index zero is not an error in OpenGL ES 2.0.

Querying an index larger than the value returned by
GL_MAX_VERTEX_ATTRIBS is an error in all APIs.

Fixes bugzilla #32375.
2011-02-04 12:10:05 -08:00
Ian Romanick
ce9171f9d8 linker: Generate link errors when ES shaders are missing stages
ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.
2011-02-04 12:10:04 -08:00
Vinson Lee
425ba19832 glsl: Add opt_copy_propagation_elements.cpp to SConscript.
Fixes SCons build.
2011-02-04 11:47:01 -08:00
Eric Anholt
1b80622c4e i965: Drop the dead tracking of color_regions[].
We pull the draw regions right out of the renderbuffers these days.
2011-02-04 12:18:38 -06:00
Eric Anholt
95cdce7f70 i965: Drop the INTEL_DEBUG=state spam about the cache size check.
There's way more interesting info in INTEL_DEBUG=state if you could find
it among the state size checks.
2011-02-04 12:18:38 -06:00
Eric Anholt
29a2e9133e glsl: Remove extra checks for constant true assignment conditions.
These are already stripped by opt_constant_folding.cpp.
2011-02-04 12:18:38 -06:00
Eric Anholt
b6d49ab843 glsl: Fix a comment typo in copy propagation. 2011-02-04 12:18:38 -06:00
Eric Anholt
e31266ed3e glsl: Add a new opt_copy_propagation variant that does it channel-wise.
This patch cleans up many of the extra copies in GLSL IR introduced by
i965's scalarizing passes.  It doesn't result in a statistically
significant performance difference on nexuiz high settings (n=3) or my
demo (n=10), due to brw_fs.cpp's register coalescing covering most of
those extra moves anyway.  However, it does make the debug of wine's
GLSL shaders much more tractable, and reduces instruction count of
glsl-fs-convolution-2 from 376 to 288.
2011-02-04 12:18:38 -06:00
Vinson Lee
cde443e0b9 ralloc: Add missing va_end following va_copy. 2011-02-03 22:10:16 -08:00
Dave Airlie
3188a7deb3 r600g: don't set tile_type on evergreen.
Since we never bind the actual DB to the CB/texture only the flushed one
we don't need to track the tile type at the moment.
2011-02-04 15:26:41 +10:00
Dave Airlie
fdd35dc912 r600g: fix evergreen sampler view + depth interaction 2011-02-04 15:26:09 +10:00
Vinson Lee
9ee765197c util: Change u_get_transfer_vtbl usage argument type to match prototype.
The type of u_get_transfer_vtbl of the usage argument in u_transfer.h is
unsigned and not enum pipe_transfer_usage. This patch changes the type
of usage to unsigned to match the prototype in the header file.
2011-02-03 20:15:25 -08:00
Vinson Lee
61c59234f9 glsl: Add using statements for standard library functions.
Standard library functions in C++ are in the std namespace. When using
C++-style header files for the standard library, some compilers, such as
Sun Studio, provide symbols only for the std namespace and not for the
global namespace.

This patch adds using statements for standard library functions. Another
option could have been to prepend standard library function calls with
'std::'.

This patch fixes several compilation errors with Sun Studio.
2011-02-03 19:19:12 -08:00
Dave Airlie
151a945d38 r600g: get offset for correct texture when setting up CB.
this fixes the mipmap tests with tiling forced on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:38:01 +10:00
Dave Airlie
812c314e51 r600g: avoid trying to flush the flushing texture.
Since these textures still have the depth bit set.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:36:02 +10:00
Dave Airlie
8c643446f9 r600g: evergreen CB check for flushed texture 2011-02-04 09:34:32 +10:00
Dave Airlie
2271c793e8 r600g: flushing texture needs all levels.
For mipmap generation we need all levels in the flushing texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:45 +10:00
Dave Airlie
cd6864c079 r600g: remove unused variables 2011-02-04 09:09:45 +10:00
Dave Airlie
3e9bc43fba r600g: add a flag to just create flushed texture without flushing.
This just adds a flag to create the texture without doing any
flushing to it. Flushing occurs in the draw function. This avoids
unnecessary flushes when we end up rebinding a CB/DB/texture due
to the blitter just restoring state.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:45 +10:00
Dave Airlie
446bc12c17 r600g: also check CB bindings for textures to depth flush.
This checks the color buffer bindings to make sure there is something
to flush.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:44 +10:00
Dave Airlie
4b49fcbb9a r600g: flush depth texture before a blit from it.
If we are going to blit from a depth texture we need to flush
it before we blit from it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:44 +10:00
Brian Paul
5026841d5e svga: rename a couple sampler, sampler view functions 2011-02-03 14:22:21 -07:00
Brian Paul
e40252d4d9 gallium/svga: added debug code for dumping framebuffer images (disabled) 2011-02-03 14:22:21 -07:00
Brian Paul
73e37d933d gallium/docs: more info about setting samplers and sampler views
Plus other assorted clarifications.
2011-02-03 13:47:12 -07:00
Brian Paul
c5fb2c60bf cso: don't tell drivers to bind null samplers, sampler views
Before, the set_sampler_views() and restore_sampler_views() functions
used MAX2(old,new) to tell the driver how many samplers or sampler
views to set.  This could result in cases such as:

pipe->set_fragment_sampler_views(pipe, 4, views={foo, bar, NULL, NULL})

Many/most gallium drivers would take this as-is and set
ctx->num_sampler_views=4 and ctx->sampler_views={foo, bar, NULL, NULL, ...}.
Later, loops over ctx->num_sampler_views would have to check for null
pointers.  Worse, the number of sampler views and number of sampler CSOs
could get out of sync:

ctx->num_samplers = 2
ctx->samplers = {foo, bar, ...}
ctx->num_sampler_views = 4
ctx->sampler_views={Foo, Bar, NULL, NULL, ...}

So loops over the num_samplers could run into null sampler_views pointers
or vice versa.

This fixes a failed assertion in the SVGA driver when running the Mesa
engine demo in AA line mode (and possibly other cases).

It looks like all gallium drivers are careful to unreference views
and null-out sampler CSO pointers for the units beyond what's set
with the pipe::bind_x_sampler_states() and pipe::set_x_sampler_views()
functions.

I'll update the gallium docs to explain this as well.
2011-02-03 13:47:11 -07:00
Henri Verbeet
a6a710cbe7 r600g: Make some more things static. 2011-02-03 21:13:12 +01:00
Henri Verbeet
d06b990096 r600g: Get rid of the unused r600_cf_vtx_tc() function. 2011-02-03 21:13:12 +01:00
Henri Verbeet
d17d03a8dc r300g: Make the buffer and texture vbtls static const. 2011-02-03 21:13:12 +01:00
Henri Verbeet
126e98966d r600g: Make the buffer and texture vbtls static const. 2011-02-03 21:13:12 +01:00
Alex Deucher
4668ad36f3 egl_dri2: Add new radeon pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-03 14:35:54 -05:00
Kristian Høgsberg
9dc5de5bb1 egl_dri2: Split out drm platform implementation to a separate file 2011-02-03 11:59:38 -05:00
Kristian Høgsberg
2889d9640f egl_dri2: Split out x11 platform code 2011-02-03 11:59:38 -05:00
Haitao Feng
b43a147128 swrast: add an interface createNewContextForAPI
This new interface could set up context for OpenGL,
OpenGL ES1 and OpenGL ES2. It will be used by egl_dri2
driver.

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-03 11:59:30 -05:00
José Fonseca
610c24b19d svga: Fix resource leak; undo temporary workaround.
Leak was introduced when fixing strict aliasing violation in this code:
the reference counting was preserved, but the destructor call on zero
reference count was not.
2011-02-03 16:14:02 +00:00
José Fonseca
0f3eeb45c7 svga: Temporarily disable buffer DMA upload coalescing.
See comment for more details.
2011-02-03 15:15:23 +00:00
José Fonseca
637ed52f59 svga/drm: Flushing preemptively on a 1/3 of the aperture.
Exactly one half would be the ideal, but this is a soft limit, and one
more byte over brings us to synchronous behavior.

Flushing when the referred GMR exceeds one third of the aperture gives us
statistically better performance.
2011-02-03 15:15:23 +00:00
José Fonseca
b6b6b8f8bb util: Prevent transfer dangling pointer on map failure. 2011-02-03 15:15:23 +00:00
José Fonseca
5c296a583d svga: Don't call swc->flush directly.
Only svga_context_flush should do it, to ensure upload commands are not
submitted to hardware in an inconsistent state.
2011-02-03 15:15:23 +00:00
José Fonseca
9d4488e4a8 svga: Add an assert to catch reentrancy. 2011-02-03 15:15:23 +00:00
José Fonseca
63c0a504a0 svga/drm: Update for pb_vtbl::map argument addition. 2011-02-03 15:15:23 +00:00
Michel Dänzer
7535f93e5a r300c: Unbreak after R4xx support was added to r300/compiler. 2011-02-03 13:25:16 +01:00
José Fonseca
82e79e93ac scons: Eliminate libgcc_s_sjlj-1.dll dependency
Certain mingw32 cross compilers (e.g. RedHat's) defaults to use DLL gcc
runtime.

Given the main deliverable from this project are self-contained drivers,
which are loaded by any application, this dependency can cause havoc.
2011-02-03 09:16:49 +00:00
Dave Airlie
aa31a5cbc7 r600g: flush differences back to DB copy. 2011-02-03 14:19:52 +10:00
Dave Airlie
417cfa60b2 r600g: fix depth hw resource copies.
With the previous fixes we can now enabled hw depth copies

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:19:37 +10:00
Dave Airlie
5730d56549 r600g: only set depth bit for hw accessible depth buffers.
If we get a sw accessible buffer like the S8 texture we end up
doing depth tracking on it when there is no need since we won't
ever bind it to the hardware. This leads to a sw fallback in the
transfer destruction which leads to and endless recusion loop
of fail in transfer destroy.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:18:01 +10:00
Dave Airlie
b13b7b86b2 r600g: rework dirty / depth texture tracking.
this adds a flag to keep track of whether the depth texture structure
is the flushed texture or not, so we can avoid doing flushes when
we do a hw rendering from one to the other.

it also renames flushed to dirty_db which tracks if the DB copy
has been dirtied by being bound to the hw.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:17:05 +10:00
Dave Airlie
d0293290ad r600g: set correct pitch/offset for depth textures in flushed state.
This fixes zreaddraw in tiling mode
2011-02-03 14:12:32 +10:00
Brian Paul
4629be0509 softpipe: rename sampler[] -> fragment_samplers[] 2011-02-02 20:43:56 -07:00
Brian Paul
843f206a34 softpipe: rename fragment sampler/view fields
To be consistant with vertex, geometry sampler fields.
2011-02-02 20:30:56 -07:00
Brian Paul
c06fa98c86 cso: refactor texture sampler and sampler view code
This consolidates the code duplicated between the fragment sampler
and vertex sampler functions.  Plus, it'll make adding support for
geometry shader samplers trivial.
2011-02-02 20:28:00 -07:00
Brian Paul
5f30e0b231 cso: rename fragment sampler-related fields
To better distinguish from vertex sampler fields.
2011-02-02 18:14:48 -07:00
Brian Paul
d087cfaabf cso: fix loop bound in cso_set_vertex_samplers()
Before we were looping to nr_samplers, which is the number of fragment
samplers, not vertex samplers.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 18:11:30 -07:00
Chad Versace
fd1252ab67 glcpp: Raise error when modulus is zero
For example, this now raises an error:
   #define XXX 1 / 0

Fixes bug: https://bugs.freedesktop.org//show_bug.cgi?id=33507
Fixes Piglit test: spec/glsl-1.10/preprocessor/modulus-by-zero.vert

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 10:19:51 -08:00
Chad Versace
e7c1f058d1 glsl: Avoid division-by-zero during constant-folding
Avoid division-by-zero when constant-folding the following expression
types:
    ir_unop_rsq
    ir_binop_div
    ir_binop_mod

Fixes bugs:
https://bugs.freedesktop.org//show_bug.cgi?id=33306
https://bugs.freedesktop.org//show_bug.cgi?id=33508

Fixes Piglit tests:
glslparsertest/glsl2/div-by-zero-01.frag
glslparsertest/glsl2/div-by-zero-02.frag
glslparsertest/glsl2/div-by-zero-03.frag
glslparsertest/glsl2/modulus-zero-01.frag
glslparsertest/glsl2/modulus-zero-02.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 09:55:35 -08:00
Chad Versace
b3cf92aa91 glsl: Fix constant-folding for reciprocal expressions
Do not constant-fold a reciprocal if any component of the reciprocated
expression is 0. For example, do not constant-fold `1 / vec4(0, 1, 2, 3)`.

Incorrect, previous behavior
----------------------------
Reciprocals were constant-folded even when some component of the
reciprocated expression was 0. The incorrectly applied arithmetic was:
   1 / 0 := 0
For example,
   1 / vec4(0, 1, 2, 3) = vec4(0, 1, 1/2, 1/3)

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 09:54:52 -08:00
José Fonseca
50278c0901 svga: Flush upload buffers or we get asserts
Based on work from Jakob Bornecrantz, Michel Dänzer, and Brian Paul.
2011-02-02 11:28:41 +00:00
Kenneth Graunke
dfdb9fda82 glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.
This has probably existed since e5e34ab18e or so.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-01 23:53:39 -08:00
Kenneth Graunke
cfd8d45ccd glsl: Fix invalid use of ralloc_asprintf in prototype_string.
This was my mistake when converting from talloc to ralloc.  I was
confused because the other calls in the function are to asprintf_append
and the original code used str as the context rather than NULL.

Fixes bug #33823.
2011-02-01 23:31:35 -08:00
Christian König
8ca3b140eb r600g: use burst exports in shaders
Join multiple exports into just one instruction
instead of exporting each register separately.
2011-02-02 01:33:03 +01:00
Alex Deucher
8503cffc4c r200: remove 0x4243 pci id
There's no such device.  0x4243 is a pci bridge id,
not a GPU.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-01 19:13:54 -05:00
Ian Romanick
a04582739e i915: Only mark a register as available if all components are written
Previously a register would be marked as available if any component
was written.  This caused shaders such as this:

  0: TEX TEMP[0].xyz, INPUT[14].xyyy, texture[0], 2D;
  1: MUL TEMP[1], UNIFORM[0], TEMP[0].xxxx;
  2: MAD TEMP[2], UNIFORM[1], TEMP[0].yyyy, TEMP[1];
  3: MAD TEMP[1], UNIFORM[2], TEMP[0].zzzz, TEMP[2];
  4: ADD TEMP[0].xyz, TEMP[1].xyzx, UNIFORM[3].xyzx;
  5: TEX TEMP[1].w, INPUT[14].xyyy, texture[0], 2D;
  6: MOV TEMP[0].w, TEMP[1].wwww;
  7: MOV OUTPUT[2], TEMP[0];
  8: END

to produce incorrect code such as this:

  BEGIN
  DCL S[0]
  DCL T_TEX0
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[0].xyz = MOV U[0]
  R[1] = MUL CONST[0], R[0].xxxx
  R[2] = MAD CONST[1], R[0].yyyy, R[1]
  R[1] = MAD CONST[2], R[0].zzzz, R[2]
  R[0].xyz = ADD R[1].xyzx, CONST[3].xyzx
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[1].w = MOV U[0]
  R[0].w = MOV R[1].wwww
  oC = MOV R[0]
  END

Note that T_TEX0 is copied to R[0], but the xyz components of R[0] are
still expected to hold a calculated value.

Fixes piglit tests draw-elements-vs-inputs, fp-kill, and
glsl-fs-color-matrix.  It also fixes Meego bugzilla #13005.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-01 13:43:36 -08:00
Ian Romanick
20d278a7ff mesa: glGetUniform only returns a single element of an array
Also return it as the correct type.  Previously the whole array would
be returned and each element would be expanded to a vec4.

Fixes piglit test getuniform-01 and bugzilla #29823.
2011-02-01 09:48:41 -08:00
José Fonseca
3c701f1d61 glsl: Fix printf_length() on MSVC. 2011-02-01 10:41:46 +00:00
Kenneth Graunke
a7d350790b glsl: Fix memory error when creating the supported version string.
Passing ralloc_vasprintf_append a 0-byte allocation doesn't work.  If
passed a non-NULL argument, ralloc calls strlen to find the end of the
string.  Since there's no terminating '\0', it runs off the end.

Fixes a crash introduced in 14880a510a.
2011-02-01 00:20:01 -08:00
Dave Airlie
11bc8991e9 r600g: just change tile type when buffer is set to depth.
Not 100% sure on this one, but this is how it should work,
the question is whether it will uncover other bugs elsewhere.
2011-02-01 14:38:45 +10:00
Dave Airlie
a112cc283d r600g: align the tiling modes with what the DDX and kernel expects.
If we see a MACRO bit on r600g its 2D tiled,
if don't see a MACRO bit and we do see a MICRO bit then its 1D tiled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-01 14:23:35 +10:00
Dave Airlie
8b5a50b31c r600g: fix evergreen for depth decompress test 2011-02-01 13:06:35 +10:00
Dave Airlie
aee5f1e40c r600: only decompress depth when its tile type is wrong.
If the tile type for the buffer is 1 then its been bound to the
DB at some point, we need to decompress it, otherwise its only
been bound as texture/cb so don't do anything.

This fixes 5 piglit tests here on r600g.
2011-02-01 13:02:56 +10:00
Kenneth Graunke
3ef397dafc texture_builtins.py: Fix a warning about mixed tabs/spaces. 2011-01-31 16:41:34 -08:00
Dave Airlie
42b5f68198 r600g: start looking at evergreen tiling.
this just adds the ioctl interface and sets the tile type
and array mode in the correct place.

This seems to bring eg 1D tiling to the same level, and issues
as on r600. No idea how to address 2D yet.
2011-02-01 10:36:57 +10:00
Henri Verbeet
d171ae086b r600g: Actually use the info from the flushed depth texture when creating a sampler view on a depth texture.
R600/R700 was using incorrect tiling information from the (compressed) depth
buffer. Evergreen worked anyway because tiling doesn't work.
2011-02-01 01:19:16 +01:00
Ian Romanick
5e19b5ad16 glsl: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-31 15:32:56 -08:00
Ian Romanick
14880a510a glsl: Reject shader versions not supported by the implementation
Previously we'd happily compile GLSL 1.30 shaders on any driver.  We'd
also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context.
This has been a long standing FINISHME in the compiler.

NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-01-31 15:32:56 -08:00
Ian Romanick
e5e34ab18e glsl: Ensure that all GLSL versions are supported in the stand-alone compiler
NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-01-31 15:32:56 -08:00
Ian Romanick
bf9850db22 glsl: Fix dependencies / linkage for glsl_compiler 2011-01-31 15:32:55 -08:00
Ian Romanick
09e15ac76a mesa: Initial size for secondary color array is 3
See table 6.7 on page 347 of the OpenGL 3.0 specification.
2011-01-31 15:32:55 -08:00
Christian König
7fb722c35c r600g: fix invalid ref count handling in r600_set_constant_buffer
Only decrement ref count if r600_upload_const_buffer
really changes the buffer.
2011-01-31 23:38:10 +01:00
Brian Paul
a8c144a388 llvmpipe: fix incorrect array index in image dump code 2011-01-31 14:09:24 -07:00
Brian Paul
a1f5c46d24 glsl: regerated files 2011-01-31 14:09:24 -07:00
Brian Paul
aacd07d623 glsl: make _token_list_is_empty_ignoring_space() static
To silence warning about missing prototype.
2011-01-31 14:09:24 -07:00
Brian Paul
3b8c7d70b3 scons/glsl: add top-level 'include' dir to CPPPATH
To avoid using the /usr/include/GL/gl.h file which may be lacking
some special #defines.
2011-01-31 14:09:24 -07:00
Brian Paul
59c957b688 glsl: add cast to silence signed/unsigned comparison warning 2011-01-31 14:09:24 -07:00
José Fonseca
3ae7aa3403 glsl: Define va_copy on MSVC. 2011-01-31 20:53:03 +00:00
Kenneth Graunke
0f7325b890 i965: Emit texel offsets in sampler messages. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
ca418cbde6 glsl/builtins: Uncomment prototypes for texture*Offset functions. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
ba3de801ec texture_builtins.py: Generate texture*Offset functions. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
4c63f2de2f texture_builtins.py: Generalize the "use_proj" field to support offsets.
Rather than passing "True", pass a bitfield describing the particular
variant's features - either projection or offset.

This should make the code a bit more readable ("Proj" instead of "True")
and make it easier to support offsets in the future.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
99f36486eb texture_builtins.py: Refactor coordinate dimension calculations.
For offsets, we'll want the straight sampler dimensionality, without the
+1 for array types.  Create a new function to do that; refactor.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
819d57fce9 glsl: Introduce a new "const_in" variable mode.
This annotation is for an "in" function parameter for which it is only legal
to pass constant expressions.  The only known example of this, currently,
is the textureOffset functions.

This should never be used for globals.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
c5a27b5939 glsl: Change texel offsets to a single vector rvalue.
Having these as actual integer values makes it difficult to implement
the texture*Offset built-in functions, since the offset is actually a
function parameter (which doesn't have a constant value).

The original rationale was that some hardware needs these offset baked
into the instruction opcode.  However, at least i965 should be able to
support non-constant offsets.  Others should be able to rely on inlining
and constant propagation.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
60c8e91c79 glsl: Re-synchronize ir_variable_mode and the printer's string array.
Since the introduction of ir_var_system_value, system variables would be
printed as "temporary" and temporaries would result in out-of-bounds
array access, showing up as garbage in printed IR.
2011-01-31 11:04:37 -08:00
Vinson Lee
8c115aa247 scons: Gracefully handle pkg-config errors with libdrm_radeon.
Print warnings and continue build.
2011-01-31 10:50:06 -08:00
Kenneth Graunke
1568b19e3b Remove the talloc sources from the Mesa repository. 2011-01-31 10:17:10 -08:00
Kenneth Graunke
8aac5d123c Remove talloc from the SCons build system. 2011-01-31 10:17:10 -08:00
Kenneth Graunke
d1d8120545 Remove talloc from the make and automake build systems. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
42fd9c2ebb ralloc: a new MIT-licensed recursive memory allocator. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
d3073f58c1 Convert everything from the talloc API to the ralloc API. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
dc55254f5b ralloc: Add a fake implementation of ralloc based on talloc. 2011-01-31 10:17:09 -08:00
Henri Verbeet
7d9e0ea739 glx: Properly check for a valid fd in dri2CreateScreen().
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 10:54:04 -07:00
Michel Dänzer
5a1ce49c82 svga: Fix translation of TGSI SSG opcode.
SVGA3D only supports SGN for vertex shaders, and this requires two additional
temporary registers for intermediate results.

For fragment shaders, lower to two CMPs and one ADD.
2011-01-31 17:47:57 +01:00
Michel Dänzer
11c11ee0bc svga: TEXLDL opcode dst/src register information is correct. 2011-01-31 17:47:14 +01:00
Michel Dänzer
a61b7aa90d svga: Print the number and mnemonic of the opcode we're missing information for.
Makes it easier to figure out which opcode it's about.
2011-01-31 17:45:07 +01:00
Henri Verbeet
0b47d59e5b glx: Fix leaks in DRISW screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:31:24 -07:00
Henri Verbeet
0e8e8ba29a glx: Fix leaks in DRI screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:31:21 -07:00
Henri Verbeet
bfc889517a glx: Fix leaks in DRI2 screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:29:54 -07:00
Julien Cristau
cbe9fc12a6 glx: fix length of GLXGetFBConfigsSGIX
The extra length is the size of the request *minus* the size of the
VendorPrivate header, not the addition.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:28:55 -07:00
Julien Cristau
e27913f805 glx: fix GLXChangeDrawableAttributesSGIX request
xGLXChangeDrawableAttributesSGIXReq follows the GLXVendorPrivate header
with a drawable, number of attributes, and list of (type, value)
attribute pairs.  Don't forget to put the number of attributes in there.
I don't think this can ever have worked.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:28:37 -07:00
Dave Airlie
ea5ede2178 r600g: fix eg OQ properly.
the context init is separate for these gpus.
2011-01-31 20:44:47 +10:00
Alex Deucher
26a4c1cb65 r600g: fix OQ on evergreen
6xx/7xx have a max of 4 DBs, evergreen have a max of 8.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-31 02:49:27 -05:00
Dave Airlie
df8089df90 r600g: fix occlusion query results.
Like on some r5xx, there are multiple DB backends on the r600,
we need to add up the query results from each of these to get the
final correct value.

So far I'm not 100% sure how to calculate the num_db, value
setting it to 4 should be harmless enough until we do.

This fixes occulsion_query piglit test on my rv740.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 16:14:03 +10:00
Alex Deucher
2f7c876ff5 r600g: remove some non-existent evergreen reg fields
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-30 22:41:59 -05:00
Dave Airlie
065c8696e7 r600g: fix regression in cubemap tests since eea1d8199b
Although CUBE is a reduction inst, it writes to more than just PV.X
so we need to keep the dst channel.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 13:06:17 +10:00
Dave Airlie
5555cd776b r600g: handle the write all cbufs property.
This only works on r600/r700 so far, evergreen doesn't appear
to have the multiwrite enable bit in the color control, so we
may have to actually do a shader rewrite on EG hardware.

remove some duplicate code reg defines also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 10:01:06 +10:00
Henri Verbeet
f668b464c0 util: Call tables should be const. 2011-01-30 18:59:13 +01:00
Henri Verbeet
38b54158b6 r600g: Update the flushed depth texture after drawing to the corresponding texture.
I know Jerome will probably rewrite the way depth textures work sometime
soon. For the time being this should at least make common depth texture usage
for shadowing work properly though.
2011-01-30 18:59:13 +01:00
Chia-I Wu
3f0a966807 st/vega: Disable blending when the paint is opaque.
When the paint is opaque (currently, solid color with alpha 1.0f), no
blending is needed for VG_BLEND_SRC_OVER.  This eliminates the serious
performance hit introduced by 859106f196
for a common scenario.
2011-01-30 23:22:40 +08:00
Chia-I Wu
e919dee1ed st/vega: Remove an invalid sanity check.
Before create_handle returns, obj->handle is 0.  Calling
handle_to_object will fail.
2011-01-30 23:22:40 +08:00
Chia-I Wu
05e5b53128 st/vega: s/vg[A-Z]/vega[A-Z]/. 2011-01-30 23:22:40 +08:00
José Fonseca
11b15c4d25 scons: We have C++ in several libraries, so always link with the C++ compiler
Prevents missing symbols in libGL.so when LLVM is disabled.
2011-01-30 11:19:44 +00:00
Vinson Lee
cad0520179 r600g: Fix void pointer arithmetic.
Fixes SCons build.
2011-01-30 01:08:54 -08:00
Dave Airlie
71f610e26e r600g: fixes a segfault in the piglit fbo-genmipmap-formats test.
should be no need to unset this ptr here and if we don't end up using the
blitter we've just broken the state.
2011-01-30 18:09:25 +10:00
Tom Stellard
8f32c6cfc6 r300/compiler: Standardize the number of bits used by swizzle fields
Swizzles are now defined everywhere as a field with 12 bits that contains
4 channels worth of meaningful information.  Any channel that is unused is
set to RC_SWIZZLE_UNUSED.  This change is necessary because rgb instructions
and alpha instructions were initializing channels that would never be used
(channel 3 for rgb and channels 1-3 for alpha) with 0 (aka RC_SWIZZLE_X).
This made it impossible to use generic helper functions for swizzles,
because sometimes a channel value of 0 meant unused and other times it
meant RC_SWIZZLE_X.

All hacks that tried to guess how many channels were relevant have
also been removed.
2011-01-29 21:32:02 -08:00
Marek Olšák
debc45bca0 r300g: upload translated indices via the uploader 2011-01-30 03:29:49 +01:00
Marek Olšák
8d0a540020 r300g: rework vertex format fallback
1) Only translate the [min_index, max_index] range.
2) Upload translated vertices via the uploader.
3) Rename valid_vertex_buffer[] to real_vertex_buffer[]
2011-01-30 03:29:48 +01:00
Marek Olšák
77900843b4 r600g: upload translated indices via the uploader 2011-01-30 03:29:48 +01:00
Marek Olšák
73a40d1383 r600g: rework vertex format fallback
1) Only translate the [min_index, max_index] range.
2) Upload translated vertices via the uploader.
2011-01-30 03:29:48 +01:00
Marek Olšák
70e656b4eb r600g: fix vertex format fallback
This fixes:
- piglit/draw-vertices
- piglit/draw-vertices-half-float
2011-01-30 03:29:48 +01:00
Marek Olšák
8c631cfeae r600g: rework vertex buffer uploads
Only upload the [min_index, max_index] range instead of [0, userbuf_size].
This an important optimization.

Framerate in Lightsmark:
Before: 22 fps
After: 75 fps

The same optimization is already in r300g.
2011-01-30 03:29:48 +01:00
Marek Olšák
15730a8207 r600g: consolidate set_constant_buffer functions 2011-01-30 03:29:48 +01:00
Marek Olšák
73fb2b7c90 r600g: consolidate vertex_buffer_update functions 2011-01-30 03:29:48 +01:00
Marek Olšák
2d7738eb2b r600g: consolidate draw_vbo functions (v2)
Added a conditional to spi_update per Dave's comment.
2011-01-30 03:29:48 +01:00
Marek Olšák
5cefe1eddd r600g: make r600_drawl inherit pipe_draw_info 2011-01-30 03:29:48 +01:00
Marek Olšák
02f8f13464 r600g: add back u_upload_mgr integration
I can't see a performance difference with this code, which means all
the driver-specific code removed in this commit was unnecessary.

Now we use u_upload_mgr in a slightly different way than we did before it got
dropped. I am not restoring the original code "as is" due to latest
u_upload_mgr changes that r300g performance benefits from.

This also fixes:
- piglit/fp-kil
2011-01-30 03:29:48 +01:00
Christoph Bumiller
f8a7a0b6f3 nvc0: implement transform feedback state 2011-01-30 01:25:41 +01:00
Christoph Bumiller
7fd29468ec nvc0: enable PIPE_CAP_ARRAY_TEXTURES and fix them 2011-01-29 23:57:52 +01:00
Chia-I Wu
218381d927 egl_dri2: Export glapi symbols for DRI drivers.
When an app loads libEGL.so dynamically with RTLD_LOCAL, loading DRI
drivers would fail because of missing glapi symbols.  This commit makes
egl_dri2 load libglapi.so with RTLD_GLOBAL to export glapi symbols for
future symbol resolutions.

The same trick can be found in GLX.  However, egl_dri2 can only do so
when --enable-shared-glapi is given.  Because, otherwise, both libGL.so
and libglapi.so define glapi symbols and egl_dri2 cannot tell which
library to load.
2011-01-30 05:28:24 +08:00
Chia-I Wu
f36cba6cf3 egl: Make the transition to built-in drivers more smooth.
When the user sets EGL_DRIVER to egl_dri2 (or egl_glx), make sure the
built-in driver is used.  The user might leave the outdated egl_dri2.so
(or egl_glx.so) on the filesystem and we do not want to load it.
2011-01-30 04:55:08 +08:00
Chia-I Wu
b825e49552 mapi: Workaround a bug in makedepend.
makedepend would crash when a source includes a header indirectly, such
as

  #define HEADER "some-header.h"
  #include HEADER

Do not define HEADER (makedepend would detects this as an incomplete
include) and add the dependency manually in the Makefile.

This should hopefully fix bug #33374.
2011-01-29 19:22:54 +08:00
Marek Olšák
2a456dc123 u_blitter: use user buffers instead of real buffers
User buffers may be the fastest way to upload data.
2011-01-29 05:17:43 +01:00
Brian Paul
c5fb0518f4 gallium/docs: add info about transfer boxes and array textures 2011-01-28 20:25:27 -07:00
Brian Paul
f9a36a496f gallium: added comments to pipe_transfer 2011-01-28 20:25:27 -07:00
Brian Paul
1dd8e27578 st/mesa: fix texture array dimensions
For 1D/2D texture arrays use the pipe_resource::array_size field.
In OpenGL 1D arrays texture use the height dimension as the array
size and 2D array textures use the depth dimension as the array size.
Gallium uses a special array_size field instead.  When setting up
gallium textures or comparing Mesa textures to gallium textures we
need to be extra careful that we're comparing the right fields.

The new st_gl_texture_dims_to_pipe_dims() function maps OpenGL
texture dimensions to gallium texture dimensions and simplifies
this quite a bit.
2011-01-28 20:25:27 -07:00
Brian Paul
80777743b7 softpipe: fix array textures to use resource array_size
Don't use height for 1D array textures or depth for 2D array textures.
2011-01-28 20:25:27 -07:00
Brian Paul
b3cfcdf923 mesa: fix typo, wrap long line 2011-01-28 20:25:26 -07:00
Brian Paul
db3a8af7f9 st/mesa: pass layers param to st_texture_create() 2011-01-28 20:25:26 -07:00
Carl Worth
2a18d1950c Revert "glcpp: Demote "macro redefined" from an error to a warning"
This reverts commit d3df641f0a.

The original commit had sat unpushed on my machine for months. By the
time I found it again, I had forgotten that we had decided not to use
this change after all, (the relevant test was removed long ago).
2011-01-29 08:21:05 +10:00
Jakob Bornecrantz
3451ee056c util: Fix leak of transfers in upload manager 2011-01-28 22:10:53 +01:00
Brian Paul
e89fc33d7a docs: removed VC8 project files 2011-01-28 13:40:47 -07:00
Brian Paul
f247175e4a mesa: omit VC8 project files from tarball 2011-01-28 13:40:47 -07:00
Thierry Vignaud
d3d6beec96 Fix missing files in Mesa tarballs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-01-28 12:31:04 -08:00
Chad Versace
c494763579 mesa: Fix available APIs for AMD_conservative_depth
Remove ES2, since AMD_conservative_depth is not listed in the OpenGL ES
extension registry.
2011-01-28 11:19:51 -08:00
Marek Olšák
c6ace30028 r300/compiler: print stats based on the initial number of instructions
The same number of shaders is now printed regardless of optimizations being
enabled or not, so that we can compare shader stats side by side easily.
2011-01-28 19:37:31 +01:00
Marek Olšák
0029979eee r300g: fix resource_copy_region for DXT SRGB formats 2011-01-28 17:15:22 +01:00
Carl Worth
d3df641f0a glcpp: Demote "macro redefined" from an error to a warning
The GLSL specification is vague here, (just says "as is standard for
C++"), though the C specifications seem quite clear that this should
be an error.

However, an existing piglit test (CorrectPreprocess11.frag) expects
this to be a warning, not an error, so we change this, and document in
README the deviation from the specification.
2011-01-28 15:16:36 +10:00
Dave Airlie
476db2bd3d dri: add a placeholder for the framebuffer sRGB capable bit.
This is needed to build the X server GLX_EXT_framebuffer_sRGB bits.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-28 11:45:44 +10:00
Dimitry Andric
cfb9aae3ec glapi: add @GOTPCREL relocation type
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
This replaces commit 731ec60da3

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-27 18:04:57 -07:00
Marek Olšák
6dc0a0e71f r600g: handle PIPE_CAP_ARRAY_TEXTURES 2011-01-28 01:58:30 +01:00
Marek Olšák
588c925224 r300g: handle PIPE_CAP_ARRAY_TEXTURES 2011-01-28 01:56:57 +01:00
Marek Olšák
baf2a795eb r300g: 8x8-compressed zbuffer can only be point-sampled 2011-01-28 01:16:27 +01:00
Marek Olšák
2050f2ab96 r300g: fix and re-enable 8x8 zbuffer compression mode
Also cleanup the whole thing.
2011-01-28 01:04:51 +01:00
Marek Olšák
82e60236a9 r300g: print driver info if RADEON_DEBUG=info 2011-01-27 23:17:41 +01:00
Marek Olšák
39f16e2aa7 r300g: add winsys flag CAN_AACOMPRESS 2011-01-27 23:13:28 +01:00
Marek Olšák
2e3ccada07 r300g: rename flag squaretiling -> drm_2_1_0 2011-01-27 23:06:15 +01:00
Marek Olšák
e0b98cde41 docs: update GL3 status 2011-01-27 21:17:25 +01:00
Marek Olšák
387fe8dd47 util: fix parsing debug options
So that 'foo' can be found in: OPTION=prefixfoosuffix,foo

Also allow that debug options can be separated by a non-alphanumeric characters
instead of just commas.
2011-01-27 20:32:03 +01:00
Marek Olšák
db299a9f82 r300g: fix some bugs with zbuffer compression (v4)
This drops the memblock manager for ZMASK. Instead, only one zbuffer can be
compressed at a time. Note that this does not necessarily have to be slower.
When there is a large number of zbuffers, compression might be used more often
than it was before. It's also easier to debug.

How it works:
1) 'clear' turns the compression on.
2) If some other zbuffer is set or the currently-bound zbuffer is used
   for texturing, the driver decompresses it and then turns the compression off.

Notes:
- The ZMASK clear has been refactored, so that only one packet3 is used to clear
  ZMASK.
- The 8x8 compression mode is disabled. I couldn't make it work without issues.
- Also removed driver-specific stuff from u_blitter.

Driver status:
- RV530 and R580 appear to just work (finally).
- RV570 should work, but there may be an issue that we don't correctly
  calculate the number of dwords to clear, resulting in a partially
  uninitialized zbuffer.
- RS690 misrenders as if no ZMASK clear happened. No idea what's going on.
- RV350 may even hardlock. This issue was already present and this patch doesn't
  fix it.

I think we are still missing some hardware info we need to make the zbuffer
compression work fully.

Note that there is also an issue with HiZ, resulting in a sort of blocky
zigzagged corruption around some objects.
2011-01-27 18:12:01 +01:00
Brian Paul
7a4345fd83 glsl: use 'this' pointer to be consistent 2011-01-26 21:16:41 -07:00
Brian Paul
2b7be12d54 glsl: remove needless conditional 2011-01-26 21:16:32 -07:00
Brian Paul
86471246f0 glsl: move ir_var_out code 2011-01-26 21:16:14 -07:00
Brian Paul
7baa498ae4 glsl: move ir_var_system_value code 2011-01-26 21:15:52 -07:00
Brian Paul
304b239869 glsl: use local var to simplify code a bit 2011-01-26 21:15:39 -07:00
Zack Rusin
59dbdbbb7d mesa: fix compilation
this isn't c++ please don't mix declerations with code
2011-01-26 21:20:53 -05:00
Chad Versace
67c67ee80f glsl: Refresh autogenerated lexer file
For previous commit.
2011-01-26 16:37:45 -08:00
Chad Versace
cc4a787044 glsl: Remove extraneously extraneous parens
I found this parenthetical usage of parentheses to be extraneously
extraneous:
   (yyextra->ARB_fragment_coord_conventions_enable)
2011-01-26 16:37:45 -08:00
Chad Versace
ad3dc370d8 mesa: Allow extensions in MESA_EXTENSION_OVERRIDE to be prefixed with '+'
If an extension is prefixed with '+', attempt to enable it.  This
introduces symmetry with the prefix '-', which is already allowed.
2011-01-26 16:37:45 -08:00
Chad Versace
7cbcf4c583 mesa: Simplify logic in get_extension_override()
* Reduce max indentation level from 7 to 3.
* Eliminate counter variables.
* Remove function append().
2011-01-26 16:37:45 -08:00
Chad Versace
8ba260e099 glsl: Enable AMD_conservative_depth in parser
All the necessary compiler infrastructure for AMD_conservative_depth is in
place, so it's safe to enable it in the parser.
2011-01-26 16:37:45 -08:00
Chad Versace
a1b83464ff mesa: Propagate gl_FragDepth layout from GLSL IR to Mesa IR 2011-01-26 16:37:45 -08:00
Chad Versace
addae33d6b glsl: Raise linking error if gl_FragDepth layout is inconsistent
From the AMD_conservative_depth spec:
   If gl_FragDepth is redeclared in any fragment shader in a program, it
   must be redeclared in all fragment shaders in that program that have
   static assignments to gl_FragDepth. All redeclarations of gl_FragDepth in
   all fragment shaders in a single program must have the same set of
   qualifiers.
2011-01-26 16:37:45 -08:00
Chad Versace
bc04d244f5 glsl: Propagate depth layout qualifier from AST to IR 2011-01-26 16:37:44 -08:00
Chad Versace
5fc57f471b glsl: Define enum ir_depth_layout 2011-01-26 16:37:44 -08:00
Chad Versace
39cad66a88 glsl: Refresh autogenerated parser files
For commits titled:
glcpp: Conditionally define macro GL_AMD_conservative_depth
glsl: Add support for AMD_conservative_depth to parser
2011-01-26 16:37:44 -08:00
Chad Versace
fb5db0570c glsl: Add support for AMD_conservative_depth to parser
When AMD_conservative_depth is enabled:
* Let 'layout' be a token.
* Extend the production rule of layout_qualifier_id to process the tokens:
   depth_any
   depth_greater
   depth_less
   depth_unchanged
2011-01-26 16:37:44 -08:00
Chad Versace
565a22090c glsl: Add depth layout qualifiers to ast_type_qualifier 2011-01-26 16:37:44 -08:00
Chad Versace
0423f24eb8 glcpp: Conditionally define macro GL_AMD_conservative_depth
Define macro GL_AMD_conservative_depth to 1 when its extension is
enabled.
2011-01-26 16:37:44 -08:00
Chad Versace
1aeecaa433 mesa: Add AMD_conservative_depth to extension list
The extension is off by default.

First in a patchset that implements support for AMD_conservative_depth in
the compiler.
2011-01-26 16:37:44 -08:00
Brian Paul
8697dbdfbc tgsi: add cases for array textures
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33555
2011-01-26 16:22:32 -07:00
Kristian Høgsberg
3fe0185ba5 mesa: Support internalFormat=GL_BGRA for DRI drivers 2011-01-26 15:05:46 -05:00
Kristian Høgsberg
e28ecdee03 st/egl: Downgrade warning to debug when we can't create a drm screen
We try to load a DRI driver if this fails so don't confuse users.
2011-01-26 10:47:03 -05:00
Brian Paul
684c66bb8b mesa: fix MESA/EXT typo
Spotted by Bernd Buschinski.
2011-01-26 08:01:31 -07:00
Marek Olšák
c7c733545a util: require debug options to be separated by commas
Let's assume there are two options with names such that one is a substring
of another. Previously, if we only specified the longer one as a debug option,
the shorter one would be considered specified as well (because of strstr).
This commit fixes it by checking that each option is surrounded by commas.

(a regexp would be nicer, but this is not a performance critical code)
2011-01-26 10:48:21 +01:00
Zack Rusin
0657fc00dd gallium: add an interface for query predicates
as specified in the arb_occlusion_query2. just the interface.
2011-01-26 00:03:12 -05:00
Brian Paul
779e9cb658 softpipe: support for 1D/2D texture arrays 2011-01-25 20:27:10 -07:00
Brian Paul
9b56a2cb62 st/mesa: support for 1D/2D texture arrays 2011-01-25 20:26:22 -07:00
Brian Paul
c0d941877b tgsi: add support for 1D/2D texture arrays 2011-01-25 20:25:53 -07:00
Tormod Volden
903185bf3b configure.ac: define LIBDRM_INTEL_REQUIRED
To have the LIBDRM* requirements in one place

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 18:53:00 -07:00
Brian Paul
0bfd174fb5 mesa: remove isProxy local var 2011-01-25 18:53:00 -07:00
Brian Paul
365f658602 mesa: use texFormat local var in more places 2011-01-25 18:53:00 -07:00
Brian Paul
f322400970 mesa: consolidate error handling code in _mesa_GetTexLevelParameteriv() 2011-01-25 18:53:00 -07:00
Brian Paul
0f6b8e29ab mesa: consolidate error handling in set_tex_parameteri() 2011-01-25 18:53:00 -07:00
Brian Paul
f2dd11817a mesa: add checks for GL_EXT_texture_array
In case the driver enables GL_MESA_texture_array but not the EXT version.
2011-01-25 18:53:00 -07:00
Ian Romanick
0f4b2a0a23 linker: Propagate max_array_access while linking functions
Update the max_array_access of a global as functions that use that
global are pulled into the linked shader.

Fixes piglit test glsl-fs-implicit-array-size-01 and bugzilla #33219.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 13:41:26 -08:00
Ian Romanick
c87e9ef4d2 linker: Set sizes for non-global arrays as well
Previously only global arrays with implicit sizes would be patched.
This causes all arrays that are actually accessed to be sized.

Fixes piglit test glsl-fs-implicit-array-size-02.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 13:41:26 -08:00
Ian Romanick
5c2cec8337 ir_to_mesa: Add several assertions about sizes of arrays
Both of these assertions are triggered by the test case in bugzilla
size of 0.
2011-01-25 13:41:26 -08:00
Brian Paul
9f2bf3d65c glsl: silence uninitialized var warning in read_texture()
And generate an error if the texture pattern is not matched.
2011-01-25 13:11:47 -07:00
Mathias Fröhlich
90c2fd8640 r600g: Implement timer queries. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich
e7ec532735 r600g: Implement asyncronous query results. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich
b55fd961e1 r600g: Fix meaning of num_results for queries. 2011-01-25 14:18:19 -05:00
Tim Wiederhake
4102c7c7e2 fix potential leak in r600_context_init 2011-01-25 14:18:19 -05:00
Tim Wiederhake
9d41e5ee46 silences some valgrind warnings
==5547== Conditional jump or move depends on uninitialised value(s)
==5547==    at 0x8FE745D: r600_drm_winsys_create (r600_drm.c:86)
2011-01-25 14:18:19 -05:00
Brian Paul
ba0953da5b Revert "glapi: adding missing @GOTPCREL qualifer in glapi_x86-64.S"
This reverts commit 731ec60da3.

This change causes crashes in the x86-64 dispatch code.
2011-01-25 12:12:34 -07:00
Brian Paul
40ac24e631 softpipe: fix off-by-one error in setup_fragcoord_coeff()
If we invert Y, need to subtract one from the surface height.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=26795
for softpipe.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 11:58:15 -07:00
Brian Paul
23490d7a8b st/mesa: add comments in emit_wpos() 2011-01-25 11:57:10 -07:00
Brian Paul
bb56631f0c st/mesa: fix incorrect fragcoord.x translation
emit_adjusted_wpos() needs separate x,y translation values.  If we
invert Y, we don't want to effect X.

Part of the fix for http://bugs.freedesktop.org/show_bug.cgi?id=26795

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 11:54:07 -07:00
Dimitry Andric
37bffe8d12 glapi: adding @ char before type specifier in glapi_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33433
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 09:23:46 -07:00
Dimitry Andric
731ec60da3 glapi: adding missing @GOTPCREL qualifer in glapi_x86-64.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 09:22:14 -07:00
Roland Scheidegger
7acb98c67c svga: link libwsw for dri-vmwgfx target with make build system too 2011-01-25 16:32:32 +01:00
Marek Olšák
02d7d9ec36 u_blitter: remove bogus assertion
The module uses the 3D engine, so it can blit non-compatible formats.
2011-01-25 05:51:49 +01:00
Marek Olšák
9a3523e38b u_blitter: report recursion, update comments 2011-01-25 05:51:49 +01:00
Vinson Lee
db4f6c7eeb nvc0: Move declaration before code.
Fixes nvc0 SCons build.
2011-01-24 20:04:31 -08:00
Zack Rusin
3fa814d7f8 gallium/tgsi: update the docs for the new opcodes a bit 2011-01-24 21:46:03 -05:00
Brian Paul
d30156525f mesa: add red, red/green formats in _mesa_base_fbo_format() 2011-01-24 19:38:52 -07:00
Brian Paul
62c66b3430 mesa: plug in fallback function for ctx->Driver.ValidateFramebuffer()
The software renderer doesn't support GL_ALPHA, GL_LUMINANCE, etc
so we should report GL_FRAMEBUFFER_UNSUPPORTED during FBO validation.
2011-01-24 19:38:52 -07:00
Brian Paul
976ea9d76b mesa: new cases in _mesa_base_fbo_format()
The set of internalFormat parameters accepted by glRenderBufferStorage
depends on the EXT vs. ARB version of framebuffer_object.  The later
added support for GL_ALPHA, GL_LUMINANCE, etc. formats.  Note that
these formats might be legal but might not be supported.  That should
be checked with glCheckFramebufferStatus().
2011-01-24 19:38:52 -07:00
Brian Paul
f41bbc7c44 Revert "mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages."
This reverts commit 65c41d55a0.

There really are quite a few differences in the set of internal
formats allowed by glTexImage and glRenderbufferStorage.
2011-01-24 19:38:52 -07:00
Vinson Lee
e24f1ea594 scons: Add nvc0 to SConscript. 2011-01-24 17:48:24 -08:00
Brian Paul
99c67f27d3 vega: implement handler/pointer conversion using a hash table
Before, we were just casting between 32-bit VGHandles and 64-bit pointers.
2011-01-24 18:12:49 -07:00
Brian Paul
f3e6edc70b vega: remove redundant functions found elsewhere 2011-01-24 18:12:49 -07:00
Brian Paul
d41e694cf7 vega: replace casts with pointer/handle conversion functions
Per the spec, all OpenVG handles are 32-bit.  We can't just cast them
to/from integers on 64-bit systems.

Start fixing that mess by introducing a set of handle/pointer conversion
functions in handle.h.  The next step is to implement a handle/pointer
hash table...
2011-01-24 18:12:49 -07:00
Julien Cristau
4324d6fdfb glx: fix request lengths
We were sending too long requests for GLXChangeDrawableAttributes,
GLXGetDrawableAttributes, GLXDestroyPixmap and GLXDestroyWindow.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 18:10:38 -07:00
Jakob Bornecrantz
c523f31f4a svga: Add more swrast debuging 2011-01-25 01:00:07 +01:00
Jakob Bornecrantz
daaf542220 svga: Use get once helpers for context debug envs 2011-01-25 00:58:46 +01:00
Jakob Bornecrantz
becb733dbc rbug: Fix surface reference leak 2011-01-25 00:58:46 +01:00
Jakob Bornecrantz
4fabdf72ea glsl: Fix mingw crosscompile 2011-01-25 00:58:46 +01:00
Henri Verbeet
1af59b28b5 r600g: FLT_TO_INT* are vector instructions on Evergreen.
FLT_TO_INT is a vector instruction, despite what the (current) documentation
says. FLT_TO_INT_FLOOR and FLT_TO_INT_RPI aren't explicitly mentioned in the
documentation, but those are vector instructions too.
2011-01-25 00:35:34 +01:00
Zack Rusin
3d9138781d graw: add a test showing the new sampling scheme in action 2011-01-24 17:53:29 -05:00
Zack Rusin
bdbe77f9c6 gallium: implement modern sampling scheme
largely a merge of the previously discussed origin/gallium-resource-sampling
but updated.
the idea is to allow arbitrary binding of resources, the way opencl, new gl
versions and dx10+ require, i.e.
    DCL RES[0], 2D, FLOAT

    LOAD DST[0], SRC[0], RES[0]
    SAMPLE DST[0], SRC[0], RES[0], SAMP[0]
2011-01-24 17:47:10 -05:00
Benjamin Franzke
b066983780 st/mesa: Enable EXT_texture_format_BGRA8888 for gles1/2 2011-01-24 16:41:29 -05:00
Benjamin Franzke
c5c1dc8b3f st/mesa: support internalFormat=GL_BGRA in TexImage2D 2011-01-24 16:41:29 -05:00
Benjamin Franzke
8bfbcba2b7 mesa/es: require internalFormat==format in TexImage2D 2011-01-24 16:41:29 -05:00
Benjamin Franzke
f1452844fe mesa: allow internalFormat=GL_BGRA_EXT in TexImage2D 2011-01-24 16:41:29 -05:00
Dimitry Andric
811ee32a9e mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33386
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 14:37:52 -07:00
Dimitry Andric
3fda80246f mesa: s/movzx/movzbl/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33388
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 14:34:28 -07:00
Kenneth Graunke
e0c4a59dc6 glsl: Remove long unused 'configure.ac' file.
This was from way back when glsl2 lived in its own repository.
2011-01-24 10:33:38 -08:00
José Fonseca
92badb4c8c draw: Do not use LLVM's opaque types.
Contrary what the name may suggest, LLVM's opaque types are used for
recursive types -- types whose definition refers itself -- so opaque
types correspond to pre-declaring a structure in C. E.g.:

   struct node;

   struct link {
      ....
      struct node *next;
   };

   struct node {
      struct link link;
   }

Void pointers are also disallowed by LLVM. So the suggested way of creating
what's commonly referred as "opaque pointers" is using byte pointer (i.e.,
uint8_t * ).
2011-01-24 17:27:14 +00:00
Tim Wiederhake
d14764815c add machine generated files to .gitignore
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 09:17:57 -07:00
Tim Wiederhake
c48dd8049c secure malloc in translate_cache_create
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 09:17:54 -07:00
Christopher James Halse Rogers
7d6abd254a osmesa: mklib requires arguments before objects
Fixes the build when selecting driver=osmesa and building static libraries.
Otherwise, mklib tries to add the ‘-ltalloc’ object to the archive, which
obviously fails.

Clients which statically link to osmesa will need to link to libtalloc also,
as specified in the Libs.private of osmesa.pc.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=33360

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 07:53:24 -07:00
Michel Dänzer
be0665b461 st/xorg: Fix build failure against xserver with XF86_CRTC_VERSION < 3.
Reported by Vinson Lee.
2011-01-24 15:48:13 +01:00
Marek Olšák
db234176b1 r300g: remove unused function 2011-01-24 13:37:23 +01:00
Marek Olšák
09109c11d9 r300g: remove any traces of depth_clamp
I couldn't make it work.

GB_TILE_CONFIG.Z_EXTENDED, which enables per-pixel Z clamping, and
VAP_CLIP_CNTL.CLIP_DISABLE, which disables clipping, do help, but they
also add regressions like random graphics corruptions in some games.
2011-01-24 13:32:52 +01:00
Marek Olšák
d78a984baa r300g: handle PIPE_CAP_INSTANCED_DRAWING in get_param 2011-01-24 11:40:26 +01:00
Andre Maasikas
92767e9052 r600c: only colors can be flat shaded
fixes stellarium text and menu display
2011-01-24 10:23:19 +02:00
Jakob Bornecrantz
b7d2919e8e util: Add function logger helpers 2011-01-24 03:37:57 +01:00
Jakob Bornecrantz
a82408c353 Revert "r300g/swtcl: re-enable LLVM"
This reverts commit 88550083b3.
2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
4c73030d47 draw: Init llvm if not provided 2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
832029e1c1 i915g: Remove draw_flushes and state that we don't need to track 2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
9a9630dcf0 i915g: Improve constant handling 2011-01-24 03:26:59 +01:00
Tom Stellard
c40ec20c27 r300g: Increase fragment shader limits for r400 cards
r400 fragment shaders now support up to 64 temporary registers,
512 ALU instructions, and 512 TEX instructions.
2011-01-23 17:47:48 -08:00
Brian Paul
1bf3c75825 gldirect: remove _NEW_ACCUM 2011-01-23 14:06:21 -07:00
Brian Paul
c78b48d808 i965: remove _NEW_ACCUM 2011-01-23 14:06:21 -07:00
Christoph Bumiller
a287a758c6 nvc0: implement point coord replacement
But we have to cheat and peek at the GENERIC semantic indices the
state tracker uses for TEXn.
Only outputs from 0x300 to 0x37c can be replaced, and so we have to
know on shader compilation which ones to put there in order to keep
doing separate shader objects properly.

At some point I'll probably create a patch that makes gallium not
force us to discard the information about what is a TexCoord.
2011-01-23 21:35:27 +01:00
Marek Olšák
f154cd2315 mesa: add ARB_framebuffer_sRGB as alias of the EXT variant
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-23 20:59:46 +01:00
Marek Olšák
81ae8c6313 mesa: return GL_LINEAR for ..COLOR_ENCODING if framebuffer_sRGB is unsupported
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-23 20:59:46 +01:00
Brian Paul
2dac3f995b vega: sort filenames in Makefile, SConscript 2011-01-23 10:15:07 -07:00
Brian Paul
fb7efb1b19 mesa: get rid of _NEW_ACCUM, clean-up _NEW_* #defines
The _NEW_ACCUM flag was only set when changing the accumulation
buffer clear color and never used anywhere.  Reclaim that dirty bit.
Clean up the definitions of the other dirty bit flags.
2011-01-23 09:50:52 -07:00
Brian Paul
f4dc24a0b5 mesa: smarter glTexParameter state invalidation
Only a few texture object parameters can effect texture completeness:
min level, max level, minification filter.  Don't mark the texture
incomplete for other texture object state changes.
2011-01-23 09:50:52 -07:00
Marek Olšák
91eba2567e r300g: support sRGB colorbuffers
We are not required to do the linear->sRGB conversion if ARB_framebuffer_sRGB
is unsupported. However I think the conversion should work in hw except
for blending, which matches the D3D9 behavior.
2011-01-23 13:32:56 +01:00
Marek Olšák
ffcdd49c69 r300/compiler: remove any code related to relative addressing of temporaries
The hw can't do it and the code was useless anyway (it's lowered
in the GLSL compiler).
2011-01-23 13:32:56 +01:00
Christoph Bumiller
835c4ea105 nvc0: fix emit_cvt for ceil, floor and trunc 2011-01-23 13:09:10 +01:00
Christoph Bumiller
95eef7a705 nvc0: remove bad assert and emit TEMP movs instead 2011-01-23 13:07:30 +01:00
Christoph Bumiller
f9bb1c8b33 nvc0: fix address and value slot assignment in load combining 2011-01-23 13:05:44 +01:00
Christoph Bumiller
005d186d66 nvc0: don't omit highest bit of branch target
Fixes negative relative branch offsets.
2011-01-23 13:03:20 +01:00
Christoph Bumiller
419ff10b0e nvc0: recognize r63 as zero in constant folding 2011-01-23 13:03:15 +01:00
Christoph Bumiller
bf1df06773 nvc0: add MARK_RING where missing to avoid too many relocs errors 2011-01-23 13:03:10 +01:00
Christoph Bumiller
49f16c96f1 nvc0: don't apply base vertex to per-instance arrays 2011-01-23 13:03:00 +01:00
Christoph Bumiller
c18aa3c73f nvc0: commute sources of SET too if beneficial 2011-01-23 13:01:33 +01:00
Christoph Bumiller
8e572998fc nvc0: accept neg abs modifiers on lg2 2011-01-23 13:01:22 +01:00
Ian Romanick
2db46fe5f0 glsl: Don't assert when the value returned by a function has no rvalue
The rvalue of the returned value can be NULL if the shader says
'return foo();' and foo() is a function that returns void.

Existing GLSL specs do *NOT* say that this is an error.  The type of
the return value is void.  If the return type of the function is also
void, then this should compile without error.  I expect that future
versions of the GLSL spec will fix this (wink, wink, nudge, nudge).

Fixes piglit test glsl-1.10/compiler/expressions/return-01.vert and
bugzilla #33308.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-22 18:04:40 -08:00
Brian Paul
9d380f487a st/mesa: ensure that all pixel paths operation on linear RGB data, not sRGB
Before, we were converting between linear/sRGB in glReadPixels,
glDrawPixels, glAccum, etc if the renderbuffer was an sRGB texture.
Those all need to operate on pixel values as-is without conversion.

Also, when setting up render-to-texture, if the texture is sRGB the
pipe_surface view must be linear RGB.  This will change when we
support GL_ARB_framebuffer_sRGB.

This fixes http://bugs.freedesktop.org/show_bug.cgi?id=33353
2011-01-22 18:33:35 -07:00
Brian Paul
4c9ad084c1 softpipe: pass surface format to get/put_tile functions
When we read/write image tiles we need to use the format specified
in the pipe_surface, not the pipe_transfer format (which comes from
the underlying texture/resource format).

This comes up when rendering to sRGB surfaces (via OpenGL render to
texture).  Ignoring the new GL_ARB/EXT_framebuffer_sRGB extension
for now, when we render to a sRGB surface we need to treat it like
a regular, linear colorspace RGB surface.  Before, when we read/wrote
tiles to sRGB surfaces we were inadvertantly doing the color space
conversion.
2011-01-22 18:33:35 -07:00
Brian Paul
e75844b4e0 gallium/util: added pipe_put_tile_rgba_format() 2011-01-22 18:33:35 -07:00
Brian Paul
3ce1ec853b gallium/util: simplify pipe_get_tile_rgba()
Implement it in terms of pipe_get_tile_rgba_format()
2011-01-22 18:33:35 -07:00
Brian Paul
90671fcdda gallium/softpipe: replace pipe_get_tile_swizzle()
The new function, pipe_get_tile_rgba_format(), no longer takes a
swizzle (we weren't actually using it anywhere).  Rename it to
indicate that the format is passed explicitly.
2011-01-22 18:33:35 -07:00
Brian Paul
4e2c077879 softpipe: use proper type for format field 2011-01-22 18:33:35 -07:00
Brian Paul
11fbdf726d gallium/util: added util_format_linear() 2011-01-22 18:33:35 -07:00
Brian Paul
4c251b8861 st/mesa: update comment, use st_fb_orientation() 2011-01-22 18:33:35 -07:00
Brian Paul
bd67962c5e st/mesa: comments in update_viewport() 2011-01-22 18:33:35 -07:00
Chia-I Wu
bb770af3a5 scons: Add support for GLES.
GLES can be enabled by running scons with

  $ scons gles=yes

When gles=yes is given, the build is changed in three ways.  First,
libmesa.a will be built with FEATURE_ES1 and FEATURE_ES2.  This makes
DRI drivers and libEGL support and advertise GLES support.  Second, GLES
libraries will be created.  They are libGLESv1_CM, libGLESv2, and
libglapi.  Last, libGL or opengl32 will link to libglapi.  This change
is required as _glapi_* will be declared as __declspec(dllimport) in
libmesa.a on windows.  libmesa.a expects those symbols to be defined in
another DLL.  Due to this change to GL, GLES support is marked
experimental.

Note that GLES requires libxml2-python to generate some of its sources.
2011-01-22 11:59:05 +08:00
Chia-I Wu
3f04314ae2 mapi: ENTRY_CURRENT_TABLE_GET should be stringified.
So that it can be renamed to _glapi_get_dispatch.
2011-01-22 11:58:38 +08:00
Kenneth Graunke
0db3161036 glcpp: Regenerate parser files. 2011-01-21 15:41:19 -08:00
Kenneth Graunke
6ecee54a9a glcpp: Remove use of talloc reference counting.
We almost always want to simply steal; we only need to copy when copying
a token list (in which case we're already cloning stuff anyway).
2011-01-21 15:41:19 -08:00
Kenneth Graunke
e256e4743c glsl, i965: Remove unnecessary talloc includes.
These are already picked up by ir.h or glsl_types.h.
2011-01-21 15:41:19 -08:00
Kenneth Graunke
819f92deaa ra: Use the same context when realloc'ing arrays.
The original allocations use regs->regs as the context, so talloc will
happily ignore the context given here.  Change it to match to clarify
that it isn't changing.
2011-01-21 15:39:57 -08:00
Chad Versace
b66be7518a glsl: Improve error message when read-only vars are written
Improves the cases when:
* an explicit assignment references the read-only variable
* an 'out' or 'inout' function parameter references the read-only variable
2011-01-21 14:06:28 -08:00
Chad Versace
01a584d093 glsl: Mark 'in' variables at global scope as read-only
Fixes Piglit tests:
spec/glsl-1.30/compiler/storage-qualifiers/static-write-centroid-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-02.frag
2011-01-21 14:06:28 -08:00
Chad Versace
f633b993b0 glsl: Remove unused class ast_declaration_statment 2011-01-21 14:06:25 -08:00
Jakob Bornecrantz
8af583f6e8 i915g: Don't (un)map vbuf on each (un)map call 2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
0c3352b6df i915g: Don't do unnecessary copies of constants
Even tho st/mesa use user buffers for constants align buffers
other state trackers doesn't use user buffers.
2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
2e60aa511d i915g: Don't emit FS constants when VS contants change 2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
7287964f94 i915g: Use slab allocator for transfers
Also remove unused i915_transfer struct
2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
484edfc815 st/dri: Fix warning 2011-01-21 20:53:29 +01:00
Christian König
a40305dcdb r600g: check if hardware blits are possible bevore enabling tilling 2011-01-21 19:47:24 +01:00
Alex Deucher
4b3789427f r600g: FLT_TO_INT_FLOOR is trans instruction
Add missing evergreen FLT_TO_INT_FLOOR instruction.
2011-01-21 12:41:23 -05:00
Dave Airlie
a637280e42 mesa: EXT_framebuffer_sRGB interface additions.
This adds the get/enable enums and internal gl_config storage
for this extension.

In theory this is all that is needed to enable this extension
from what I can see, since its not mandatory to implement the
features if you don't advertise the visuals or the fb configs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-21 19:56:13 +10:00
Andre Maasikas
634e889bb5 r600c: get OQ results only for 4 DBs on r600 class
- since evergreen addition which increased this to 8 depth backends
  other bytes may contain garbage values
2011-01-21 11:48:03 +02:00
Brian Paul
af4e2f4665 docs: update README.WIN32 per Karl's request 2011-01-20 18:52:53 -07:00
Ian Romanick
2fb0aebd4a intel: Fix typeos from 3d028024 and 790ff232
...and remove egg from face.
2011-01-20 13:51:07 -08:00
Ian Romanick
790ff232e2 i915: Set correct values for range/precision of fragment shader types 2011-01-20 13:35:59 -08:00
Ian Romanick
3d028024e5 i965: Set correct values for range/precision of fragment shader types 2011-01-20 13:35:59 -08:00
Ian Romanick
04dca296e0 mesa: Set correct values for range/precision of shader integer types 2011-01-20 13:35:59 -08:00
Ian Romanick
dde3270c19 mesa: Connect glGetShaderPrecisionFormat into the dispatch table 2011-01-20 13:35:59 -08:00
Brian Paul
37233f1ee0 softpipe: check for null pointers during context create/destroy
See http://bugs.freedesktop.org/show_bug.cgi?id=32309
Apparently, malloc() is failing during context creation.  Not
checking for nulls here led to crashes elsewhere.
2011-01-20 13:46:57 -07:00
Brian Paul
4ef955a12a graw: fix logic error in pixel format selection
The loop to choose a pixel format for the window was incrementing
'i' after we succeeded in creating the window so if we chose format[0]
for graw_create_window_and_screen() we were putting format[1] in
the pipe_resource template for creating the render target.

This only worked because of the order of the elements in the formats[]
array.

The graw_xlib.c code now properly compares the requested gallium pixel
format against the visual's color layout.

Update all the graw demos to fix the off-by-one-i error.
2011-01-20 13:37:26 -07:00
Ian Romanick
22eeb1b331 Fix the build from 887d2b64
Thanks to all the include frobbing, GLuint is not known in some places
that included enums.h.
2011-01-20 11:30:14 -08:00
Brian Paul
887d2b647b mesa: clean-up _mesa_lookup_prim_by_nr()
Remove the redundant public _mesa_prim_name[] array.
2011-01-20 09:44:33 -07:00
Brian Paul
fe49dcb3b0 mesa: move extra prim mode #defines 2011-01-20 09:44:33 -07:00
Brian Paul
b62e78c783 vbo: added comment 2011-01-20 09:44:33 -07:00
Brian Paul
cfae745a8b mesa: minor formatting fixes 2011-01-20 09:10:03 -07:00
Brian Paul
7330f8b2bc st/mesa: clean up the sampler view format code 2011-01-20 08:56:36 -07:00
Brian Paul
751fe9058b mesa: document sRGBDecode field 2011-01-20 08:56:36 -07:00
Brian Paul
f579a05a9f st/mesa: formatting, whitespace fixes 2011-01-20 08:56:32 -07:00
Andre Maasikas
c20778e76f r600c: bump sq gpr resources if a shader needs more than default
ideally this should be set once in the beginning of CS but there's
no way to change values there while in the middle of rendering.
For now reemitting SQ setup seems to work probably due to
r700WaitForIdleClean after each render

currently does not to try to decrease values once increased

fixes hangs in glsl-vs-vec4-indexing-temp-src-in-nested-loop-combined
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined for my rv740
maybe more for other chips
2011-01-20 13:11:56 +02:00
Chia-I Wu
e8c7d7598f glapi: Fix OpenGL and OpenGL ES interop.
When --enable-shared-glapi is specified, libGL will share libglapi with
OpenGL ES instead of defining its own copy of glapi.  This makes sure an
app will get only one copy of glapi in its address space.

The new option is disabled by default.  When enabled, libGL and libglapi
must be built from the same source tree and distributed together.  This
requirement comes from the fact that the dispatch offsets used by these
libraries are re-assigned whenever GLAPI XMLs are changed.

For GLX, indirect rendering for has_different_protocol() functions is
tricky.  A has_different_protocol() function is assigned only one
dispatch offset, yet each entry point needs a different protocol opcode.
It cannot be supported by the shared glapi.  The fix to this is to make
glXGetProcAddress handle such functions specially before calling
_glapi_get_proc_address.

Note that these files are automatically generated/re-generated

 src/glx/indirect.c
 src/glx/indirect.h
 src/mapi/glapi/glapi_mapi_tmp.h
2011-01-20 17:15:50 +08:00
Chia-I Wu
9767d3b5ad glapi: Fix OpenGL ES 1.1 and 2.0 interop.
Move _glapi_* symbols from libGLESv1_CM.so and libGLESv2.so to
libglapi.so.  This makes sure an app will get only one copy of glapi in
its address space.

Note that with this change, libGLES* and libglapi must be built from the
same source tree and distributed together.  This requirement comes from
the fact that the dispatch offsets used by these libraries are
re-assigned whenever GLAPI XMLs are changed.
2011-01-20 17:15:50 +08:00
Chia-I Wu
97185bf265 mapi: Add support for bridge mode.
In bridge mode, mapi no longer implements glapi.h.  It becomes a user of
glapi.h.  Imagine an app that uses both libGL.so and libGLESv2.so.
There will be two copies of glapi in the app's memory.  It is possible
that _glapi_get_dispatch does not return what _glapi_set_dispatch set,
if they access different copies of the global variables.  The solution
to this situation to build either one of the libraries as a bridge to
the other.  Or build both libraries as bridges to another shared
glapi library.
2011-01-20 17:15:50 +08:00
Chia-I Wu
96c52d16c1 mapi: u_current_table may be renamed.
When MAPI_MODE_GLAPI is defined, u_current_table is renamed to
_glapi_Dispatch or _glapi_tls_Dispatch.  The ASM dispatchers should not
use hardcoded name.
2011-01-20 17:15:50 +08:00
Chia-I Wu
6fc152f660 mapi: Add a new glapi.h implementation.
The new implementation is based on mapi.  No new script is needed.  As
noted in sources.mk, the way to use it is to compile MAPI_GLAPI_SOURCES
with MAPI_MODE_GLAPI defined.
2011-01-20 17:15:50 +08:00
Chia-I Wu
23a89f1872 mapi: Fix glapi printers for gl_and_es_API.xml.
Fix GLAPIPrinter, ES1APIPrinter, and ES2APIPrinter to output files that
are ready for compilation.  Since gl_and_es_API.xml is based on
gl_API.xml, the hidden and handcode attributes of entries have to be
overridden for ES1APIPrinter and ES2APIPrinter.
2011-01-20 17:15:50 +08:00
Chia-I Wu
7828f554ab mapi: Allow prefix to be macro.
Treat prefix as macro when it is all uppercase.  Generate PREFIX(name)
instead of PREFIXname when it is a macro.
2011-01-20 17:15:49 +08:00
Chia-I Wu
f71a9acf59 mapi: Add the ability to parse GLAPI XML.
A prerequisite if we want to convert vgapi.csv to vgapi.xml, or to use
mapi for glapi.
2011-01-20 17:15:49 +08:00
Chia-I Wu
323b5e323a glapi: Add gl_and_es_API.xml.
gl_and_es_API.xml defines OpenGL ES 1.1 and 2.0 API as well as OpenGL
API.  It consists of gl_API.xml and the newly added es_EXT.xml,
ARB_get_program_binary.xml, OES_single_precision.xml, and
OES_fixed_point.xml.
2011-01-20 17:15:49 +08:00
Kenneth Graunke
4fafde6a8c doxygen: Add glsl to the Makefile and .gitignore. 2011-01-19 23:49:54 -08:00
twied
aec19381ec Add machine generated files to .gitignore 2011-01-19 23:48:47 -08:00
Kenneth Graunke
21031b4e88 glsl: Don't bother unsetting a destructor that was never set.
This was totally copied and pasted from glsl_symbol_table.
2011-01-19 23:40:33 -08:00
Chia-I Wu
c116a0e2dc autoconf: Fail when --with-state-trackers is incomplete.
When --enable-openvg or --enable-gallium-egl is enabled,
--with-state-trackers must have vega or egl.
2011-01-20 15:04:34 +08:00
Henri Verbeet
21148e6a88 softpipe: Bind samplers to views instead of the underlying resource.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-19 21:47:27 -07:00
Henri Verbeet
54fdc351dd softpipe: Get rid of the redundant resource parameter to get_sampler_variant().
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-19 21:47:27 -07:00
Dave Airlie
8c68362d7c r200: fix up some problems with TFP on r200 2011-01-20 14:35:09 +10:00
Brian Paul
7e86d9bd8c llvmpipe: implement TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33284
2011-01-19 18:46:59 -07:00
Eric Anholt
b41d323c90 i965/fs: Take the shared mathbox into account in instruction scheduling.
I don't have evidence for this amounting to any improvement,
but it does codify a bit more what we understand so far about
the pipeline.
2011-01-19 16:30:00 -08:00
Eric Anholt
382c2d99da i965/fs: Add a helper function for detecting math opcodes. 2011-01-19 16:29:14 -08:00
Eric Anholt
1991d92207 i965/fs: Assign URB/CURB register numbers after instruction scheduling.
This fixes a bunch of unnecessary barriers due to the scheduler not
knowing what that arbitrary register description refers to when trying
to reason about its dependencies.

The result is rescheduling in the convolution kernel shader in
Lightsmark, which results in avoiding register spilling and increasing
the performance of the first scene from 6-7 fps midway through the
panning to 11fps.  The register spilling was a regression from Mesa
7.9 to Mesa 7.10.
2011-01-19 16:29:14 -08:00
Eric Anholt
63879d90ac i965/fs: Add an instruction scheduler.
Improves performance of my GLSL demo by 5.1% (+/- 1.4%, n=7).  It also
reschedules the giant multiply tree at the end of
glsl-fs-convolution-1 so that we end up not spilling registers,
producing the expected level of performance.
2011-01-19 16:29:11 -08:00
Eric Anholt
3f2fe31eee i965/fs: Add a helper for detecting texturing opcodes. 2011-01-19 16:29:10 -08:00
Christian König
a124490262 r600g: fix segfault if texture operand is a literal
This fixes Bug 33262
2011-01-19 23:48:02 +01:00
Brian Paul
3ee60a3558 mesa: implement glGetShaderPrecisionFormat()
Drivers should override the default range/precision info as needed.
No drivers do this yet.
2011-01-19 07:41:55 -07:00
Brian Paul
34613c66ac gallium/docs: document result type for some types of queries 2011-01-19 07:41:55 -07:00
Dave Airlie
a5da4acb95 radeon: avoid segfault on 3D textures.
This is a candidate for 7.9 and 7.10
2011-01-19 16:27:13 +10:00
Dave Airlie
4832403c38 radeon: oops didn't need this logbase2 fn 2011-01-19 16:17:03 +10:00
Dave Airlie
c6fb88fc5a radeon: calculate complete texture state inside TFP function
(really not sure why I'm doing this).

This is a candidate for 7.9 and 7.10 branches.
2011-01-19 16:11:29 +10:00
Ben Skeggs
c73a1c18b2 dri/nouveau: allow multiple maps of surface buffers
Can happen during swrast fallbacks if a buffer is somehow bound as
a render target and a texture.

Fixes gnome-shell on nv20, and gets it mostly working on nv10.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-19 15:51:57 +10:00
Dave Airlie
f7bab47e6c radeon/r200: fix fbo-clearmipmap + gen-teximage
sw clears were being used and not getting the correct offsets in the span
code.

also not emitting correct offsets for CB draws to texture levels.

(I've no idea why I'm playing with r100).

This is a candidate for 7.9 and 7.10
2011-01-19 12:55:04 +10:00
Eric Anholt
568e008365 i965: Fix a comment typo. 2011-01-18 16:30:59 -08:00
Eric Anholt
8ce425f3e3 i965: Fix a bug in i965 compute-to-MRF.
Fixes piglit glsl-fs-texture2d-branching.  I couldn't come up with a
testcase that didn't involve dead code, but it's still worthwhile to
fix I think.
2011-01-18 16:30:59 -08:00
Christian König
ba700d2ead r600g: fix reserve_cfile for R700+
According to R700 ISA we have only two channels for cfile constants.
This patch makes piglit tests "glsl1-constant array with constant
indexing" happy on RV710.
2011-01-19 00:40:28 +01:00
Chad Versace
46f7105df4 glsl: Fix segfault due to missing printf argument
Fixes the following Piglit tests:
glslparsertest/shaders/array2.frag
glslparsertest/shaders/dataType6.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-18 15:23:18 -08:00
Chad Versace
45e8e6c6b1 glsl: Fix semantic checks on precision qualifiers
The check for
   Precision qualifiers only apply to floating point and integer types.
was incomplete. It rejected only type 'bool' and structures.
2011-01-18 14:43:49 -08:00
Brian Paul
42dbc2530b llvmpipe: make sure binning is active when we begin/end a query
This fixes a potential failure when a begin/end_query is the first
thing to happen after flushing the scene.

NOTE: This is a candidate for the 7.10 and 7.9 branches.
2011-01-18 14:02:01 -07:00
Brian Paul
fb7a8dedfa softpipe: rename some functions for consistency 2011-01-18 14:02:01 -07:00
Henri Verbeet
9e964baaf3 r600g: Kill trailing whitespace. 2011-01-18 20:57:04 +01:00
Henri Verbeet
7e2e8d09f7 r600g: Remove the unused eg_states_inc.h and r600_states_inc.h. 2011-01-18 20:57:04 +01:00
Henri Verbeet
495dec0a2b r600g: Simplify some r600_bc_add_alu_type() calls to r600_bc_add_alu(). 2011-01-18 20:57:04 +01:00
Brian Paul
90ff6178a2 vbo: initialize num_instances in a few places
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=33247
There might still be some issues with drawing multiple instances
with VBO splitting to investigate someday.
2011-01-18 12:18:32 -07:00
Eric Anholt
d5a53ad271 ra: Take advantage of the adjacency list in finding a node to spill.
This revealed a bug in ra_get_spill_benefit where we only considered
the benefit of the first adjacency we were to remove, explaining some
of the ugly spilling I've seen in shaders.  Because of the reduced
spilling, it reduces the runtime of glsl-fs-convolution-1 36.9% +/-
0.9% (n=5).
2011-01-18 10:17:50 -08:00
Eric Anholt
ea8e21856e ra: Remove unused "name" field in regs. 2011-01-18 10:17:48 -08:00
Eric Anholt
604022abed ra: Take advantage of the adjacency list in ra_select() too.
Reduces runtime of glsl-fs-convolution-1 another 13.9% +/- 0.6% (n=5).
2011-01-18 10:17:44 -08:00
Eric Anholt
7cf648da63 ra: Add an adjacency list to trade space for time in ra_simplify().
This was recommended in the original paper, but I figued "make it run"
before "make it fast".  Now we make it fast.  Reduces the runtime of
glsl-fs-convolution-1 by 12.7% +/- 0.6% (n=5).
2011-01-18 10:17:40 -08:00
Eric Anholt
58c988ada5 glsl: Skip the rest of loop unrolling if no loops were found.
Shaves 1.6% (+/- 1.0%) off of ff_fragment_shader glean texCombine time
(n=5).
2011-01-18 10:17:37 -08:00
Eric Anholt
754b9c5363 ra: Trade off some space to get time efficiency in ra_set_finalize().
Our use of the register allocator in i965 is somewhat unusual.
Whereas most architectures would have a smaller set of registers with
fewer register classes and reuse that across compilation, we have 1,
2, and 4-register classes (usually) and a variable number up to 128
registers per compile depending on how many setup parameters and push
constants are present.  As a result, when compiling large numbers of
programs (as with glean texCombine going through ff_fragment_shader),
we spent much of our CPU time in computing the q[] array.  By keeping
a separate list of what the conflicts are for a particular reg, we
reduce glean texCombine time 17.0% +/- 2.3% (n=5).

We don't expect this optimization to be useful for 915, which will
have a constant register set, but it would be useful if we were switch
to this register allocator for Mesa IR.
2011-01-18 10:17:34 -08:00
Brian Paul
5b58b8c579 softpipe: added some null pointer checks
This shouldn't really be needed but it may help with
http://bugs.freedesktop.org/show_bug.cgi?id=32309
2011-01-18 09:59:28 -07:00
Brian Paul
c97e4532bb softpipe: s/tex_cache/fragment_tex_cache/
Just to be more consistant with the vertex and geometry tex cache fields.
2011-01-18 09:59:28 -07:00
José Fonseca
843f537cfb Remove executables from source tree. 2011-01-18 15:25:30 +00:00
Andre Maasikas
4ef3e261a4 r600c: preserve correct buffer when using fbo
Hopefully better than previous - this passes more mipgen tests
2011-01-18 16:25:19 +02:00
Andre Maasikas
0a85845c9e r600: set border color as RGBA
border color is RGBA for samples - this passes texenv tests
2011-01-18 16:21:14 +02:00
Andre Maasikas
52fbff2130 r600c: use STATE_FB_WPOS_Y_TRANSFORM variable to do wpos transform
use introduced STATE_FB_WPOS_Y_TRANSFORM variable (thanks Marek)
this gets coords also right when using fbo
2011-01-18 16:21:13 +02:00
Eric Anholt
e4be665bbd i965: Fix dead pointers to fp->Parameters->ParameterValues[] after realloc.
Fixes texrect-many regression with ff_fragment_shader -- as we added
refs to the subsequent texcoord scaling paramters, the array got
realloced to a new address while our params[] still pointed at the old
location.
2011-01-17 16:27:55 -08:00
Brian Paul
96a2e89dde llvmpipe: enable PIPE_CAP_INDEP_BLEND_FUNC
The driver was saying that independend blend functions was not supported,
but it really was.  The driver was using the per-target independend blend
factors but the state tracker was only setting the 0th one (per the
Gallium spec).

Fixes a piglit fbo-drawbuffers2-blend regression.
See https://bugs.freedesktop.org/show_bug.cgi?id=33215
2011-01-17 16:51:13 -07:00
Brian Paul
afeebecd95 st/mesa: move PIPE_CAP_INDEP_BLEND_FUNC code 2011-01-17 16:51:12 -07:00
Chad Versace
774750a32f doxygen: Add doxyfile for glsl module 2011-01-17 13:52:40 -08:00
Chad Versace
a54e2de4bb glsl: Refresh autogenerated parser files 2011-01-17 10:20:47 -08:00
Chad Versace
a9bf8c12ee glsl: Remove redundant semantic check in parser
The removed semantic check also exists in ast_type_specifier::hir(), which
is a more natural location for it.

The check verified that precision statements are applied only to types
float and int.
2011-01-17 10:20:47 -08:00
Chad Versace
08a286c9cc glsl: Add support for default precision statements
* Add new field ast_type_specifier::is_precision_statement.
* Add semantic checks in ast_type_specifier::hir().
* Alter parser rules accordingly.
2011-01-17 10:20:47 -08:00
Chad Versace
889e1a5b6c glsl: Add semantic checks for precision qualifiers
* Check that precision qualifiers only appear in language versions 1.00,
  1.30, and later.
* Check that precision qualifiers do not apply to bools and structs.

Fixes the following Piglit tests:
* spec/glsl-1.30/precision-qualifiers/precision-bool-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-02.frag
2011-01-17 09:41:25 -08:00
Chad Versace
33279cd2d3 glsl: Fix parser rule for type_specifier
Do not assign a value to ast_type_specifier::precision when no precision
qualifier is present.
2011-01-17 09:41:25 -08:00
Chad Versace
aaa31bf8f4 glsl: Change default value of ast_type_specifier::precision
Change default value to ast_precision_none, which denotes the absence of
a precision of a qualifier.

Previously, the default value was ast_precision_high. This made it
impossible to detect if a precision qualifier was present or not.
2011-01-17 09:41:25 -08:00
Chad Versace
1eb0f17fa4 glsl: Check that 'centroid in' does not occur in vertex shader
The check is performed only in GLSL versions >= 1.30.

From section 4.3.4 of the GLSL 1.30 spec:
   "It is an error to use centroid in in a vertex shader."

Fixes Piglit test
spec/glsl-1.30/compiler/storage-qualifiers/vs-centroid-in-01.vert
2011-01-17 09:41:25 -08:00
Chad Versace
8faaa4a672 glsl: Check that interpolation quals only apply to vertex ins and fragment outs
The check is performed only in GLSL versions >= 1.30.

Fixes the following Piglit tests:
* spec/glsl-1.30/compiler/interpolation-qualifiers/fs-smooth-02.frag
* spec/glsl-1.30/compiler/interpolation-qualifiers/vs-smooth-01.vert
2011-01-17 09:41:25 -08:00
Chad Versace
605aacc67d glsl: Check that interpolation qualifiers do not precede 'varying'
... and 'centroid varying'. The check is performed only in GLSL
versions >= 1.30.

From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
   "interpolation qualifiers may only precede the qualifiers in, centroid
    in, out, or centroid out in a declaration. They do not apply to the
    deprecated storage qualifiers varying or centroid varying."

Fixes Piglit test
spec/glsl-1.30/compiler/interpolation-qualifiers/smooth-varying-01.frag.
2011-01-17 09:41:24 -08:00
Chad Versace
0e2f8936c8 glsl: Add method ast_type_qualifier::interpolation_string()
If an interpolation qualifier is present, then the method returns that
qualifier's string representation. For example, if the noperspective bit
is set, then it returns "noperspective".
2011-01-17 09:41:24 -08:00
Brian Paul
5a64626ee5 vbo: init num_instances in split_prims()
Fixes a VTK regression after adding GL_ARB_draw_instanced.
2011-01-17 09:56:58 -07:00
Brian Paul
6179f7e38e tnl: assert that num_instances > 0 2011-01-17 09:40:16 -07:00
Brian Paul
72f2551017 mesa: s/primcount/numInstances/
primcount is also a parameter to glMultiDrawElements().  Use numInstances
to avoid confusion between these things.
2011-01-17 09:33:49 -07:00
Dave Airlie
2bf52e7c28 nouveau: fix build against out of tree libdrm
For doing builds against a separated libdrm these cflags are needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-17 15:42:34 +10:00
Christian König
ef3b8042e0 r600g: fix PIPE_CAP_INSTANCED_DRAWING warning 2011-01-16 23:52:53 +01:00
Christian König
b61afe13f1 r600g: fix alu inst group merging for relative adressing 2011-01-16 21:43:17 +01:00
Christoph Bumiller
a4742c6a07 nvc0: fix and enable instanced drawing and arrays 2011-01-16 14:10:46 +01:00
Chia-I Wu
326332a130 d3d1x: Fix broken build.
st/egl native.h changed its interface in
a22a332fc7.
2011-01-16 20:58:17 +08:00
Brian Paul
d136d1d2e1 mesa: minor tweaks in _mesa_set_fetch_functions() 2011-01-15 20:41:26 -07:00
Brian Paul
aad7219f80 mesa: add comment for _mesa_get_srgb_format_linear() 2011-01-15 20:41:06 -07:00
Brian Paul
bfad484505 mesa: move declarations before code 2011-01-15 20:37:57 -07:00
Dave Airlie
608ccfe316 docs: add GL_EXT_texture_sRGB_decode to relnotes 2011-01-16 12:54:57 +10:00
Dave Airlie
527bf67682 gallium: add EXT_texture_sRGB_decode.
This uses a sampler view to access the texture with the alternate format.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:07 +10:00
Dave Airlie
9b1a15e1cb i965: add support for EXT_texture_sRGB_decode
We just choose the texture format depending on the srgb decode bit
for the sRGB formats.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:06 +10:00
Dave Airlie
edc2dd8e47 mesa/swrast: implement EXT_texture_sRGB_decode
This implements the extension by choosing a different set of texture
fetch functions when the texture parameter changes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:06 +10:00
Christian König
ac6334145e r600d: fix some bugs added reworking literal handling
If a literal slot isn't used it should be set
to 0 instead of an uninitialized value. Also the
channels for pre R700 trig functions were incorrect.
And most important literals were not counted against ndw,
resulting in an invalid force_add_cf detection.
2011-01-16 03:30:25 +01:00
Brian Paul
3bee900a72 docs: document GL_ARB_draw_buffers_blend 2011-01-15 18:38:46 -07:00
Brian Paul
b3ca110594 mesa: implement glGet queries for GL_ARB_draw_buffers_blend 2011-01-15 18:35:45 -07:00
Brian Paul
44c2122a73 mesa: display list support for GL_ARB_draw_buffers_blend functions 2011-01-15 18:35:45 -07:00
Brian Paul
7f48278edc mesa: plug in GL_ARB_draw_buffers_blend functions 2011-01-15 18:35:45 -07:00
Brian Paul
561307844f glapi: regenerated files 2011-01-15 18:35:45 -07:00
Brian Paul
1cf6ff3046 glapi: new entrypoint specs for GL_ARB_draw_buffers_blend 2011-01-15 18:35:45 -07:00
Brian Paul
74713e2d29 mesa: begin implementation of GL_ARB_draw_buffers_blend 2011-01-15 18:35:39 -07:00
Brian Paul
3dab2b1795 docs: update GL3.txt status 2011-01-15 17:41:43 -07:00
Brian Paul
9473ca356f docs: document GL_ARB_instanced_arrays 2011-01-15 17:40:56 -07:00
Brian Paul
a6860f0913 st/mesa: GL_ARB_instanced_arrays support 2011-01-15 17:37:41 -07:00
Brian Paul
1d1eb95787 mesa: support for GL_ARB_instanced_arrays 2011-01-15 17:37:41 -07:00
Brian Paul
1250e2330b glapi: regenerated files 2011-01-15 17:37:41 -07:00
Brian Paul
caee0d024f glapi: GL_ARB_instanced_arrays support 2011-01-15 17:37:40 -07:00
Brian Paul
5700bc6bac draw: add missing LP_CHECK_MEMBER_OFFSET() 2011-01-15 17:37:40 -07:00
Brian Paul
d1e284407c st/mesa: move/consolidate an assignment 2011-01-15 17:37:40 -07:00
Brian Paul
889f44bc90 docs: document GL_ARB_draw_instanced 2011-01-15 17:37:40 -07:00
Henri Verbeet
a25473b535 r600g: Remove the redundant radeon_new() prototype. 2011-01-15 19:48:43 +01:00
Henri Verbeet
5a2abf7a85 r600g: Fix some register value name typos.
SFR -> SRF.
2011-01-15 19:48:43 +01:00
Henri Verbeet
f6f7808028 r600g: Get rid of r600_translate_vertex_data_type().
This has been replaced with r600_vertex_data_type().
2011-01-15 19:48:43 +01:00
Brian Paul
652901e95b Merge branch 'draw-instanced'
Conflicts:
	src/gallium/auxiliary/draw/draw_llvm.c
	src/gallium/drivers/llvmpipe/lp_state_fs.c
	src/glsl/ir_set_program_inouts.cpp
	src/mesa/tnl/t_vb_program.c
2011-01-15 10:24:08 -07:00
Christoph Bumiller
21001d2ba7 nvc0: try to swap immediates to first source too 2011-01-15 14:14:55 +01:00
Christoph Bumiller
52474d4246 nvc0: make sure all sources of the BIND op are distinct
They're supposed to be assigned consecutive registers so they can't
contain the same SSA value more than once.
2011-01-15 14:14:50 +01:00
Christoph Bumiller
1ae982adfd nvc0: update user vbufs on each draw call
This is required in case set_vertex_buffers is not called again.
2011-01-15 12:18:52 +01:00
Christoph Bumiller
b50d02e2e0 nvc0: enable early fragment tests where possible 2011-01-15 12:17:57 +01:00
Christoph Bumiller
5ec66c6e70 nvc0: upload small buffers through the command buffer 2011-01-15 12:17:00 +01:00
Chia-I Wu
a4a5a9a5ce mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.
Core mesa has gained support for GL_ARB_ES2_compatibility.  Make GLES
generated dispatch table use them.
2011-01-15 12:42:59 +08:00
Chia-I Wu
b70d0a6a51 targets/egl-static: Assorted cleanups and fixes.
Share more code between windows and non-windows platforms.  Check
env['x11'] for X11 and add env['X11_LIBS'] to LIBS.  Add ws_wrapper for
i965g.
2011-01-15 12:35:22 +08:00
Chia-I Wu
6f769a690b targets/egl: i965 needs libwsw.
Fix undefined symbol wrapper_sw_winsys_dewrap_pipe_screen.
2011-01-15 12:35:19 +08:00
Eric Anholt
4620de7eea mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.
Fixes piglit arb_es2_compatibility-shadercompiler
2011-01-14 16:55:35 -08:00
Eric Anholt
8395f206a8 mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.
Fixes piglit arb_es2_compatibility-maxvectors.
2011-01-14 16:55:35 -08:00
Eric Anholt
e12c4faf7e mesa: Add support for glDepthRangef and glClearDepthf.
These are ARB_ES2_compatibility float variants of the core double
entrypoints.  Fixes arb_es2_compatibility-depthrangef.
2011-01-14 16:55:35 -08:00
Eric Anholt
25beab10cd ir_to_mesa: Fix segfaults on ir_to_mesa invocation after MSVC change. 2011-01-14 16:55:35 -08:00
Brian Paul
d42acef139 glsl: fix implicit int to bool warning
Maybe preprocess() should return a bool.
2011-01-14 17:46:47 -07:00
Brian Paul
7ff89b030f docs: skeleton file for 7.11 release notes, add missing links 2011-01-14 17:46:38 -07:00
Vinson Lee
7772a34f3a mesa: Dynamically allocate acp array in ir_to_mesa_visitor::copy_propagate.
Fixes these MSVC errors.
ir_to_mesa.cpp(2644) : error C2057: expected constant expression
ir_to_mesa.cpp(2644) : error C2466: cannot allocate an array of constant size 0
ir_to_mesa.cpp(2644) : error C2133: 'acp' : unknown size
ir_to_mesa.cpp(2646) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
ir_to_mesa.cpp(2709) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
ir_to_mesa.cpp(2718) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
2011-01-14 16:18:52 -08:00
Eric Anholt
7b987578a9 mesa: Add actual support for glReleaseShaderCompiler from ES2.
Fixes no-op dispatch warning in piglit
arb_es2_compatibility-releaseshadercompiler.c.
2011-01-14 15:30:04 -08:00
Eric Anholt
ed93f9f3a3 intel: Expose GL_ARB_ES2_compatibility.
We don't have all of the features of this extension hooked up yet, but
the consensus yesterday was that since those features are things that
we should also be supporting in our ES2 implementation, claiming ES2
here too doesn't make anything worse and will make incremental
improvement through piglit easier.
2011-01-14 15:30:01 -08:00
Eric Anholt
9c6954fc9d mesa: Add extension enable bit for GL_ARB_ES2_compatibility. 2011-01-14 15:28:50 -08:00
Eric Anholt
841ad6bfad glapi: Regenerate for GL_ARB_ES2_compatibility. 2011-01-14 15:28:01 -08:00
Eric Anholt
8560cb939b glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility. 2011-01-14 15:28:00 -08:00
Alex Deucher
634dece281 r600g: compiler helper opcode fixes for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-14 17:50:49 -05:00
Alex Deucher
9dfc68314d r600g: pass r600_bc to some addition compiler helper functions
needed for asic specific opcodes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-14 17:50:29 -05:00
Vinson Lee
57ef69dd88 generate_builtins.py: Whitespace fixes.
Also removed unnecessary semicolons.
2011-01-14 14:19:02 -08:00
Vinson Lee
0de6d7e991 generate_builtins.py: Fix builds using Python 2.5. 2011-01-14 14:17:03 -08:00
Eric Anholt
a6e4614ca1 i965: Replace broken handling of dead code with an assert.
This code should never have been triggered, but I often did anyway
when I disabled optimization passes during debugging, then spent my
time debugging that this code doesn't work.
2011-01-14 13:57:15 -08:00
Eric Anholt
7c7df146b5 i965: Add an invalidation of live intervals after register splitting.
No effect, since it was called before live intervals were calculated.
2011-01-14 13:57:15 -08:00
Eric Anholt
65c41d55a0 mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages.
The comment of "this is just like teximages except for..." is a pretty
good clue that we're handling this wrong.  By just using the teximage
code, we catch a bunch of cases we'd missed, like GL_RED and GL_RG.
2011-01-14 13:57:15 -08:00
Eric Anholt
34a9da4eb4 mesa: Add channel-wise copy propagation to ir_to_mesa.
This catches more opportunities than the prog_optimize.c code on
openarena's fixed function shaders turned to GLSL, mostly due to
looking at multiple source instructions for copy propagation
opportunities.  It should also be much more CPU efficient than
prog_optimize.c's code.
2011-01-14 13:57:14 -08:00
Eric Anholt
d53c8380bf i915: Fix compiler warning from sw fallback removal change. 2011-01-14 13:57:14 -08:00
Vinson Lee
4c6d6dd8fc r600g: Disable V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR case.
The usage of macro V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR was
introduced by commit 323ef3a1f0 but the
macro is undefined. Disable this case to fix the build for now.
2011-01-14 13:47:37 -08:00
Kristian Høgsberg
6e9b0f6807 gles2: Also support GL_BGRA_EXT for glTexSubImage2d 2011-01-14 16:12:21 -05:00
Christian König
323ef3a1f0 r600g: add more missing instructions to r600_bc_get_num_operands 2011-01-14 18:46:52 +01:00
Chia-I Wu
e7d8f92570 egl: Fix EGL_VERSION string.
Fix a copy-and-paste error in a4a38dcf61.
2011-01-14 14:29:19 +08:00
Chia-I Wu
36a59b29ef egl: Fix an assertion in _eglUpdateAPIsString.
dpy->ClientAPIs was renamed in a4a38dcf61.
2011-01-14 14:12:42 +08:00
Dave Airlie
483de8ef2e i965: fix fbo-srgb on i965.
Until we get the EXT_framebuffer_sRGB extension we should bind the sRGB
formats for FBO as linear.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-14 14:58:47 +10:00
Dave Airlie
7f652fc523 srgb: fix fbo base format picking.
Pointed out by Brian.
2011-01-14 14:58:47 +10:00
Chad Versace
7b9dc40b0d i915: Disable extension OES_standard_derivatives
OES_standard_derivatives must be manually disabled for i915 because Mesa
enables it by default.
2011-01-13 17:26:28 -08:00
Chad Versace
78838b2d1b mesa: Change OES_standard_derivatives to be stand-alone extension
Add a bit in struct gl_extensions for OES_standard_derivatives, and enable
the bit by default. Advertise the extension only if the bit is enabled.

Previously, OES_standard_derivatives was advertised in GLES2 contexts
if ARB_framebuffer_object was enabled.
2011-01-13 17:26:28 -08:00
Vinson Lee
a2ab929ab2 r600g: Move declaration before code in r600_asm.c.
Fixes SCons build.
2011-01-13 14:17:01 -08:00
Christian König
96f8f8db7b r600g: rework literal handling 2011-01-13 23:01:35 +01:00
Christian König
d7342f6a81 r600g: merge alu groups 2011-01-13 23:01:35 +01:00
Christian König
eea1d8199b r600g: implement replacing gpr with pv and ps 2011-01-13 23:01:35 +01:00
Ian Romanick
4bcff0c190 glsl: Emit errors or warnings when 'layout' is used with 'attribute' or 'varying'
The specs that add 'layout' require the use of 'in' or 'out'.
However, a number of implementations, including Mesa, shipped several
of these extensions allowing the use of 'varying' and 'attribute'.
For these extensions only a warning is emitted.

This differs from the behavior of Mesa 7.10.  Mesa 7.10 would only
accept 'attribute' with 'layout(location)'.  This behavior was clearly
wrong.  Rather than carrying the broken behavior forward, we're just
doing the correct thing.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-13 13:38:50 -08:00
Ian Romanick
82c4b4f88a glsl: Allow 'in' and 'out' when 'layout' is also available
All of the extensions that add the 'layout' keyword also enable (and
required) the use of 'in' and 'out' with shader globals.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-13 13:35:50 -08:00
José Fonseca
e1bc68b014 scons: Fix cross-compilation.
Hairy stuff. Don't know how to do it better though.
2011-01-13 20:53:42 +00:00
Christian König
0448f73f06 r600g: add missing RECIPSQRT_CLAMPED to r600_bc_get_num_operands 2011-01-13 21:29:47 +01:00
Christian König
a25b91c2c2 r600g: rework bank swizzle code 2011-01-13 21:22:00 +01:00
Christian König
89275c0b36 r600g: fix alu slot assignment 2011-01-13 19:41:07 +01:00
Christian König
236e99fe05 r600g: optimize away CF ALU instructions even if type doesn't match 2011-01-13 19:41:07 +01:00
Christoph Bumiller
370ae0bd61 nvc0: identify POINT_RASTER_RULES, add POINT_SMOOTH state
Point smoothing requires rasterization rules to be set to OGL.

Sorry for the extra noise caused by the header update.
2011-01-13 19:36:25 +01:00
Chia-I Wu
abbb1c8f08 draw: Fix an off-by-one bug in a vsplit assertion.
When use_spoken is true, istart (the first vertex of this segment) is
replaced by i0 (the spoken vertex of the fan).  There are still icount
vertices.

Thanks to Brian Paul for spotting this.
2011-01-14 02:02:26 +08:00
Vinson Lee
1f66930332 i965: Remove unnecessary headers. 2011-01-13 09:28:47 -08:00
Vinson Lee
d599df8a8c targets/egl-static: Remove unnecessary header. 2011-01-13 09:16:25 -08:00
Vinson Lee
eb70e58caf r600g: Silence uninitialized variable warnings. 2011-01-13 09:07:19 -08:00
Vinson Lee
d76f1da7cb mesa: Add missing break statement in SARGB8 case. 2011-01-13 08:53:33 -08:00
Brian Paul
ca31c596e8 egl: need stdio.h for non-Windows build too to avoid compiler warning 2011-01-13 09:25:55 -07:00
Paulo Zanoni
dad914f6b2 dri_util: fail driCreateNewScreen if InitScreen is NULL
Without this, X doesn't start with UMS on r300g.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-13 07:44:33 -07:00
José Fonseca
9277a62aa3 scons: Ensure the OpenVG/EGL import libs are also prefixed with 'lib'. 2011-01-13 12:33:41 +00:00
José Fonseca
63528c4510 scons: Build libOpenVG.dll & libEGL.dll
But without creating liblibOpenVG or liblibEGL elsewhere.

Thanks Chia-I Wu for pointing this out.
2011-01-13 11:54:43 +00:00
José Fonseca
80f18876f6 util: Undo spurious changes in last commit. 2011-01-13 11:45:40 +00:00
José Fonseca
fe2cfd9b19 util: Don't limit debug_printf message length on unices. 2011-01-13 11:44:16 +00:00
Chia-I Wu
a22a332fc7 egl: Improve driver selection.
The idea is to be able to match a driver using the following order

  try egl_gallium with hw renderer
  try egl_dri2
  try egl_gallium with sw renderer
  try egl_glx

given the module list

  egl_gallium
  egl_dri2
  egl_glx

For that, UseFallback initialization option is added.  The module list
is matched twice: with the option unset and with the option set.  In the
first pass, egl_gallium skips its sw renderer and egl_glx rejects to
initialize since UseFallback is not set.  In the second pass,
egl_gallium skips its hw renderer and egl_dri2 rejects to initialize
since UseFallback is set.  The process stops at the first driver that
initializes the display.
2011-01-13 18:15:45 +08:00
Chia-I Wu
655e459892 egl: Simplify driver matching.
Add initialization options that drv->API.Initialize should support.
Replace drv->Probe by TestOnly initialization option and simplify
_eglMatchDriver.
2011-01-13 18:10:38 +08:00
Chia-I Wu
a4a38dcf61 egl: Cleanup _EGLDisplay initialization.
Reorder/rename and document the fields that should be set by the driver during
initialization.  Drop the major/minor arguments from drv->API.Initialize.
2011-01-13 17:57:38 +08:00
Kenneth Graunke
47b2af2c62 glsl/s_expression: Read and ignore Scheme-style comments.
A single-semicolon until the end of the line, i.e.
; this is a comment.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
5bfb68cd0f glsl/builtins: Remove unnecessary (constant bool (1)) from assignments.
This isn't strictly necessary, but is definitely nicer.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
bbafd2b849 ir_reader: Make assignment conditions optional.
You can now simply write (assign (xy) <lhs> <rhs>) instead of the
verbose (assign (constant bool (1)) (xy) <lhs> <rhs>).
2011-01-12 23:55:34 -08:00
Kenneth Graunke
b74ff382a4 ir_reader: Convert to a class.
This makes it unnecessary to pass _mesa_glsl_parse_state around
everywhere, making at least the prototypes a lot easier to read.

It's also more C++-ish than a pile of static C functions.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
ec7e4f0ec5 ir_reader: Combine the three dereference reading functions into one.
These used to be more complicated, but now are so simple there's no real
point in keeping them separate.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
e486fca2d3 ir_reader: Relax requirement that function arguments be s_lists.
All of these functions used to take s_list pointers so they wouldn't all
need SX_AS_LIST conversions and error checking.  However, the new
pattern matcher conveniently does this for us in one centralized place.

So there's no need to insist on s_list.  Switching to s_expression saves
a bit of code and is somewhat cleaner.
2011-01-12 23:55:33 -08:00
Kenneth Graunke
d798815272 ir_reader: Remove s_list::length() method.
Most code now relies on the pattern matcher rather than this function,
and for the only remaining case, not using this saves an iteration.
2011-01-12 23:55:33 -08:00
Kenneth Graunke
daeb0c646e ir_reader: Add a pattern matching system and use it everywhere.
Previously, the IR reader was riddled with code that:
1. Checked for the right number of list elements (via a linked list walk)
2. Retrieved references to each component (via ->next->next pointers)
3. Downcasted as necessary to make sure that each sub-component was the
   right type (i.e. symbol, int, list).
4. Checking that the tag (i.e. "declare") was correct.

This was all very ad-hoc and a bit ugly.  Error checking had to be done
at both steps 1, 3, and 4.  Most code didn't even check the tag, relying
on the caller to do so.  Not all callers did.

The new pattern matching module performs the whole process in a single
straightforward function call, resulting in shorter, more readable code.

Unfortunately, MSVC does not support C99-style anonymous arrays, so the
pattern must be declared outside of the match call.
2011-01-12 23:55:33 -08:00
Dave Airlie
407184fe08 mesa/srgb: handle SARGB8 case in the sw fbo renderer. 2011-01-13 16:51:30 +10:00
Fredrik Höglund
71b889f904 st/mesa: fix a regression from cae2bb76
stObj->pt is null when a TFP texture is passed to st_finalize_texture,
and with the changes introduced in the above commit this resulted in a
new texture being created and the existing image being copied into it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-13 01:22:20 -05:00
Ben Skeggs
bd2b72359e nvc0: disable calling of sw methods we don't implement
Left in the code as a marker of what NVIDIA do, just in case we need
to do this some day.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-13 15:26:31 +10:00
Dave Airlie
8c8e26d66a mesa/fbo: prevent assert trigger on i965 with piglit fbo-srgb test. 2011-01-13 15:17:34 +10:00
Ben Skeggs
0c1db2feb9 nvc0: fix mp_stack_bo relocation
Fixes a PT_NOT_PRESENT error cause by:
- allocating in VRAM
- emitting GART relocs to 0x17bc/0x17c0, moving the buffer
- telling the bufmgr that the buffer should be in VRAM when we use it,
  but not correcting the value sent to 0x17bc/0x17c0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-13 13:31:29 +10:00
Vinson Lee
31b1051663 mesa: Move loop variable declarations outside for loop in extensions.c.
Fixes MSVC build.
2011-01-12 17:43:28 -08:00
Brian Paul
dd973cd9e8 mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
Fixes a failed assertion when a renderbuffer ID that was gen'd but not
previously bound was passed to glFramebufferRenderbuffer().  Generate
the same error that NVIDIA does.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:14:18 -07:00
Brian Paul
67722ae403 mesa: don't assert in GetIntegerIndexed, etc
We were getting an assertion upon invalid pname.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:13:18 -07:00
Brian Paul
2fa6012f6a mesa: fix num_draw_buffers==0 in fixed-function fragment program generation
This fixes a problem when glDrawBuffers(GL_NONE).  The fragment program
was writing to color output[0] but OutputsWritten was 0.  That led to a
failed assertion in the Mesa->TGSI translation code.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 17:55:45 -07:00
Brian Paul
30616fdacf st/mesa: add st_BeginQuery() case for GL_ANY_SAMPLES_PASSED
Fixes piglit occlusion_query2 failure.
2011-01-12 17:55:44 -07:00
Brian Paul
1b173fb3ba glsl: remove trailing comma to silence warning 2011-01-12 17:55:44 -07:00
Brian Paul
4d96af9337 noop: change var type to silence warning 2011-01-12 17:55:44 -07:00
Kenneth Graunke
b076551e3b glsl/Makefile: Fix build with --as-needed. 2011-01-12 16:37:03 -08:00
Vinson Lee
356e2e962f mesa: Move declaration before code in extensions.c.
Fixes SCons build.
2011-01-12 16:23:11 -08:00
Chad Versace
a7b5664c05 mesa: Change OES_point_sprite to depend on ARB_point_sprite
The extension string in GLES1 contexts always advertised
GL_OES_point_sprite. Now advertisement depends on ARB_point_sprite being
enabled.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
039150169e mesa: Change dependencies of some OES extension strings
Change all OES extension strings that depend on ARB_framebuffer_object to
instead depend on EXT_framebuffer_object.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
19418e921a mesa: Add/remove extensions in extension string
Add GL_OES_stencil8 to ES2.

Remove the following:
   GL_OES_compressed_paletted_texture : ES1
   GL_OES_depth32                     : ES1, ES2
   GL_OES_stencil1                    : ES1, ES2
   GL_OES_stencil4                    : ES1, ES2
Mesa advertised these extensions, but did not actually support them.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
9b260c377f mesa: Refactor handling of extension strings
Place GL, GLES1, and GLES2 extensions in a unified extension table. This
allows one to enable, disable, and query the status of GLES1 and GLES2
extensions by name.

When tested on Intel Ironlake, this patch did not alter the extension
string [as given by glGetString(GL_EXTENSIONS)] for any API.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-01-12 15:45:03 -08:00
Ian Romanick
bd33055ef4 glsl: Track variable usage, use that to enforce semantics
In particular, variables cannot be redeclared invariant after being
used.

Fixes piglit test invariant-05.vert and bugzilla #29164.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 14:30:31 -08:00
Eric Anholt
c3f000b392 i965/fs: Do flat shading when appropriate.
We were trying to interpolate, which would end up doing unnecessary
math, and doing so on undefined values.   Fixes glsl-fs-flat-color.
2011-01-12 13:51:01 -08:00
Christian König
6881262eff r600g: also look at tex inst when for maximum gpu count 2011-01-12 20:41:15 +01:00
Vinson Lee
a42906f862 generate_builtins.py: Add missing import.
Import sys for sys.exit.
2011-01-12 11:35:43 -08:00
Eric Anholt
e1fb511570 meta: Actually use mipmapping when generating mipmaps.
With the change to not reset baselevel, this GL_LINEAR filtering was
resulting in generating mipmaps off of the base level instead of the
next higher detail level.  Fixes fbo-generatemipmap-filtering.

Reported by: Neil Roberts <neil@linux.intel.com>
2011-01-12 11:08:07 -08:00
Eric Anholt
e880a57a71 i965: Clarify when we need to (re-)calculate live intervals.
The ad-hoc placement of recalculation somewhere between when they got
invalidated and when they were next needed was confusing.  This should
clarify what's going on here.
2011-01-12 11:08:07 -08:00
Christian König
c60cb25bfb r600g: implement output modifiers and use them to further optimize LRP 2011-01-12 19:44:49 +01:00
Christian König
7728bef290 r600g: use special constants for 0, 1, -1, 1.0f, 0.5f etc 2011-01-12 19:40:52 +01:00
Christian König
dffad730df r600g: optimize temp register handling for LRP 2011-01-12 19:36:55 +01:00
Christian König
8813842121 r600g: optimize away CF_INST_POP
If last instruction is an CF_INST_ALU we don't need to emit an
additional CF_INST_POP for stack clean up after an IF ELSE ENDIF.
2011-01-12 19:31:36 +01:00
Christian König
052b9e8fab r600g: make dumping of shaders an option 2011-01-12 19:17:49 +01:00
Christian König
95a2b265fa r600g: fix alu dumping 2011-01-12 19:17:49 +01:00
Christian König
47e7c6f571 r600g: improve r600_bc_dump 2011-01-12 19:17:49 +01:00
Eric Anholt
9351ef7a44 i965/vs: When MOVing to produce ABS, strip negate of the operand.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-vs-abs-neg.
2011-01-12 09:50:34 -08:00
Eric Anholt
ab56e3be9a i965/fs: When producing ir_unop_abs of an operand, strip negate.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-fs-abs-neg.
2011-01-12 09:50:10 -08:00
José Fonseca
416ca90138 glsl: Make builtin_compiler build on Windows with MSVC. 2011-01-12 16:58:37 +00:00
José Fonseca
0035d1d902 glsl: Make builtin_compiler portable for non-unices. 2011-01-12 16:54:25 +00:00
José Fonseca
f9bb5323eb getopt: Make code more portable. 2011-01-12 16:54:21 +00:00
José Fonseca
6d670f6c0f getopt: Import OpenBSD getopt implementation for MSVC. 2011-01-12 15:32:17 +00:00
José Fonseca
46662de68b scons: Update windows build for vgapi->openvg rename. 2011-01-12 15:13:57 +00:00
José Fonseca
b07ad1d6bd scons: Fix build on systems without libOpenVG.so 2011-01-12 15:06:57 +00:00
Chia-I Wu
1e4f412242 egl: When EGL_DRIVER is set, do not add other drivers.
Setting EGL_DRIVER forces the driver to be loaded, as documented.  There
should be no fallbacks.
2011-01-12 18:10:15 +08:00
Chia-I Wu
4924cb9036 egl: libEGL depends on LOCAL_LIBS.
So that libEGL is rebuilt whenever LOCAL_LIBS changes.
2011-01-12 18:10:15 +08:00
Chia-I Wu
39812c48df egl_dri2: Fix eglGetProcAddress.
The driver struct is zeroed after dri2_load.  Oops.
2011-01-12 18:10:15 +08:00
Chia-I Wu
a8b6b6555c scons: Updates for targets/egl-static.
Update SConscripts to re-enable or add support for EGL on windows and
x11 platforms respectively.  targets/egl-gdi is replaced by
targets/egl-static, where "-static" means pipe drivers and state
trackers are linked to statically by egl_gallium, and egl_gallium is a
built-in driver of libEGL.  There is no more egl_gallium.dll on Windows.
2011-01-12 17:40:01 +08:00
Chia-I Wu
49ed5bb28d targets/egl-static: New EGL target for scons.
This target is based on and replaces egl-gdi.  It is suitable for both
windows and x11.
2011-01-12 17:40:01 +08:00
Kenneth Graunke
1412dea949 glsl: Add type inference support for remaining expression opcodes. 2011-01-11 23:28:58 -08:00
Eric Anholt
4eb7284ef9 i965: Tighten up the check for flow control interfering with coalescing.
This greatly improves codegen for programs with flow control by
allowing coalescing for all instructions at the top level, not just
ones that follow the last flow control in the program.
2011-01-11 16:04:25 -08:00
Christian König
93a95ad8ff r600g: texture instructions also work fine with TGSI_FILE_INPUT 2011-01-12 00:44:30 +01:00
Christian König
a1146c1373 r600g: DP4 also supports writemasking 2011-01-12 00:41:49 +01:00
Christian König
7be5455796 r600g: Why all this fiddling with tgsi_helper_copy?
tgsi_helper_copy is used on several occasions to copy a temporary result
into the real destination register to emulate writemasks for OP3 and
reduction operations. According to R600 ISA that's unnecessary.

This patch fixes this use for MAD, CMP and DP4.
2011-01-12 00:40:55 +01:00
Christian König
cc0f604241 r600g: fix tex and vtx joining 2011-01-12 00:06:48 +01:00
Eric Anholt
c00bc13564 glsl: Fix the lowering of variable array indexing to not lose write_masks.
Fixes glsl-complex-subscript on 965.
2011-01-11 14:50:19 -08:00
Eric Anholt
5acf94e955 i965: Remove dead fallback for stencil _Enabled but no stencil buffer.
The _Enabled field is the thing that takes into account whether
there's a stencil buffer.  Tested with piglit glx-visuals-stencil.
2011-01-11 13:48:31 -08:00
Tilman Sauerbeck
242205404d r600g: Fixed SIN/COS/SCS for the case where the operand is a literal.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-11 22:37:01 +01:00
Alberto Milone
ca8960234e r600c: add evergreen ARL support.
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
2011-01-11 14:48:44 -05:00
Jerome Glisse
0865af4b42 noop: remove dead dri target
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-11 14:46:09 -05:00
Jerome Glisse
63b9790a55 r600g: move user fence into base radeon structure
This avoid any issue when context is free and we still try to
access fence through radeon structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-11 14:34:25 -05:00
Brian Paul
483f566222 configure: bump libdrm version requirement to 2.4.23
NOTE: This is a candidate for the 7.10 (and 7.9?) branch.
2011-01-11 09:42:54 -07:00
Brian Paul
167db6d34f mesa: include teximage.h to silence warning 2011-01-11 09:37:35 -07:00
Brian Paul
d92e56460e mesa: do a debug check of _mesa_format_to_type_and_comps()
Make sure that all formats are handled in this function.  It's
easy to miss this function when adding new pixel formats.

See also http://bugs.freedesktop.org/show_bug.cgi?id=31544
2011-01-11 09:27:06 -07:00
Brian Paul
0073f50cd4 mesa: fix a few format table mistakes, assertions
The BaseFormat field was incorrect for a few R and RG formats.
Fix a couple assertions too.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-11 09:27:06 -07:00
Kenneth Graunke
33d0c44910 glsl: Autogenerate builtin_functions.cpp as part of the build process.
Python is already necessary for other parts of Mesa, so there's no
reason we can't just generate it.  This patch updates both make and
SCons to do so.
2011-01-10 19:03:27 -08:00
Ian Romanick
469ea695bb glsl: Disallow 'in' and 'out' on globals in GLSL 1.20
Fixes piglit tests glsl-1.20/compiler/qualifiers/in-01.vert and
glsl-1.20/compiler/qualifiers/out-01.vert and bugzilla #32910.

NOTE: This is a candidate for the 7.9 and 7.10 branches.  This patch
also depends on the previous two commits.
2011-01-10 17:39:16 -08:00
Ian Romanick
a0c2ec8e2d glsl: Refresh autogenerated parser file.
For the previous commit.
2011-01-10 17:39:16 -08:00
Ian Romanick
eebdfdfbcf glsl: Add version_string containing properly formatted GLSL version 2011-01-10 17:39:16 -08:00
Ian Romanick
a302d740bd glcpp: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-10 17:38:56 -08:00
Ian Romanick
9ca5300b6e glcpp: Generate an error for division by zero
When GCC encounters a division by zero in a preprocessor directive, it
generates an error.  Since the GLSL spec says that the GLSL
preprocessor behaves like the C preprocessor, we should generate that
same error.

It's worth noting that I cannot find any text in the C99 spec that
says this should be an error.  The only text that I can find is line 5
on page 82 (section 6.5.5 Multiplicative Opertors), which says,

    "The result of the / operator is the quotient from the division of
    the first operand by the second; the result of the % operator is
    the remainder. In both operations, if the value of the second
    operand is zero, the behavior is undefined."

Fixes 093-divide-by-zero.c test and bugzilla #32831.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-10 17:37:51 -08:00
Chad Versace
4e09a786d2 glcpp: Regenerate glcpp-parse.c 2011-01-10 17:28:24 -08:00
Chad Versace
4fff52f1c9 glcpp: Fix segfault when validating macro redefinitions
In _token_list_equal_ignoring_space(token_list_t*, token_list_t*), add
a guard that prevents dereferncing a null token list.

This fixes test src/glsl/glcpp/tests/092-redefine-macro-error-2.c and
Bugzilla #32695.
2011-01-10 17:28:24 -08:00
Eric Anholt
c0cdae0368 i965: Use a new miptree to avoid software fallbacks due to drawing offset.
When attaching a small mipmap level to an FBO, the original gen4
didn't have the bits to support rendering to it.  Instead of falling
back, just blit it to a new little miptree just for it, and let it get
revalidated into the stack later just like any other new teximage.

Bug #30365.
2011-01-10 17:21:54 -08:00
Eric Anholt
6bdc319421 intel: Drop the speculatively-use-firstImage-mt in validation.
It's been replaced by just setting texObj->mt to image->mt at TexImage
time.
2011-01-10 17:21:11 -08:00
Eric Anholt
bdc6dc1d7e intel: Don't relayout the texture on maxlevel change.
This avoids relayouts in the common case of glGenerateMipmap() or
people doing similar things.

Bug #30366.
2011-01-10 17:21:11 -08:00
Eric Anholt
48024fb44c intel: When making a new teximage miptree, make a full one.
If we hit this path, we're level 1+ and the base level got allocated
as a single level instead of a full tree (so we don't match
intelObj->mt).  This tries to recover from that so that we end up with
2 allocations and 1 validation blit (old -> new) instead of
allocations equal to number of levels and levels - 1 blits.
2011-01-10 17:21:11 -08:00
Eric Anholt
bd4a2e9209 meta: Don't tweak BaseLevel when doing glGenerateMipmap().
We don't need to worry about levels other than MaxLevel because we're
minifying -- the lower levels (higher detail) won't contribute to the
result.  By changing BaseLevel, we forced hardware that doesn't
support BaseLevel != 0 to relayout the texture object.
2011-01-10 17:21:11 -08:00
Eric Anholt
5b3eb7538c Revert "intel: Always allocate miptrees from level 0, not tObj->BaseLevel."
This reverts commit 7ce6517f3a.
This reverts commit d60145d06d.

I was wrong about which generations supported baselevel adjustment --
it's just gen4, nothing earlier.  This meant that i915 would have
never used the mag filter when baselevel != 0.  Not a severe bug, but
not an intentional regression.  I think we can fix the performance
issue another way.
2011-01-10 17:21:10 -08:00
Kenneth Graunke
da0c0dbab0 i965: Add #defines for HiZ and separate stencil buffer commands. 2011-01-10 15:44:32 -08:00
Kenneth Graunke
4b929c75e2 i965: Add new HiZ related bits to WM_STATE. 2011-01-10 15:44:32 -08:00
Kenneth Graunke
1feee7b1b3 i965: Rename more #defines to 3DSTATE rather than CMD or CMD_3D.
Again, this makes it match the documentation.
2011-01-10 15:44:32 -08:00
Kenneth Graunke
6c5e6cd130 i965: Remove unused #defines which only contain the sub-opcode.
Most _3DSTATE defines contain the command type, sub-type, opcode, and
sub-opcode (i.e. 0x7905).  These, however, contain only the sub-opcode
(i.e. 0x05).  Since they are inconsistent with the rest of the code and
nothing uses them, simply delete them.

The _3DOP and _3DCONTROL defines seemed similar, and were also unused.
2011-01-10 15:44:32 -08:00
Chad Versace
61428dd2ab glsl: At link-time, check that globals have matching centroid qualifiers
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
2011-01-10 15:29:30 -08:00
Tom Fogal
0e3ff159f9 Add GLX_TLS setting to configs/default.
Should have gone in with 31351dc029,
thanks to Dan Nicholson for noticing.
2011-01-10 15:39:21 -07:00
Dave Airlie
a988ddf379 mesa/swrast: handle sRGB FBOs correctly (v2)
From reading EXT_texture_sRGB and EXT_framebuffer_sRGB and interactions
with FBO I've found that swrast is converting the sRGB values to linear for
blending when an sRGB texture is bound as an FBO. According to the spec
and further explained in the framebuffer_sRGB spec this behaviour is not
required unless the GL_FRAMEBUFFER_SRGB is enabled and the Visual/config
exposes GL_FRAMEBUFFER_SRGB_CAPABLE_EXT.

This patch fixes swrast to use a separate Fetch call for FBOs bound to
SRGB and avoid the conversions.

v2: export _mesa_get_texture_dimensions as per Brian's comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-11 08:32:33 +10:00
Tom Fogal
31351dc029 Export TLS support in gl.pc. 2011-01-10 12:34:02 -07:00
Marek Olšák
9d33e4e16c r300g: add debug option for buffer upload logging 2011-01-10 05:45:10 +01:00
Chia-I Wu
97e9a0e23f st/egl: Fix a void pointer arithmetic warning. 2011-01-10 11:51:13 +08:00
Chia-I Wu
12583174c5 mesa: Remove GLES overlay.
With core mesa doing runtime API checks, GLES overlay is no longer
needed.  Make --enable-gles-overlay equivalent to --enable-gles[12].
There may still be places where compile-time checks are done.  They
could be fixed case by case.
2011-01-10 11:50:35 +08:00
Chia-I Wu
c98ea26e16 egl: Make egl_dri2 and egl_glx built-in drivers.
These two drivers are small in size.  Making them built-in should
simplify packaging.
2011-01-10 11:50:34 +08:00
Chia-I Wu
15f0223931 egl_glx: Load libGL dynamically.
This is a step forward for compatibility with really old GLX.  But the
real reason for making this change now is so that we can make egl_glx a
built-in driver without having to link to libGL.
2011-01-10 11:25:31 +08:00
Chia-I Wu
fef5d14494 egl_dri2: Look up _glapi_get_proc_address dynamically.
In preparation for making egl_dri2 built-in.  It also handles

  symbol lookup error: /usr/local/lib/egl/egl_dri2.so: undefined symbol:
  _glapi_get_proc_address

more gracefully.
2011-01-10 11:23:24 +08:00
Vinson Lee
231ca0ec85 r600: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:29:02 -08:00
Vinson Lee
c45814d6d3 r300: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:25:36 -08:00
Vinson Lee
7a1cdef6c4 r200: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:22:07 -08:00
Jerome Glisse
3349517351 noop: make noop useable like trace or rbug
If you want to enable noop set GALLIUM_NOOP=1 as an env variable.
You need first to enable noop wrapping for your driver see change
to src/gallium/targets/dri-r600/ in this commit as an example.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-09 21:04:41 -05:00
Marek Olšák
ac6306e9ca r300g: do not upload the same user buffer several times
Performance++.
2011-01-09 22:43:41 +01:00
Christoph Bumiller
b3d8e1fb3b nvc0: implement queries 2011-01-09 21:50:06 +01:00
Juan Zhao
e59fa4c46c dri2: release texture image.
Add release function for texture_from_pixmap extension.
Some platform need to release texture image for texture_from_pixmap
extension, add this interface for those platforms.
2011-01-09 14:55:16 -05:00
Vinson Lee
fb9c6e681f radeon: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:45:04 -08:00
Vinson Lee
1933e97034 dri/nouveau: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:33:14 -08:00
Vinson Lee
45a56e4730 intel: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:25:54 -08:00
Vinson Lee
14b36cd568 vbo: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:18:23 -08:00
Vinson Lee
edc09358f7 st/mesa: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:04:19 -08:00
Vinson Lee
21750a2d9d mesa: Include mfeatures.h in program.c.
Include mfeatures.h for feature tests.
2011-01-09 00:47:33 -08:00
Dave Airlie
97195d04fd i965g: fix warnings 2011-01-09 17:25:12 +10:00
Dave Airlie
5e044e3900 i965g: update intel_decode from upstream. 2011-01-09 17:21:52 +10:00
Dave Airlie
3ee8d13c00 i965g: update disassembler code from classic.
still a bit of work to do, the winsys gen setting is a bit of a hack.
2011-01-09 17:21:10 +10:00
Dave Airlie
9562284114 i965g: update brw_defines.h from classic driver 2011-01-09 17:21:10 +10:00
Dave Airlie
571b317d02 i965g: update brw_structs.h from classic driver. 2011-01-09 17:21:10 +10:00
Dave Airlie
5826967d2e i965g: update to similiar gen stuff as i965 2011-01-09 17:21:10 +10:00
Marek Olšák
3332229b3b r300g: fix crash when flushing ZMASK
https://bugs.freedesktop.org/show_bug.cgi?id=32912

The fix is to call update_derived_state before user buffer uploads.
I've also moved some code around.

Unfortunately, there are still some ZMASK-related bugs which cause
misrendering, i.e. flushing doesn't always work and glean/fbo fails.
2011-01-09 06:14:23 +01:00
Marcin Slusarz
69191d4123 targets/egl: add libnvc0.a to nouveau libs 2011-01-09 00:46:35 +01:00
Christoph Bumiller
90e29afcb6 nvfx,nv50: pipe_reference the constant buffers 2011-01-08 15:40:14 +01:00
Christoph Bumiller
703f3597ad nvc0: fix primitive restart in immediate mode 2011-01-08 14:25:20 +01:00
Vinson Lee
d8cfe46442 mesa: Clean up header file inclusion in cpuinfo.c. 2011-01-08 03:03:17 -08:00
Marek Olšák
7c16a77b00 r300g: fix a surface leak when flushing ZMASK 2011-01-08 09:42:17 +01:00
Marek Olšák
1f0348c4a2 r300g: rework command submission and resource space checking
The motivation behind this rework is to get some speed by reducing
CPU overhead. The performance increase depends on many factors,
but it's measurable (I think it's about 10% increase in Torcs).

This commit replaces libdrm's radeon_cs_gem with our own implemention.
It's optimized specifically for r300g, but r600g could use it as well.
Reloc writes and space checking are faster and simpler than their
counterparts in libdrm (the time complexity of all the functions
is O(1) in nearly all scenarios, thanks to hashing).
(libdrm's radeon_bo_gem is still being used in the driver.)

It works like this:

cs_add_reloc(cs, buf, read_domain, write_domain) adds a new relocation and
also adds the size of 'buf' to the used_gart and used_vram winsys variables
based on the domains, which are simply or'd for the accounting purposes.
The adding is skipped if the reloc is already present in the list, but it
accounts any newly-referenced domains.

cs_validate is then called, which just checks:
    used_vram/gart < vram/gart_size * 0.8
The 0.8 number allows for some memory fragmentation. If the validation
fails, the pipe driver flushes CS and tries do the validation again,
i.e. it validates only that one operation. If it fails again, it drops
the operation on the floor and prints some nasty message to stderr.

cs_write_reloc(cs, buf) just writes a reloc that has been added using
cs_add_reloc. The read_domain and write_domain parameters have been removed,
because we already specify them in cs_add_reloc.

The space checking has been tested by putting small values in vram/gart_size
variables.
2011-01-08 07:05:42 +01:00
Eric Anholt
29c4f95cbc intel: Make renderbuffer tiling choice match texture tiling choice.
There really shouldn't be any difference between the two for us.
Fixes a bug where Z16 renderbuffers would be untiled on gen6, likely
leading to hangs.
2011-01-07 18:25:54 -08:00
Eric Anholt
8f593597fc intel: Use the _BaseFormat from MESA_FORMAT_* in renderbuffer setup. 2011-01-07 18:25:54 -08:00
Marek Olšák
aa6456dcd1 docs: fix messed up names with special characters in relnotes-7.9.1
(cherry picked from commit 67aeab0b77)
2011-01-08 03:10:18 +01:00
Marek Olšák
8d61a3f408 docs: fix messed up names with special characters in relnotes-7.10
(cherry picked from commit 36009724fd)
2011-01-08 03:09:47 +01:00
Eric Anholt
5df51c2bb0 i915: Drop old checks for the settexoffset hack. 2011-01-07 17:49:03 -08:00
Eric Anholt
372dc4cd6c i915: Don't claim to support AL1616 when neither 830 nor 915 does it.
Fixes an abort in fbo-generatemipmap-formats.
2011-01-07 17:49:03 -08:00
Eric Anholt
a7bf723056 intel: Add a vtbl hook for determining if a format is renderable.
By relying on just intel_span_supports_format, some formats that
aren't supported pre-gen4 were not reporting FBO incomplete.  And we
also complained in stderr when it happened on i915 because draw_region
gets called before framebuffer completeness validation.
2011-01-07 17:49:03 -08:00
Eric Anholt
f3240547f9 intel: expose ARB_framebuffer_object in the i915 driver.
ARB_fbo no longer disallows mismatched width/height on attachments
(shouldn't be any problem), mixed format color attachments (we only
support 1), and L/A/LA/I color attachments (we already reject them on
965 too).  It requires Gen'ed names (driver doesn't care), and adds
FramebufferTextureLayer (we don't do texture arrays).  So it looks
like we're already in the position we need to be for this extension.

Bug #27468, #32381.
2011-01-07 17:49:03 -08:00
Christoph Bumiller
8b2a46c0de nvc0: fix reloc domain conflict on buffer migration
Occurred because the code assumed that buf->domain would remain
equal to old_domain.
2011-01-08 02:14:00 +01:00
Christoph Bumiller
b2a79953a6 nvc0: upload user buffers only from draw info min to max index
There are actually applications that profit immensely from this.
2011-01-08 02:13:54 +01:00
Christoph Bumiller
64b639959f nvc0: fix emission of first 3 u8 indices to RING_NI 2011-01-08 02:13:10 +01:00
Christoph Bumiller
f5f086ca92 nvc0: reset mt transfer address after read loop over layers 2011-01-08 02:12:56 +01:00
Christoph Bumiller
bd301dfc12 nvc0: tie buffer memory release to the buffer fence
... instead of the next fence to be emitted. This way we have a
chance to reclaim the storage earlier.
2011-01-08 02:12:20 +01:00
Łukasz Krotowski
96d8a54716 r300g: Remove invalid assertion.
Invalid after be1af4394e (user buffer
creation with width0 == ~0).

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-01-08 01:35:02 +01:00
Ian Romanick
1e1aef567f docs: Import 7.10 release notes from 7.10 branch 2011-01-07 14:38:23 -08:00
Eric Anholt
1d1ad6306d i965: Avoid double-negation of immediate values in the VS.
In general, we have to negate in immediate values we pass in because
the src1 negate field in the register description is in the bits3 slot
that the 32-bit value is loaded into, so it's ignored by the hardware.
However, the src0 negate field is in bits1, so after we'd negated the
immediate value loaded in, it would also get negated through the
register description.  This broke this VP instruction in the position
calculation in civ4:

MAD TEMP[1], TEMP[1], CONST[256].zzzz, CONST[256].-y-y-y-y;

Bug #30156
2011-01-07 14:35:42 -08:00
Ian Romanick
46a360b26a docs: Import 7.9.1 release notes from 7.9 branch 2011-01-07 13:39:40 -08:00
Henri Verbeet
82acc3b14c r600g: Also set const_offset if the buffer is not a user buffer in r600_upload_const_buffer(). 2011-01-07 18:21:12 +01:00
Henri Verbeet
f39dfa0ab0 r600g: Update some comments for Evergreen. 2011-01-07 18:21:12 +01:00
Henri Verbeet
97e2aa31c6 r600g: Split ALU clauses based on used constant cache lines. 2011-01-07 18:21:12 +01:00
Henri Verbeet
2a134534a6 r600g: Consistently use the copy of the alu instruction in r600_bc_add_alu_type(). 2011-01-07 18:21:12 +01:00
Henri Verbeet
8273921b7a r600g: Store kcache settings as an array. 2011-01-07 18:21:12 +01:00
Marek Olšák
be1af4394e r300g: derive user buffer sizes at draw time
This only uploads the [min_index, max_index] range instead of [0, userbuf size],
which greatly speeds up user buffer uploads.

This is also a prerequisite for atomizing vertex arrays in st/mesa.
2011-01-07 16:23:49 +01:00
Jian Zhao
2a7380e9c3 mesa: fix an error in uniform arrays in row calculating.
Fix the error in uniform row calculating, it may alloc one line
more which may cause out of range on memory usage, sometimes program
aborted when free the memory.

NOTE: This is a candidate for 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-07 07:22:18 -07:00
Vinson Lee
db61b9ce39 mesa: Directly include mfeatures.h in files that perform feature tests. 2011-01-07 00:13:00 -08:00
Alex Deucher
7c320a869b r600c: fix up SQ setup in blit code for Ontario/NI 2011-01-07 03:10:50 -05:00
Dave Airlie
6d9ca78ef7 r600g: allow constant buffers to be user buffers.
This provides an upload facility for the constant buffers since Marek's
constants in user buffers changes.

gears at least work on my evergreen now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-07 10:35:41 +10:00
Alex Deucher
7b97bdba40 r600c: add support for NI asics 2011-01-06 18:40:17 -05:00
Alex Deucher
f54366bcf6 r600g: add support for NI (Northern Islands) GPUs
This adds support for Barts, Turks, and Caicos asics.
2011-01-06 18:05:16 -05:00
Kenneth Graunke
e31defc825 i965: Rename various gen6 #defines to match the documentation.
This should make it easier to cross-reference the code and hardware
documentation, as well as clear up any confusion on whether constants
like CMD_3D_WM_STATE mean WM_STATE (pre-gen6) or 3DSTATE_WM (gen6+).

This does not rename any pre-gen6 defines.
2011-01-06 13:56:26 -08:00
Jakob Bornecrantz
ff0f087513 svga: Ensure that the wrong vdecls don't get used in swtnl path
The draw module set new state that didn't require swtnl which caused need_swtnl to
be unset. This caused the call from to svga_update_state(svga, SVGA_STATE_SWTNL_DRAW)
from the vbuf backend to overwrite the vdecls we setup there to be overwritten with
the real buffers vdecls.
2011-01-06 20:09:07 +00:00
Ian Romanick
f2d0f776b1 glsl: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-06 10:53:38 -08:00
Ian Romanick
86b4398cd1 glsl: Support the 'invariant(all)' pragma
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
simply ignored by the compiler.  This adds support for setting all
variable invariant.

In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
but a warning is generated.

Fixes piglit test glsl-invariant-pragma and bugzilla #31925.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-06 10:49:56 -08:00
Ian Romanick
e942f32836 glsl: Allow less restrictive uses of sampler array indexing in GLSL <= 1.20
GLSL 1.10 and 1.20 allow any sort of sampler array indexing.
Restrictions were added in GLSL 1.30.  Commit f0f2ec4d added support
for the 1.30 restrictions, but it broke some valid 1.10/1.20 shaders.
This changes the error to a warning in GLSL 1.10, GLSL 1.20, and GLSL
ES 1.00.

There are some spurious whitespace changes in this commit.  I changed
the layout (and wording) of the error message so that all three cases
would be similar.  The 1.10/1.20 and 1.30 text is the same.  The only
difference is that one is an error, and the other is a warning.  The
GLSL ES 1.00 wording is similar but not quite the same.

Fixes piglit test
spec/glsl-1.10/compiler/constant-expressions/sampler-array-index-02.frag
and bugzilla #32374.
2011-01-06 10:06:59 -08:00
Marek Olšák
c60f1d8b00 r300g: fix corruption when nr_cbufs==0 and multiwrites enabled
https://bugs.freedesktop.org/show_bug.cgi?id=32634
2011-01-06 19:05:31 +01:00
Marek Olšák
6125cbe983 r300g: remove the buffer range checking
It's no longer needed because the upload buffer remains mapped while the CS
is being filled (openarena, ut2004 and others that this code was for do not
use VBOs by default).
2011-01-06 16:59:32 +01:00
Marek Olšák
31afa7616e r300g: skip buffer validation of upload buffers when appropriate
because the upload buffers are reused for subsequent draw operations.
2011-01-06 16:51:54 +01:00
Marek Olšák
45b51a9e70 util: add comments to u_upload_mgr and u_inlines 2011-01-06 16:16:30 +01:00
Marek Olšák
984d64881f vbo: remove a redundant call to _ae_invalidate_state
It's called in vbo_exec_invalidate_state too.
2011-01-06 16:16:30 +01:00
Marek Olšák
009cecf246 st/mesa: remove unused members in st_context
What were these for?
2011-01-06 16:16:30 +01:00
Marek Olšák
92209314df tgsi: remove redundant name tables from tgsi_text, use those from tgsi_dump
I also specified the array sizes in the header so that one can use
the Elements macro on it.
2011-01-06 16:16:30 +01:00
Marek Olšák
3c9aa3a7b1 gallium: drivers should reference vertex buffers
So that a state tracker can unreference them after set_vertex_buffers.
2011-01-06 16:16:29 +01:00
Marek Olšák
58c5e782e3 st/mesa: optimize constant buffer uploads
The overhead of resource_create, transfer_inline_write, and resource_destroy
to upload constant data is very visible with some apps in sysprof, and
as such should be eliminated.

My approach uses a user buffer to pass a pointer to a driver. This gives
the driver the freedom it needs to take the fast path, which may differ
for each driver.

This commit addresses the same issue as Jakob's one that suballocates out
of a big constant buffer, but it also eliminates the copy to the buffer.
2011-01-06 16:16:29 +01:00
Marek Olšák
5adcd9c911 st/mesa: do sanity checks on states only in debug builds 2011-01-06 16:16:29 +01:00
Marek Olšák
06286110b4 u_upload_mgr: new features
- Added a parameter to specify a minimum offset that should be returned.
  r300g needs this to better implement user buffer uploads. This weird
  requirement comes from the fact that the Radeon DRM doesn't support negative
  offsets.

- Added a parameter to notify a driver that the upload flush occured.
  A driver may skip buffer validation if there was no flush, resulting
  in a better performance.

- Added a new upload function that returns a pointer to the upload buffer
  directly, so that the buffer can be filled e.g. by the translate module.
2011-01-06 16:16:29 +01:00
Marek Olšák
8b7bd3ce88 u_upload_mgr: keep the upload buffer mapped until it is flushed
The map/unmap overhead can be significant even though there is no waiting on busy
buffers. There is simply a huge number of uploads.

This is a performance optimization for Torcs, a car racing game.
2011-01-06 16:16:29 +01:00
Pierre Allegraud
8fd8de3995 mesa: fix build for NetBSD
See http://bugs.freedesktop.org/show_bug.cgi?id=32859

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-06 08:00:01 -07:00
Brian Paul
1384aea50f glext: upgrade to version 67 2011-01-06 07:56:00 -07:00
Vinson Lee
ab564b516e mesa: Clean up header file inclusion in version.c.
Include imports.h directly instead of indirectly through context.h.
version.c does use any symbols that are added by context.h.
2011-01-06 00:45:08 -08:00
Vinson Lee
84ebd8e2d7 nvc0: Fix typo of nvc0_mm.c in SConscript. 2011-01-06 00:06:38 -08:00
Vinson Lee
becd98018b mesa: bump version to 7.11 2011-01-05 23:27:30 -08:00
Vinson Lee
0117da40cd mesa: Include mtypes.h in files that use gl_context struct.
Directly include mtypes.h if a file uses a gl_context struct. This
allows future removal of headers that are not strictly necessary but
indirectly include mtypes.h for a file.
2011-01-05 23:11:54 -08:00
Zou Nan hai
a728646fb5 i965: skip too small size mipmap
this fixes doom3 crash.
2011-01-06 11:36:23 +08:00
Eric Anholt
d60145d06d i915: Fix build for previous commit. 2011-01-05 18:28:13 -08:00
Eric Anholt
7ce6517f3a intel: Always allocate miptrees from level 0, not tObj->BaseLevel.
BaseLevel/MaxLevel are mostly used for two things: clamping texture
access for FBO rendering, and limiting the used mipmap levels when
incrementally loading textures.  By restricting our mipmap trees to
just the current BaseLevel/MaxLevel, we caused reallocation thrashing
in the common case, for a theoretical win if someone really did want
just levels 2..4 or whatever of their texture object.

Bug #30366
2011-01-05 18:23:54 -08:00
Eric Anholt
01b70c0628 intel: Drop unused first/lastlevel args to miptree_create_for_region.
We're always making a single-level, 0-baselevel miptree.
2011-01-05 18:11:31 -08:00
Vinson Lee
f84573d039 swrast: Include mtypes.h in s_triangle.c.
Include mtypes.h for gl_context symbol.
2011-01-05 17:46:39 -08:00
Vinson Lee
20d85865ec st/mesa: Include mtypes.h in st_cb_drawpixels.c.
Include mtypes.h for gl_context symbol.
2011-01-05 16:34:29 -08:00
Eric Anholt
1b18b45d79 intel: Clarify first_level/last_level vs baselevel/maxlevel by deletion.
This has always been ugly about our texture code -- object base/max
level vs intel object first/last level vs image level vs miptree
first/last level.  We now get rid of intelObj->first_level which is
just tObj->BaseLevel, and make intelObj->_MaxLevel clearly based off
of tObj->_MaxLevel instead of duplicating its code (incorrectly, as
image->MaxLog2 only considers width/height and not depth!)
2011-01-05 16:11:30 -08:00
Eric Anholt
9b7f57b18e mesa: Consider textures incomplete when maxlevel < baselevel.
See section 3.8.10 of the GL 2.1 specification.  There's no way to do
anything sane with that, and drivers would get all sorts of angry.
2011-01-05 15:51:37 -08:00
Eric Anholt
39cc0ee3ea i915: Enable LOD preclamping on 8xx like on 915/965.
Fixes lodclamp-between and lodclamp-between-max.
2011-01-05 14:50:27 -08:00
Eric Anholt
973e821a63 i915: Implement min/max lod clamping in hardware on 8xx.
This avoids 8xx-specific texture relayout for min/max lod changes.
One step closer to avoiding relayout for base/maxlevel changes!
2011-01-05 14:50:24 -08:00
Eric Anholt
6f31da584f intel: Drop TEXTURE_RECTANGLE check in miptree layout setup.
It's already handled by our non-mipmapped MinFilter, since
TEXTURE_RECTANGLE is always NEAREST or LINEAR.
2011-01-05 14:45:16 -08:00
Eric Anholt
8f0005bfd5 intel: Clean up redundant setup of firstLevel.
It's always BaseLevel (since TEXTURE_RECTANGLE's baselevel can't be
changed from 0), except for 8xx minlod hilarity.
2011-01-05 14:45:16 -08:00
Eric Anholt
e2ee0c55d3 intel: Drop a check for GL_TEXTURE_4D_SGIS.
The SGIS_texture4D extension was thankfully never completed, so we
couldn't implement it if we wanted to.
2011-01-05 14:45:16 -08:00
Vinson Lee
d5435b3f0c swrast: Remove unnecessary headers. 2011-01-05 13:47:02 -08:00
Eric Anholt
332a90e101 i965: Simplify the renderbuffer setup code.
It was quite a mess by trying to do NULL renderbuffers and real
renderbuffers in the same function.  This clarifies the common case of
real renderbuffers.
2011-01-05 10:28:10 -08:00
Michel Dänzer
c7c1e5338c st/xorg: Flesh out colour map support and support depth 8. 2011-01-05 11:41:56 +01:00
Xiang, Haihao
266d8eed69 i965: use BLT to clear buffer if possible on Sandybridge
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32713
2011-01-05 14:12:40 +08:00
Eric Anholt
06cb1a6a5b i965: Add support for SRGB DXT1 formats.
This makes
fbo-generatemipmap-formats GL_EXT_texture_sRGB-s3tc
match
fbo-generatemipmap-formats GL_EXT_texture_compression_s3tc

and swrast in bad DXT1_RGBA alpha=0 handling, but it means we won't
unpack and repack someone's textures into uncompressed SARGB8 format.
2011-01-04 16:43:35 -08:00
Vinson Lee
5a3f31575b glcpp: Add test for recursive #define. 2011-01-04 16:39:19 -08:00
Eric Anholt
3488b14a04 mesa: Fix the baseFormat for GL_COMPRESSED_SLUMINANCE_EXT.
It's just LUMINANCE, not LUMINANCE_ALPHA.  Fixes
fbo-generatemipmap-formats GL_EXT_texture_sRGB-s3tc assertion failure
when it tries to pack the L8 channels into LUMINANCE_ALPHA and wonders
why it's trying to do that.
2011-01-04 15:25:35 -08:00
Eric Anholt
5dbb856e96 intel: Merge our choosetexformat fallbacks into core.
We now share the type/format -> MESA_FORMAT_* mappings with software
mesa, and the core supports most of the fallbacks hardware drivers
will want.
2011-01-04 14:42:54 -08:00
Eric Anholt
001d944fd5 mesa: Make _mesa_choose_tex_format() choose formats out of a supported table.
Right now this is just tweaking the current code to look at the table.
Choosing actually supported formats will come later.
2011-01-04 14:14:17 -08:00
Vinson Lee
6530944b50 glcpp: Add division by zero test cases. 2011-01-04 13:18:19 -08:00
Marek Olšák
50630f9016 mesa: preserve 10 bits of precision in the texstore general path for ARGB2101010
Use make_temp_float_image instead of _make_temp_chan_image.
The latter converts the texture to 8 bits/component, losing 2 bits.
2011-01-04 21:59:56 +01:00
Marek Olšák
73e8a27387 st/mesa: advertise GL_ARB_half_float_pixel
This extension doesn't appear to need any driver-specific parts.
2011-01-04 21:59:56 +01:00
Marek Olšák
8543902bfb r300/compiler: disable the rename_regs pass for loops
This workaround fixes rendering of kwin thumbnails.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-04 21:58:51 +01:00
Alex Deucher
f28bb6bdd1 r600g: support up to 64 shader constants
From the r600 ISA:
Each ALU clause can lock up to four sets of constants
into the constant cache.  Each set (one cache line) is
16 128-bit constants. These are split into two groups.
Each group can be from a different constant buffer
(out of 16 buffers). Each group of two constants consists
of either [Line] and [Line+1] or [line + loop_ctr]
and [line + loop_ctr +1].

For supporting more than 64 constants, we need to
break the code into multiple ALU clauses based
on what sets of constants are needed in that clause.

Note: This is a candidate for the 7.10 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-04 15:37:12 -05:00
Tom Stellard
e96e86d07b r300/compiler: Fix black terrain in Civ4
rc_inst_can_use_presub() wasn't checking for too many RGB sources in
Alpha instructions or too many Alpha sources in RGB instructions.

Note: This is a candidate for the 7.10 branch.
2011-01-04 11:25:27 -08:00
Chad Versace
68d06b1454 glsl: Check that integer vertex outputs are qualified with flat
Perform this check in ast_declarator_list::hir().

From section 4.3.6 of the GLSL 1.30 spec:
   "If a vertex output is a signed or unsigned integer or integer
   vector, then it must be qualified with the interpolation
   qualifier
   flat."
2011-01-04 10:49:10 -08:00
Chad Versace
b84e3f570f glsl: Allow redeclaration of gl_Color and its variants in GLSL 1.30
Allow redeclaration of the following built-in variables with an
interpolation qualifier in language versions >= 1.30:
   * gl_FrontColor
   * gl_BackColor
   * gl_FrontSecondaryColor
   * gl_BackSecondaryColor
   * gl_Color
   * gl_SecondaryColor

See section 4.3.7 of the GLSL 1.30 spec.
2011-01-04 10:49:10 -08:00
Chad Versace
4a62a1c366 glsl: Comment ast_type_qualifier.flags 2011-01-04 10:49:10 -08:00
Eric Anholt
b7b2791c6b intel: When validating an FBO's combined depth/stencil, use the given FBO.
We were looking at the current draw buffer instead to see whether the
depth/stencil combination matched.  So you'd get told your framebuffer
was complete, until you bound it and went to draw and we decided that
it was incomplete.
2011-01-04 10:04:19 -08:00
Eric Anholt
0ea49380e2 intel: Fix segfaults from trying to use _ColorDrawBuffers in FBO validation.
The _ColorDrawBuffers is a piece of computed state that gets for the
current draw/read buffers at _mesa_update_state time.  However, this
function actually gets used for non-current draw/read buffers when
checking if an FBO is complete from the driver's perspective.  So,
instead of trying to just look at the attachment points that are
currently referenced by glDrawBuffers, look at all attachment points
to see if they're driver-supported formats.  This appears to actually
be more in line with the intent of the spec, too.

Fixes a segfault in my upcoming fbo-clear-formats piglit test, and
hopefully bug #30278
2011-01-04 10:04:15 -08:00
Christoph Bumiller
cd1cf78828 Merge remote branch 'origin/nvc0' 2011-01-04 18:20:05 +01:00
Brian Paul
c94996f057 st/mesa: skip glDrawPixels/glBitmap-related code for ES build
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32560
2011-01-04 08:28:17 -07:00
Christoph Bumiller
4884ca5f67 nvc0: fix index size method value for u8 indices 2011-01-04 16:16:52 +01:00
Christoph Bumiller
2f08d872b2 nvc0: set the correct FP header bit for multiple colour outputs 2011-01-04 16:14:58 +01:00
Christoph Bumiller
6de94e1012 nvc0: delete memory caches and fence on screen destruction 2011-01-04 16:14:46 +01:00
Christoph Bumiller
471025929c nvc0: use mov instead of ld for scalar const loads 2011-01-04 16:14:42 +01:00
Christoph Bumiller
c024c1d75f nvc0: fix resource unmap after vertex push 2011-01-04 16:14:38 +01:00
Christoph Bumiller
e1e29395df nvc0: use the proper typed opcodes in constant folding 2011-01-04 16:14:33 +01:00
Christoph Bumiller
92caa65c24 nvc0: demagic GP invocation count bitfield 2011-01-04 16:14:26 +01:00
Christoph Bumiller
997f84ff4e nvc0: rewrite the 9097 GRAPH macros 2011-01-04 16:13:42 +01:00
Brian Paul
6a102074bb i965g: include brw_types.h instead of GL/gl.h
Alternately, some search&replace could be used to replace all
occurances of GLint with int, etc. in the driver.
2011-01-04 07:24:38 -07:00
Brian Paul
c8a6a8bf2c osmesa: pass context to _mesa_update_framebuffer_visual()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32814
2011-01-04 07:13:52 -07:00
Vinson Lee
90b7a4cc1a llvmpipe: Include p_compiler.h in lp_scene_queue.h.
Include p_compiler.h for boolean symbol.
2011-01-04 01:08:47 -08:00
Vinson Lee
f67dad7b82 llvmpipe: Include p_compiler.h in lp_perf.h.
Include p_compiler.h for int64_t symbol.
2011-01-04 01:01:18 -08:00
Vinson Lee
c72eb72ca6 llvmpipe: Include missing headers in lp_bld_depth.h
Include p_compiler.h for boolean symbol.
Include p_state.h for pipe_stencil_state symbol.
2011-01-04 00:54:14 -08:00
Vinson Lee
deb9a6ae79 llvmpipe: Include p_compiler.h in lp_bld_alpha.h.
Include p_compiler.h for boolean symbol.
Add forward declaration for gallivm_state struct.
2011-01-04 00:50:48 -08:00
Vinson Lee
7bfc54ea5d i965g: Include p_compiler.h in intel_decode.h.
Include p_compiler.h for uint32_t symbol.
2011-01-04 00:44:23 -08:00
Vinson Lee
cf15e9b343 i965g: Include gl.h in intel_structs.h.
Include gl.h for OpenGL symbols.
2011-01-04 00:41:10 -08:00
Zhenyu Wang
bea6539abf i965: Use last vertex convention for quad provoking vertex on sandybridge
Until we know how hw converts quads to polygon in beginning of
3D pipeline, for now unconditionally use last vertex convention.

Fix glean/clipFlat case.
2011-01-04 15:56:26 +08:00
Vinson Lee
9095947fa7 mesa: Include mtypes.h in renderbuffer.h.
Include mtypes.h for gl_buffer_index symbol.

This is a follow-up to commit 65da73c5f8.
2011-01-03 22:42:12 -08:00
Zhenyu Wang
1df795f958 i965: Correct comment for gen6 fb write control message setting
Remove incorrect headless comment for gen6 fb write message.
Note current SIMD16 mode has already done right for control message.
2011-01-04 13:57:16 +08:00
Zhenyu Wang
9977297ad9 i965: Fix provoking vertex select in clip state for sandybridge
Triangle fan provoking vertex for first convention should be
'vertex 1' in sandybridge clip state.

Partly fix glean/clipFlat case
2011-01-04 13:51:39 +08:00
Brian Paul
7bd2c5d1f9 mesa: fix AL44 texture fetch function nybble -> float conversion
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32804
2011-01-03 17:16:48 -07:00
Eric Anholt
bd8e658884 intel: Bump libdrm configure.ac requirement for the gen6 BLT ring support. 2011-01-03 15:04:19 -08:00
Eric Anholt
30fef21aa3 intel: Use tri clears when we don't know how to blit clear the format.
Bug #32207.  Fixes ARB_texture_rg/fbo-clear-formats (see my
fbo-clear-formats piglit branch currently)
2011-01-03 13:28:26 -08:00
Eric Anholt
5f13c39484 mesa: Also report the number of renderbuffer alpha bits for GL_LUMINANCE_ALPHA.
Noticed by code inspection.
2011-01-03 13:28:26 -08:00
Eric Anholt
f45aea0ec9 mesa: Also report renderbuffer red/green size for GL_RED and GL_RG.
Noticed by code inspection.
2011-01-03 13:28:26 -08:00
Eric Anholt
059cca92a8 mesa: Use the common logic for "is this baseformat a color format?"
When figuring out whether a renderbuffer should be used to set the
visual bits of an FBO, we were missing important baseformats like
GL_RED, GL_RG, and GL_LUMINANCE.
2011-01-03 13:28:24 -08:00
Eric Anholt
beac6ee62a mesa: Allow color renderbuffers besides just RGB and RGBA.
We did so already for textures to do ARB_fbo's
GL_ALPHA/GL_LUMINANCE/etc. support and for ARB_texture_rg's GL_RED and
GL_RG, but this path was missed.
2011-01-03 13:22:38 -08:00
Eric Anholt
2d29349c00 mesa: Update comment about the list of BaseFormats for gl_formats. 2011-01-03 13:22:38 -08:00
Eric Anholt
94ed481131 intel: Handle forced swrast clears before other clear bits.
Fixes a potential segfault on a non-native depthbuffer, and possible
accidental swrast fallback on extra color buffers.
2011-01-03 13:22:38 -08:00
Brian Paul
efbd33aff9 st/mesa: fix renderbuffer pointer check in st_Clear()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=30694

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-03 14:01:41 -07:00
Brian Paul
65da73c5f8 mesa: s/GLuint/gl_buffer_index/ 2011-01-03 14:01:41 -07:00
Brian Paul
35266fbe4f st/mesa: 80-column wrapping 2011-01-03 14:01:41 -07:00
Brian Paul
337f6e7b0e st/mesa: 80-column wrapping 2011-01-03 14:01:41 -07:00
Chia-I Wu
ada9c78c29 autoconf: Fix --with-driver=xlib --enable-openvg.
st/egl should be enabled with --enable-openvg even the driver is xlib or
osmesa.  Also, GLX_DIRECT_RENDERING should not be defined because libdrm
is not checked.
2011-01-04 01:13:49 +08:00
Chia-I Wu
cba7786954 docs: Add an example for EGL_DRIVERS_PATH.
EGL_DRIVERS_PATH can be set to test EGL without installation.
2011-01-04 00:54:55 +08:00
Dave Airlie
fb03510738 radeon: fix build on non-KMS systems.
Reported on irc by adamk.
2011-01-03 06:03:44 +10:00
Kenneth Graunke
1d40cf57f8 glsl: Really remove unused "instructions" parameter.
I forgot about this file, and it didn't show up until I tried to do
"make builtins" from a clean build.
2011-01-01 12:29:24 -08:00
Kenneth Graunke
81168351a7 glsl: Remove unused "instructions" parameter.
I think was used long ago, when we actually read the builtins into the
shader's instruction stream directly, rather than creating a separate
shader and linking the two.  It doesn't seem to serve any purpose now.
2011-01-01 12:01:54 -08:00
Brian Paul
1eceb9d323 mapi: add missing newline in error message 2010-12-31 16:37:41 -07:00
Brian Paul
e227f4bf50 egl: add missing case in _eglError() 2010-12-31 09:14:25 -07:00
Henri Verbeet
59051ad443 st/mesa: Handle wrapped depth buffers in st_copy_texsubimage(). 2010-12-31 07:49:59 +01:00
Vinson Lee
8d79765feb util: Add forward declarations in u_index_modify.h. 2010-12-30 01:54:35 -08:00
Vinson Lee
8114cf9ad8 tgsi: Clean up header file inclusion in tgsi_text.h. 2010-12-30 01:51:27 -08:00
Vinson Lee
8bfb9061b7 graw: Include p_shader_tokens.h for tgsi_token struct. 2010-12-30 01:49:26 -08:00
Vinson Lee
20a0f34283 tgsi: Clean up header file inclusion in tgsi_sanity.h. 2010-12-30 01:40:53 -08:00
Vinson Lee
79fa5acf26 x86: Clean up header file inclusion in mmx.h. 2010-12-30 01:26:47 -08:00
Vinson Lee
a1cd093a72 tnl: Clean up header file inclusion in t_vertex.h. 2010-12-30 01:05:33 -08:00
Vinson Lee
43c291683c vbo: Clean up header file inclusion in vbo.h. 2010-12-30 00:57:03 -08:00
Vinson Lee
176a8359b9 tnl: Clean up header file inclusion in t_vp_build.h. 2010-12-30 00:50:56 -08:00
Vinson Lee
9db9761874 tnl: Clean up header file inclusion in tnl.h. 2010-12-30 00:46:13 -08:00
Ben Skeggs
5b0e5e7389 drm/nvc0: don't un-bind every subchannel on init
The initial values in the grctx are 0x0000 anyway, and re-binding them
all to 0x0000 destroys some init done by the nouveau drm.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-30 12:34:12 +10:00
Marek Olšák
76db330e2c util: add a way to store translated indices to a user memory in u_index_modify
I am about to use the upload buffer in r300g instead.
2010-12-29 18:32:41 +01:00
Marek Olšák
48ed458e87 r300g: support user buffers as constant buffers 2010-12-29 18:32:41 +01:00
Eric Anholt
df4d83dca4 i965: Do lowering of array indexing of a vector in the FS.
Fixes a regression in ember since switching to the native FS backend,
and the new piglit tests glsl-fs-vec4-indexing-{2,3} for catching this.
2010-12-28 17:32:20 -08:00
Eric Anholt
54df8e48bc i965: Fix regression in FS comparisons on original gen4 due to gen6 changes.
Fixes 26 piglit cases on my GM965.
2010-12-28 15:35:00 -08:00
Eric Anholt
74dffb39c3 i965: Factor out the ir comparision to BRW_CONDITIONAL_* code. 2010-12-28 14:23:52 -08:00
Vinson Lee
f3319561a4 glcpp: Add negative tests for redefintions with valueless macros. 2010-12-27 23:20:35 -08:00
Dave Airlie
17004b3954 tgsi_dump: fix assert due to missing property name. 2010-12-28 16:52:19 +10:00
Marek Olšák
33e0b726e8 r300g: rename aos to vertex arrays 2010-12-28 04:52:36 +01:00
Marek Olšák
d9b84017e0 r300g: mark vertex arrays as dirty after a buffer_offset change
We shouldn't hit this bug in theory.

NOTE: This is a candidate for the 7.10 branch.
2010-12-28 04:40:05 +01:00
Zhenyu Wang
689aca7822 i965: Fix occlusion query on sandybridge
Clear target query buffer fixed occlusion query on sandybridge.

https://bugs.freedesktop.org/show_bug.cgi?id=32167
2010-12-28 11:11:40 +08:00
Zhenyu Wang
59fa8600d8 Revert "i965: upload multisample state for fragment program change"
This reverts commit de6fd527a5.

Revert this workaround as it seems the real trouble is caused by
lineloop, which doesn't require GS convert on sandybridge actually.
2010-12-28 09:36:43 +08:00
Kenneth Graunke
6bb1e4541e i965: Internally enable GL_NV_blend_square on ES2.
Hopefully should fix bug #32520.
2010-12-27 15:44:52 -08:00
Christoph Bumiller
0cb6d1a4eb nvc0: reference the vertex buffers 2010-12-27 21:00:40 +01:00
Christoph Bumiller
4fa429c876 nvc0: reenable some shader optimizations
CSE and constants folding.
2010-12-27 20:59:53 +01:00
Christoph Bumiller
a10b1c1204 nvc0: use VTX_ATTR for stride 0 vertex attributes 2010-12-27 13:59:43 +01:00
Christoph Bumiller
e4349027f6 nvc0: implement VRAM buffer transfers with bounce buffers 2010-12-27 13:57:46 +01:00
Christoph Bumiller
abd08f4c01 nvc0: init miptree transfer layer stride 2010-12-27 13:29:10 +01:00
Xiang, Haihao
b832ae8a4a i965: don't spawn GS thread for LINELOOP on Sandybridge
LINELOOP is converted to LINESTRIP at the beginning of the 3D pipeline.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32596
2010-12-27 17:05:58 +08:00
Kenneth Graunke
634a7dce9c i965: Flatten if-statements beyond depth 16 on pre-gen6.
Gen4 and Gen5 hardware can have a maximum supported nesting depth of 16.
Previously, shaders with control flow nested 17 levels deep would
cause a driver assertion or segmentation fault.

Gen6 (Sandybridge) hardware no longer has this restriction.

Fixes fd.o bug #31967.
2010-12-27 00:59:31 -08:00
Kenneth Graunke
9ac6a9b2fa glsl: Support if-flattening beyond a given maximum nesting depth.
This adds a new optional max_depth parameter (defaulting to 0) to
lower_if_to_cond_assign, and makes the pass only flatten if-statements
nested deeper than that.

By default, all if-statements will be flattened, just like before.

This patch also renames do_if_to_cond_assign to lower_if_to_cond_assign,
to match the new naming conventions.
2010-12-27 00:59:31 -08:00
Christoph Bumiller
780fbecc20 nvc0: respond please inline to PIPE_SHADER_CAP_SUBROUTINES 2010-12-23 15:22:00 +01:00
Christoph Bumiller
96def0c314 nvc0: fix layer stride state 2010-12-23 15:21:36 +01:00
Christoph Bumiller
2c20aae233 nvc0: use most defs/decls from nouveau_pushbuf.h 2010-12-23 15:19:22 +01:00
Ben Skeggs
82e0a38eed nvc0: remove unused 'buf' parameter in pipe_buffer_unmap 2010-12-21 06:41:09 +10:00
Ben Skeggs
317a1445c8 nvc0: BEGIN_RING->BEGIN_RING_NI in a couple of places 2010-12-21 06:33:17 +10:00
Ben Skeggs
e4e1a85bf8 nvc0: fence.bo is mappable, mark it as such 2010-12-21 06:32:13 +10:00
Ben Skeggs
e52ebd6e85 Merge remote branch 'origin/master' into nvc0-new
Conflicts:
	src/gallium/drivers/nouveau/nouveau_winsys.h
2010-12-21 06:30:39 +10:00
Ben Skeggs
5c102dd94f nouveau: fix includes for latest libdrm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 06:28:08 +10:00
Tom Fogal
cd9ed3da68 Regenerate gl_mangle.h.
NOTE: This is a candidate for the 7.10 branch.
2010-12-20 19:29:48 -07:00
Jerome Glisse
abe9ffc25c r600g: properly unset vertex buffer
Fix bug http://bugs.freedesktop.org/show_bug.cgi?id=32455

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-20 15:33:28 -05:00
Vinson Lee
a14f79f801 st/python: remove unused 'buf' parameter in pipe_buffer_unmap
This is a follow-up to commit ec51092a72.

Fixes SCons build.
2010-12-20 11:40:54 -08:00
Marek Olšák
ec51092a72 gallium: remove unused 'buf' parameter in pipe_buffer_unmap 2010-12-20 17:42:55 +01:00
Vinson Lee
c451aade88 st/mesa: Remove comment cruft from st_context.h.
This was unintentionally added by commit
1525fb4afe.
2010-12-20 01:24:26 -08:00
Vinson Lee
2dd788663a st/mesa: Clean up header file inclusion in st_cb_texture.h. 2010-12-20 01:15:04 -08:00
Vinson Lee
10eb0c39d5 st/mesa: Clean up header file inclusion in st_cb_readpixels.h. 2010-12-20 01:00:26 -08:00
Christoph Bumiller
9f2cf89957 nvc0: s/INLIN_RING/IMMED_RING 2010-12-19 22:53:47 +01:00
Christoph Bumiller
608b3c4432 nvc0: improve shader support for texturing
Fixed shadow and cube texture fetches, add array texture fetches.
2010-12-19 21:49:32 +01:00
Christoph Bumiller
ca5deb0c35 nvc0: adapt to array textures interface change 2010-12-19 21:48:39 +01:00
Christoph Bumiller
0f68236a24 Merge remote branch 'origin/master' into nvc0-new 2010-12-19 21:46:33 +01:00
Christoph Bumiller
d047168d81 nvc0: fix clipping with scissors/viewport
Also setup optional path to use proper primitive clipping instead,
which is probably slower.
2010-12-19 21:42:00 +01:00
Christoph Bumiller
e9de2a31a5 nvc0: use BIND_RING to set subchannel classes 2010-12-19 21:40:24 +01:00
Christoph Bumiller
f0f1cce962 nvc0: switch to the proper constants upload path
Makes things suddenly go surprisingly fast.
2010-12-19 21:38:42 +01:00
Christoph Bumiller
99f9a9727c nvc0: add the index buffer offset where missing 2010-12-19 21:33:37 +01:00
Marek Olšák
237880463d r300g: optimize the fallback for misaligned ushort indices 2010-12-19 04:05:34 +01:00
Vinson Lee
c87f82bc40 st/mesa: Clean up header file inclusion in st_cb_program.h. 2010-12-18 01:44:52 -08:00
Vinson Lee
ac09685d2a st/mesa: Clean up header file inclusion in st_cb_accum.h. 2010-12-18 01:28:18 -08:00
Vinson Lee
488e994ba9 mesa: Clean up header file inclusion in prog_statevars.h. 2010-12-18 01:16:53 -08:00
Dave Airlie
aa4d311873 mesa: fix queryobj whitespace.
Had done this before pushing but forgot to amend, doh.
2010-12-18 17:48:21 +10:00
Dave Airlie
ff7aa554a1 mesa/swrast/st: add ARB_occlusion_query2 support.
This gets my vote for most pointless extension of all time, I'm guessing
some driver could possibly optimise for this instead of counting it might
just get a true/false, but I'm not really sure.

need this to eventually advertise 3.3 despite its total uselessness.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-18 17:33:25 +10:00
Chia-I Wu
7048095513 mapi: Clean up sources.mk.
Rename MAPI_GLAPI_SOURCES to MAPI_UTIL_SOURCES.  Rename macro
MAPI_GLAPI_CURRENT to MAPI_MODE_UTIL.  Update the comments to make it
clear that mapi may be used in two ways and how.
2010-12-18 15:05:58 +08:00
Chia-I Wu
c17d4999f1 mapi: Clean up u_current interface.
Try not to use macros to make u_current.h appear to be glapi.h.  Use
u_current.h to implement glapi.h instead whenever possible.
2010-12-18 15:05:52 +08:00
Chia-I Wu
c7119e281b mapi: Add ABI-tag note.
TLS requires kernel >= 2.4.20.  Per glapi.
2010-12-18 14:46:10 +08:00
Kenneth Graunke
a954dbeb8c Refresh autogenerated file builtin_function.cpp.
NOTE: The 7.9 and 7.10 branches will need their builtins refreshed too.
Rather than cherry-picking this commit, run 'make builtins'.
2010-12-17 19:40:56 -08:00
Kenneth Graunke
d7423a6531 glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).
These mistakenly computed 't' instead of t * t * (3.0 - 2.0 * t).

Also, properly vectorize the smoothstep(float, float, vec) variants.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-17 19:29:22 -08:00
José Fonseca
3f94d96fce gallivm: Cleanup util_format_xxx_fetch_xxx call generation.
No need to register function prototypes in the module now that we call
the C function pointer directly -- less LLVM objects lying around.

Limited testing with lp_test_format.
2010-12-17 20:14:31 +00:00
Kenneth Graunke
5c229e5fbd glsl: Expose a public glsl_type::void_type const pointer.
This is analogous to glsl_type::int_type and all the others.
2010-12-17 10:55:17 -08:00
Marek Olšák
daffaca53e r300g: finally fix the texture corruption on r3xx-r4xx
Even though a bound texture stays bound when calling set_fragment_sampler_views,
it must be assigned a new cache region depending on the occupancy of other
texture units.

This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28800

Thanks to Álmos <aaalmosss@gmail.com> for finding the bug in the code.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-17 13:17:52 +01:00
Kenneth Graunke
d0f8eea9a0 Remove OES_compressed_paletted_texture from the ES2 extension list.
We don't support it.
2010-12-16 17:40:50 -08:00
Brian Paul
42a0967a36 softpipe: remove sp_tex_tile_cache_border_color()
With swizzling done at the end of texture sampling, we can greatly
simplify swizzling of the border color.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32460
2010-12-16 18:18:57 -07:00
Brian Paul
9d9f8aba0a softpipe: fix depth texture sampling regression
We need to keep using the pipe_get_tile_swizzle() even though there's
no swizzling because we need to explicitly pass in the surface format.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32459
2010-12-16 17:40:09 -07:00
Brian Paul
3ecf47af12 gallivm: fix copy&paste error from previous commit
Fixes piglit regression, http://bugs.freedesktop.org/show_bug.cgi?id=32452

NOTE: This is a candidate for the 7.10 branch
2010-12-16 14:30:39 -07:00
richard
fcc7024afe r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well. 2010-12-16 15:52:55 -05:00
Eric Anholt
290a1141bc intel: Support glCopyTexImage() from XRGB8888 to ARGB8888.
The only mismatch between the two is that we have to clear the
destination's alpha to 1.0.  Fixes WOW performance on my Ironlake,
from a few frames a second to almost playable.
2010-12-16 10:48:19 -08:00
Eric Anholt
ec03b316b4 intel: Try to sanely check that formats match for CopyTexImage.
Before, we were going off of a couple of known (hopeful) matches
between internalFormats and the cpp of the read buffer.  Instead, we
can now just look at the gl_format of the two to see if they match.
We should avoid bad blits that might have been possible before, but
also allow different internalFormats to work without having to
enumerate each one.
2010-12-16 10:48:19 -08:00
Eric Anholt
e65c643792 intel: Drop commented intel_flush from copy_teximage.
The blit that follows appears in the command stream so it's serialized
with previous rendering.  Any queued vertices in the tnl layer were
already flushed up in mesa/main/.
2010-12-16 10:48:19 -08:00
Eric Anholt
99c7840b0c intel: Update renderbuffers before looking up CopyTexImage's read buffer.
Not fixing a particular bug, just noticed by code inspection.
2010-12-16 10:48:19 -08:00
Brian Paul
ee16e97ed1 gallivm: work around LLVM 2.6 bug when calling C functions
Create a constant int pointer to the C function, then cast it to the
function's type.  This avoids using trampoline code which seem to be
inadvertantly freed by LLVM in some situations (which leads to segfaults).
The root issue and work-around were found by José.

NOTE: This is a candidate for the 7.10 branch
2010-12-16 10:19:16 -07:00
Brian Paul
b7e150605d draw: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul
2bd9b386e6 svga: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul
bd75e4b8be i965g: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul
a185d439bd i915g: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul
f3955f6fcd softpipe: s/varient/variant 2010-12-16 10:18:23 -07:00
Brian Paul
aa5ba96d29 st/mesa: s/varient/variant 2010-12-16 10:18:23 -07:00
Eric Anholt
c52adfc2e1 i965: Set the alternative floating point mode on gen6 VS and WM.
This matches how we did the math instructions pre-gen6, though it
applies to non-math as well.

Fixes vp1-LIT test 2 (degenerate case: 0 ^ 0 -> 1)
2010-12-16 09:01:14 -08:00
Shuang He
2bd11ea119 i915: Fix INTEL_DEBUG=wm segmentation fault
The program should be disassembled after it's uploaded
2010-12-16 09:01:14 -08:00
Jakob Bornecrantz
23aa3c552c svga, glhd: Remove incorrect assert and add note
Stride can be lower then the size of the attribute.
But should probably be aligned to component size atleast for floats.
2010-12-16 09:44:02 +01:00
Jakob Bornecrantz
1138775d79 svga: Minor debug text fix 2010-12-16 09:44:02 +01:00
Jakob Bornecrantz
c28debbf6f svga: Remove debug print in winsys 2010-12-16 09:44:02 +01:00
Jakob Bornecrantz
486da2cfc0 svga: Correct spelling in swtnl backend 2010-12-16 09:44:01 +01:00
Jakob Bornecrantz
d7ff6dd09c svga: Fix newline at EOF 2010-12-16 09:36:51 +01:00
Jakob Bornecrantz
f75549a9d8 svga: Add Galahad and Softpipe to scons build 2010-12-16 08:53:26 +01:00
Jakob Bornecrantz
0967d77a9a wrapper: Flush pipe on unmap
For drivers that does DMA transfers instead of mapping directly
2010-12-16 08:53:26 +01:00
Jakob Bornecrantz
8b60bf4e9f wrapper: Fix width and height given to map and remove uneeded fields 2010-12-16 08:53:26 +01:00
Jakob Bornecrantz
b7a73c72a6 i915g: Ignore color0 writes all cbufs tgsi property 2010-12-27 00:18:55 +01:00
Chia-I Wu
9f2062fb12 st/egl: Fix eglChooseConfig when configs is NULL.
When configs is NULL, the app wants to know the number of matching
configs.
2010-12-26 23:35:50 +08:00
Vinson Lee
aa68dd9a49 swrast: Clean up header file inclusion in ss_vb.h. 2010-12-25 20:53:27 -08:00
Vinson Lee
da0bdc7cd5 swrast: Clean up header file inclusion in ss_triangle.h. 2010-12-25 20:48:29 -08:00
Vinson Lee
77d1d35163 swrast: Clean up header file inclusion in s_texfilter.h. 2010-12-25 20:28:17 -08:00
Vinson Lee
06fa986112 swrast: Clean up header file inclusion in s_texcombine.h. 2010-12-25 20:12:06 -08:00
Vinson Lee
77aaaf5fd5 swrast: Clean up header file inclusion in s_masking.h. 2010-12-25 20:03:33 -08:00
Vinson Lee
8ca0aca8dd nvfx: Remove unused variable.
Fixes this GCC warning.
nvfx_vbo.c: In function 'nvfx_idxbuf_emit':
nvfx_vbo.c:410: warning: unused variable 'eng3d'
2010-12-25 19:09:54 -08:00
Xavier Chantry
5f0f9f0486 nvfx: restore BEGIN_RING usage
Michel Hermier reported libdrm segfault (and kernel crash) on nv40 using
gallium :
http://www.mail-archive.com/nouveau@lists.freedesktop.org/msg06563.html

It turns out these were caused by some missing WAIT_RING (or wrong
computation of the WAIT_RING sizes). Unlike all other libdrm_nouveau users,
nvfx gallium tried to use a mininum calls of WAIT_RING, one WAIT_RING could
apply to many methods for different code paths and spread across several
functions. This made it too tricky to find out what the missing or wrong
WAIT_RING was.

By restoring BEGIN_RING, we force one WAIT_RING per method, and it's much
easier to check if the free size required in the pushbuffer is correct.  As
curro said, "let's keep it simple for the maintainers until the big
bottlenecks are gone"

Benchmarked on nv35 with openarena, nexuiz and ut2004 and no performance
regression.

The core of this patch was made with Coccinelle, with minor manual fixes
made on top.

Tested-by: Michel Hermier <hermier@frugalware.org>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-12-25 20:37:39 +01:00
Eric Anholt
b01b73c482 intel: Only do frame throttling at glFlush time when using frontbuffer.
This is the hack for input interactivity of frontbuffer rendering
(like we do for backbuffer at intelDRI2Flush()) by waiting for the n-2
frame to complete before starting a new one.  However, for an
application doing multiple contexts or regular rebinding of a single
context, this would end up lockstepping the CPU to the GPU because
every unbind was considered the end of a frame.

Improves WOW performance on my Ironlake by 48.8% (+/- 2.3%, n=5)
2010-12-25 09:06:52 -08:00
Marek Olšák
b606c8a015 r300g: simplify buffer_transfer_inline_write 2010-12-25 16:07:13 +01:00
Marek Olšák
7e752760d4 r300g: simplify the code for buffer uploads 2010-12-25 16:07:13 +01:00
Marek Olšák
9c448817f7 r300g: user index buffers are always aligned 2010-12-25 16:07:13 +01:00
Marek Olšák
b10bff1135 r300g: increase the size of upload buffers 2010-12-25 16:07:13 +01:00
Vinson Lee
ecc6b7c002 swrast: Clean up header file inclusion in s_logic.h. 2010-12-24 20:43:35 -08:00
Vinson Lee
8dfeb98eb1 swrast: Clean up header file inclusion in s_fragprog.h. 2010-12-24 20:34:53 -08:00
Vinson Lee
3e2ea145b1 swrast: Clean up header file inclusion in s_span.h. 2010-12-24 20:17:18 -08:00
Vinson Lee
7d5f5d3843 swrast: Clean up header file inclusion in s_fog.h. 2010-12-24 20:11:44 -08:00
Vinson Lee
ec891d78a0 swrast: Clean up header file inclusion in s_depth.h. 2010-12-24 20:06:11 -08:00
Vinson Lee
b3c59acca6 swrast: Clean up header file inclusion in s_blend.h. 2010-12-24 19:55:42 -08:00
Vinson Lee
c9a0e25919 swrast: Clean up header file inclusion in s_atifragshader.h. 2010-12-24 19:47:54 -08:00
Vinson Lee
eadb90f045 swrast: Clean up header file inclusion in s_alpha.h. 2010-12-24 19:30:38 -08:00
Vinson Lee
ebe95d3796 swrast: Clean up header file inclusion in s_accum.h. 2010-12-24 19:25:30 -08:00
Vinson Lee
775e373dd9 swrast: Clean up header file inclusion in s_aatriangle.h. 2010-12-24 18:48:00 -08:00
Vinson Lee
d59075303a swrast: Clean up header file inclusion in s_aaline.h. 2010-12-24 18:35:10 -08:00
Vinson Lee
499c77edf1 st/mesa: Clean up header file inclusion in st_mesa_to_tgsi.h. 2010-12-24 18:27:55 -08:00
Vinson Lee
b20dac4e2d st/mesa: Clean up header file inclusion in st_gen_mipmap.h. 2010-12-24 18:06:20 -08:00
Chia-I Wu
65e8f81110 docs/egl: Update egl.html.
Various updates and a new section about packaging.
2010-12-25 02:53:49 +08:00
Marek Olšák
88550083b3 r300g/swtcl: re-enable LLVM
Based on a patch from Drill <drill87@gmail.com>.

NOTE: This is a candidate for the 7.10 branch.
2010-12-24 18:38:03 +01:00
Henri Verbeet
8fc6c5fb36 r600g: r600_blit_uncompress_depth() can't fail. 2010-12-24 11:41:26 +01:00
Henri Verbeet
878519b73e r600g: Get rid of r600_blit_uncompress_depth_ptr. 2010-12-24 11:41:25 +01:00
Chia-I Wu
a91a337a7d mapi: Move mapi_func typedef to entry.h.
Make it clear that entry.h does not depend on stub.h.
2010-12-24 17:33:50 +08:00
Chia-I Wu
a33e9f049d mapi: Define MAPI_TMP_DEFINES only when needed.
Since struct mapi_table is opaque, MAPI_TMP_DEFINES is not needed in
table.h.
2010-12-24 17:33:49 +08:00
Chia-I Wu
e6a7ef3ca6 mapi: Add and use entry_get_public.
Given a dispatch slot, entry_get_public returns the address of the
corresponding public entry point.  There may be more than one of them.
But since they are all equivalent, it is fine to return any one of them.

With entry_get_public, the address of any public entry point can be
calculated at runtime when an assembly dispatcher is used.  There is no
need to have a mapping table in such case.  This omits the unnecessary
relocations from the binary.
2010-12-24 17:33:49 +08:00
Chia-I Wu
897bff6773 mapi: Make struct mapi_stub opaque.
Add accessors for struct mapi_stub and make it opaque.
2010-12-24 17:28:52 +08:00
Chia-I Wu
0c205484bf mapi: Allow blocks to be disabled from the output.
For example, a printer may ask not to output noop dispatch table.
2010-12-24 17:28:52 +08:00
Chia-I Wu
b765b1269f mapi: Fix hidden entries.
Hidden entries are just like normal entries except that they are not
exported.  Since it is not always possible to hide them, and two hidden
aliases can share the same entry, the name of hidden aliases are mangled
to '_dispatch_stub_<slot>'.
2010-12-24 17:28:52 +08:00
Chia-I Wu
52ca153349 mapi: Add "handcode" attribute to the script.
Entries with handcode attribute will be handled normally, except no
entry point will be generated for them.
2010-12-24 17:28:52 +08:00
Chia-I Wu
8eee1d522e mapi: Minor ABIPrinter refactoring.
Split out function name generation from _c_decl to _c_function, and use
it everywhere.  Add an optional 'export' argument to _cdecl.  It is
prepended to the returned string.
2010-12-24 17:28:51 +08:00
Chia-I Wu
86d29eab48 mapi: Store alias entry instead of alias name.
An entry can hold more info than plain name.
2010-12-24 17:28:51 +08:00
Dave Airlie
876effb0e7 r600g: hack around property unknown issues.
should fix https://bugs.freedesktop.org/show_bug.cgi?id=32619

Need to add proper support for properties later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 17:34:40 +10:00
Dave Airlie
ac38ad6156 r300g: turn back on rv530 hiz.
still needs RADEON_HYPERZ=y env var.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 15:46:12 +10:00
Dave Airlie
7a5fac56b2 r300g: hyperz fixing typo.
Really no idea why I didn't see this before, but these values were opposite
the register spec.

this seems to fix rv530 HiZ on my laptop, will reenable in next commit.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 15:46:11 +10:00
Vinson Lee
a57e2c436b mesa: Assert format is not MESA_FORMAT_COUNT in _mesa_format_to_type_and_comps.
The case of format being MESA_FORMAT_COUNT should never occur.
2010-12-23 18:19:42 -08:00
Xiang, Haihao
dc987adc9f i965: use align1 access mode for instructions with execSize=1 in VS
All operands must be 16-bytes aligned in aligh16 mode. This fixes l_xxx.c
in oglconform.
2010-12-24 09:51:44 +08:00
Xiang, Haihao
8249321604 i965: fix register region description
This fixes
 brw_eu_emit.c:179: validate_reg: Assertion `width == 1' failed.
2010-12-24 09:51:22 +08:00
Vinson Lee
1039f36c47 r600g: Rearrange print order of outputs of R600_ERR. 2010-12-23 17:26:36 -08:00
Vinson Lee
38eff56f7e mesa: Assert _mesa_DeleteFragmentShaderATI doesn't ever free static DummyShader. 2010-12-23 16:44:42 -08:00
Vinson Lee
7f178ffbf1 st/egl: Remove unnecessary header. 2010-12-23 16:23:53 -08:00
Vinson Lee
070f5da96d libgl-xlib: Remove unnecessary header. 2010-12-23 16:19:11 -08:00
Vinson Lee
075a807f43 r300g: Remove unnecessary header. 2010-12-23 16:05:28 -08:00
Dave Airlie
aaccb73276 tgsi_text: just parse as an integer (value is a boolean).
fixes warning reported by vlee on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 09:29:19 +10:00
Vinson Lee
0b76255714 mapi: Remove unnecessary header. 2010-12-23 15:25:38 -08:00
Vinson Lee
bf4dffb8ef intel: Remove unnecessary headers. 2010-12-23 15:08:53 -08:00
Dave Airlie
4e52e8f746 r300g: add support for color0 writes to all bound color buffers.
Thanks to Marek Olšák for making my initial attempt actually work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 07:19:58 +10:00
Dave Airlie
07498075b5 mesa/st: set the color write cbuf property for fragColor writes 2010-12-24 07:19:58 +10:00
Dave Airlie
2f4860f2ab softpipe: add support for color writes all color bufs property 2010-12-24 07:19:57 +10:00
Dave Airlie
c9c8a5ed02 gallium: add fragment shader property for color writes to all buffers. (v2)
For GL fragColor semantics we need to tell the pipe drivers that the fragment
shader color result is to be replicated to all bound color buffers, this
adds the basic TGSI + documentation.

v2: fix missing comma pointed out by Tilman on mesa-dev.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 07:19:57 +10:00
Vinson Lee
eccffe2328 i965: Remove unnecessary headers. 2010-12-23 11:54:29 -08:00
Vinson Lee
280750c5ca mesa: Fix #ifdef typo in _mesa_format_to_type_and_comps.
According to the comment, the warning should be for debug builds.
2010-12-23 11:32:16 -08:00
Marek Olšák
aedbf05d31 r300g: use a simpler fallback for misaligned ushort indices with triangles
If 'start' is odd, render the first triangle with indices embedded
in the command stream, which adds 3 to 'start' and makes it even.
Then continue with the fast path.
2010-12-23 16:54:59 +01:00
Marek Olšák
c420c0e7d6 r300g: add support for B2G3R3 texturing 2010-12-23 16:54:59 +01:00
Marek Olšák
bf7b6f60ae mesa: fix texel store functions for some float formats
These are copy-paste errors obviously.
2010-12-23 16:54:58 +01:00
Marek Olšák
4a710469e0 st/mesa: do not require all texture formats to be renderable
This is a bandaid on the problem that if some formats were not renderable
(like luminance_alpha), st/mesa fell back to some RGBA format, so basically
some non-renderable formats were actually not used at all. This is only
a problem with hardware drivers, softpipe can render to anything.

Instead, require only RGB8/RGBA8 to be renderable.
2010-12-23 16:54:58 +01:00
Marek Olšák
998657112b st/mesa: use the formats RGB233, ARGB2101010, AL44, AL1616, A16, L16, I16 2010-12-23 16:54:58 +01:00
Marek Olšák
a780490374 gallium: add new formats L16A16_UNORM, A16_UNORM, I16_UNORM, B2G3R3_UNORM 2010-12-23 16:54:58 +01:00
Marek Olšák
fd8aa7ac71 mesa: implement new texture format I16 2010-12-23 16:54:58 +01:00
Marek Olšák
bb5ace68ce mesa: implement new texture format L16 2010-12-23 16:54:58 +01:00
Marek Olšák
eb31837a0d mesa: implement new texture format A16 2010-12-23 16:54:58 +01:00
Marek Olšák
bae9d511f3 mesa: implement new texture format AL44
Radeon GPUs can do this. R600 can even do render-to-texture.
Packing and extracting aren't implemented, but we shouldn't hit them (I think).
Tested with swrast, softpipe, and r300g.
2010-12-23 16:54:58 +01:00
Marek Olšák
621e5254ef mesa: implement new texture format ARGB2101010
Radeon GPUs do support GL_RGB10_A2.
2010-12-23 16:54:58 +01:00
Marek Olšák
0a7b60f7ed st/mesa: if Z32 is unsupported, prefer Z24 to Z16 2010-12-23 16:54:58 +01:00
Marek Olšák
888e59fce8 st/mesa: use RGBA16 for RGB12 and RGB16
To provide enough precision if a user wants it.
2010-12-23 16:54:58 +01:00
Marek Olšák
3f9e78ac39 st/mesa: use DXT SRGB formats for COMPRESSED_SRGB
And also check if the formats are supported to return something meaningful
if compression cannot be used.
2010-12-23 16:54:57 +01:00
Eric Anholt
bf15ad3782 i965: Keep around a copy of the VS constant surface dumping code.
Just like everywhere else, I never trust my constant uploads to
correctly put constants in the right places, even though that's so
rarely where the issue is.
2010-12-23 01:32:44 -08:00
Eric Anholt
5dc53444c8 i965: Correct the dp_read message descriptor setup on g4x.
It's mostly like gen4 message descriptor setup, except that the sizes
of type/control changed to be like gen5.  Fixes 21 piglit cases on
gm45, including the regressions in bug #32311 from increased VS
constant buffer usage.
2010-12-23 01:32:43 -08:00
Zhenyu Wang
de6fd527a5 i965: upload multisample state for fragment program change
This makes conformance tests stable on sandybridge D0 to track
multisample state before SF/WM state.
2010-12-23 17:30:03 +08:00
Zhenyu Wang
845d651cf6 i965: Use MI_FLUSH_DW for blt ring flush on sandybridge
Old MI_FLUSH command is deprecated on sandybridge blt.
2010-12-23 17:29:46 +08:00
Vinson Lee
1e7bfcc707 st/mesa: Remove unnecessary header. 2010-12-23 01:03:32 -08:00
Vinson Lee
492afbce18 gallivm: Disable MMX-disabling code on llvm-2.9.
The disable-mmx option was removed in llvm-2.9svn by revisions 122188
and 122189.

Fixes FDO bug 32564.
2010-12-22 19:56:10 -08:00
Vinson Lee
adaa310e39 gallivm: Fix 'cast from pointer to integer of different size' warning.
Fixes this GCC warning.
lp_bld_const.h: In function 'lp_build_const_int_pointer':
lp_bld_const.h:137: warning: cast from pointer to integer of different size
2010-12-22 16:48:19 -08:00
Vinson Lee
38c8b034e2 i915g: Remove unnecessary header. 2010-12-22 00:57:52 -08:00
Vinson Lee
442fcd0620 llvmpipe: Remove unnecessary headers. 2010-12-22 00:55:41 -08:00
Vinson Lee
013fc33462 r300g: Remove unnecessary headers. 2010-12-22 00:52:05 -08:00
Vinson Lee
f39d0c791a svga: Remove unnecessary header. 2010-12-22 00:42:23 -08:00
Vinson Lee
a91128030e st/vega: Remove unnecessary headers. 2010-12-22 00:38:42 -08:00
Henri Verbeet
ca8b4ca478 r600g: Remove the unused "pframebuffer" field from r600_pipe_context. 2010-12-22 09:19:48 +01:00
Henri Verbeet
2fd718d560 r600g: r600_new() and r600_delete() are unused. 2010-12-22 09:19:48 +01:00
Zhenyu Wang
4374703a9b i965: explicit tell header present for fb write on sandybridge
Determine header present for fb write by msg length is not right
for SIMD16 dispatch, and if there're more output attributes, header
present is not easy to tell from msg length. This explicitly adds
new param for fb write to say header present or not.

Fixes many cases' hang and failure in GL conformance test.
2010-12-22 11:08:51 -05:00
Chia-I Wu
445cb9e53b st/egl: Assorted fixes for dri2_display_get_configs.
Set window_bit only when the visual id is greater than zero.  Correct
visual types.  Skip slow configs as they are not relevant.  Finally, do
not return duplicated configs.
2010-12-22 16:05:27 +08:00
Alex Deucher
341d048e45 r600g: remove useless switch statements
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-22 01:30:41 -05:00
Chia-I Wu
a31e2e3312 st/egl: Fix eglCopyBuffers.
Flush before presenting.
2010-12-22 14:21:47 +08:00
Chia-I Wu
18bc427ade st/egl: Plug pbuffer leaks.
Unreference validated resources or remove unnecessary validations.
2010-12-22 14:12:33 +08:00
Chia-I Wu
0fb2dcc98f st/egl: Allow single-buffered pixmaps.
All single-buffered configs were ignored before to make sure
EGL_RENDER_BUFFER is settable for window surfaces.  It is better to
allow single-buffered configs and set EGL_WINDOW_BIT only for
double-buffered ones.  This way there can be single-buffered pixmaps.
2010-12-22 14:12:33 +08:00
Dave Airlie
f431e0452b r600g: drop unused code in evergreen.
this code was pretty much duplicated, thanks to Henri Verbeet on irc for
pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-22 15:58:29 +10:00
Chia-I Wu
975b7ef92a st/egl: Remove native_config::samples.
Multisample buffers are never requested.
2010-12-22 13:22:36 +08:00
Chia-I Wu
3a93c34828 st/egl: Remove native_config::slow_config.
In direct rendering scenario, it is not needed until an EGLDisplay can
support both HW and SW pipe screens.
2010-12-22 13:22:36 +08:00
Chia-I Wu
0364c08d7f st/egl: Remove unnecessary egl_g3d_find_pixmap_config.
It was used to find a compatible config for a given pixmap.  Now that a
config is optional for pixmap surface creation, the function is not
needed.
2010-12-22 13:22:36 +08:00
Chia-I Wu
af767ee113 st/egl: Make config optional for create_pixmap_surface.
eglCopyBuffers or EGL_KHR_image_pixmap require creating a pixmap surface
without a config.  Make it just work without relying on
is_pixmap_supported.
2010-12-22 13:22:36 +08:00
Dave Airlie
2dd189a824 r600g: fix evergreen segfaults.
evergreen was crashing running even gears here.

This is a 7.10 candidate if its broken the same.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-22 14:54:17 +10:00
Marek Olšák
cb4f367b26 r300g: fix precision issues with B10G10R10A2 2010-12-22 03:39:37 +01:00
Marek Olšák
2a95542088 r300g: support B10G10R10A2 render targets only with DRM 2.8.0 or later versions 2010-12-22 03:39:37 +01:00
Eric Anholt
4fe78d3e12 i965: Avoid using float type for raw moves, to work around SNB issue.
The SNB alt-mode math does the denorm and inf reduction even for a
"raw MOV" like we do for g0 message header setup, where we are moving
values that aren't actually floats.  Just use UD type, where raw MOVs
really are raw MOVs.

Fixes glxgears since c52adfc2e1, but no
piglit tests had regressed(!)
2010-12-21 13:06:15 -08:00
Jerome Glisse
fa62cf7450 r600g: avoid segfault
Candidates 7.10

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-21 10:51:32 -05:00
Chris Wilson
8b9570e685 intel: Check for unsupported texture when finishing using as a render target
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-21 11:58:35 +00:00
Vinson Lee
c1f0f90a97 st/mesa: Clean up header file inclusion in st_format.h. 2010-12-21 01:25:04 -08:00
Vinson Lee
3d03b4d839 st/mesa: Clean up header file inclusion in st_draw.h. 2010-12-21 01:17:37 -08:00
Ben Skeggs
57dcd800ca nvfx: fix fragprog word swapping on big-endian machines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-16 11:13:21 +10:00
Jerome Glisse
dbb679e51d gallium: properly check for src->dst blit compatibilities
Spotted by Christoph Bumiller & Jose Fonseca

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-15 15:29:31 -05:00
Fredrik Höglund
66f55de31e r600g: fix pow(0, 0) evaluating to NaN
We have to use the non-IEEE compliant version of MUL here, since
log2(0) is -inf, and 0 * -inf is NaN in IEEE arithmetic.

candidates for 7.10 branch
2010-12-15 14:07:00 -05:00
Jerome Glisse
3861a1001c r600g: need to reference upload buffer as the might still live accross flush
Can't get away from referencing upload buffer as after flush a vertex buffer
using the upload buffer might still be active. Likely need to simplify the
pipe_refence a bit so we don't waste so much cpu time in it.

candidates for 7.10 branch

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-15 12:07:09 -05:00
Brian Paul
a8ca30bc58 st/mesa: fix incorrect prev pointer in destroy_program_variants() 2010-12-14 14:15:22 -07:00
Brian Paul
c62bb90d6a softpipe: do texture swizzle during texture sampling
Instead of when we read texture tiles.  Now swizzling happens after
the shadow depth compare step.  This fixes the piglit glsl-fs-shadow2d*
tests (except for proj+bias because of a GLSL bug).
2010-12-14 13:01:03 -07:00
Brian Paul
be2aa81f5f mesa: more program debug code 2010-12-14 12:46:01 -07:00
Brian Paul
2a77c3cc0b tgsi: document texture opcodes 2010-12-14 12:45:36 -07:00
Brian Paul
bb10e081c8 glsl: new glsl_strtod() wrapper to fix decimal point interpretation
We always want to use '.' as the decimal point.

See http://bugs.freedesktop.org/show_bug.cgi?id=24531

NOTE: this is a candidate for the 7.10 branch.
2010-12-14 12:38:38 -07:00
Brian Paul
dfbc20593e gallivm: do texture swizzle after shadow compare
We need to swizzle after the shadow comparison so that the GL_DEPTH_MODE
functionality is handled properly.

This fixes all the piglit glsl-fs-shadow2d*.shader_test cases, except
for glsl-fs-shadow2dproj-bias.shader_test which fails because of a
bug in the GLSL compiler (fd.o 32395).
2010-12-14 12:17:10 -07:00
Brian Paul
68c41a25b4 st/mesa: rename the varient release functions 2010-12-14 12:17:10 -07:00
Jerome Glisse
54773415f4 r600g: fix segfault when translating vertex buffer
Note the support for non float vertex draw likely regressed need to
find what we want to do there.

candidates for 7.10 branches

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-14 13:50:46 -05:00
Vinson Lee
4d1b2df6c0 mesa: Clean up header file inclusion in prog_optimize.h. 2010-12-14 00:39:57 -08:00
Vinson Lee
2c582dd25f mesa: Clean up header file inclusion in prog_cache.h. 2010-12-14 00:30:24 -08:00
Vinson Lee
71af07bf40 mesa: Clean up header file inclusion in nvvertparse.h. 2010-12-14 00:22:27 -08:00
Eric Anholt
c27285610c i965: Add support for using the BLT ring on gen6. 2010-12-13 19:41:58 -08:00
Eric Anholt
d88aa6fe3e i965: Improve the hacks for ARB_fp scalar^scalar POW on gen6.
This is still awful, but my ability to care about reworking the old
backend so we can just get a temporary value into a POW is awfully low
since the new backend does this all sensibly.

Fixes:
fp1-LIT test 1
fp1-LIT test 3 (case x < 0)
fp1-POW test (exponentiation)
fp-lit-mask
2010-12-13 16:47:57 -08:00
Brian Paul
43b7b9d02a st/mesa: 80-columns wrapping, whitespace fixes in st_cb_bitmap.c 2010-12-13 17:34:07 -07:00
Brian Paul
c21807d2f7 st/mesa: add geom program code in destroy_program_variants() 2010-12-13 17:29:56 -07:00
Brian Paul
b830b62a47 st/mesa: program struct comments 2010-12-13 17:28:02 -07:00
Brian Paul
4312569410 st/mesa: use st_fragment_program() instead of cast 2010-12-13 17:25:29 -07:00
Brian Paul
6c669d0c07 st/mesa: rename variable 2010-12-13 17:25:10 -07:00
Brian Paul
83d50c3ee1 st/mesa: minor re-indenting 2010-12-13 17:20:56 -07:00
Brian Paul
8d8e9491df st/mesa: make st_delete_program() static 2010-12-13 17:20:56 -07:00
Brian Paul
9b4433fe58 st/mesa: add comments, fix formatting in st_cb_program.c 2010-12-13 17:20:56 -07:00
Brian Paul
3d203b6100 Squashed commit of the following (st-mesa-per-context-shaders branch):
commit 4f106f44a32eaddb6cf3fea6ba5ee9787bff609a
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Dec 13 14:06:08 2010 -0700

    st/mesa: reorganize vertex program translation code

    Now it looks like the fragment and geometry program code.
    Also remove the serial number fields from programs.  It was used to
    determine when new translations were needed.  Now the variant key is
    used for that.  And the st_program_string_notify() callback removes all
    variants when the program's code is changed.

commit e12d6791c5e4bff60bb2e6c04414b1b4d1325f3e
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Dec 13 13:38:12 2010 -0700

    st/mesa: implement geometry shader varients

    Only needed in order to support per-context gallium shaders.

commit c5751c673644808ab069259a852f24c4c0e92b9d
Author: Brian Paul <brianp@vmware.com>
Date:   Sun Dec 12 15:28:57 2010 -0700

    st/mesa: restore glDraw/CopyPixels using new fragment program variants

    Clean up the logic for fragment programs for glDraw/CopyPixels.  We now
    generate fragment program variants for glDraw/CopyPixels as needed which
    do texture sampling, pixel scale/bias, pixelmap lookups, etc.

commit 7b0bb99bab6547f503a0176b5c0aef1482b02c97
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Dec 10 17:03:23 2010 -0700

    st/mesa: checkpoint: implement fragment program variants

    The fragment programs variants are per-context, as the vertex programs.

    NOTE: glDrawPixels is totally broken at this point.

commit 2cc926183f957f8abac18d71276dd5bbd1f27be2
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Dec 10 14:59:32 2010 -0700

    st/mesa: make vertex shader variants per-context

    Gallium shaders are per-context but OpenGL shaders aren't.  So we need
    to make a different variant for each context.

    During context tear-down we need to walk over all shaders/programs and
    free all variants for the context being destroyed.
2010-12-13 17:20:53 -07:00
Brian Paul
bb7c2691d2 mesa, st/mesa: disable GL_ARB_geometry_shader4
The new GLSL compiler doesn't support geom shaders yet so disable the
GL_ARB_geometry_shader4 extension.  Undo this when geom shaders work again.

NOTE: This is a candidate for the 7.10 branch.
2010-12-13 17:02:48 -07:00
Ian Romanick
2d577ee730 ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors
This is the same as what the array dereference handler does.

Fixes piglit test glsl-link-struct-array (bugzilla #31648).

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-13 15:47:56 -08:00
Ian Romanick
cb2b547a47 linker: Allow built-in arrays to have different sizes between shader stages
Fixes pitlit test glsl-link-varying-TexCoord (bugzilla #31650).
2010-12-13 15:16:39 -08:00
Eric Anholt
036c817f77 i965: Fix gl_FragCoord.z setup on gen6.
Fixes glsl-bug-22603.
2010-12-13 14:02:34 -08:00
Eric Anholt
5fbd8da8df i956: Fix the old FP path fragment position setup on gen6.
Fixes fp-arb-fragment-coord-conventions-none
2010-12-13 14:02:34 -08:00
Eric Anholt
7cec7bf56c i965: Fix ARL to work on gen6.
RNDD isn't one of the instructions that can do conversion from
execution type to destination type.

Fixes glsl-vs-arrays-3.
2010-12-13 14:02:34 -08:00
Eric Anholt
df9f891544 intel: Include stdbool so we can stop using GLboolean when we want to.
This requires shuffling the driconf XML macros around, since they use
true and false tokens expecting them to not get expanded to anything.
2010-12-13 14:02:34 -08:00
Brian Paul
b363dd43d6 gallivm: store callbacks in a linked list rather than fixed size array
Should fix http://bugs.freedesktop.org/show_bug.cgi?id=32308
2010-12-13 11:47:28 -07:00
Brian Paul
6577f753b2 tnl: a better way to initialize the gl_program_machine memory
This improves commit ef3f7e61b3

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-13 08:11:58 -07:00
Alex Deucher
4523285e51 r600g: fix rendering with a vertex attrib having a zero stride
The hardware supports zero stride just fine.  This is a port
of 2af8a19831 from r300g.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-12 23:35:37 -05:00
Dave Airlie
d19b5cbd31 r300g: fixup rs690 tiling stride alignment calculations.
The RS690 memory controller prefers things to be on a different
boundary than the discrete GPUs, we had an attempt to fix this,
but it still failed, this consolidates the stride calculation
into one place and removes the really special case check.

This fixes gnome-shell and 16 piglit tests on my rs690 system.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-13 11:29:21 +10:00
Chia-I Wu
d6b1478ff0 egl: Do not unload drivers.
When the driver is the last reference to libEGL.so, unloading it will
cause libEGL.so to be unmapped and give problems.  Disable the unloading
for now.  Still have to figure out the right timing to unload drivers.
2010-12-12 18:31:48 +08:00
Chia-I Wu
1c01bedb02 mapi: Fix a warning in !THREADS build.
It should be u_thread_self, not _glthread_GetID.
2010-12-12 17:59:47 +08:00
Vinson Lee
bf8242684a mesa: Clean up header file inclusion in nvfragparse.h. 2010-12-11 14:37:18 -08:00
Vinson Lee
7d8c067460 mesa: Clean up header file inclusion in ir_to_mesa.h. 2010-12-11 13:30:13 -08:00
Christoph Bumiller
5138ac033a nvc0: support user clip planes 2010-12-11 16:24:27 +01:00
Christoph Bumiller
67d0c3dd79 nvc0: enable vertex color clamping 2010-12-11 16:24:21 +01:00
Marek Olšák
2af8a19831 r300g: fix rendering with a vertex attrib having a zero stride
The hardware apparently does support a zero stride, so let's use it.

This fixes missing objects in ETQW, but might also fix a ton of other
similar-looking bugs.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-11 14:49:28 +01:00
Marek Olšák
c398f1544e tgsi: fix rbug compile error
../mesa/src/gallium/auxiliary/tgsi/tgsi_parse.h:139:
error: dereferencing pointer ‘tokens.25’ does break strict-aliasing rules

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-12-11 13:37:57 +01:00
Marek Olšák
d0990db6bd r300/compiler: fix swizzle lowering with a presubtract source operand
If a source operand has a non-native swizzle (e.g. the KIL instruction
cannot have a swizzle other than .xyzw), the lowering pass uses one or more
MOV instructions to move the operand to an intermediate temporary with
native swizzles.

This commit fixes that the presubtract information was lost during
the lowering.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-11 13:37:57 +01:00
Marek Olšák
9e1fbd3d6e r300/compiler: fix LIT in VS
This fixes broken rendering of trees in ETQW. The trees still disappear
for an unknown reason when they are close.

Broken since:
2ff9d4474b
r300/compiler: make lowering passes possibly use up to two less temps

NOTE: This is a candidate for the 7.10 branch.
2010-12-11 07:32:24 +01:00
Ian Romanick
d7f27e2e76 glsl: Inherrit type of declared variable from initializer after processing assignment
do_assignment may apply implicit conversions to coerce the base type
of initializer to the base type of the variable being declared.  Fixes
piglit test glsl-implicit-conversion-02 (bugzilla #32287).  This
probably also fixes bugzilla #32273.

NOTE: This is a candidate for the 7.9 branch and the 7.10 branch.
2010-12-10 17:52:35 -08:00
Ian Romanick
ec53010c4d glsl: Minor clean-up in validate_assignment
This code has been changed around a lot, and there were some temporary
variables left around from previous versions.
2010-12-10 17:52:35 -08:00
Eric Anholt
783e7caadf i965: Put common info on converting MESA_FORMAT to BRW_FORMAT in a table.
There are exceptions to the table for depth texturing or rendering to
not-quite-supported formats thanks to the non-orthogonal component
selection for surface formats, but it's still a lot simpler.
2010-12-10 16:17:01 -08:00
Eric Anholt
be72efb4f2 intel: Just use ChooseTextureFormat for renderbuffer format choice.
One less place to forget to put your new MESA_FORMAT support in.
2010-12-10 16:16:13 -08:00
Eric Anholt
e339b669a1 intel: Add a couple of helper functions to reduce rb code duplication. 2010-12-10 15:37:16 -08:00
Eric Anholt
28bab24e16 intel: Add spans code for the ARB_texture_rg support.
This starts spantmp2.h down the path of using MESA_FORMAT_* for
specifying the format instead of the crazy GL format/type combo.
2010-12-10 15:37:10 -08:00
Eric Anholt
a7e2d64971 mesa: Don't assertion fail for _mesa_get_format_name(MESA_FORMAT_NONE) 2010-12-10 15:29:52 -08:00
Vinson Lee
ef3f7e61b3 tnl: Initialize gl_program_machine memory in run_vp.
Fixes piglit valgrind glsl-array-bounds-04 failure (FDO bug 29946).

NOTE:
This is a candidate for the 7.10 branch.
This is a candidate for the 7.9 branch.
2010-12-10 14:24:05 -08:00
Christoph Bumiller
dea9d60400 nvc0: fix FACE state and and handle FACE sysval/varying offset 2010-12-10 20:20:37 +01:00
Christoph Bumiller
51f22689a4 nvc0: fix branching ops
- bra is PC relative
- jump to else condition was inverted
- handle integer comparisons
2010-12-10 20:20:34 +01:00
Mathias Fröhlich
b3d2ec9942 vbo: Avoid the copy to current in dlists if not required.
The current state is allowed to be undefined past DrawElements et al.
Consequently omit that copying at least in the display list code.
This pays us some percents performance.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-10 10:17:48 -07:00
Brian Paul
2a4df8933e mesa/meta: fix broken assertion, rename stack depth var
assert(current_save_state < MAX_META_OPS_DEPTH) did not compile.

Rename current_save_state to SaveStackDepth to be more consistent with
the style of the other fields.
2010-12-10 10:02:37 -07:00
Brian Paul
b7c38734c9 mesa: enable GL_ARB_draw_instanced for software drivers 2010-12-10 09:29:41 -07:00
Brian Paul
a63486ac68 tnl: implement instanced drawing 2010-12-10 09:29:13 -07:00
Brian Paul
6a0d3b7696 mesa: implement system values in program interpreter 2010-12-10 09:29:00 -07:00
Jerome Glisse
b22c8e8bbc r600g: fix bo size when creating bo from handle
Spoted by Alex Diomin

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-10 11:17:27 -05:00
Vinson Lee
d5810efca6 mesa: Clean up header file inclusion in arbprogparse.h. 2010-12-09 23:52:28 -08:00
Xiang, Haihao
e47eacdc53 i965: support for two-sided lighting on Sandybridge
VS places color attributes together so that SF unit can fetch the right
attribute according to object orientation. This fixes light issue in
mesa demo geartrain, projtex.
2010-12-10 13:25:22 +08:00
Xiang, Haihao
d1196bbc19 meta: allow nested meta operations
_mesa_meta_CopyPixels results in nested meta operations on Sandybridge.
Previoulsy the second meta operation overrides all states saved by the
first meta function.
2010-12-10 13:25:17 +08:00
Eric Anholt
3a3b1bd722 i965: Add support for gen6 reladdr VS constant loading. 2010-12-09 20:25:34 -08:00
Eric Anholt
15566183a6 i965: Add support for gen6 constant-index constant loading. 2010-12-09 20:25:34 -08:00
Chia-I Wu
83bdd402aa targets/egl: Improve st_GL.so loading.
When the application is not linked to any libGL*.so, loading st_GL.so
would give

  /usr/local/lib/egl/st_GL.so: undefined symbol: _glapi_tls_Context

In that case, load libGL.so and try again.  This works because
util_dl_open loads with RTLD_GLOBAL.

Fix "clear" OpenGL ES 1.1 demo.
2010-12-10 11:01:05 +08:00
Chia-I Wu
6efd963a23 target/egl: Fix misleading debug message.
When the name of the module is NULL, the process itself is dlopen()ed.
Do not print

  libEGL debug: searching for st module (null)
2010-12-10 11:00:31 +08:00
Brian Paul
becc4bb90c draw/llvm: don't flush in vs_llvm_delete()
Fixes piglit glx-shader-sharing crash.

When shaders are shared by multiple contexts, the shader's draw context
pointer may point to a previously destroyed context.  Dereferencing the
context pointer will lead to a crash.

In this case, simply removing the flushing code avoids the crash (the
exec and sse shader paths don't flush here either).

There's a deeper issue here, however, that needs examination.  Shaders
should not keep pointers to contexts since contexts might get destroyed
at any time.

NOTE: This is a candidate for the 7.10 branch (after this has been
tested for a while).
2010-12-09 18:41:22 -07:00
Brian Paul
70ca064454 draw/llvm: remove redundant comment 2010-12-09 18:40:48 -07:00
Brian Paul
bd995cf6c0 draw/llvm: remove extraneous conditional 2010-12-09 18:40:48 -07:00
Luca Barbieri
0e50c21e24 glsl: Unroll loops with conditional breaks anywhere (not just the end)
Currently we only unroll loops with conditional breaks at the end, which is
the form that lower_jumps generates.

However, if breaks are not lowered, they tend to appear at the beginning, so
add support for a conditional break anywhere.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-12-09 16:42:05 -08:00
Kenneth Graunke
13c45c590b glsl: Consider the "else" branch when looking for loop breaks.
Found this bug by code inspection.  Based off the comments just before
this code, the intent is to find whether the break exists in the "then"
branch or the "else" branch.  However, the code actually looked at the
last instruction in the "then" branch twice.
2010-12-09 16:42:05 -08:00
Kenneth Graunke
528fa8ce32 glsl: Clean up code by adding a new is_break() function. 2010-12-09 16:42:05 -08:00
Eric Anholt
b13a2e640f glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.
If you used a constant array index to access the matrix, we'd flag a
bunch of wrong inputs/outputs as being used because the index was
multiplied by matrix columns and the actual used index was left out.

Fixes glsl-mat-attribute.
2010-12-09 14:41:50 -08:00
Eric Anholt
3fb18d6775 intel: Set the swizzling for depth textures using the GL_RED depth mode.
Fixes depth-tex-modes-rg.
2010-12-09 14:41:50 -08:00
Eric Anholt
b4e8ec3a57 intel: Use plain R8 and RG8 for COMPRESSED_RED and COMPRESSED_RG.
Fixes texture-rg.
2010-12-09 14:41:50 -08:00
Vinson Lee
c3ca384e71 i965: Silence uninitialized variable warning.
Fixes this GCC warning.
brw_fs.cpp: In function 'brw_reg brw_reg_from_fs_reg(fs_reg*)':
brw_fs.cpp:3255: warning: 'brw_reg' may be used uninitialized in this function
2010-12-09 14:17:17 -08:00
Vinson Lee
af5f7b3260 r600g: Fix SCons build. 2010-12-09 14:03:58 -08:00
Jerome Glisse
121079bd67 r600g: indentation cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:16:22 -05:00
Jerome Glisse
7055068eea r600g: specialized upload manager
Allow important performance increase by doing hw specific implementation
of the upload manager helper. Drop the range flushing that is not hit with
this code (and wasn't with previous neither). Performance improvement are
mostly visible on slow CPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:05 -05:00
Jerome Glisse
15753cf54d r600g: avoid using pb* helper we are loosing previous cpu cycle with it
r600g is up to a point where all small CPU cycle matter and pb* turn
high on profile. It's mostly because pb try to be generic and thus
trigger unecessary check for r600g driver. To avoid having too much
abstraction & too much depth in the call embedded everythings into
r600_bo. Make code simpler & faster. The performance win highly depend
on the CPU & application considered being more important on slower CPU
and marginal/unoticeable on faster one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:01 -05:00
Fabian Bieler
ef534f3838 glsl: fix lowering conditional returns in subroutines
this fix applies to the lower_sub_return 'branch' of the lower_jumps pass

Fixes piglit tests glsl-functions-5 and glsl-functions-6.
2010-12-09 11:28:06 -08:00
Eric Anholt
834cc8e501 i965: remove unused variable since brw_wm_glsl.c removal. 2010-12-09 11:11:04 -08:00
Eric Anholt
cfcc2ef587 i965: Set render_cache_read_write surface state bit on gen6 constant surfs.
This is said to be required in the spec, even when you aren't doing writes.
2010-12-09 11:11:04 -08:00
Eric Anholt
30f25a1019 i965: Set up the correct texture border color state struct for Ironlake.
This doesn't actually fix border color on Ironlake, but it appears to
be a requirement, and gen6 needs it too.
2010-12-09 10:51:00 -08:00
Eric Anholt
14a9153a32 i965: Clean up VS constant buffer location setup. 2010-12-09 10:51:00 -08:00
Eric Anholt
8fab1c0e2e i965: Fix VS constants regression pre-gen6.
Last minute change for gen6 with 0 used params dropped the multiply.
2010-12-09 10:50:59 -08:00
José Fonseca
cdd4f04f80 llvmpipe: Plug fence leaks. 2010-12-09 16:48:26 +00:00
Christoph Bumiller
e32ec11278 nvc0: call grobj_alloc for all used classes
Only doing this to notify the DRM that we need a PGRAPH context,
nvc0 hardware doesn't use actual grobjs anymore.
2010-12-09 17:41:13 +01:00
Shuang He
9946f15d30 mesa: allow GLfixed arrays for OpenGL ES 2.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-09 08:23:54 -07:00
Christoph Bumiller
92f3642a4f nvc0: write texture address to TIC with a RELOC
Direct access to the bo address requires an API change.
2010-12-09 15:22:17 +01:00
Christoph Bumiller
6e753e3c29 nvc0: use tile flags in a way compatible with nouveau 2010-12-09 15:08:29 +01:00
Christoph Bumiller
3ef1616b63 nvc0: buffer suballocation with a primitive slab allocator 2010-12-09 15:01:37 +01:00
Christoph Bumiller
0d1a2bd0fb nvc0: generate shader header for geometry programs 2010-12-09 14:44:21 +01:00
Christoph Bumiller
14a09095d3 nvc0: fix immediate arg for SHL/SHR 2010-12-09 14:43:11 +01:00
Christoph Bumiller
2bb377ee02 nvc0: index buffers are back
Probably because long methods are gone index buffers must be
explicit again.
2010-12-09 14:41:33 +01:00
Christoph Bumiller
7fa7229560 nvc0: upload constants with m2mf for the time being
I get mysterious lockups with the dedicated CB upload ...
2010-12-09 14:35:26 +01:00
Christoph Bumiller
5655f8d42d nvc0: support primitive restart 2010-12-09 12:08:25 +01:00
Christoph Bumiller
548967f9fa nvc0: rcp f32 also supports neg and abs modifiers 2010-12-09 12:05:03 +01:00
Brian Paul
dcb48e7eb4 llvmpipe: enable instanced drawing cap 2010-12-08 19:06:22 -07:00
Brian Paul
cf2184f057 softpipe: enable instanced drawing cap 2010-12-08 19:04:16 -07:00
Brian Paul
1d6f3543a0 gallivm/llvmpipe: implement system values and instanceID 2010-12-08 19:04:11 -07:00
Brian Paul
2b5e1e5287 st/mesa: translate shader system inputs 2010-12-08 19:01:15 -07:00
Brian Paul
2d62fb6c3f draw: setup instance ID for SSE generator 2010-12-08 19:00:44 -07:00
Brian Paul
0be042cb4d draw: setup instance ID for VS interpreter 2010-12-08 19:00:32 -07:00
Brian Paul
691048a22a mesa: ir_to_mesa support for system values 2010-12-08 18:25:58 -07:00
Brian Paul
7ce186358e glsl: add support for system values and GL_ARB_draw_instanced 2010-12-08 18:25:38 -07:00
Brian Paul
379332f629 mesa: program printing for PROGRAM_SYSTEM_VALUE 2010-12-08 18:24:48 -07:00
Brian Paul
c6d74bcbfc mesa: add PROGRAM_SYSTEM_VALUE and related tokens
System values are shader inputs which don't necessarily change from
vertex to vertex or fragment to fragment.  gl_InstanceID and
gl_FrontFacing are examples.
2010-12-08 18:21:20 -07:00
Brian Paul
975418a654 tgsi/ppc: add case for system values and assert 2010-12-08 18:20:44 -07:00
Brian Paul
e8154eeae5 tgsi/sse: add support for system values 2010-12-08 18:20:05 -07:00
Brian Paul
b550d8d76b tgsi: new tgsi_shader_info fields for system values 2010-12-08 18:19:47 -07:00
Brian Paul
859f45a921 tgsi: add support for system values to TGSI interpreter 2010-12-08 18:19:14 -07:00
Brian Paul
9cd277684d st/mesa: GL_ARB_draw_instanced depends on PIPE_CAP_INSTANCED_DRAWING 2010-12-05 13:34:02 -07:00
Brian Paul
d87bc015dc gallium: added PIPE_CAP_INSTANCED_DRAWING 2010-12-05 13:32:59 -07:00
Christoph Bumiller
4c22475383 nvc0: import nvc0 gallium driver 2010-11-12 15:17:40 +01:00
1509 changed files with 140447 additions and 107823 deletions

View File

@@ -180,7 +180,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.10-devel
VERSION=7.11-devel
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
@@ -209,7 +209,6 @@ MAIN_FILES = \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES* \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/glext.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
@@ -232,6 +231,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/sources.mak \
@@ -283,8 +283,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/x86/*.S \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile \
$(DIRECTORY)/windows/VC8/
$(DIRECTORY)/src/mesa/x86-64/Makefile
MAPI_FILES = \
$(DIRECTORY)/include/GLES/*.h \
@@ -308,8 +307,7 @@ MAPI_FILES = \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in \
$(DIRECTORY)/src/mapi/vgapi/*.h
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
@@ -422,10 +420,22 @@ LIB_FILES = \
$(GLW_FILES)
# Everything for new a Mesa release:
tarballs: rm_depend configure aclocal.m4 lib_gz glut_gz \
lib_bz2 glut_bz2 lib_zip glut_zip md5
parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
$(LIB_NAME).tar.bz2 \
$(LIB_NAME).zip \
$(GLUT_NAME).tar.gz \
$(GLUT_NAME).tar.bz2 \
$(GLUT_NAME).zip
tarballs: md5
rm -f ../$(LIB_NAME).tar
# Helper for autoconf builds
ACLOCAL = aclocal
@@ -434,7 +444,7 @@ AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: configure.ac aclocal.m4 acinclude.m4
configure: rm_depend configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
rm_depend:
@@ -443,47 +453,41 @@ rm_depend:
touch $$dep ; \
done
rm_config:
rm_config: parsers
rm -f configs/current
rm -f configs/autoconf
lib_gz: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.gz $(DIRECTORY)
$(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
glut_gz:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
gzip $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
lib_bz2: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
bzip2 $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
$(GLUT_NAME).tar: rm_depend
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
glut_bz2:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
bzip2 $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
lib_zip: rm_config
$(LIB_NAME).tar.bz2: $(LIB_NAME).tar
bzip2 --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.bz2
$(GLUT_NAME).tar.bz2: $(GLUT_NAME).tar
bzip2 --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.bz2
$(LIB_NAME).zip: rm_config
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
glut_zip:
$(GLUT_NAME).zip:
rm -f $(GLUT_NAME).zip ; \
cd .. ; \
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
mv $(GLUT_NAME).zip $(DIRECTORY)
md5:
md5: $(ARCHIVES)
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@@ -491,7 +495,4 @@ md5:
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5 \
lib_gz glut_gz \
lib_bz2 glut_bz2 \
lib_zip glut_zip
.PHONY: tarballs rm_depend rm_config md5

View File

@@ -56,6 +56,12 @@ else:
Help(opts.GenerateHelpText(env))
# fail early for a common error on windows
if env['gles']:
try:
import libxml2
except ImportError:
raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
#######################################################################
# Environment setup
@@ -115,8 +121,51 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
# for debugging
#print env.Dump()
Export('env')
#######################################################################
# Invoke host SConscripts
#
# For things that are meant to be run on the native host build machine, instead
# of the target machine.
#
# Create host environent
if env['crosscompile'] and env['platform'] != 'embedded':
host_env = Environment(
options = opts,
# no tool used
tools = [],
toolpath = ['#scons'],
ENV = os.environ,
)
# Override options
host_env['platform'] = common.host_platform
host_env['machine'] = common.host_machine
host_env['toolchain'] = 'default'
host_env['llvm'] = False
host_env.Tool('gallium')
host_env['hostonly'] = True
assert host_env['crosscompile'] == False
if host_env['msvc']:
host_env.Append(CPPPATH = ['#include/c99'])
target_env = env
env = host_env
Export('env')
SConscript(
'src/SConscript',
variant_dir = host_env['build_dir'],
duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
env = target_env
Export('env')
#######################################################################
# Invoke SConscripts

View File

@@ -307,7 +307,7 @@ fi
#
case $ARCH in
'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*)
'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/* | 'NetBSD')
# we assume gcc
if [ "x$LINK" = "x" ] ; then
@@ -574,20 +574,6 @@ case $ARCH in
fi
;;
'NetBSD')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}_pic.a"
echo "mklib: Making NetBSD PIC static library: " ${LIBNAME}
FINAL_LIBS=`make_ar_static_lib cq 1 ${LIBNAME} ${OBJECTS}`
else
LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME}
rm -f ${LIBNAME}
ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
fi
;;
'IRIX' | 'IRIX64')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"

View File

@@ -14,22 +14,16 @@ import SCons.Script.SConscript
#######################################################################
# Defaults
_platform_map = {
'linux2': 'linux',
'win32': 'windows',
}
default_platform = sys.platform
default_platform = _platform_map.get(default_platform, default_platform)
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
if 'platform' in SCons.Script.ARGUMENTS:
selected_platform = SCons.Script.ARGUMENTS['platform']
target_platform = SCons.Script.ARGUMENTS['platform']
else:
selected_platform = default_platform
cross_compiling = selected_platform != default_platform
target_platform = host_platform
_machine_map = {
'x86': 'x86',
@@ -38,19 +32,22 @@ _machine_map = {
'i586': 'x86',
'i686': 'x86',
'ppc' : 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
}
# find default_machine value
# find host_machine value
if 'PROCESSOR_ARCHITECTURE' in os.environ:
default_machine = os.environ['PROCESSOR_ARCHITECTURE']
host_machine = os.environ['PROCESSOR_ARCHITECTURE']
else:
default_machine = _platform.machine()
default_machine = _machine_map.get(default_machine, 'generic')
host_machine = _platform.machine()
host_machine = _machine_map.get(host_machine, 'generic')
default_machine = host_machine
default_toolchain = 'default'
if selected_platform == 'windows' and cross_compiling:
if target_platform == 'windows' and host_platform != 'windows':
default_machine = 'x86'
default_toolchain = 'crossmingw'
@@ -61,7 +58,7 @@ if 'LLVM' in os.environ:
else:
default_llvm = 'no'
try:
if selected_platform != 'windows' and \
if target_platform != 'windows' and \
subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
default_llvm = 'yes'
except:
@@ -85,9 +82,10 @@ def AddOptions(opts):
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', default_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8')))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8')))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))

View File

@@ -15,11 +15,13 @@ ASM_FLAGS = @ASM_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
GLES_OVERLAY = @GLES_OVERLAY@
CFLAGS = @CPPFLAGS@ @CFLAGS@ \
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
@@ -33,9 +35,9 @@ LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
TALLOC_LIBS = @TALLOC_LIBS@
TALLOC_CFLAGS = @TALLOC_CFLAGS@
GLX_TLS = @GLX_TLS@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
@@ -65,6 +67,8 @@ OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -76,6 +80,8 @@ EGL_LIB_NAME = @EGL_LIB_NAME@
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -87,6 +93,8 @@ EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
@@ -103,7 +111,10 @@ GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
DRI_DIRS = @DRI_DIRS@
DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
DRICORE_LIBS = @DRICORE_LIBS@
DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
@@ -129,12 +140,16 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIBPATH) @WAYLAND_EGL_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
EXPAT_INCLUDES = @EXPAT_INCLUDES@
# Autoconf directories
@@ -182,11 +197,16 @@ GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@

View File

@@ -9,7 +9,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=10
MESA_MINOR=11
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
@@ -25,6 +25,7 @@ CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
GLX_TLS = no
# Compiler for building demos/tests/etc
APP_CC = $(CC)
@@ -58,6 +59,8 @@ EGL_LIB = EGL
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
# Library names (actual file names)
@@ -70,6 +73,8 @@ EGL_LIB_NAME = lib$(EGL_LIB).so
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -81,9 +86,11 @@ EGL_LIB_GLOB = $(EGL_LIB_NAME)*
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
TALLOC_LIBS = `pkg-config --libs talloc`
TALLOC_CFLAGS = `pkg-config --cflags talloc`
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
@@ -107,7 +114,7 @@ EGL_DRIVERS_DIRS = glx
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS_DIRS = softpipe trace rbug identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib
@@ -119,7 +126,7 @@ EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread $(TALLOC_LIBS)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
@@ -129,6 +136,8 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LI
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
@@ -177,3 +186,6 @@ GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =

View File

@@ -30,9 +30,11 @@ ASM_SOURCES =
MESA_ASM_SOURCES =
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)

View File

@@ -43,9 +43,11 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -ltalloc $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)

View File

@@ -41,9 +41,11 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)

View File

@@ -38,9 +38,11 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl \
$(LIBDRM_LIB)

View File

@@ -42,7 +42,8 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl

View File

@@ -12,7 +12,7 @@ GALLIUM_DRIVERS_DIRS += llvmpipe
OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DHAVE_UDIS86
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE
# override -std=c99
CFLAGS += -std=gnu99
@@ -31,9 +31,9 @@ endif
ifeq ($(MESA_LLVM),1)
LLVM_CFLAGS=`llvm-config --cppflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo interpreter instrumentation` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags backend bitreader engine ipo interpreter instrumentation)
LLVM_LIBS = $(shell llvm-config --libs backend bitwriter bitreader engine ipo interpreter instrumentation)
LLVM_CXXFLAGS=`llvm-config --cxxflags` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags)
LLVM_LIBS = $(shell llvm-config --libs)
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
@@ -41,4 +41,4 @@ else
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -ltalloc -lstdc++ -ludis86
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++

View File

@@ -18,11 +18,12 @@ AC_CONFIG_AUX_DIR([bin])
AC_CANONICAL_HOST
dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.15
LIBDRM_RADEON_REQUIRED=2.4.17
LIBDRM_REQUIRED=2.4.24
LIBDRM_RADEON_REQUIRED=2.4.24
LIBDRM_INTEL_REQUIRED=2.4.24
DRI2PROTO_REQUIRED=2.1
GLPROTO_REQUIRED=1.4.11
LIBDRM_XORG_REQUIRED=2.4.17
LIBDRM_XORG_REQUIRED=2.4.24
LIBKMS_XORG_REQUIRED=1.0.0
dnl Check for progs
@@ -150,9 +151,13 @@ if test "x$GCC" = xyes; then
# Enable -fvisibility=hidden if using a gcc that supports it
save_CFLAGS="$CFLAGS"
AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
CFLAGS="$CFLAGS -fvisibility=hidden"
VISIBILITY_CFLAGS="-fvisibility=hidden"
CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[CFLAGS="$save_CFLAGS" ; AC_MSG_RESULT([no])]);
[VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
# Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
CFLAGS=$save_CFLAGS
# Work around aliasing bugs - developers should comment this out
CFLAGS="$CFLAGS -fno-strict-aliasing"
@@ -163,14 +168,21 @@ if test "x$GXX" = xyes; then
# Enable -fvisibility=hidden if using a gcc that supports it
save_CXXFLAGS="$CXXFLAGS"
AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
VISIBILITY_CXXFLAGS="-fvisibility=hidden"
CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
[CXXFLAGS="$save_CXXFLAGS" ; AC_MSG_RESULT([no])]);
[VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
# Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
CXXFLAGS=$save_CXXFLAGS
# Work around aliasing bugs - developers should comment this out
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
fi
AC_SUBST([VISIBILITY_CFLAGS])
AC_SUBST([VISIBILITY_CXXFLAGS])
dnl These should be unnecessary, but let the user set them if they want
AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
Default is to use CFLAGS.])
@@ -316,6 +328,8 @@ EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
@@ -327,6 +341,8 @@ EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTE
GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
@@ -337,6 +353,8 @@ AC_SUBST([EGL_LIB_NAME])
AC_SUBST([GLESv1_CM_LIB_NAME])
AC_SUBST([GLESv2_LIB_NAME])
AC_SUBST([VG_LIB_NAME])
AC_SUBST([GLAPI_LIB_NAME])
AC_SUBST([WAYLAND_EGL_LIB_NAME])
AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB])
@@ -347,6 +365,8 @@ AC_SUBST([EGL_LIB_GLOB])
AC_SUBST([GLESv1_CM_LIB_GLOB])
AC_SUBST([GLESv2_LIB_GLOB])
AC_SUBST([VG_LIB_GLOB])
AC_SUBST([GLAPI_LIB_GLOB])
AC_SUBST([WAYLAND_EGL_LIB_GLOB])
dnl
dnl Arch/platform-specific settings
@@ -377,14 +397,14 @@ if test "x$enable_asm" = xyes; then
case "$host_cpu" in
i?86)
case "$host_os" in
linux* | *freebsd* | dragonfly*)
linux* | *freebsd* | dragonfly* | *netbsd*)
test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
;;
esac
;;
x86_64)
case "$host_os" in
linux* | *freebsd* | dragonfly*)
linux* | *freebsd* | dragonfly* | *netbsd*)
test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
;;
esac
@@ -483,9 +503,9 @@ AC_ARG_ENABLE([gles2],
[enable_gles2=no])
AC_ARG_ENABLE([gles-overlay],
[AS_HELP_STRING([--enable-gles-overlay],
[build separate OpenGL ES only libraries @<:@default=no@:>@])],
[enable_gles_overlay="$enableval"],
[enable_gles_overlay=no])
[DEPRECATED. Same as --enable-gles1 and --enable-gles2])],
[enable_gles1="$enableval"; enable_gles2="$enableval"],
[])
AC_ARG_ENABLE([openvg],
[AS_HELP_STRING([--enable-openvg],
@@ -506,13 +526,11 @@ fi
if test "x$enable_opengl" = xno -a \
"x$enable_gles1" = xno -a \
"x$enable_gles2" = xno -a \
"x$enable_gles_overlay" = xno -a \
"x$enable_openvg" = xno; then
AC_MSG_ERROR([at least one API should be enabled])
fi
API_DEFINES=""
GLES_OVERLAY=0
if test "x$enable_opengl" = xno; then
API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
else
@@ -524,11 +542,19 @@ fi
if test "x$enable_gles2" = xyes; then
API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
fi
if test "x$enable_gles_overlay" = xyes; then
GLES_OVERLAY=1
fi
AC_SUBST([API_DEFINES])
AC_SUBST([GLES_OVERLAY])
AC_ARG_ENABLE([shared-glapi],
[AS_HELP_STRING([--enable-shared-glapi],
[EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])],
[enable_shared_glapi="$enableval"],
[enable_shared_glapi=no])
SHARED_GLAPI="0"
if test "x$enable_shared_glapi" = xyes; then
SHARED_GLAPI="1"
fi
AC_SUBST([SHARED_GLAPI])
dnl
dnl Driver configuration. Options are xlib, dri and osmesa right now.
@@ -542,7 +568,7 @@ linux*)
i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
esac
;;
*freebsd* | dragonfly*)
*freebsd* | dragonfly* | *netbsd*)
case "$host_cpu" in
i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
esac
@@ -572,10 +598,6 @@ xno)
;;
esac
PKG_CHECK_MODULES([TALLOC], [talloc])
AC_SUBST([TALLOC_LIBS])
AC_SUBST([TALLOC_CFLAGS])
dnl
dnl Driver specific build directories
dnl
@@ -588,20 +610,30 @@ GLU_DIRS="sgi"
GALLIUM_DIRS="auxiliary drivers state_trackers"
GALLIUM_TARGET_DIRS=""
GALLIUM_WINSYS_DIRS="sw"
GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug identity"
GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug noop identity"
GALLIUM_STATE_TRACKERS_DIRS=""
# build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
x*yes*)
CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
;;
esac
# build glapi if OpenGL is enabled
if test "x$enable_opengl" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/glapi"
fi
# build es1api and es2api if OpenGL ES is enabled
case "x$enable_gles1$enable_gles2$enable_gles_overlay" in
x*yes*)
CORE_DIRS="$CORE_DIRS mapi/es1api mapi/es2api"
;;
esac
# build es1api if OpenGL ES 1.x is enabled
if test "x$enable_gles1" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/es1api"
fi
# build es2api if OpenGL ES 2.x is enabled
if test "x$enable_gles2" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/es2api"
fi
# build vgapi if OpenVG is enabled
if test "x$enable_openvg" = xyes; then
@@ -609,7 +641,7 @@ if test "x$enable_openvg" = xyes; then
fi
# build glsl and mesa if OpenGL or OpenGL ES is enabled
case "x$enable_opengl$enable_gles1$enable_gles2$enable_gles_overlay" in
case "x$enable_opengl$enable_gles1$enable_gles2" in
x*yes*)
CORE_DIRS="$CORE_DIRS glsl mesa"
;;
@@ -714,8 +746,8 @@ xlib)
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $TALLOC_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $TALLOC_LIBS"
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
# if static, move the external libraries to the programs
# and empty the libraries for libGL
@@ -795,11 +827,48 @@ AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
AC_SUBST([GLESv2_LIB_DEPS])
AC_SUBST([GLESv2_PC_LIB_PRIV])
GLAPI_LIB_DEPS="-lpthread"
AC_SUBST([GLAPI_LIB_DEPS])
dnl Setup default DRI CFLAGS
DRI_CFLAGS='$(CFLAGS)'
DRI_CXXFLAGS='$(CXXFLAGS)'
DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
AC_ARG_ENABLE([shared-dricore],
[AS_HELP_STRING([--enable-shared-dricore],
[link DRI modules with shared core DRI routines @<:@default=disabled@:>@])],
[enable_dricore="$enableval"],
[enable_dricore=no])
if test "$mesa_driver" = dri ; then
if test "$enable_dricore" = yes ; then
if test "$GCC$GXX" != yesyes ; then
AC_MSG_WARN([Shared dricore requires GCC-compatible rpath handling. Disabling shared dricore])
enable_dricore=no
else
DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl'
DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE'
DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE'
MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
fi
fi
fi
AC_SUBST([DRICORE_LIBS])
AC_SUBST([DRICORE_GLSL_LIBS])
AC_SUBST([DRICORE_LIB_DEPS])
AC_SUBST([DRI_CXXFLAGS])
AC_SUBST([DRI_CFLAGS])
AC_SUBST([MESA_MODULES])
AC_SUBST([HAVE_XF86VIDMODE])
PKG_CHECK_MODULES([LIBDRM_RADEON],
[libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
[libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
HAVE_LIBDRM_RADEON=yes,
HAVE_LIBDRM_RADEON=no)
@@ -811,13 +880,22 @@ if test "$mesa_driver" = xlib; then
fi
dnl
dnl More DRI setup
dnl TLS detection
dnl
AC_ARG_ENABLE([glx-tls],
[AS_HELP_STRING([--enable-glx-tls],
[enable TLS support in GLX @<:@default=disabled@:>@])],
[GLX_USE_TLS="$enableval"],
[GLX_USE_TLS=no])
AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
AS_IF([test "x$GLX_USE_TLS" = xyes],
[DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
dnl
dnl More DRI setup
dnl
dnl Directory for DRI drivers
AC_ARG_WITH([dri-driverdir],
[AS_HELP_STRING([--with-dri-driverdir=DIR],
@@ -870,11 +948,6 @@ esac
dnl Set DRI_DIRS, DEFINES and LIB_DEPS
if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
# Use TLS in GLX?
if test "x$GLX_USE_TLS" = xyes; then
DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
fi
# Platform specific settings and drivers to build
case "$host_os" in
linux*)
@@ -909,16 +982,13 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
;;
esac
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | *netbsd*)
DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
if test "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
if test "x$GXX" = xyes; then
CXXFLAGS="$CXXFLAGS -ansi -pedantic"
fi
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
@@ -963,8 +1033,8 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
[AC_MSG_ERROR([Expat required for DRI.])])
fi
# put all the necessary libs together
DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS $TALLOC_LIBS"
# put all the necessary libs together, including possibly libdricore
DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
fi
AC_SUBST([DRI_DIRS])
AC_SUBST([EXPAT_INCLUDES])
@@ -972,7 +1042,7 @@ AC_SUBST([DRI_LIB_DEPS])
case $DRI_DIRS in
*i915*|*i965*)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.21])
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
;;
esac
@@ -1040,12 +1110,12 @@ case "$DRIVER_DIRS" in
*osmesa*)
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS $TALLOC_LIBS"
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
else
OSMESA_LIB_DEPS=""
fi
OSMESA_MESA_DEPS=""
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS $TALLOC_LIBS"
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
;;
esac
AC_SUBST([OSMESA_LIB_DEPS])
@@ -1092,6 +1162,9 @@ if test "x$enable_egl" = xyes; then
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
fi
# workaround a bug in xcb-dri2 generated by xcb-proto 1.6
AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
[DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
fi
fi
@@ -1327,8 +1400,6 @@ if test "x$enable_gallium" = xno -a "x$enable_openvg" = xyes; then
fi
if test "x$enable_gallium" = xyes; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
AC_CHECK_HEADER([udis86.h], [HAS_UDIS86="yes"],
[HAS_UDIS86="no"])
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
fi
@@ -1352,7 +1423,7 @@ if test "x$enable_gallium_egl" = xauto; then
enable_gallium_egl=$enable_egl
;;
*)
enable_gallium_egl=no
enable_gallium_egl=$enable_openvg
;;
esac
fi
@@ -1428,6 +1499,7 @@ yes)
if test "x$enable_openvg" != xyes; then
AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
fi
have_st_vega="yes"
;;
esac
@@ -1442,6 +1514,14 @@ yes)
fi
done
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
# append --enable-openvg/--enable-gallium-egl to --with-state-trackers
if test "x$have_st_vega" != xyes -a "x$enable_openvg" = xyes; then
AC_MSG_ERROR([--with-state-trackers specified but vega is missing])
fi
if test "x$HAVE_ST_EGL" != xyes -a "x$enable_gallium_egl" = xyes; then
AC_MSG_ERROR([--with-state-trackers specified but egl is missing])
fi
;;
esac
@@ -1454,9 +1534,6 @@ x*yes*)
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
;;
esac
if test "x$enable_gles_overlay" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
fi
if test "x$enable_openvg" = xyes; then
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
@@ -1467,10 +1544,6 @@ AC_SUBST([EGL_CLIENT_APIS])
if test "x$HAVE_ST_EGL" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl"
# define GLX_DIRECT_RENDERING even when the driver is not dri
if test "x$mesa_driver" != xdri -a "x$driglx_direct" = xyes; then
DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
fi
fi
if test "x$HAVE_ST_XORG" = xyes; then
@@ -1491,6 +1564,8 @@ AC_ARG_WITH([egl-displays],
[with_egl_platforms="$withval"])
EGL_PLATFORMS=""
WAYLAND_EGL_LIB_DEPS=""
case "$with_egl_platforms" in
yes)
if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
@@ -1508,16 +1583,31 @@ yes)
egl_platforms=`IFS=', '; echo $with_egl_platforms`
for plat in $egl_platforms; do
test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \
AC_MSG_ERROR([EGL platform '$plat' does't exist])
AC_MSG_ERROR([EGL platform '$plat' doesn't exist])
if test "$plat" = "fbdev"; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
fi
if test "$plat" = "wayland"; then
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
[AC_MSG_ERROR([cannot find libwayland-client])])
WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
fi
done
EGL_PLATFORMS="$egl_platforms"
;;
esac
AC_SUBST([EGL_PLATFORMS])
AC_SUBST([WAYLAND_EGL_LIB_DEPS])
WAYLAND_EGL_PC_REQ_PRIV="wayland-client libdrm"
WAYLAND_EGL_PC_LIB_PRIV=
WAYLAND_EGL_PC_CFLAGS=
AC_SUBST([WAYLAND_EGL_PC_REQ_PRIV])
AC_SUBST([WAYLAND_EGL_PC_LIB_PRIV])
AC_SUBST([WAYLAND_EGL_PC_CFLAGS])
AC_ARG_WITH([egl-driver-dir],
[AS_HELP_STRING([--with-egl-driver-dir=DIR],
[directory for EGL drivers [[default=${libdir}/egl]]])],
@@ -1559,12 +1649,8 @@ if test "x$enable_gallium_llvm" = xyes; then
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version`
LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
LLVM_LIBS="`$LLVM_CONFIG --libs jit interpreter nativecodegen bitwriter` -lstdc++"
LLVM_LIBS="`$LLVM_CONFIG --libs` -lstdc++"
if test "x$HAS_UDIS86" != xno; then
LLVM_LIBS="$LLVM_LIBS -ludis86"
DEFINES="$DEFINES -DHAVE_UDIS86"
fi
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
DEFINES="$DEFINES -DGALLIUM_LLVMPIPE -D__STDC_CONSTANT_MACROS"
@@ -1648,20 +1734,12 @@ AC_ARG_ENABLE([gallium-radeon],
[enable_gallium_radeon="$enableval"],
[enable_gallium_radeon=auto])
if test "x$enable_gallium_radeon" = xauto; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
else
AC_MSG_WARN([libdrm_radeon is missing, not building gallium-radeon (r300)])
fi
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300"
fi
if test "x$enable_gallium_radeon" = xyes; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-radeon (r300)])
fi
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
fi
dnl
@@ -1673,12 +1751,8 @@ AC_ARG_ENABLE([gallium-r600],
[enable_gallium_r600="$enableval"],
[enable_gallium_r600=auto])
if test "x$enable_gallium_r600" = xyes; then
if test "x$HAVE_LIBDRM_RADEON" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
else
AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-r600])
fi
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
gallium_check_st "r600/drm" "dri-r600"
fi
dnl
@@ -1690,7 +1764,7 @@ AC_ARG_ENABLE([gallium-nouveau],
[enable_gallium_nouveau="$enableval"],
[enable_gallium_nouveau=no])
if test "x$enable_gallium_nouveau" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
fi
@@ -1708,19 +1782,6 @@ if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xau
fi
fi
dnl
dnl Gallium noop configuration
dnl
AC_ARG_ENABLE([gallium-noop],
[AS_HELP_STRING([--enable-gallium-noop],
[build gallium radeon @<:@default=disabled@:>@])],
[enable_gallium_noop="$enableval"],
[enable_gallium_noop=auto])
if test "x$enable_gallium_noop" = xyes; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS noop"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-noop"
fi
dnl prepend CORE_DIRS to SRC_DIRS
SRC_DIRS="$CORE_DIRS $SRC_DIRS"
@@ -1753,7 +1814,6 @@ echo " includedir: $includedir"
dnl API info
echo ""
echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
echo " GLES overlay: $enable_gles_overlay"
echo " OpenVG: $enable_openvg"
dnl Driver info
@@ -1775,6 +1835,7 @@ if test "$mesa_driver" != no; then
fi
echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
echo " Use XCB: $enable_xcb"
echo " Shared dricore: $enable_dricore"
fi
fi
echo ""
@@ -1790,7 +1851,7 @@ if test "$enable_egl" = yes; then
egl_drivers=""
for d in $EGL_DRIVERS_DIRS; do
egl_drivers="$egl_drivers egl_$d"
egl_drivers="$egl_drivers builtin:egl_$d"
done
if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then

View File

@@ -15,40 +15,45 @@ GL 3.0:
GLSL changes (GL_EXT_gpu_shader4, etc) not started
Conditional rendering (GL_NV_conditional_render) DONE (swrast & softpipe)
Map buffer subranges (GL_ARB_map_buffer_range) DONE
Float textures, renderbuffers some infrastructure done
(incl. GL_EXT_packed_float, GL_EXT_shared_exponent)
Clamping controls (GL_ARB_color_buffer_float) BRANCH ~mareko/mesa floating2
Float textures, renderbuffers (GL_ARB_texture_float) BRANCH ~mareko/mesa floating2
GL_EXT_packed_float not started
GL_EXT_texture_shared_exponent not started
Float depth buffers (GL_ARB_depth_buffer_float) not started
Framebuffer objects (GL_EXT_framebuffer_object) DONE
Half-float some infrastructure done
Half-float DONE
Multisample blit DONE
Non-normalized Integer texture/framebuffer formats ~50% done
1D/2D Texture arrays core Mesa, swrast done
Packed depth/stencil formats DONE
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE
GL_EXT_texture_compression_rgtc not started
GL_EXT_texture_compression_rgtc DONE (swrast, gallium r600)
Red and red/green texture formats DONE (swrast, i965, gallium)
Transform feedback (GL_EXT_transform_feedback) ~50% done
glBindFragDataLocation, glGetFragDataLocation,
glBindBufferRange, glBindBufferBase commands
Vertex array objects (GL_APPLE_vertex_array_object) DONE
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) not started
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) core GL done (i965, gallium), GLX todo
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands DONE (but converts int
values to floats)
Depth format cube textures 0% done
GL 3.1:
GLSL 1.30 and 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) ~50% done
Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE
Primitive restart (GL_NV_primitive_restart) DONE (gallium)
16 vertex texture image units not started
Texture buffer objs (GL_ARB_texture_buffer_object) not started
Rectangular textures (GL_ARB_texture_rectangle) DONE
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
Signed normalized texture formats ~50% done
Signed normalized textures (GL_EXT_texture_snorm) ~50% done
GL 3.2:
@@ -71,12 +76,12 @@ GL 3.3:
GLSL 3.30 not started
GL_ARB_blend_func_extended not started
GL_ARB_explicit_attrib_location DONE (swrast, i915, i965)
GL_ARB_occlusion_query2 not started
GL_ARB_occlusion_query2 DONE (swrast, gallium)
GL_ARB_sampler_objects not started
GL_ARB_texture_rgb10_a2ui not started
GL_ARB_texture_swizzle DONE (same as EXT version)
GL_ARB_timer_query DONE (only Xlib sw driver)
GL_ARB_instanced_arrays not started
GL_ARB_instanced_arrays DONE (gallium)
GL_ARB_vertex_type_2_10_10_10_rev not started
@@ -84,7 +89,7 @@ GL 4.0:
GLSL 4.0 not started
GL_ARB_texture_query_lod not started
GL_ARB_draw_buffers_blend not started
GL_ARB_draw_buffers_blend DONE (gallium softpipe)
GL_ARB_draw_indirect not started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading not started

View File

@@ -0,0 +1,158 @@
Name
MESA_multithread_makecurrent
Name Strings
GLX_MESA_multithread_makecurrent
Contact
Eric Anholt (eric@anholt.net)
Status
Not shipping.
Version
Last Modified Date: 21 February 2011
Number
TBD
Dependencies
OpenGL 1.0 or later is required.
GLX 1.3 or later is required.
Overview
The GLX context setup encourages multithreaded applications to
create a context per thread which each operate on their own
objects in parallel, and leaves synchronization for write access
to shared objects up to the application.
For some applications, maintaining per-thread contexts and
ensuring that the glFlush happens in one thread before another
thread starts working on that object is difficult. For them,
using the same context across multiple threads and protecting its
usage with a mutex is both higher performance and easier to
implement. This extension gives those applications that option by
relaxing the context binding requirements.
This new behavior matches the requirements of AGL, while providing
a feature not specified in WGL.
IP Status
Open-source; freely implementable.
Issues
None.
New Procedures and Functions
None.
New Tokens
None.
Changes to Chapter 2 of the GLX 1.3 Specification (Functions and Errors)
Replace the following sentence from section 2.2 Rendering Contexts:
In addition, a rendering context can be current for only one
thread at a time.
with:
In addition, an indirect rendering context can be current for
only one thread at a time. A direct rendering context may be
current to multiple threads, with synchronization of access to
the context thruogh the GL managed by the application through
mutexes.
Changes to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
Replace the following sentence from section 3.3.7 Rendering Contexts:
If ctx is current to some other thread, then
glXMakeContextCurrent will generate a BadAccess error.
with:
If ctx is an indirect context current to some other thread,
then glXMakeContextCurrent will generate a BadAccess error.
Replace the following sentence from section 3.5 Rendering Contexts:
If ctx is current to some other thread, then
glXMakeCurrent will generate a BadAccess error.
with:
If ctx is an indirect context current to some other thread,
then glXMakeCurrent will generate a BadAccess error.
GLX Protocol
None. The GLX extension only extends to direct rendering contexts.
Errors
None.
New State
None.
Issues
(1) What happens if the app binds a context/drawable in multiple
threads, then binds a different context/thread in one of them?
As with binding a new context from the current thread, the old
context's refcount is reduced and the new context's refcount is
increased.
(2) What happens if the app binds a context/drawable in multiple
threads, then binds None/None in one of them?
The GLX context is unreferenced from that thread, and the other
threads retain their GLX context binding.
(3) What happens if the app binds a context/drawable in 7 threads,
then destroys the context in one of them?
As with GLX context destruction previously, the XID is destroyed
but the context remains usable by threads that have the context
current.
(4) What happens if the app binds a new drawable/readable with
glXMakeCurrent() when it is already bound to another thread?
The context becomes bound to the new drawable/readable, and
further rendering in either thread will use the new
drawable/readable.
(5) What requirements should be placed on the user managing contexts
from multiple threads?
The intention is to allow multithreaded access to the GL at the
minimal performance cost, so requiring that the GL do general
synchronization (beyond that already required by context sharing)
is not an option, and synchronizing of GL's access to the GL
context between multiple threads is left to the application to do
across GL calls. However, it would be unfortunate for a library
doing multithread_makecurrent to require that other libraries
share in synchronization for binding of their own contexts, so the
refcounting of the contexts is required to be threadsafe.
(6) Does this apply to indirect contexts?
This was ignored in the initial revision of the spec. Behavior
for indirect contexts is left as-is.
Revision History
20 November 2009 Eric Anholt - initial specification
22 November 2009 Eric Anholt - added issues from Ian Romanick.
3 February 2011 Eric Anholt - updated with resolution to issues 1-3
3 February 2011 Eric Anholt - added issue 4, 5
21 February 2011 Eric Anholt - Include glXMakeCurrent() sentence
along with glXMakeContextCurrent() for removal.

View File

@@ -1,6 +1,10 @@
File: docs/README.WIN32
Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: Apr 25, 2007
NOTE: This information only applies to Mesa 7.8 and older. Nowadays
it's probably better to use Scons to build for Windows.
Quick Start
----- -----
@@ -130,11 +134,5 @@ change all the gl* symbols to mgl*. Because this is easy to do with a
global replace operation in a text editor, no additional mangled
version of mesa.def is maintained or shipped.
If you have a Windows-related build problem or question, it is
probably better to direct it to me (kschultz@users.sourceforge.net),
rather than directly to the other Mesa developers. I will help you as
much as I can. I also monitor the Mesa mailing lists and will answer
questions in this area there as well.
Karl Schultz
If you have a Windows-related build problem or question, please post
to the mesa-dev or mesa-users list.

View File

@@ -0,0 +1,92 @@
Name
WL_bind_wayland_display
Name Strings
EGL_WL_bind_wayland_display
Contact
Kristian Høgsberg <krh@bitplanet.net>
Benjamin Franzke <benjaminfranzke@googlemail.com>
Status
Proposal
Version
Version 1, March 1, 2011
Number
EGL Extension #not assigned
Dependencies
Reguires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
EGL_KHR_base_image is required.
Overview
This extension provides entry points for binding and unbinding the
wl_display of a Wayland compositor to an EGLDisplay. Binding a
wl_display means that the EGL implementation should provide one or
more interfaces in the Wayland protocol to allow clients to create
wl_buffer objects. On the server side, this extension also
provides a new target for eglCreateImageKHR, to create an EGLImage
from a wl_buffer
Adding a implementation specific wayland interface, allows the
EGL implementation to define specific wayland requests and events,
needed for buffer sharing in a EGL wayland platform.
IP Status
Open-source; freely implementable.
New Procedures and Functions
EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
New Tokens
Accepted as <target> in eglCreateImageKHR
EGL_WAYLAND_BUFFER_WL 0x31D5
Additions to the EGL 1.4 Specification:
To bind a server side wl_display to an EGLDisplay, call
EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
To unbind a server side wl_display from an EGLDisplay, call
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
eglBindWaylandDisplayWL returns EGL_FALSE when there is already a
wl_display bound to EGLDisplay otherwise EGL_TRUE.
eglUnbindWaylandDisplayWL returns EGL_FALSE when there is no
wl_display bound to the EGLDisplay currently otherwise EGL_TRUE.
Import a wl_buffer by calling eglCreateImageKHR with
wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
and an empty attribute_list.
Issues
Revision History
Version 1, March 1, 2011
Initial draft (Benjamin Franzke)

View File

@@ -19,10 +19,7 @@ API entry points and helper functions for use by the drivers. Drivers are
dynamically loaded by the main library and most of the EGL API calls are
directly dispatched to the drivers.</p>
<p>The driver in use decides the window system to support. For drivers that
support hardware rendering, there are usually multiple drivers supporting the
same window system. Each one of of them supports a certain range of graphics
cards.</p>
<p>The driver in use decides the window system to support.</p>
<h2>Build EGL</h2>
@@ -86,16 +83,8 @@ select the right platforms automatically.</p>
<li><code>--enable-gles1</code> and <code>--enable-gles2</code>
<p>These options enable OpenGL ES support in OpenGL. The result is
one big library that supports multiple APIs.</p>
</li>
<li><code>--enable-gles-overlay</code>
<p>This option enables OpenGL ES as separate libraries. This is an alternative
approach to enable OpenGL ES. It is only supported by
<code>egl_gallium</code>.</p>
<p>These options enable OpenGL ES support in OpenGL. The result is one big
internal library that supports multiple APIs.</p>
</li>
@@ -134,13 +123,24 @@ colon-separated directories where the main library will look for drivers, in
addition to the default directory. This variable is ignored for setuid/setgid
binaries.</p>
<p>This variable is usually set to test an uninstalled build. For example, one
may set</p>
<pre>
$ export LD_LIBRARY_PATH=$mesa/lib
$ export EGL_DRIVERS_PATH=$mesa/lib/egl
</pre>
<p>to test a build without installation</p>
</li>
<li><code>EGL_DRIVER</code>
<p>This variable specifies a full path to an EGL driver and it forces the
specified EGL driver to be loaded. It comes in handy when one wants to test a
specific driver. This variable is ignored for setuid/setgid binaries.</p>
<p>This variable specifies a full path to or the name of an EGL driver. It
forces the specified EGL driver to be loaded. It comes in handy when one wants
to test a specific driver. This variable is ignored for setuid/setgid
binaries.</p>
</li>
@@ -180,8 +180,10 @@ variable to true forces the use of software rendering.</p>
<li><code>egl_dri2</code>
<p>This driver supports both <code>x11</code> and <code>drm</code> platforms.
It functions as a DRI2 driver loader. For <code>x11</code> support, it talks
to the X server directly using (XCB-)DRI2 protocol.</p>
It functions as a DRI driver loader. For <code>x11</code> support, it talks to
the X server directly using (XCB-)DRI2 protocol.</p>
<p>This driver can share DRI drivers with <code>libGL</code>.</p>
</li>
@@ -191,6 +193,10 @@ to the X server directly using (XCB-)DRI2 protocol.</p>
hardwares supported by Gallium3D. It is the only driver that supports OpenVG.
The supported platforms are X11, DRM, FBDEV, and GDI.</p>
<p>This driver comes with its own hardware drivers
(<code>pipe_&lt;hw&gt;</code>) and client API modules
(<code>st_&lt;api&gt;</code>).</p>
</li>
<li><code>egl_glx</code>
@@ -202,6 +208,21 @@ is not available in GLX or GLX extensions.</p>
</li>
</ul>
<h2>Packaging</h2>
<p>The ABI between the main library and its drivers are not stable. Nor is
there a plan to stabilize it at the moment. Of the EGL drivers,
<code>egl_gallium</code> has its own hardware drivers and client API modules.
They are considered internal to <code>egl_gallium</code> and there is also no
stable ABI between them. These should be kept in mind when packaging for
distribution.</p>
<p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
when the system already has DRI drivers. As <code>egl_gallium</code> is loaded
before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
may either be disabled with <code>--disable-gallium-egl</code> or packaged
separately.</p>
<h2>Developers</h2>
<p>The sources of the main library and the classic drivers can be found at

View File

@@ -9,17 +9,38 @@
<H1>Environment Variables</H1>
<p>
Mesa supports the following environment variables:
Normally, no environment variables need to be set. Most of the environment
variables used by Mesa/Gallium are for debugging purposes, but they can
sometimes be useful for debugging end-user issues.
</p>
<H2>LibGL environment variables</H2>
<ul>
<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
If set to 'verbose' additional information will be printed.
<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
</ul>
<H2>Core Mesa environment variables</H2>
<ul>
<li>MESA_NO_ASM - if set, disables all assembly language optimizations
<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
<li>MESA_DEBUG - if set, error messages are printed to stderr.
If the value of MESA_DEBUG is "FP" floating point arithmetic errors will
generate exceptions.
<li>MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER)
<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
if the application generates a GL_INVALID_ENUM error, a corresponding error
message indicating where the error occured, and possibly why, will be
printed to stderr.<br>
If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
generate exceptions.
<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
fragment programs (intended for developers only)
<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
@@ -28,11 +49,14 @@ Setting this variable automatically sets the MESA_TEX_PROG variable as well.
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
and disable the GL_EXT_bar extension.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language options</a>
<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
</ul>
<H2>Mesa Xlib driver environment variables</H2>
<p>
The following are only applicable to the Xlib software driver.
The following are only applicable to the Mesa Xlib software driver.
See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</p>
<ul>
@@ -51,9 +75,8 @@ See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</ul>
<p>
These environment variables are for the Intel i945/i965 drivers:
</p>
<h2>i945/i965 driver environment variables (non-Gallium)</h2>
<ul>
<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
OpenGL conformance. If set to 2, always use software rendering.
@@ -62,17 +85,71 @@ These environment variables are for the Intel i945/i965 drivers:
</ul>
<p>
These environment variables are for the Radeon R300 driver:
</p>
<h2>Radeon R300 driver environment variables (non-Gallium)</h2>
<ul>
<li>R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
</ul>
<h2>EGL environment variables</h2>
<p>
Mesa EGL supports different sets of environment variables. See the
<a href="egl.html">Mesa EGL</a> page for the details.
</p>
<h2>Gallium environment variables</h2>
<ul>
<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
variables which are used, and their current values.
<li>GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for
shader execution
<li>GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for
shader execution
<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
print any errors to stderr.
<LI>DRAW_FSE - ???
<LI>DRAW_NO_FSE - ???
<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
shaders, vertex fetch, etc.
</ul>
<h3>Softpipe driver environment variables</h3>
<ul>
<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
to stderr
<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
to stderr
<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
</ul>
<h3>LLVMpipe driver environment variables</h3>
<ul>
<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
source code for details.
<li>LP_PERF - a comma-separated list of options to selectively no-op various
parts of the driver. See the source code for details.
<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
Zero turns of threading completely. The default value is the number of CPU
cores present.
</ul>
<p>
Other Gallium drivers have their own environment variables. These may change
frequently so the source code should be consulted for details.
</p>
<br>
<br>
</BODY>
</HTML>

View File

@@ -11,6 +11,15 @@
<H1>News</H1>
<h2>March 2, 2011</h2>
<p>
<a href="relnotes-7.9.2.html">Mesa 7.9.2</a> and
<a href="relnotes-7.10.1.html">Mesa 7.10.1</a> are released. These are
stable releases containing bug fixes since the 7.9.1 and 7.10 releases.
</p>
<h2>October 4, 2010</h2>
<p>

View File

@@ -17,7 +17,7 @@ target="_parent"> http://www.khronos.org/opengles/</a>.</p>
<h2>Build the Libraries</h2>
<ol>
<li>Run <code>configure</code> with <code>--enable-gles-overlay</code> and enable the Gallium driver for your hardware.</li>
<li>Run <code>configure</code> with <code>--enable-gles1 --enable-gles2</code> and enable the Gallium driver for your hardware.</li>
<li>Build and install Mesa as usual.</li>
</ol>
@@ -53,8 +53,6 @@ your build. For example,</p>
<tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
<tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
<tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
<tr><td><code>libes1gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>y</td><td>n</td></tr>
<tr><td><code>libes2gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>n</td><td>y</td></tr>
</table>
<h3>Dispatch Table</h3>

380
docs/relnotes-7.10.1.html Normal file
View File

@@ -0,0 +1,380 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.1 Release Notes / TBD</H1>
<p>
Mesa 7.10.1 is a bug fix release which fixes bugs found since the 7.10 release.
</p>
<p>
Mesa 7.10.1 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
4b4cee19f3bf16eb78bd4cc278ccf812 MesaLib-7.10.1.tar.gz
efe8da4d80c2a5d32a800770b8ce5dfa MesaLib-7.10.1.tar.bz2
0fd2b1a025934de3f8cecf9fb9b57f4c MesaLib-7.10.1.zip
42beb0f5188d544476c19496f725fa67 MesaGLUT-7.10.1.tar.gz
637bb8a20fdad89f7382b4ea83f896e3 MesaGLUT-7.10.1.tar.bz2
bdbf3ffb2606d6aa8afabb6c6243b91b MesaGLUT-7.10.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Fix an off-by-one bug in a vsplit assertion.</li>
<li>Fix incorrect handling of <tt>layout</tt> qualifier
with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.</li>
<li>Fix numerous issues handling precision qualifiers in GLSL ES.</li>
<li>Fixed a few GLX protocol encoder bugs (Julien Cristau)</li>
<li>Assorted Gallium llvmpipe driver bug fixes</li>
<li>Assorted Mesa/Gallium state tracker bug fixes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26795">Bug 26795</a> - gl_FragCoord off by one in Gallium drivers.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29164">Bug 29164</a> - [GLSL 1.20] invariant variable shouldn't be used before declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29823">Bug 29823</a> - GetUniform[if]v busted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29927">Bug 29927</a> - [glsl2] fail to compile shader with constructor for array of struct type</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30156">Bug 30156</a> - [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31923">Bug 31923</a> - [GLSL 1.20] allowing inconsistent centroid declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31925">Bug 31925</a> - [GLSL 1.20] "#pragma STDGL invariant(all)" fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32214">Bug 32214</a> - [gles2]no link error happens when missing vertex shader or frag shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32375">Bug 32375</a> - [gl gles2] Not able to get the attribute by function glGetVertexAttribfv</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32541">Bug 32541</a> - Segmentation Fault while running an HDR (high dynamic range) rendering demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32569">Bug 32569</a> - [gles2] glGetShaderPrecisionFormat not implemented yet</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32695">Bug 32695</a> - [glsl] SIGSEGV glcpp/glcpp-parse.y:833</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32831">Bug 32831</a> - [glsl] division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32910">Bug 32910</a> - Keywords 'in' and 'out' not handled properly for GLSL 1.20 shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33219">Bug 33219</a> -[GLSL bisected] implicit sized array triggers segfault in ir_to_mesa_visitor::copy_propagate</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33308">Bug 33308</a> -[glsl] ast_to_hir.cpp:3016: virtual ir_rvalue* ast_jump_statement::hir(exec_list*, _mesa_glsl_parse_state*): Assertion `ret != __null' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33316">Bug 33316</a> - uniform array will be allocate one line more and initialize it when it was freed will abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33386">Bug 33386</a> - Dubious assembler in read_rgba_span_x86.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33388">Bug 33388</a> - Dubious assembler in xform4.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33433">Bug 33433</a> - Error in x86-64 API dispatch code.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33507">Bug 33507</a> - [glsl] GLSL preprocessor modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33916">Bug 33916</a> - Compiler accepts reserved operators % and %=</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34030">Bug 34030</a> - [bisected] Starcraft 2: some effects are corrupted or too big</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34047">Bug 34047</a> - Assert in _tnl_import_array() when using GLfixed vertex datatypes with GLESv2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34114">Bug 34114</a> - Sun Studio build fails due to standard library functions not being in global namespace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34179">Bug 34179</a> - Nouveau 3D driver: nv50_pc_emit.c:863 assertion error kills Compiz</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34198">Bug 34198</a> - [GLSL] implicit sized array with index 0 used gets assertion</li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653">Ubuntu bug 691653</a> - compiz crashes when using alt-tab (the radeon driver kills it) </li>
<li><a href="https://bugs.meego.com/show_bug.cgi?id=13005">Meego bug 13005</a> - Graphics GLSL issue lead to camera preview fail on Pinetrail</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10..mesa-7.10.1
</pre>
<p>Alberto Milone (1):
<ul>
<li>r600c: add evergreen ARL support.</li>
</ul></p>
<p>Brian Paul (21):
<ul>
<li>draw: Fix an off-by-one bug in a vsplit assertion.</li>
<li>docs: add links to 7.9.1 and 7.10 release notes</li>
<li>docs: added news item for 7.9.1 and 7.10 release</li>
<li>gallivm: work around LLVM 2.6 bug when calling C functions</li>
<li>gallivm: fix copy&amp;paste error from previous commit</li>
<li>mesa: fix a few format table mistakes, assertions</li>
<li>mesa: fix num_draw_buffers==0 in fixed-function fragment program generation</li>
<li>mesa: don't assert in GetIntegerIndexed, etc</li>
<li>mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
<li>llvmpipe: make sure binning is active when we begin/end a query</li>
<li>st/mesa: fix incorrect fragcoord.x translation</li>
<li>softpipe: fix off-by-one error in setup_fragcoord_coeff()</li>
<li>cso: fix loop bound in cso_set_vertex_samplers()</li>
<li>st/mesa: fix incorrect glCopyPixels position on fallback path</li>
<li>st/mesa: set renderbuffer _BaseFormat in a few places</li>
<li>st/mesa: fix the default case in st_format_datatype()</li>
<li>st/mesa: need to translate clear color according to surface's base format</li>
<li>docs: update 7.9.2 release notes with Brian's cherry-picks</li>
<li>docs: add link to 7.10.1 release notes</li>
<li>mesa: implement glGetShaderPrecisionFormat()</li>
<li>docs: updated environment variable list</li>
</ul></p>
<p>Bryce Harrington (1):
<ul>
<li>r300g: Null pointer check for buffer deref in gallium winsys</li>
</ul></p>
<p>Chad Versace (20):
<ul>
<li>glsl: At link-time, check that globals have matching centroid qualifiers</li>
<li>glcpp: Fix segfault when validating macro redefinitions</li>
<li>glsl: Fix parser rule for type_specifier</li>
<li>glsl: Change default value of ast_type_specifier::precision</li>
<li>glsl: Add semantic checks for precision qualifiers</li>
<li>glsl: Add support for default precision statements</li>
<li>glsl: Remove redundant semantic check in parser</li>
<li>glsl: Fix semantic checks on precision qualifiers</li>
<li>glsl: Fix segfault due to missing printf argument</li>
<li>glsl: Mark 'in' variables at global scope as read-only</li>
<li>mesa: Refactor handling of extension strings</li>
<li>mesa: Add/remove extensions in extension string</li>
<li>mesa: Change dependencies of some OES extension strings</li>
<li>mesa: Change OES_point_sprite to depend on ARB_point_sprite</li>
<li>mesa: Change OES_standard_derivatives to be stand-alone extension</li>
<li>i915: Disable extension OES_standard_derivatives</li>
<li>glcpp: Raise error when modulus is zero</li>
<li>glsl: Set operators '%' and '%=' to be reserved when GLSL &lt 1.30</li>
<li>glsl: Reinstate constant-folding for division by zero</li>
<li>tnl: Add support for datatype GL_FIXED in vertex arrays</li>
</ul></p>
<p>Chia-I Wu (1):
<ul>
<li>mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.</li>
</ul></p>
<p>Christoph Bumiller (1):
<ul>
<li>nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs</li>
</ul></p>
<p>Cyril Brulebois (1):
<ul>
<li>Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org</li>
</ul></p>
<p>Dave Airlie (3):
<ul>
<li>radeon/r200: fix fbo-clearmipmap + gen-teximage</li>
<li>radeon: calculate complete texture state inside TFP function</li>
<li>radeon: avoid segfault on 3D textures.</li>
</ul></p>
<p>Dimitry Andric (4):
<ul>
<li>mesa: s/movzx/movzbl/</li>
<li>mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S</li>
<li>glapi: adding @ char before type specifier in glapi_x86.S</li>
<li>glapi: add @GOTPCREL relocation type</li>
</ul></p>
<p>Eric Anholt (16):
<ul>
<li>glsl: Fix the lowering of variable array indexing to not lose write_masks.</li>
<li>i965/fs: When producing ir_unop_abs of an operand, strip negate.</li>
<li>i965/vs: When MOVing to produce ABS, strip negate of the operand.</li>
<li>i965/fs: Do flat shading when appropriate.</li>
<li>i965: Avoid double-negation of immediate values in the VS.</li>
<li>intel: Make renderbuffer tiling choice match texture tiling choice.</li>
<li>i965: Fix dead pointers to fp-&gt;Parameters-&gt;ParameterValues[] after realloc.</li>
<li>docs: Add a relnote for the Civ IV on i965.</li>
<li>glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add extension enable bit for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add actual support for glReleaseShaderCompiler from ES2.</li>
<li>mesa: Add support for glDepthRangef and glClearDepthf.</li>
<li>mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.</li>
<li>mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.</li>
<li>i965: Fix a bug in i965 compute-to-MRF.</li>
<li>i965/fs: Add a helper function for detecting math opcodes.</li>
</ul></p>
<p>Fredrik Höglund (1):
<ul>
<li>st/mesa: fix a regression from cae2bb76</li>
</ul></p>
<p>Ian Romanick (42):
<ul>
<li>docs: Add 7.10 md5sums</li>
<li>glsl: Support the 'invariant(all)' pragma</li>
<li>glcpp: Generate an error for division by zero</li>
<li>glsl: Add version_string containing properly formatted GLSL version</li>
<li>glsl &amp; glcpp: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Disallow 'in' and 'out' on globals in GLSL 1.20</li>
<li>glsl: Track variable usage, use that to enforce semantics</li>
<li>glsl: Allow 'in' and 'out' when 'layout' is also available</li>
<li>docs: Initial bits of 7.10.1 release notes</li>
<li>mesa: bump version to 7.10.1-devel</li>
<li>doc: Update 7.10.1 release notes</li>
<li>glsl: Emit errors or warnings when 'layout' is used with 'attribute' or 'varying'</li>
<li>docs: Update 7.10.1 release notes</li>
<li>glsl: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Don't assert when the value returned by a function has no rvalue</li>
<li>linker: Set sizes for non-global arrays as well</li>
<li>linker: Propagate max_array_access while linking functions</li>
<li>docs: Update 7.10.1 release notes</li>
<li>mesa: glGetUniform only returns a single element of an array</li>
<li>linker: Generate link errors when ES shaders are missing stages</li>
<li>mesa: Fix error checks in GetVertexAttrib functions</li>
<li>Use C-style system headers in C++ code to avoid issues with std:: namespace</li>
<li>docs: Update 7.10.1 release notes</li>
<li>glapi: Regenerate for GL_ARB_ES2_compatibility.</li>
<li>mesa: Connect glGetShaderPrecisionFormat into the dispatch table</li>
<li>i965: Set correct values for range/precision of fragment shader types</li>
<li>i915: Set correct values for range/precision of fragment shader types</li>
<li>intel: Fix typeos from 3d028024 and 790ff232</li>
<li>glsl: Ensure that all GLSL versions are supported in the stand-alone compiler</li>
<li>glsl: Reject shader versions not supported by the implementation</li>
<li>mesa: Initial size for secondary color array is 3</li>
<li>glsl: Finish out the reduce/reduce error fixes</li>
<li>glsl: Regenerate compiler and glcpp files from cherry picks</li>
<li>linker: Fix off-by-one error implicit array sizing</li>
<li>docs: update 7.10.1 release notes with Ian's recent cherry picks</li>
<li>i915: Only mark a register as available if all components are written</li>
<li>i915: Calculate partial result to temp register first</li>
<li>i915: Force lowering of all types of indirect array accesses in the FS</li>
<li>docs: Update 7.10.1 with (hopefully) the last of the cherry picks</li>
<li>docs: Clean up bug fixes list</li>
<li>intel: Remove driver date and related bits from renderer string</li>
<li>mesa: set version string to 7.10.1 (final)</li>
</ul></p>
<p>Jian Zhao (1):
<ul>
<li>mesa: fix an error in uniform arrays in row calculating.</li>
</ul></p>
<p>Julien Cristau (3):
<ul>
<li>glx: fix request lengths</li>
<li>glx: fix GLXChangeDrawableAttributesSGIX request</li>
<li>glx: fix length of GLXGetFBConfigsSGIX</li>
</ul></p>
<p>Keith Packard (1):
<ul>
<li>glsl: Eliminate reduce/reduce conflicts in glsl grammar</li>
</ul></p>
<p>Kenneth Graunke (20):
<ul>
<li>glsl: Expose a public glsl_type::void_type const pointer.</li>
<li>glsl: Don't bother unsetting a destructor that was never set.</li>
<li>glsl, i965: Remove unnecessary talloc includes.</li>
<li>glcpp: Remove use of talloc reference counting.</li>
<li>ralloc: Add a fake implementation of ralloc based on talloc.</li>
<li>Convert everything from the talloc API to the ralloc API.</li>
<li>ralloc: a new MIT-licensed recursive memory allocator.</li>
<li>Remove talloc from the make and automake build systems.</li>
<li>Remove talloc from the SCons build system.</li>
<li>Remove the talloc sources from the Mesa repository.</li>
<li>glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.</li>
<li>i965/fs: Apply source modifier workarounds to POW as well.</li>
<li>i965: Fix shaders that write to gl_PointSize on Sandybridge.</li>
<li>i965/fs: Avoid register coalescing away gen6 MATH workarounds.</li>
<li>i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.</li>
<li>i965: Increase Sandybridge point size clamp.</li>
<li>i965/fs: Refactor control flow stack handling.</li>
<li>i965: Increase Sandybridge point size clamp in the clip state.</li>
<li>glsl: Use reralloc instead of plain realloc.</li>
<li>Revert "i965/fs: Correctly set up gl_FragCoord.w on Sandybridge."</li>
</ul></p>
<p>Marek Olšák (4):
<ul>
<li>docs: fix messed up names with special characters in relnotes-7.10</li>
<li>docs: fix messed up names with special characters in relnotes-7.9.1</li>
<li>mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2</li>
<li>st/dri: Track drawable context bindings</li>
</ul></p>
<p>Paulo Zanoni (1):
<ul>
<li>dri_util: fail driCreateNewScreen if InitScreen is NULL</li>
</ul></p>
<p>Sam Hocevar (2):
<ul>
<li>docs: add glsl info</li>
<li>docs: fix glsl_compiler name</li>
</ul></p>
<p>Tom Fogal (1):
<ul>
<li>Regenerate gl_mangle.h.</li>
</ul></p>
<p>Tom Stellard (2):
<ul>
<li>r300/compiler: Disable register rename pass on r500</li>
<li>r300/compiler: Don't erase sources when converting RGB-&gt;Alpha</li>
</ul></p>
<p>Vinson Lee (3):
<ul>
<li>ralloc: Add missing va_end following va_copy.</li>
<li>mesa: Move declaration before code in extensions.c.</li>
<li>mesa: Move loop variable declarations outside for loop in extensions.c.</li>
</ul></p>
<p>nobled (1):
<ul>
<li>glx: Put null check before use</li>
</ul></p>
</p>
</body>
</html>

File diff suppressed because it is too large Load Diff

62
docs/relnotes-7.11.html Normal file
View File

@@ -0,0 +1,62 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.11 Release Notes / (release date TBD)</H1>
<p>
Mesa 7.11 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 7.11.1.
</p>
<p>
Mesa 7.11 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
tbd
</pre>
<h2>New features</h2>
<ul>
<li>GL_ARB_draw_instanced extension (gallium drivers, swrast)
<li>GL_ARB_instanced_arrays extension (gallium drivers)
<li>GL_ARB_texture_compression_rgtc (gallium r600, swrast)
<li>GL_ARB_draw_buffers_blend (gallium)
<li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
</ul>
<h2>Bug fixes</h2>
<ul>
</ul>
<h2>Changes</h2>
<ul>
<li>The Windows MSVC project files have been removed. They haven't been maintained
in quite a while. Building with SCons is an alterantive.
<li>Removed GL_SGI_texture_color_table support from swrast driver - the only
driver that implemented it.
</ul>
</body>
</html>

406
docs/relnotes-7.9.1.html Normal file
View File

@@ -0,0 +1,406 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.1 Release Notes / January 7, 2011</H1>
<p>
Mesa 7.9.1 is a bug fix release which fixes bugs found since the 7.9 release.
</p>
<p>
Mesa 7.9.1 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
78422843ea875ad4eac35b9b8584032b MesaLib-7.9.1.tar.gz
07dc6cfb5928840b8b9df5bd1b3ae434 MesaLib-7.9.1.tar.bz2
c8eaea5b3c3d6dee784bd8c2db91c80f MesaLib-7.9.1.zip
ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
41fc477d524e7dc5c84da8ef22422bea MesaGLUT-7.9.1.tar.bz2
90b287229afdf19317aa989d19462e7a MesaGLUT-7.9.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28800">Bug 28800</a> - [r300c, r300g] Texture corruption with World of Warcraft</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29420">Bug 29420</a> - Amnesia / HPL2 RendererFeatTest - not rendering correctly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29946">Bug 29946</a> - [swrast] piglit valgrind glsl-array-bounds-04 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30261">Bug 30261</a> - [GLSL 1.20] allowing inconsistent invariant declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30632">Bug 30632</a> - [softpipe] state_tracker/st_manager.c:489: st_context_notify_invalid_framebuffer: Assertion `stfb &amp;&amp; stfb-&gt;iface == stfbi' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30694">Bug 30694</a> - wincopy will crash on Gallium drivers when going to front buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30787">Bug 30787</a> - Invalid asm shader does not generate draw-time error when used with GLSL shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30993">Bug 30993</a> - getFramebufferAttachmentParameteriv wrongly generates error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31101">Bug 31101</a> - [glsl2] abort() in ir_validate::visit_enter(ir_assignment *ir)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31193">Bug 31193</a> - [regression] aa43176e break water reflections</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31194">Bug 31194</a> - The mesa meta save/restore code doesn't ref the current GLSL program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31371">Bug 31371</a> - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type &gt;= 0) &amp;&amp; (type->base_type &lt;= 3)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31439">Bug 31439</a> - Crash in glBufferSubData() with size == 0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31495">Bug 31495</a> - [i965 gles2c bisected] OpenGL ES 2.0 conformance GL2Tests_GetBIFD_input.run regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31514">Bug 31514</a> - isBuffer returns true for unbound buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31560">Bug 31560</a> - [tdfx] tdfx_tex.c:702: error: const struct gl_color_table has no member named Format</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31617">Bug 31617</a> - Radeon/Compiz: 'failed to attach dri2 front buffer', error case not handled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31648">Bug 31648</a> - [GLSL] array-struct-array gets assertion: `(size &gt;= 1) && (size &lt;= 4)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31650">Bug 31650</a> - [GLSL] varying gl_TexCoord fails to be re-declared to different size in the second shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31673">Bug 31673</a> - GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31690">Bug 31690</a> - i915 shader compiler fails to flatten if in Aquarium webgl demo.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31832">Bug 31832</a> - [i915] Bad renderbuffer format: 21</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31841">Bug 31841</a> - [drm:radeon_cs_ioctl] *ERROR* Invalid command stream !</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31894">Bug 31894</a> - Writing to gl_PointSize with GLES2 corrupts other varyings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31909">Bug 31909</a> - [i965] brw_fs.cpp:1461: void fs_visitor::emit_bool_to_cond_code(ir_rvalue*): Assertion `expr-&gt;operands[i]-&gt;type-&gt;is_scalar()' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31934">Bug 31934</a> - [gallium] Mapping empty buffer object causes SIGSEGV</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31983">Bug 31983</a> - [i915 gles2] "if (expression with builtin/varying variables) discard" breaks linkage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31985">Bug 31985</a> - [GLSL 1.20] initialized uniform array considered as "unsized"</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31987">Bug 31987</a> - [gles2] if input a wrong pname(GL_NONE) to glGetBoolean, it will not case GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32035">Bug 32035</a> - [GLSL bisected] comparing unsized array gets segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32070">Bug 32070</a> - llvmpipe renders stencil demo incorrectly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32273">Bug 32273</a> - assertion fails when starting vdrift 2010 release with shaders enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32287">Bug 32287</a> - [bisected GLSL] float-int failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32311">Bug 32311</a> - [965 bisected] Array look-ups broken on GM45</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32520">Bug 32520</a> - [gles2] glBlendFunc(GL_ZERO, GL_DST_COLOR) will result in GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32825">Bug 32825</a> - egl_glx driver completely broken in 7.9 branch [fix in master]</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.9..mesa-7.9.1
</pre>
<p>Alex Deucher (5):
<ul>
<li>r100: revalidate after radeon_update_renderbuffers</li>
<li>r600c: add missing radeon_prepare_render() call on evergreen</li>
<li>r600c: properly align mipmaps to group size</li>
<li>gallium/egl: fix r300 vs r600 loading</li>
<li>r600c: fix some opcodes on evergreen</li>
</ul></p>
<p>Aras Pranckevicius (2):
<ul>
<li>glsl: fix crash in loop analysis when some controls can't be determined</li>
<li>glsl: fix matrix type check in ir_algebraic</li>
</ul></p>
<p>Brian Paul (27):
<ul>
<li>swrast: fix choose_depth_texture_level() to respect mipmap filtering state</li>
<li>st/mesa: replace assertion w/ conditional in framebuffer invalidation</li>
<li>egl/i965: include inline_wrapper_sw_helper.h</li>
<li>mesa: Add missing else in do_row_3D</li>
<li>mesa: add missing formats in _mesa_format_to_type_and_comps()</li>
<li>mesa: handle more pixel types in mipmap generation code</li>
<li>mesa: make glIsBuffer() return false for never bound buffers</li>
<li>mesa: fix glDeleteBuffers() regression</li>
<li>swrast: init alpha value to 1.0 in opt_sample_rgb_2d()</li>
<li>meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear</li>
<li>st/mesa: fix mapping of zero-sized buffer objects</li>
<li>mesa: check for posix_memalign() errors</li>
<li>llvmpipe: fix broken stencil writemask</li>
<li>mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query</li>
<li>mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type</li>
<li>mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM</li>
<li>mesa: test for cube map completeness in glGenerateMipmap()</li>
<li>tnl: Initialize gl_program_machine memory in run_vp.</li>
<li>tnl: a better way to initialize the gl_program_machine memory</li>
<li>mesa, st/mesa: disable GL_ARB_geometry_shader4</li>
<li>glsl: fix off by one in register index assertion</li>
<li>st/mesa: fix mipmap generation bug</li>
<li>glsl: new glsl_strtod() wrapper to fix decimal point interpretation</li>
<li>mesa: no-op glBufferSubData() on size==0</li>
<li>tdfx: s/Format/_BaseFormat/</li>
<li>st/mesa: fix renderbuffer pointer check in st_Clear()</li>
<li>mesa: Bump the number of bits in the register index.</li>
</ul></p>
<p>Chad Versace (5):
<ul>
<li>glsl: Fix lexer rule for ^=</li>
<li>glsl: Fix ast-to-hir for ARB_fragment_coord_conventions</li>
<li>glsl: Fix ir_expression::constant_expression_value()</li>
<li>glsl: Fix erroneous cast in ast_jump_statement::hir()</li>
<li>glsl: Fix linker bug in cross_validate_globals()</li>
</ul></p>
<p>Chia-I Wu (10):
<ul>
<li>targets/egl: Fix linking with libdrm.</li>
<li>st/vega: Fix version check in context creation.</li>
<li>st/egl: Do not finish a fence that is NULL.</li>
<li>egl: Fix a false negative check in _eglCheckMakeCurrent.</li>
<li>st/mesa: Unreference the sampler view in st_bind_surface.</li>
<li>egl_dri2: Fix __DRI_DRI2 version 1 support.</li>
<li>st/vega: Do not wait NULL fences.</li>
<li>mesa: Do not advertise GL_OES_texture_3D.</li>
<li>egl_glx: Fix borken driver.</li>
<li>egl: Check extensions.</li>
</ul></p>
<p>Daniel Lichtenberger (1):
<ul>
<li>radeon: fix potential segfault in renderbuffer update</li>
</ul></p>
<p>Daniel Vetter (1):
<ul>
<li>r200: revalidate after radeon_update_renderbuffers</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>r300g: fixup rs690 tiling stride alignment calculations.</li>
</ul></p>
<p>Eric Anholt (13):
<ul>
<li>intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.</li>
<li>glsl: Free the loop state context when we free the loop state.</li>
<li>i965: Allow OPCODE_SWZ to put immediates in the first arg.</li>
<li>i965: Add support for rendering to SARGB8 FBOs.</li>
<li>glsl: Add a helper constructor for expressions that works out result type.</li>
<li>glsl: Fix structure and array comparisions.</li>
<li>glsl: Quiet unreachable no-return-from-function warning.</li>
<li>glsl: Mark the array access for whole-array comparisons.</li>
<li>glsl: Fix flipped return of has_value() for array constants.</li>
<li>mesa: Add getters for the rest of the supported draw buffers.</li>
<li>mesa: Add getters for ARB_copy_buffer's attachment points.</li>
<li>i965: Correct the dp_read message descriptor setup on g4x.</li>
<li>glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.</li>
</ul></p>
<p>Fabian Bieler (1):
<ul>
<li>glsl: fix lowering conditional returns in subroutines</li>
</ul></p>
<p>Francisco Jerez (3):
<ul>
<li>meta: Don't leak alpha function/reference value changes.</li>
<li>meta: Fix incorrect rendering of the bitmap alpha component.</li>
<li>meta: Don't try to disable cube maps if the driver doesn't expose the extension.</li>
</ul></p>
<p>Henri Verbeet (2):
<ul>
<li>r600: Evergreen has two extra frac_bits for the sampler LOD state.</li>
<li>st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().</li>
</ul></p>
<p>Ian Romanick (33):
<ul>
<li>Add 7.9 md5sums</li>
<li>docs: Import 7.8.x release notes from 7.8 branch.</li>
<li>docs: download.html does not need to be updated for each release</li>
<li>docs: Update mailing lines from sf.net to freedesktop.org</li>
<li>docs: added news item for 7.9 release</li>
<li>mesa: Validate assembly shaders when GLSL shaders are used</li>
<li>linker: Reject shaders that have unresolved function calls</li>
<li>mesa: Refactor validation of shader targets</li>
<li>glsl: Slightly change the semantic of _LinkedShaders</li>
<li>linker: Improve handling of unread/unwritten shader inputs/outputs</li>
<li>glsl: Commit lexer files changed by previous cherry picking</li>
<li>mesa: Make metaops use program refcounts instead of names.</li>
<li>glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow</li>
<li>mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample</li>
<li>glsl: better handling of linker failures</li>
<li>mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.</li>
<li>i915: Disallow alpha, red, RG, and sRGB as render targets</li>
<li>glsl/linker: Free any IR discarded by optimization passes.</li>
<li>glsl: Add an optimization pass to simplify discards.</li>
<li>glsl: Add a lowering pass to move discards out of if-statements.</li>
<li>i915: Correctly generate unconditional KIL instructions</li>
<li>glsl: Add unary ir_expression constructor</li>
<li>glsl: Ensure that equality comparisons don't return a NULL IR tree</li>
<li>glcpp: Commit changes in generated files cause by previous commit</li>
<li>glsl: Inherrit type of declared variable from initializer</li>
<li>glsl: Inherrit type of declared variable from initializer after processing assignment</li>
<li>linker: Ensure that unsized arrays have a size after linking</li>
<li>linker: Fix regressions caused by previous commit</li>
<li>linker: Allow built-in arrays to have different sizes between shader stages</li>
<li>ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors</li>
<li>Refresh autogenerated file builtin_function.cpp.</li>
<li>docs: Initial set of release notes for 7.9.1</li>
<li>mesa: set version string to 7.9.1</li>
</ul></p>
<p>Julien Cristau (1):
<ul>
<li>Makefile: don't include the same files twice in the tarball</li>
</ul></p>
<p>Kenneth Graunke (19):
<ul>
<li>glcpp: Return NEWLINE token for newlines inside multi-line comments.</li>
<li>generate_builtins.py: Output large strings as arrays of characters.</li>
<li>glsl: Fix constant component count in vector constructor emitting.</li>
<li>ir_dead_functions: Actually free dead functions and signatures.</li>
<li>glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version &gt;= 1.30.</li>
<li>glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.</li>
<li>glsl: Fix constant expression handling for &lt, &gt;, &lt=, &gt;= on vectors.</li>
<li>glsl: Use do_common_optimization in the standalone compiler.</li>
<li>glsl: Don't inline function prototypes.</li>
<li>glsl: Add a virtual as_discard() method.</li>
<li>glsl: Remove "discard" support from lower_jumps.</li>
<li>glsl: Refactor get_num_operands.</li>
<li>glcpp: Don't emit SPACE tokens in conditional_tokens production.</li>
<li>glsl: Clean up code by adding a new is_break() function.</li>
<li>glsl: Consider the "else" branch when looking for loop breaks.</li>
<li>Remove OES_compressed_paletted_texture from the ES2 extension list.</li>
<li>glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).</li>
<li>Fix build on systems where "python" is python 3.</li>
<li>i965: Internally enable GL_NV_blend_square on ES2.</li>
</ul></p>
<p>Kristian Høgsberg (1):
<ul>
<li>i965: Don't write mrf assignment for pointsize output</li>
</ul></p>
<p>Luca Barbieri (1):
<ul>
<li>glsl: Unroll loops with conditional breaks anywhere (not just the end)</li>
</ul></p>
<p>Marek Olšák (17):
<ul>
<li>r300g: fix microtiling for 16-bits-per-channel formats</li>
<li>r300g: fix texture border for 16-bits-per-channel formats</li>
<li>r300g: add a default channel ordering of texture border for unhandled formats</li>
<li>r300g: fix texture border color for all texture formats</li>
<li>r300g: fix rendering with no vertex elements</li>
<li>r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction</li>
<li>r300g: fix texture border color once again</li>
<li>r300g: fix texture swizzling with compressed textures on r400-r500</li>
<li>r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only</li>
<li>mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium</li>
<li>st/mesa: initialize key in st_vp_varient</li>
<li>r300/compiler: fix swizzle lowering with a presubtract source operand</li>
<li>r300g: fix rendering with a vertex attrib having a zero stride</li>
<li>ir_to_mesa: Add support for conditional discards.</li>
<li>r300g: finally fix the texture corruption on r3xx-r4xx</li>
<li>mesa: fix texel store functions for some float formats</li>
<li>r300/compiler: disable the rename_regs pass for loops</li>
</ul></p>
<p>Mario Kleiner (1):
<ul>
<li>mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.</li>
</ul></p>
<p>Peter Clifton (1):
<ul>
<li>intel: Fix emit_linear_blit to use DWORD aligned width blits</li>
</ul></p>
<p>Robert Hooker (2):
<ul>
<li>intel: Add a new B43 pci id.</li>
<li>egl_dri2: Add missing intel chip ids.</li>
</ul></p>
<p>Roland Scheidegger (1):
<ul>
<li>r200: fix r200 large points</li>
</ul></p>
<p>Thomas Hellstrom (17):
<ul>
<li>st/xorg: Don't try to use option values before processing options</li>
<li>xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers</li>
<li>st/xorg: Add a customizer option to get rid of annoying cursor update flicker</li>
<li>xorg/vmwgfx: Don't hide HW cursors when updating them</li>
<li>st/xorg: Don't try to remove invalid fbs</li>
<li>st/xorg: Fix typo</li>
<li>st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments</li>
<li>st/xorg: Fix compilation errors for Xservers compiled without Composite</li>
<li>st/xorg: Don't use deprecated x*alloc / xfree functions</li>
<li>xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions</li>
<li>st/xorg: Fix compilation for Xservers &gt;= 1.10</li>
<li>mesa: Make sure we have the talloc cflags when using the talloc headers</li>
<li>egl: Add an include for size_t</li>
<li>mesa: Add talloc includes for gles</li>
<li>st/egl: Fix build for include files in nonstandard places</li>
<li>svga/drm: Optionally resolve calls to powf during link-time</li>
<li>gallium/targets: Trivial crosscompiling fix</li>
</ul></p>
<p>Tom Stellard (7):
<ul>
<li>r300/compiler: Make sure presubtract sources use supported swizzles</li>
<li>r300/compiler: Fix register allocator's handling of loops</li>
<li>r300/compiler: Fix instruction scheduling within IF blocks</li>
<li>r300/compiler: Use zero as the register index for unused sources</li>
<li>r300/compiler: Ignore alpha dest register when replicating the result</li>
<li>r300/compiler: Use correct swizzles for all presubtract sources</li>
<li>r300/compiler: Don't allow presubtract sources to be remapped twice</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>glsl: Fix 'control reaches end of non-void function' warning.</li>
</ul></p>
<p>richard (1):
<ul>
<li>r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well.</li>
</ul></p>
</body>
</html>

336
docs/relnotes-7.9.2.html Normal file
View File

@@ -0,0 +1,336 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.2 Release Notes / TBD</H1>
<p>
Mesa 7.9.2 is a bug fix release which fixes bugs found since the 7.9.1 release.
</p>
<p>
Mesa 7.9.2 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
eb4ab8c1a03386def3ea34b1358e9cda MesaLib-7.9.2.tar.gz
8f6d1474912787ce13bd35f3bae9938a MesaLib-7.9.2.tar.bz2
427a81dd43ac97603768dc5c6af3df26 MesaLib-7.9.2.zip
aacb8f4db997e346db40c6066942140a MesaGLUT-7.9.2.tar.gz
18abe6cff4fad8ad4752c7b7ab548e5d MesaGLUT-7.9.2.tar.bz2
3189e5732d636c71baf3d8bc23ce7b11 MesaGLUT-7.9.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Fix an off-by-one bug in a vsplit assertion.</li>
<li>Fix incorrect handling of <tt>layout</tt> qualifier
with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>Fix an i965 GPU hang in GLSL shaders that contain an unconditional <tt>discard</tt> statement.</li>
<li>Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.</li>
<li>Fix numerous issues handling precision qualifiers in GLSL ES.</li>
<li>Fixed a few GLX protocol encoder bugs (Julien Cristau)</li>
<li>Assorted Gallium llvmpipe driver bug fixes</li>
<li>Assorted Mesa/Gallium state tracker bug fixes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26795">Bug 26795</a> - gl_FragCoord off by one in Gallium drivers.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29164">Bug 29164</a> - [GLSL 1.20] invariant variable shouldn't be used before declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29823">Bug 29823</a> - GetUniform[if]v busted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29927">Bug 29927</a> - [glsl2] fail to compile shader with constructor for array of struct type</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30156">Bug 30156</a> - [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31923">Bug 31923</a> - [GLSL 1.20] allowing inconsistent centroid declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31925">Bug 31925</a> - [GLSL 1.20] "#pragma STDGL invariant(all)" fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32214">Bug 32214</a> - [gles2]no link error happens when missing vertex shader or frag shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32375">Bug 32375</a> - [gl gles2] Not able to get the attribute by function glGetVertexAttribfv</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32541">Bug 32541</a> - Segmentation Fault while running an HDR (high dynamic range) rendering demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32569">Bug 32569</a> - [gles2] glGetShaderPrecisionFormat not implemented yet</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32695">Bug 32695</a> - [glsl] SIGSEGV glcpp/glcpp-parse.y:833</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32831">Bug 32831</a> - [glsl] division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32910">Bug 32910</a> - Keywords 'in' and 'out' not handled properly for GLSL 1.20 shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33219">Bug 33219</a> -[GLSL bisected] implicit sized array triggers segfault in ir_to_mesa_visitor::copy_propagate</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33308">Bug 33308</a> -[glsl] ast_to_hir.cpp:3016: virtual ir_rvalue* ast_jump_statement::hir(exec_list*, _mesa_glsl_parse_state*): Assertion `ret != __null' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33316">Bug 33316</a> - uniform array will be allocate one line more and initialize it when it was freed will abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33386">Bug 33386</a> - Dubious assembler in read_rgba_span_x86.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33388">Bug 33388</a> - Dubious assembler in xform4.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33433">Bug 33433</a> - Error in x86-64 API dispatch code.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33507">Bug 33507</a> - [glsl] GLSL preprocessor modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33916">Bug 33916</a> - Compiler accepts reserved operators % and %=</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34047">Bug 34047</a> - Assert in _tnl_import_array() when using GLfixed vertex datatypes with GLESv2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34114">Bug 34114</a> - Sun Studio build fails due to standard library functions not being in global namespace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34198">Bug 34198</a> - [GLSL] implicit sized array with index 0 used gets assertion</li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653">Ubuntu bug 691653</a> - compiz crashes when using alt-tab (the radeon driver kills it) </li>
<li><a href="https://bugs.meego.com/show_bug.cgi?id=13005">Meego bug 13005</a> - Graphics GLSL issue lead to camera preview fail on Pinetrail</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.9.1..mesa-7.9.2
</pre>
<p>Alberto Milone (1):
<ul>
<li>r600c: add evergreen ARL support.</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>draw: Fix an off-by-one bug in a vsplit assertion.</li>
<li>mesa: fix a few format table mistakes, assertions</li>
<li>mesa: fix num_draw_buffers==0 in fixed-function fragment program generation</li>
<li>mesa: don't assert in GetIntegerIndexed, etc</li>
<li>mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
<li>llvmpipe: make sure binning is active when we begin/end a query</li>
<li>st/mesa: fix incorrect fragcoord.x translation</li>
<li>softpipe: fix off-by-one error in setup_fragcoord_coeff()</li>
<li>cso: fix loop bound in cso_set_vertex_samplers()</li>
<li>st/mesa: set renderbuffer _BaseFormat in a few places</li>
<li>st/mesa: fix the default case in st_format_datatype()</li>
<li>st/mesa: need to translate clear color according to surface's base format</li>
<li>docs: update 7.9.2 release notes with Brian's cherry-picks</li>
<li>docs: add links to 7.9.1 and 7.9.2 release notes</li>
<li>mesa: include compiler.h for ASSERT macro</li>
<li>glsl: add ir_shader case in switch stmt to silence warning</li>
<li>glsl2: fix signed/unsigned comparison warning</li>
<li>mesa: implement glGetShaderPrecisionFormat()</li>
<li>docs: updated environment variable list</li>
</ul></p>
<p>Bryce Harrington (1):
<ul>
<li>r300g: Null pointer check for buffer deref in gallium winsys</li>
</ul></p>
<p>Chad Versace (14):
<ul>
<li>glsl: At link-time, check that globals have matching centroid qualifiers</li>
<li>glcpp: Fix segfault when validating macro redefinitions</li>
<li>glsl: Fix parser rule for type_specifier</li>
<li>glsl: Change default value of ast_type_specifier::precision</li>
<li>glsl: Add semantic checks for precision qualifiers</li>
<li>glsl: Add support for default precision statements</li>
<li>glsl: Remove redundant semantic check in parser</li>
<li>glsl: Fix semantic checks on precision qualifiers</li>
<li>glsl: Fix segfault due to missing printf argument</li>
<li>glsl: Mark 'in' variables at global scope as read-only</li>
<li>glcpp: Raise error when modulus is zero</li>
<li>glsl: Set operators '%' and '%=' to be reserved when GLSL &lt 1.30</li>
<li>glsl: Reinstate constant-folding for division by zero</li>
<li>tnl: Add support for datatype GL_FIXED in vertex arrays</li>
</ul></p>
<p>Chia-I Wu (1):
<ul>
<li>mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.</li>
</ul></p>
<p>Chris Wilson (1):
<ul>
<li>intel: Check for unsupported texture when finishing using as a render target</li>
</ul></p>
<p>Cyril Brulebois (1):
<ul>
<li>Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org</li>
</ul></p>
<p>Dave Airlie (2):
<ul>
<li>radeon/r200: fix fbo-clearmipmap + gen-teximage</li>
<li>radeon: avoid segfault on 3D textures.</li>
</ul></p>
<p>Dimitry Andric (4):
<ul>
<li>mesa: s/movzx/movzbl/</li>
<li>mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S</li>
<li>glapi: adding @ char before type specifier in glapi_x86.S</li>
<li>glapi: add @GOTPCREL relocation type</li>
</ul></p>
<p>Eric Anholt (11):
<ul>
<li>i965: Avoid double-negation of immediate values in the VS.</li>
<li>docs: Add a relnote for the Civ IV on i965.</li>
<li>i965/vs: When MOVing to produce ABS, strip negate of the operand.</li>
<li>glsl: Fix the lowering of variable array indexing to not lose write_masks.</li>
<li>intel: Make renderbuffer tiling choice match texture tiling choice.</li>
<li>glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add extension enable bit for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add actual support for glReleaseShaderCompiler from ES2.</li>
<li>mesa: Add support for glDepthRangef and glClearDepthf.</li>
<li>mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.</li>
<li>mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.</li>
</ul></p>
<p>Ian Romanick (42):
<ul>
<li>docs: Add 7.9.1 md5sums</li>
<li>glsl: Support the 'invariant(all)' pragma</li>
<li>glcpp: Generate an error for division by zero</li>
<li>glsl: Add version_string containing properly formatted GLSL version</li>
<li>glsl &amp; glcpp: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Disallow 'in' and 'out' on globals in GLSL 1.20</li>
<li>glsl: Track variable usage, use that to enforce semantics</li>
<li>glsl: Allow 'in' and 'out' when 'layout' is also available</li>
<li>docs: Initial set of release notes for 7.9.2</li>
<li>mesa: bump version to 7.9.2-devel</li>
<li>docs: Update 7.9.2 release notes</li>
<li>i965: Make OPCODE_KIL_NV do its work in a temp, not the null reg!</li>
<li>glsl: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Don't assert when the value returned by a function has no rvalue</li>
<li>linker: Set sizes for non-global arrays as well</li>
<li>linker: Propagate max_array_access while linking functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>Use C-style system headers in C++ code to avoid issues with std:: namespace</li>
<li>mesa: glGetUniform only returns a single element of an array</li>
<li>linker: Generate link errors when ES shaders are missing stages</li>
<li>mesa: Fix error checks in GetVertexAttrib functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>mesa: Remove unsupported OES extensions</li>
<li>glapi: Regenerate for GL_ARB_ES2_compatibility.</li>
<li>mesa: Connect glGetShaderPrecisionFormat into the dispatch table</li>
<li>i965: Set correct values for range/precision of fragment shader types</li>
<li>i915: Set correct values for range/precision of fragment shader types</li>
<li>intel: Fix typeos from 3d028024 and 790ff232</li>
<li>glsl: Ensure that all GLSL versions are supported in the stand-alone compiler</li>
<li>glsl: Reject shader versions not supported by the implementation</li>
<li>mesa: Initial size for secondary color array is 3</li>
<li>glcpp: Regenerate files from recent cherry picks</li>
<li>glsl: Finish out the reduce/reduce error fixes</li>
<li>glsl: Regenerate compiler files from cherry picks</li>
<li>linker: Fix off-by-one error implicit array sizing</li>
<li>i915: Only mark a register as available if all components are written</li>
<li>i915: Calculate partial result to temp register first</li>
<li>i915: Force lowering of all types of indirect array accesses in the FS</li>
<li>docs: Update 7.9.2 release notes for recent cherry picks</li>
<li>docs: Clean up bug fixes list</li>
<li>intel: Remove driver date and related bits from renderer string</li>
<li>mesa: set version string to 7.9.2 (final)</li>
</ul></p>
<p>Jian Zhao (1):
<ul>
<li>mesa: fix an error in uniform arrays in row calculating.</li>
</ul></p>
<p>Julien Cristau (3):
<ul>
<li>glx: fix request lengths</li>
<li>glx: fix GLXChangeDrawableAttributesSGIX request</li>
<li>glx: fix length of GLXGetFBConfigsSGIX</li>
</ul></p>
<p>Keith Packard (1):
<ul>
<li>glsl: Eliminate reduce/reduce conflicts in glsl grammar</li>
</ul></p>
<p>Kenneth Graunke (12):
<ul>
<li>glsl: Expose a public glsl_type::void_type const pointer.</li>
<li>glsl: Don't bother unsetting a destructor that was never set.</li>
<li>glsl, i965: Remove unnecessary talloc includes.</li>
<li>glcpp: Remove use of talloc reference counting.</li>
<li>ralloc: Add a fake implementation of ralloc based on talloc.</li>
<li>Convert everything from the talloc API to the ralloc API.</li>
<li>ralloc: a new MIT-licensed recursive memory allocator.</li>
<li>Remove talloc from the make and automake build systems.</li>
<li>Remove talloc from the SCons build system.</li>
<li>Remove the talloc sources from the Mesa repository.</li>
<li>glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.</li>
<li>glsl: Use reralloc instead of plain realloc.</li>
</ul></p>
<p>Marek Olšák (3):
<ul>
<li>docs: fix messed up names with special characters in relnotes-7.9.1</li>
<li>mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2</li>
<li>st/dri: Track drawable context bindings</li>
</ul></p>
<p>Paulo Zanoni (1):
<ul>
<li>dri_util: fail driCreateNewScreen if InitScreen is NULL</li>
</ul></p>
<p>Sam Hocevar (2):
<ul>
<li>docs: add glsl info</li>
<li>docs: fix glsl_compiler name</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>ralloc: Add missing va_end following va_copy.</li>
</ul></p>
<p>nobled (1):
<ul>
<li>glx: Put null check before use</li>
</ul></p>
</p>
</body>
</html>

View File

@@ -13,6 +13,11 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="relnotes-7.11.html">7.11 release notes</A>
<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>
<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
<LI><A HREF="relnotes-7.9.1.html">7.9.1 release notes</A>
<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>

View File

@@ -167,7 +167,7 @@ Here's an example of using the compiler to compile a vertex shader and
emit GL_ARB_vertex_program-style instructions:
</p>
<pre>
src/glsl/glslcompiler --dump-ast myshader.vert
src/glsl/glsl_compiler --dump-ast myshader.vert
</pre>
Options include

View File

@@ -23,6 +23,7 @@ each directory.
<ul>
<li><b>docs</b> - EGL documentation
<li><b>drivers</b> - EGL drivers
<li><b>glsl</b> - the GLSL compiler
<li><b>main</b> - main EGL library implementation. This is where all
the EGL API functions are implemented, like eglCreateContext().
</ul>

1
doxygen/.gitignore vendored
View File

@@ -6,6 +6,7 @@ core
core_subset
gallium
glapi
glsl
main
math
math_subset

View File

@@ -11,6 +11,7 @@ FULL = \
math.doxy \
vbo.doxy \
glapi.doxy \
glsl.doxy \
shader.doxy \
swrast.doxy \
swrast_setup.doxy \

39
doxygen/glsl.doxy Normal file
View File

@@ -0,0 +1,39 @@
# Doxyfile 0.1
@INCLUDE = common.doxy
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa GLSL module"
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/glsl/
RECURSIVE = NO
EXCLUDE = ../src/glsl/glsl_lexer.cpp \
../src/glsl/glsl_lexer.h \
../src/glsl/glsl_parser.cpp \
../src/glsl/glsl_parser.h
EXCLUDE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
HTML_OUTPUT = glsl
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = glsl.tag

View File

@@ -7,6 +7,7 @@
<div class="qindex">
<a class="qindex" href="../main/index.html">core</a> |
<a class="qindex" href="../glapi/index.html">glapi</a> |
<a class="qindex" href="../glsl/index.html">glsl</a> |
<a class="qindex" href="../vbo/index.html">vbo</a> |
<a class="qindex" href="../math/index.html">math</a> |
<a class="qindex" href="../shader/index.html">shader</a> |

View File

@@ -143,6 +143,20 @@ typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESA) (EGLDisplay dpy, con
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESA) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
struct wl_display;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
#else
typedef EGLBoolean (EGLAPIENTRY PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRY PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
#endif
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
#ifndef EGL_KHR_reusable_sync
#define EGL_KHR_reusable_sync 1
@@ -382,14 +396,6 @@ struct android_native_buffer_t;
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
#endif
#ifndef EGL_ANDROID_get_render_buffer
#define EGL_ANDROID_get_render_buffer 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLClientBuffer EGLAPIENTRY eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw);
#endif
typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETRENDERBUFFERANDROIDPROC) (EGLDisplay dpy, EGLSurface draw);
#endif
#ifndef EGL_ANDROID_swap_rectangle
#define EGL_ANDROID_swap_rectangle 1
#ifdef EGL_EGLEXT_PROTOTYPES

View File

@@ -78,6 +78,12 @@ typedef int EGLNativeDisplayType;
typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
#elif defined(WL_EGL_PLATFORM)
typedef struct wl_egl_display *EGLNativeDisplayType;
typedef struct wl_egl_pixmap *EGLNativePixmapType;
typedef struct wl_egl_window *EGLNativeWindowType;
#elif defined(ANDROID) /* Android */
struct android_native_window_t;

View File

@@ -31,6 +31,7 @@
#define glAccum MANGLE(Accum)
#define glActiveProgramEXT MANGLE(ActiveProgramEXT)
#define glActiveShaderProgram MANGLE(ActiveShaderProgram)
#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
#define glActiveTextureARB MANGLE(ActiveTextureARB)
#define glActiveTexture MANGLE(ActiveTexture)
@@ -56,6 +57,7 @@
#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
#define glBeginPerfMonitorAMD MANGLE(BeginPerfMonitorAMD)
#define glBeginQueryARB MANGLE(BeginQueryARB)
#define glBeginQueryIndexed MANGLE(BeginQueryIndexed)
#define glBeginQuery MANGLE(BeginQuery)
#define glBeginTransformFeedbackEXT MANGLE(BeginTransformFeedbackEXT)
#define glBeginTransformFeedback MANGLE(BeginTransformFeedback)
@@ -75,22 +77,27 @@
#define glBindBufferRange MANGLE(BindBufferRange)
#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
#define glBindFragDataLocationIndexed MANGLE(BindFragDataLocationIndexed)
#define glBindFragDataLocation MANGLE(BindFragDataLocation)
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
#define glBindFramebuffer MANGLE(BindFramebuffer)
#define glBindImageTextureEXT MANGLE(BindImageTextureEXT)
#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
#define glBindMultiTextureEXT MANGLE(BindMultiTextureEXT)
#define glBindParameterEXT MANGLE(BindParameterEXT)
#define glBindProgramARB MANGLE(BindProgramARB)
#define glBindProgramNV MANGLE(BindProgramNV)
#define glBindProgramPipeline MANGLE(BindProgramPipeline)
#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
#define glBindRenderbuffer MANGLE(BindRenderbuffer)
#define glBindSampler MANGLE(BindSampler)
#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
#define glBindTextureEXT MANGLE(BindTextureEXT)
#define glBindTexture MANGLE(BindTexture)
#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
#define glBindTransformFeedback MANGLE(BindTransformFeedback)
#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV)
#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
#define glBindVertexArray MANGLE(BindVertexArray)
@@ -112,18 +119,22 @@
#define glBlendColorEXT MANGLE(BlendColorEXT)
#define glBlendColor MANGLE(BlendColor)
#define glBlendEquationEXT MANGLE(BlendEquationEXT)
#define glBlendEquationiARB MANGLE(BlendEquationiARB)
#define glBlendEquationi MANGLE(BlendEquationi)
#define glBlendEquationIndexedAMD MANGLE(BlendEquationIndexedAMD)
#define glBlendEquation MANGLE(BlendEquation)
#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
#define glBlendEquationSeparateiARB MANGLE(BlendEquationSeparateiARB)
#define glBlendEquationSeparatei MANGLE(BlendEquationSeparatei)
#define glBlendEquationSeparateIndexedAMD MANGLE(BlendEquationSeparateIndexedAMD)
#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
#define glBlendFunciARB MANGLE(BlendFunciARB)
#define glBlendFunci MANGLE(BlendFunci)
#define glBlendFuncIndexedAMD MANGLE(BlendFuncIndexedAMD)
#define glBlendFunc MANGLE(BlendFunc)
#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
#define glBlendFuncSeparateiARB MANGLE(BlendFuncSeparateiARB)
#define glBlendFuncSeparatei MANGLE(BlendFuncSeparatei)
#define glBlendFuncSeparateIndexedAMD MANGLE(BlendFuncSeparateIndexedAMD)
#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
@@ -153,6 +164,7 @@
#define glClearColor MANGLE(ClearColor)
#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA)
#define glClearDepthdNV MANGLE(ClearDepthdNV)
#define glClearDepthf MANGLE(ClearDepthf)
#define glClearDepth MANGLE(ClearDepth)
#define glClearIndex MANGLE(ClearIndex)
#define glClear MANGLE(Clear)
@@ -215,6 +227,10 @@
#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
#define glColorMask MANGLE(ColorMask)
#define glColorMaterial MANGLE(ColorMaterial)
#define glColorP3ui MANGLE(ColorP3ui)
#define glColorP3uiv MANGLE(ColorP3uiv)
#define glColorP4ui MANGLE(ColorP4ui)
#define glColorP4uiv MANGLE(ColorP4uiv)
#define glColorPointerEXT MANGLE(ColorPointerEXT)
#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
#define glColorPointer MANGLE(ColorPointer)
@@ -236,6 +252,7 @@
#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
#define glCompileShaderARB MANGLE(CompileShaderARB)
#define glCompileShaderIncludeARB MANGLE(CompileShaderIncludeARB)
#define glCompileShader MANGLE(CompileShader)
#define glCompressedMultiTexImage1DEXT MANGLE(CompressedMultiTexImage1DEXT)
#define glCompressedMultiTexImage2DEXT MANGLE(CompressedMultiTexImage2DEXT)
@@ -310,10 +327,18 @@
#define glCreateShader MANGLE(CreateShader)
#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
#define glCreateShaderProgramEXT MANGLE(CreateShaderProgramEXT)
#define glCreateShaderProgramv MANGLE(CreateShaderProgramv)
#define glCreateSyncFromCLeventARB MANGLE(CreateSyncFromCLeventARB)
#define glCullFace MANGLE(CullFace)
#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB)
#define glDebugMessageCallbackAMD MANGLE(DebugMessageCallbackAMD)
#define glDebugMessageCallbackARB MANGLE(DebugMessageCallbackARB)
#define glDebugMessageControlARB MANGLE(DebugMessageControlARB)
#define glDebugMessageEnableAMD MANGLE(DebugMessageEnableAMD)
#define glDebugMessageInsertAMD MANGLE(DebugMessageInsertAMD)
#define glDebugMessageInsertARB MANGLE(DebugMessageInsertARB)
#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX)
#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX)
#define glDeformSGIX MANGLE(DeformSGIX)
@@ -326,20 +351,25 @@
#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
#define glDeleteFramebuffers MANGLE(DeleteFramebuffers)
#define glDeleteLists MANGLE(DeleteLists)
#define glDeleteNamedStringARB MANGLE(DeleteNamedStringARB)
#define glDeleteNamesAMD MANGLE(DeleteNamesAMD)
#define glDeleteObjectARB MANGLE(DeleteObjectARB)
#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
#define glDeletePerfMonitorsAMD MANGLE(DeletePerfMonitorsAMD)
#define glDeleteProgram MANGLE(DeleteProgram)
#define glDeleteProgramPipelines MANGLE(DeleteProgramPipelines)
#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
#define glDeleteQueries MANGLE(DeleteQueries)
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
#define glDeleteSamplers MANGLE(DeleteSamplers)
#define glDeleteShader MANGLE(DeleteShader)
#define glDeleteSync MANGLE(DeleteSync)
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
#define glDeleteTextures MANGLE(DeleteTextures)
#define glDeleteTransformFeedbacks MANGLE(DeleteTransformFeedbacks)
#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
#define glDeleteVertexArrays MANGLE(DeleteVertexArrays)
@@ -348,7 +378,10 @@
#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
#define glDepthFunc MANGLE(DepthFunc)
#define glDepthMask MANGLE(DepthMask)
#define glDepthRangeArrayv MANGLE(DepthRangeArrayv)
#define glDepthRangedNV MANGLE(DepthRangedNV)
#define glDepthRangef MANGLE(DepthRangef)
#define glDepthRangeIndexed MANGLE(DepthRangeIndexed)
#define glDepthRange MANGLE(DepthRange)
#define glDetachObjectARB MANGLE(DetachObjectARB)
#define glDetachShader MANGLE(DetachShader)
@@ -363,6 +396,7 @@
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
#define glDrawArraysIndirect MANGLE(DrawArraysIndirect)
#define glDrawArraysInstancedARB MANGLE(DrawArraysInstancedARB)
#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
#define glDrawArraysInstanced MANGLE(DrawArraysInstanced)
@@ -374,6 +408,7 @@
#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
#define glDrawElementsBaseVertex MANGLE(DrawElementsBaseVertex)
#define glDrawElementsIndirect MANGLE(DrawElementsIndirect)
#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
#define glDrawElementsInstancedBaseVertex MANGLE(DrawElementsInstancedBaseVertex)
#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
@@ -386,7 +421,9 @@
#define glDrawRangeElementsBaseVertex MANGLE(DrawRangeElementsBaseVertex)
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glDrawRangeElements MANGLE(DrawRangeElements)
#define glDrawTransformFeedback MANGLE(DrawTransformFeedback)
#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
#define glDrawTransformFeedbackStream MANGLE(DrawTransformFeedbackStream)
#define glEdgeFlagFormatNV MANGLE(EdgeFlagFormatNV)
#define glEdgeFlag MANGLE(EdgeFlag)
#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
@@ -414,6 +451,7 @@
#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
#define glEndPerfMonitorAMD MANGLE(EndPerfMonitorAMD)
#define glEndQueryARB MANGLE(EndQueryARB)
#define glEndQueryIndexed MANGLE(EndQueryIndexed)
#define glEndQuery MANGLE(EndQuery)
#define glEndTransformFeedbackEXT MANGLE(EndTransformFeedbackEXT)
#define glEndTransformFeedback MANGLE(EndTransformFeedback)
@@ -447,6 +485,7 @@
#define glFlush MANGLE(Flush)
#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
#define glFlushMappedBufferRange MANGLE(FlushMappedBufferRange)
#define glFlushMappedNamedBufferRangeEXT MANGLE(FlushMappedNamedBufferRangeEXT)
#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
@@ -498,7 +537,6 @@
#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
#define glFramebufferTextureFace MANGLE(FramebufferTextureFace)
#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
@@ -521,23 +559,30 @@
#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
#define glGenFramebuffers MANGLE(GenFramebuffers)
#define glGenLists MANGLE(GenLists)
#define glGenNamesAMD MANGLE(GenNamesAMD)
#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
#define glGenPerfMonitorsAMD MANGLE(GenPerfMonitorsAMD)
#define glGenProgramPipelines MANGLE(GenProgramPipelines)
#define glGenProgramsARB MANGLE(GenProgramsARB)
#define glGenProgramsNV MANGLE(GenProgramsNV)
#define glGenQueriesARB MANGLE(GenQueriesARB)
#define glGenQueries MANGLE(GenQueries)
#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
#define glGenRenderbuffers MANGLE(GenRenderbuffers)
#define glGenSamplers MANGLE(GenSamplers)
#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
#define glGenTexturesEXT MANGLE(GenTexturesEXT)
#define glGenTextures MANGLE(GenTextures)
#define glGenTransformFeedbacks MANGLE(GenTransformFeedbacks)
#define glGenTransformFeedbacksNV MANGLE(GenTransformFeedbacksNV)
#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
#define glGenVertexArrays MANGLE(GenVertexArrays)
#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
#define glGetActiveAttrib MANGLE(GetActiveAttrib)
#define glGetActiveSubroutineName MANGLE(GetActiveSubroutineName)
#define glGetActiveSubroutineUniformiv MANGLE(GetActiveSubroutineUniformiv)
#define glGetActiveSubroutineUniformName MANGLE(GetActiveSubroutineUniformName)
#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
#define glGetActiveUniformBlockiv MANGLE(GetActiveUniformBlockiv)
#define glGetActiveUniformBlockName MANGLE(GetActiveUniformBlockName)
@@ -589,16 +634,21 @@
#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv)
#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA)
#define glGetDebugLogMESA MANGLE(GetDebugLogMESA)
#define glGetDebugMessageLogAMD MANGLE(GetDebugMessageLogAMD)
#define glGetDebugMessageLogARB MANGLE(GetDebugMessageLogARB)
#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
#define glGetDoubleIndexedvEXT MANGLE(GetDoubleIndexedvEXT)
#define glGetDoublei_v MANGLE(GetDoublei_v)
#define glGetDoublev MANGLE(GetDoublev)
#define glGetError MANGLE(GetError)
#define glGetFenceivNV MANGLE(GetFenceivNV)
#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
#define glGetFloatIndexedvEXT MANGLE(GetFloatIndexedvEXT)
#define glGetFloati_v MANGLE(GetFloati_v)
#define glGetFloatv MANGLE(GetFloatv)
#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
#define glGetFragDataIndex MANGLE(GetFragDataIndex)
#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
#define glGetFragDataLocation MANGLE(GetFragDataLocation)
#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
@@ -608,6 +658,7 @@
#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
#define glGetFramebufferAttachmentParameteriv MANGLE(GetFramebufferAttachmentParameteriv)
#define glGetFramebufferParameterivEXT MANGLE(GetFramebufferParameterivEXT)
#define glGetGraphicsResetStatusARB MANGLE(GetGraphicsResetStatusARB)
#define glGetHandleARB MANGLE(GetHandleARB)
#define glGetHistogramEXT MANGLE(GetHistogramEXT)
#define glGetHistogram MANGLE(GetHistogram)
@@ -678,6 +729,26 @@
#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT)
#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT)
#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT)
#define glGetNamedStringARB MANGLE(GetNamedStringARB)
#define glGetNamedStringivARB MANGLE(GetNamedStringivARB)
#define glGetnColorTableARB MANGLE(GetnColorTableARB)
#define glGetnCompressedTexImageARB MANGLE(GetnCompressedTexImageARB)
#define glGetnConvolutionFilterARB MANGLE(GetnConvolutionFilterARB)
#define glGetnHistogramARB MANGLE(GetnHistogramARB)
#define glGetnMapdvARB MANGLE(GetnMapdvARB)
#define glGetnMapfvARB MANGLE(GetnMapfvARB)
#define glGetnMapivARB MANGLE(GetnMapivARB)
#define glGetnMinmaxARB MANGLE(GetnMinmaxARB)
#define glGetnPixelMapfvARB MANGLE(GetnPixelMapfvARB)
#define glGetnPixelMapuivARB MANGLE(GetnPixelMapuivARB)
#define glGetnPixelMapusvARB MANGLE(GetnPixelMapusvARB)
#define glGetnPolygonStippleARB MANGLE(GetnPolygonStippleARB)
#define glGetnSeparableFilterARB MANGLE(GetnSeparableFilterARB)
#define glGetnTexImageARB MANGLE(GetnTexImageARB)
#define glGetnUniformdvARB MANGLE(GetnUniformdvARB)
#define glGetnUniformfvARB MANGLE(GetnUniformfvARB)
#define glGetnUniformivARB MANGLE(GetnUniformivARB)
#define glGetnUniformuivARB MANGLE(GetnUniformuivARB)
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
@@ -700,6 +771,7 @@
#define glGetPointervEXT MANGLE(GetPointervEXT)
#define glGetPointerv MANGLE(GetPointerv)
#define glGetPolygonStipple MANGLE(GetPolygonStipple)
#define glGetProgramBinary MANGLE(GetProgramBinary)
#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV)
@@ -716,28 +788,42 @@
#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
#define glGetProgramPipelineInfoLog MANGLE(GetProgramPipelineInfoLog)
#define glGetProgramPipelineiv MANGLE(GetProgramPipelineiv)
#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
#define glGetProgramStageiv MANGLE(GetProgramStageiv)
#define glGetProgramStringARB MANGLE(GetProgramStringARB)
#define glGetProgramStringNV MANGLE(GetProgramStringNV)
#define glGetProgramSubroutineParameteruivNV MANGLE(GetProgramSubroutineParameteruivNV)
#define glGetQueryIndexediv MANGLE(GetQueryIndexediv)
#define glGetQueryivARB MANGLE(GetQueryivARB)
#define glGetQueryiv MANGLE(GetQueryiv)
#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
#define glGetQueryObjecti64v MANGLE(GetQueryObjecti64v)
#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
#define glGetQueryObjectui64v MANGLE(GetQueryObjectui64v)
#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
#define glGetRenderbufferParameteriv MANGLE(GetRenderbufferParameteriv)
#define glGetSamplerParameterfv MANGLE(GetSamplerParameterfv)
#define glGetSamplerParameterIiv MANGLE(GetSamplerParameterIiv)
#define glGetSamplerParameterIuiv MANGLE(GetSamplerParameterIuiv)
#define glGetSamplerParameteriv MANGLE(GetSamplerParameteriv)
#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
#define glGetSeparableFilter MANGLE(GetSeparableFilter)
#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
#define glGetShaderiv MANGLE(GetShaderiv)
#define glGetShaderPrecisionFormat MANGLE(GetShaderPrecisionFormat)
#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
#define glGetShaderSource MANGLE(GetShaderSource)
#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
#define glGetStringi MANGLE(GetStringi)
#define glGetString MANGLE(GetString)
#define glGetSubroutineIndex MANGLE(GetSubroutineIndex)
#define glGetSubroutineUniformLocation MANGLE(GetSubroutineUniformLocation)
#define glGetSynciv MANGLE(GetSynciv)
#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
@@ -770,14 +856,17 @@
#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
#define glGetUniformBlockIndex MANGLE(GetUniformBlockIndex)
#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
#define glGetUniformdv MANGLE(GetUniformdv)
#define glGetUniformfvARB MANGLE(GetUniformfvARB)
#define glGetUniformfv MANGLE(GetUniformfv)
#define glGetUniformi64vNV MANGLE(GetUniformi64vNV)
#define glGetUniformIndices MANGLE(GetUniformIndices)
#define glGetUniformivARB MANGLE(GetUniformivARB)
#define glGetUniformiv MANGLE(GetUniformiv)
#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
#define glGetUniformLocation MANGLE(GetUniformLocation)
#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
#define glGetUniformSubroutineuiv MANGLE(GetUniformSubroutineuiv)
#define glGetUniformui64vNV MANGLE(GetUniformui64vNV)
#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
#define glGetUniformuiv MANGLE(GetUniformuiv)
@@ -803,6 +892,10 @@
#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
#define glGetVertexAttribLdvEXT MANGLE(GetVertexAttribLdvEXT)
#define glGetVertexAttribLdv MANGLE(GetVertexAttribLdv)
#define glGetVertexAttribLi64vNV MANGLE(GetVertexAttribLi64vNV)
#define glGetVertexAttribLui64vNV MANGLE(GetVertexAttribLui64vNV)
#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
@@ -864,20 +957,25 @@
#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
#define glIsFramebuffer MANGLE(IsFramebuffer)
#define glIsList MANGLE(IsList)
#define glIsNameAMD MANGLE(IsNameAMD)
#define glIsNamedBufferResidentNV MANGLE(IsNamedBufferResidentNV)
#define glIsNamedStringARB MANGLE(IsNamedStringARB)
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
#define glIsProgramARB MANGLE(IsProgramARB)
#define glIsProgram MANGLE(IsProgram)
#define glIsProgramNV MANGLE(IsProgramNV)
#define glIsProgramPipeline MANGLE(IsProgramPipeline)
#define glIsQueryARB MANGLE(IsQueryARB)
#define glIsQuery MANGLE(IsQuery)
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
#define glIsRenderbuffer MANGLE(IsRenderbuffer)
#define glIsSampler MANGLE(IsSampler)
#define glIsShader MANGLE(IsShader)
#define glIsSync MANGLE(IsSync)
#define glIsTextureEXT MANGLE(IsTextureEXT)
#define glIsTexture MANGLE(IsTexture)
#define glIsTransformFeedback MANGLE(IsTransformFeedback)
#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
@@ -915,6 +1013,8 @@
#define glLogicOp MANGLE(LogicOp)
#define glMakeBufferNonResidentNV MANGLE(MakeBufferNonResidentNV)
#define glMakeBufferResidentNV MANGLE(MakeBufferResidentNV)
#define glMakeNamedBufferNonResidentNV MANGLE(MakeNamedBufferNonResidentNV)
#define glMakeNamedBufferResidentNV MANGLE(MakeNamedBufferResidentNV)
#define glMap1d MANGLE(Map1d)
#define glMap1f MANGLE(Map1f)
#define glMap2d MANGLE(Map2d)
@@ -928,6 +1028,7 @@
#define glMapGrid2d MANGLE(MapGrid2d)
#define glMapGrid2f MANGLE(MapGrid2f)
#define glMapNamedBufferEXT MANGLE(MapNamedBufferEXT)
#define glMapNamedBufferRangeEXT MANGLE(MapNamedBufferRangeEXT)
#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
#define glMapParameterfvNV MANGLE(MapParameterfvNV)
#define glMapParameterivNV MANGLE(MapParameterivNV)
@@ -963,8 +1064,10 @@
#define glMatrixScalefEXT MANGLE(MatrixScalefEXT)
#define glMatrixTranslatedEXT MANGLE(MatrixTranslatedEXT)
#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
#define glMemoryBarrierEXT MANGLE(MemoryBarrierEXT)
#define glMinmaxEXT MANGLE(MinmaxEXT)
#define glMinmax MANGLE(Minmax)
#define glMinSampleShadingARB MANGLE(MinSampleShadingARB)
#define glMinSampleShading MANGLE(MinSampleShading)
#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
#define glMultiDrawArrays MANGLE(MultiDrawArrays)
@@ -1048,6 +1151,14 @@
#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
#define glMultiTexCoordP1ui MANGLE(MultiTexCoordP1ui)
#define glMultiTexCoordP1uiv MANGLE(MultiTexCoordP1uiv)
#define glMultiTexCoordP2ui MANGLE(MultiTexCoordP2ui)
#define glMultiTexCoordP2uiv MANGLE(MultiTexCoordP2uiv)
#define glMultiTexCoordP3ui MANGLE(MultiTexCoordP3ui)
#define glMultiTexCoordP3uiv MANGLE(MultiTexCoordP3uiv)
#define glMultiTexCoordP4ui MANGLE(MultiTexCoordP4ui)
#define glMultiTexCoordP4uiv MANGLE(MultiTexCoordP4uiv)
#define glMultiTexCoordPointerEXT MANGLE(MultiTexCoordPointerEXT)
#define glMultiTexEnvfEXT MANGLE(MultiTexEnvfEXT)
#define glMultiTexEnvfvEXT MANGLE(MultiTexEnvfvEXT)
@@ -1080,6 +1191,7 @@
#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
#define glNamedBufferDataEXT MANGLE(NamedBufferDataEXT)
#define glNamedBufferSubDataEXT MANGLE(NamedBufferSubDataEXT)
#define glNamedCopyBufferSubDataEXT MANGLE(NamedCopyBufferSubDataEXT)
#define glNamedFramebufferRenderbufferEXT MANGLE(NamedFramebufferRenderbufferEXT)
#define glNamedFramebufferTexture1DEXT MANGLE(NamedFramebufferTexture1DEXT)
#define glNamedFramebufferTexture2DEXT MANGLE(NamedFramebufferTexture2DEXT)
@@ -1087,8 +1199,6 @@
#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
#define glNamedMakeBufferNonResidentNV MANGLE(NamedMakeBufferNonResidentNV)
#define glNamedMakeBufferResidentNV MANGLE(NamedMakeBufferResidentNV)
#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
@@ -1104,6 +1214,7 @@
#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT)
#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT)
#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT)
#define glNamedStringARB MANGLE(NamedStringARB)
#define glNewList MANGLE(NewList)
#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
#define glNormal3b MANGLE(Normal3b)
@@ -1121,6 +1232,8 @@
#define glNormal3s MANGLE(Normal3s)
#define glNormal3sv MANGLE(Normal3sv)
#define glNormalFormatNV MANGLE(NormalFormatNV)
#define glNormalP3ui MANGLE(NormalP3ui)
#define glNormalP3uiv MANGLE(NormalP3uiv)
#define glNormalPointerEXT MANGLE(NormalPointerEXT)
#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
#define glNormalPointer MANGLE(NormalPointer)
@@ -1140,6 +1253,9 @@
#define glOrtho MANGLE(Ortho)
#define glPassTexCoordATI MANGLE(PassTexCoordATI)
#define glPassThrough MANGLE(PassThrough)
#define glPatchParameterfv MANGLE(PatchParameterfv)
#define glPatchParameteri MANGLE(PatchParameteri)
#define glPauseTransformFeedback MANGLE(PauseTransformFeedback)
#define glPauseTransformFeedbackNV MANGLE(PauseTransformFeedbackNV)
#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
#define glPixelMapfv MANGLE(PixelMapfv)
@@ -1191,6 +1307,7 @@
#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
#define glPrioritizeTextures MANGLE(PrioritizeTextures)
#define glProgramBinary MANGLE(ProgramBinary)
#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV)
#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV)
#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV)
@@ -1231,39 +1348,123 @@
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
#define glProgramSubroutineParametersuivNV MANGLE(ProgramSubroutineParametersuivNV)
#define glProgramUniform1dEXT MANGLE(ProgramUniform1dEXT)
#define glProgramUniform1d MANGLE(ProgramUniform1d)
#define glProgramUniform1dvEXT MANGLE(ProgramUniform1dvEXT)
#define glProgramUniform1dv MANGLE(ProgramUniform1dv)
#define glProgramUniform1fEXT MANGLE(ProgramUniform1fEXT)
#define glProgramUniform1f MANGLE(ProgramUniform1f)
#define glProgramUniform1fvEXT MANGLE(ProgramUniform1fvEXT)
#define glProgramUniform1fv MANGLE(ProgramUniform1fv)
#define glProgramUniform1i64NV MANGLE(ProgramUniform1i64NV)
#define glProgramUniform1i64vNV MANGLE(ProgramUniform1i64vNV)
#define glProgramUniform1iEXT MANGLE(ProgramUniform1iEXT)
#define glProgramUniform1i MANGLE(ProgramUniform1i)
#define glProgramUniform1ivEXT MANGLE(ProgramUniform1ivEXT)
#define glProgramUniform1iv MANGLE(ProgramUniform1iv)
#define glProgramUniform1ui64NV MANGLE(ProgramUniform1ui64NV)
#define glProgramUniform1ui64vNV MANGLE(ProgramUniform1ui64vNV)
#define glProgramUniform1uiEXT MANGLE(ProgramUniform1uiEXT)
#define glProgramUniform1ui MANGLE(ProgramUniform1ui)
#define glProgramUniform1uivEXT MANGLE(ProgramUniform1uivEXT)
#define glProgramUniform1uiv MANGLE(ProgramUniform1uiv)
#define glProgramUniform2dEXT MANGLE(ProgramUniform2dEXT)
#define glProgramUniform2d MANGLE(ProgramUniform2d)
#define glProgramUniform2dvEXT MANGLE(ProgramUniform2dvEXT)
#define glProgramUniform2dv MANGLE(ProgramUniform2dv)
#define glProgramUniform2fEXT MANGLE(ProgramUniform2fEXT)
#define glProgramUniform2f MANGLE(ProgramUniform2f)
#define glProgramUniform2fvEXT MANGLE(ProgramUniform2fvEXT)
#define glProgramUniform2fv MANGLE(ProgramUniform2fv)
#define glProgramUniform2i64NV MANGLE(ProgramUniform2i64NV)
#define glProgramUniform2i64vNV MANGLE(ProgramUniform2i64vNV)
#define glProgramUniform2iEXT MANGLE(ProgramUniform2iEXT)
#define glProgramUniform2i MANGLE(ProgramUniform2i)
#define glProgramUniform2ivEXT MANGLE(ProgramUniform2ivEXT)
#define glProgramUniform2iv MANGLE(ProgramUniform2iv)
#define glProgramUniform2ui64NV MANGLE(ProgramUniform2ui64NV)
#define glProgramUniform2ui64vNV MANGLE(ProgramUniform2ui64vNV)
#define glProgramUniform2uiEXT MANGLE(ProgramUniform2uiEXT)
#define glProgramUniform2ui MANGLE(ProgramUniform2ui)
#define glProgramUniform2uivEXT MANGLE(ProgramUniform2uivEXT)
#define glProgramUniform2uiv MANGLE(ProgramUniform2uiv)
#define glProgramUniform3dEXT MANGLE(ProgramUniform3dEXT)
#define glProgramUniform3d MANGLE(ProgramUniform3d)
#define glProgramUniform3dvEXT MANGLE(ProgramUniform3dvEXT)
#define glProgramUniform3dv MANGLE(ProgramUniform3dv)
#define glProgramUniform3fEXT MANGLE(ProgramUniform3fEXT)
#define glProgramUniform3f MANGLE(ProgramUniform3f)
#define glProgramUniform3fvEXT MANGLE(ProgramUniform3fvEXT)
#define glProgramUniform3fv MANGLE(ProgramUniform3fv)
#define glProgramUniform3i64NV MANGLE(ProgramUniform3i64NV)
#define glProgramUniform3i64vNV MANGLE(ProgramUniform3i64vNV)
#define glProgramUniform3iEXT MANGLE(ProgramUniform3iEXT)
#define glProgramUniform3i MANGLE(ProgramUniform3i)
#define glProgramUniform3ivEXT MANGLE(ProgramUniform3ivEXT)
#define glProgramUniform3iv MANGLE(ProgramUniform3iv)
#define glProgramUniform3ui64NV MANGLE(ProgramUniform3ui64NV)
#define glProgramUniform3ui64vNV MANGLE(ProgramUniform3ui64vNV)
#define glProgramUniform3uiEXT MANGLE(ProgramUniform3uiEXT)
#define glProgramUniform3ui MANGLE(ProgramUniform3ui)
#define glProgramUniform3uivEXT MANGLE(ProgramUniform3uivEXT)
#define glProgramUniform3uiv MANGLE(ProgramUniform3uiv)
#define glProgramUniform4dEXT MANGLE(ProgramUniform4dEXT)
#define glProgramUniform4d MANGLE(ProgramUniform4d)
#define glProgramUniform4dvEXT MANGLE(ProgramUniform4dvEXT)
#define glProgramUniform4dv MANGLE(ProgramUniform4dv)
#define glProgramUniform4fEXT MANGLE(ProgramUniform4fEXT)
#define glProgramUniform4f MANGLE(ProgramUniform4f)
#define glProgramUniform4fvEXT MANGLE(ProgramUniform4fvEXT)
#define glProgramUniform4fv MANGLE(ProgramUniform4fv)
#define glProgramUniform4i64NV MANGLE(ProgramUniform4i64NV)
#define glProgramUniform4i64vNV MANGLE(ProgramUniform4i64vNV)
#define glProgramUniform4iEXT MANGLE(ProgramUniform4iEXT)
#define glProgramUniform4i MANGLE(ProgramUniform4i)
#define glProgramUniform4ivEXT MANGLE(ProgramUniform4ivEXT)
#define glProgramUniform4iv MANGLE(ProgramUniform4iv)
#define glProgramUniform4ui64NV MANGLE(ProgramUniform4ui64NV)
#define glProgramUniform4ui64vNV MANGLE(ProgramUniform4ui64vNV)
#define glProgramUniform4uiEXT MANGLE(ProgramUniform4uiEXT)
#define glProgramUniform4ui MANGLE(ProgramUniform4ui)
#define glProgramUniform4uivEXT MANGLE(ProgramUniform4uivEXT)
#define glProgramUniform4uiv MANGLE(ProgramUniform4uiv)
#define glProgramUniformMatrix2dvEXT MANGLE(ProgramUniformMatrix2dvEXT)
#define glProgramUniformMatrix2dv MANGLE(ProgramUniformMatrix2dv)
#define glProgramUniformMatrix2fvEXT MANGLE(ProgramUniformMatrix2fvEXT)
#define glProgramUniformMatrix2fv MANGLE(ProgramUniformMatrix2fv)
#define glProgramUniformMatrix2x3dvEXT MANGLE(ProgramUniformMatrix2x3dvEXT)
#define glProgramUniformMatrix2x3dv MANGLE(ProgramUniformMatrix2x3dv)
#define glProgramUniformMatrix2x3fvEXT MANGLE(ProgramUniformMatrix2x3fvEXT)
#define glProgramUniformMatrix2x3fv MANGLE(ProgramUniformMatrix2x3fv)
#define glProgramUniformMatrix2x4dvEXT MANGLE(ProgramUniformMatrix2x4dvEXT)
#define glProgramUniformMatrix2x4dv MANGLE(ProgramUniformMatrix2x4dv)
#define glProgramUniformMatrix2x4fvEXT MANGLE(ProgramUniformMatrix2x4fvEXT)
#define glProgramUniformMatrix2x4fv MANGLE(ProgramUniformMatrix2x4fv)
#define glProgramUniformMatrix3dvEXT MANGLE(ProgramUniformMatrix3dvEXT)
#define glProgramUniformMatrix3dv MANGLE(ProgramUniformMatrix3dv)
#define glProgramUniformMatrix3fvEXT MANGLE(ProgramUniformMatrix3fvEXT)
#define glProgramUniformMatrix3fv MANGLE(ProgramUniformMatrix3fv)
#define glProgramUniformMatrix3x2dvEXT MANGLE(ProgramUniformMatrix3x2dvEXT)
#define glProgramUniformMatrix3x2dv MANGLE(ProgramUniformMatrix3x2dv)
#define glProgramUniformMatrix3x2fvEXT MANGLE(ProgramUniformMatrix3x2fvEXT)
#define glProgramUniformMatrix3x2fv MANGLE(ProgramUniformMatrix3x2fv)
#define glProgramUniformMatrix3x4dvEXT MANGLE(ProgramUniformMatrix3x4dvEXT)
#define glProgramUniformMatrix3x4dv MANGLE(ProgramUniformMatrix3x4dv)
#define glProgramUniformMatrix3x4fvEXT MANGLE(ProgramUniformMatrix3x4fvEXT)
#define glProgramUniformMatrix3x4fv MANGLE(ProgramUniformMatrix3x4fv)
#define glProgramUniformMatrix4dvEXT MANGLE(ProgramUniformMatrix4dvEXT)
#define glProgramUniformMatrix4dv MANGLE(ProgramUniformMatrix4dv)
#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT)
#define glProgramUniformMatrix4fv MANGLE(ProgramUniformMatrix4fv)
#define glProgramUniformMatrix4x2dvEXT MANGLE(ProgramUniformMatrix4x2dvEXT)
#define glProgramUniformMatrix4x2dv MANGLE(ProgramUniformMatrix4x2dv)
#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT)
#define glProgramUniformMatrix4x2fv MANGLE(ProgramUniformMatrix4x2fv)
#define glProgramUniformMatrix4x3dvEXT MANGLE(ProgramUniformMatrix4x3dvEXT)
#define glProgramUniformMatrix4x3dv MANGLE(ProgramUniformMatrix4x3dv)
#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
#define glProgramUniformMatrix4x3fv MANGLE(ProgramUniformMatrix4x3fv)
#define glProgramUniformui64NV MANGLE(ProgramUniformui64NV)
#define glProgramUniformui64vNV MANGLE(ProgramUniformui64vNV)
#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
@@ -1274,6 +1475,7 @@
#define glPushClientAttrib MANGLE(PushClientAttrib)
#define glPushMatrix MANGLE(PushMatrix)
#define glPushName MANGLE(PushName)
#define glQueryCounter MANGLE(QueryCounter)
#define glRasterPos2d MANGLE(RasterPos2d)
#define glRasterPos2dv MANGLE(RasterPos2dv)
#define glRasterPos2f MANGLE(RasterPos2f)
@@ -1300,6 +1502,7 @@
#define glRasterPos4sv MANGLE(RasterPos4sv)
#define glReadBuffer MANGLE(ReadBuffer)
#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
#define glReadnPixelsARB MANGLE(ReadnPixelsARB)
#define glReadPixels MANGLE(ReadPixels)
#define glRectd MANGLE(Rectd)
#define glRectdv MANGLE(Rectdv)
@@ -1310,6 +1513,7 @@
#define glRects MANGLE(Rects)
#define glRectsv MANGLE(Rectsv)
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
#define glReleaseShaderCompiler MANGLE(ReleaseShaderCompiler)
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
#define glRenderbufferStorage MANGLE(RenderbufferStorage)
#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
@@ -1345,6 +1549,7 @@
#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
#define glResetMinmax MANGLE(ResetMinmax)
#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
#define glResumeTransformFeedback MANGLE(ResumeTransformFeedback)
#define glResumeTransformFeedbackNV MANGLE(ResumeTransformFeedbackNV)
#define glRotated MANGLE(Rotated)
#define glRotatef MANGLE(Rotatef)
@@ -1357,8 +1562,17 @@
#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
#define glSamplePatternEXT MANGLE(SamplePatternEXT)
#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
#define glSamplerParameterf MANGLE(SamplerParameterf)
#define glSamplerParameterfv MANGLE(SamplerParameterfv)
#define glSamplerParameterIiv MANGLE(SamplerParameterIiv)
#define glSamplerParameteri MANGLE(SamplerParameteri)
#define glSamplerParameterIuiv MANGLE(SamplerParameterIuiv)
#define glSamplerParameteriv MANGLE(SamplerParameteriv)
#define glScaled MANGLE(Scaled)
#define glScalef MANGLE(Scalef)
#define glScissorArrayv MANGLE(ScissorArrayv)
#define glScissorIndexed MANGLE(ScissorIndexed)
#define glScissorIndexedv MANGLE(ScissorIndexedv)
#define glScissor MANGLE(Scissor)
#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
#define glSecondaryColor3b MANGLE(SecondaryColor3b)
@@ -1395,6 +1609,8 @@
#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
#define glSecondaryColorFormatNV MANGLE(SecondaryColorFormatNV)
#define glSecondaryColorP3ui MANGLE(SecondaryColorP3ui)
#define glSecondaryColorP3uiv MANGLE(SecondaryColorP3uiv)
#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
@@ -1408,6 +1624,7 @@
#define glSetInvariantEXT MANGLE(SetInvariantEXT)
#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT)
#define glShadeModel MANGLE(ShadeModel)
#define glShaderBinary MANGLE(ShaderBinary)
#define glShaderOp1EXT MANGLE(ShaderOp1EXT)
#define glShaderOp2EXT MANGLE(ShaderOp2EXT)
#define glShaderOp3EXT MANGLE(ShaderOp3EXT)
@@ -1509,6 +1726,14 @@
#define glTexCoord4s MANGLE(TexCoord4s)
#define glTexCoord4sv MANGLE(TexCoord4sv)
#define glTexCoordFormatNV MANGLE(TexCoordFormatNV)
#define glTexCoordP1ui MANGLE(TexCoordP1ui)
#define glTexCoordP1uiv MANGLE(TexCoordP1uiv)
#define glTexCoordP2ui MANGLE(TexCoordP2ui)
#define glTexCoordP2uiv MANGLE(TexCoordP2uiv)
#define glTexCoordP3ui MANGLE(TexCoordP3ui)
#define glTexCoordP3uiv MANGLE(TexCoordP3uiv)
#define glTexCoordP4ui MANGLE(TexCoordP4ui)
#define glTexCoordP4uiv MANGLE(TexCoordP4uiv)
#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
#define glTexCoordPointer MANGLE(TexCoordPointer)
@@ -1569,73 +1794,108 @@
#define glTextureSubImage3DEXT MANGLE(TextureSubImage3DEXT)
#define glTrackMatrixNV MANGLE(TrackMatrixNV)
#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
#define glTransformFeedbackStreamAttribsNV MANGLE(TransformFeedbackStreamAttribsNV)
#define glTransformFeedbackVaryingsEXT MANGLE(TransformFeedbackVaryingsEXT)
#define glTransformFeedbackVaryings MANGLE(TransformFeedbackVaryings)
#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
#define glTranslated MANGLE(Translated)
#define glTranslatef MANGLE(Translatef)
#define glUniform1d MANGLE(Uniform1d)
#define glUniform1dv MANGLE(Uniform1dv)
#define glUniform1fARB MANGLE(Uniform1fARB)
#define glUniform1f MANGLE(Uniform1f)
#define glUniform1fvARB MANGLE(Uniform1fvARB)
#define glUniform1fv MANGLE(Uniform1fv)
#define glUniform1i64NV MANGLE(Uniform1i64NV)
#define glUniform1i64vNV MANGLE(Uniform1i64vNV)
#define glUniform1iARB MANGLE(Uniform1iARB)
#define glUniform1i MANGLE(Uniform1i)
#define glUniform1ivARB MANGLE(Uniform1ivARB)
#define glUniform1iv MANGLE(Uniform1iv)
#define glUniform1ui64NV MANGLE(Uniform1ui64NV)
#define glUniform1ui64vNV MANGLE(Uniform1ui64vNV)
#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
#define glUniform1ui MANGLE(Uniform1ui)
#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
#define glUniform1uiv MANGLE(Uniform1uiv)
#define glUniform2d MANGLE(Uniform2d)
#define glUniform2dv MANGLE(Uniform2dv)
#define glUniform2fARB MANGLE(Uniform2fARB)
#define glUniform2f MANGLE(Uniform2f)
#define glUniform2fvARB MANGLE(Uniform2fvARB)
#define glUniform2fv MANGLE(Uniform2fv)
#define glUniform2i64NV MANGLE(Uniform2i64NV)
#define glUniform2i64vNV MANGLE(Uniform2i64vNV)
#define glUniform2iARB MANGLE(Uniform2iARB)
#define glUniform2i MANGLE(Uniform2i)
#define glUniform2ivARB MANGLE(Uniform2ivARB)
#define glUniform2iv MANGLE(Uniform2iv)
#define glUniform2ui64NV MANGLE(Uniform2ui64NV)
#define glUniform2ui64vNV MANGLE(Uniform2ui64vNV)
#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
#define glUniform2ui MANGLE(Uniform2ui)
#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
#define glUniform2uiv MANGLE(Uniform2uiv)
#define glUniform3d MANGLE(Uniform3d)
#define glUniform3dv MANGLE(Uniform3dv)
#define glUniform3fARB MANGLE(Uniform3fARB)
#define glUniform3f MANGLE(Uniform3f)
#define glUniform3fvARB MANGLE(Uniform3fvARB)
#define glUniform3fv MANGLE(Uniform3fv)
#define glUniform3i64NV MANGLE(Uniform3i64NV)
#define glUniform3i64vNV MANGLE(Uniform3i64vNV)
#define glUniform3iARB MANGLE(Uniform3iARB)
#define glUniform3i MANGLE(Uniform3i)
#define glUniform3ivARB MANGLE(Uniform3ivARB)
#define glUniform3iv MANGLE(Uniform3iv)
#define glUniform3ui64NV MANGLE(Uniform3ui64NV)
#define glUniform3ui64vNV MANGLE(Uniform3ui64vNV)
#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
#define glUniform3ui MANGLE(Uniform3ui)
#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
#define glUniform3uiv MANGLE(Uniform3uiv)
#define glUniform4d MANGLE(Uniform4d)
#define glUniform4dv MANGLE(Uniform4dv)
#define glUniform4fARB MANGLE(Uniform4fARB)
#define glUniform4f MANGLE(Uniform4f)
#define glUniform4fvARB MANGLE(Uniform4fvARB)
#define glUniform4fv MANGLE(Uniform4fv)
#define glUniform4i64NV MANGLE(Uniform4i64NV)
#define glUniform4i64vNV MANGLE(Uniform4i64vNV)
#define glUniform4iARB MANGLE(Uniform4iARB)
#define glUniform4i MANGLE(Uniform4i)
#define glUniform4ivARB MANGLE(Uniform4ivARB)
#define glUniform4iv MANGLE(Uniform4iv)
#define glUniform4ui64NV MANGLE(Uniform4ui64NV)
#define glUniform4ui64vNV MANGLE(Uniform4ui64vNV)
#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
#define glUniform4ui MANGLE(Uniform4ui)
#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
#define glUniform4uiv MANGLE(Uniform4uiv)
#define glUniformBlockBinding MANGLE(UniformBlockBinding)
#define glUniformBufferEXT MANGLE(UniformBufferEXT)
#define glUniformMatrix2dv MANGLE(UniformMatrix2dv)
#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
#define glUniformMatrix2x3dv MANGLE(UniformMatrix2x3dv)
#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
#define glUniformMatrix2x4dv MANGLE(UniformMatrix2x4dv)
#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
#define glUniformMatrix3dv MANGLE(UniformMatrix3dv)
#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
#define glUniformMatrix3x2dv MANGLE(UniformMatrix3x2dv)
#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
#define glUniformMatrix3x4dv MANGLE(UniformMatrix3x4dv)
#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
#define glUniformMatrix4dv MANGLE(UniformMatrix4dv)
#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
#define glUniformMatrix4x2dv MANGLE(UniformMatrix4x2dv)
#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
#define glUniformMatrix4x3dv MANGLE(UniformMatrix4x3dv)
#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
#define glUniformSubroutinesuiv MANGLE(UniformSubroutinesuiv)
#define glUniformui64NV MANGLE(Uniformui64NV)
#define glUniformui64vNV MANGLE(Uniformui64vNV)
#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
@@ -1646,9 +1906,11 @@
#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
#define glUseProgram MANGLE(UseProgram)
#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
#define glUseProgramStages MANGLE(UseProgramStages)
#define glUseShaderProgramEXT MANGLE(UseShaderProgramEXT)
#define glValidateProgramARB MANGLE(ValidateProgramARB)
#define glValidateProgram MANGLE(ValidateProgram)
#define glValidateProgramPipeline MANGLE(ValidateProgramPipeline)
#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
#define glVariantbvEXT MANGLE(VariantbvEXT)
#define glVariantdvEXT MANGLE(VariantdvEXT)
@@ -1659,6 +1921,16 @@
#define glVariantubvEXT MANGLE(VariantubvEXT)
#define glVariantuivEXT MANGLE(VariantuivEXT)
#define glVariantusvEXT MANGLE(VariantusvEXT)
#define glVDPAUFiniNV MANGLE(VDPAUFiniNV)
#define glVDPAUGetSurfaceivNV MANGLE(VDPAUGetSurfaceivNV)
#define glVDPAUInitNV MANGLE(VDPAUInitNV)
#define glVDPAUIsSurfaceNV MANGLE(VDPAUIsSurfaceNV)
#define glVDPAUMapSurfacesNV MANGLE(VDPAUMapSurfacesNV)
#define glVDPAURegisterOutputSurfaceNV MANGLE(VDPAURegisterOutputSurfaceNV)
#define glVDPAURegisterVideoSurfaceNV MANGLE(VDPAURegisterVideoSurfaceNV)
#define glVDPAUSurfaceAccessNV MANGLE(VDPAUSurfaceAccessNV)
#define glVDPAUUnmapSurfacesNV MANGLE(VDPAUUnmapSurfacesNV)
#define glVDPAUUnregisterSurfaceNV MANGLE(VDPAUUnregisterSurfaceNV)
#define glVertex2d MANGLE(Vertex2d)
#define glVertex2dv MANGLE(Vertex2dv)
#define glVertex2f MANGLE(Vertex2f)
@@ -1692,6 +1964,7 @@
#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE)
#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE)
#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
#define glVertexArrayVertexAttribLOffsetEXT MANGLE(VertexArrayVertexAttribLOffsetEXT)
#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
#define glVertexAttrib1d MANGLE(VertexAttrib1d)
#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
@@ -1800,6 +2073,7 @@
#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
#define glVertexAttribDivisorARB MANGLE(VertexAttribDivisorARB)
#define glVertexAttribDivisor MANGLE(VertexAttribDivisor)
#define glVertexAttribFormatNV MANGLE(VertexAttribFormatNV)
#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
#define glVertexAttribI1i MANGLE(VertexAttribI1i)
@@ -1844,6 +2118,49 @@
#define glVertexAttribIFormatNV MANGLE(VertexAttribIFormatNV)
#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
#define glVertexAttribIPointer MANGLE(VertexAttribIPointer)
#define glVertexAttribL1dEXT MANGLE(VertexAttribL1dEXT)
#define glVertexAttribL1d MANGLE(VertexAttribL1d)
#define glVertexAttribL1dvEXT MANGLE(VertexAttribL1dvEXT)
#define glVertexAttribL1dv MANGLE(VertexAttribL1dv)
#define glVertexAttribL1i64NV MANGLE(VertexAttribL1i64NV)
#define glVertexAttribL1i64vNV MANGLE(VertexAttribL1i64vNV)
#define glVertexAttribL1ui64NV MANGLE(VertexAttribL1ui64NV)
#define glVertexAttribL1ui64vNV MANGLE(VertexAttribL1ui64vNV)
#define glVertexAttribL2dEXT MANGLE(VertexAttribL2dEXT)
#define glVertexAttribL2d MANGLE(VertexAttribL2d)
#define glVertexAttribL2dvEXT MANGLE(VertexAttribL2dvEXT)
#define glVertexAttribL2dv MANGLE(VertexAttribL2dv)
#define glVertexAttribL2i64NV MANGLE(VertexAttribL2i64NV)
#define glVertexAttribL2i64vNV MANGLE(VertexAttribL2i64vNV)
#define glVertexAttribL2ui64NV MANGLE(VertexAttribL2ui64NV)
#define glVertexAttribL2ui64vNV MANGLE(VertexAttribL2ui64vNV)
#define glVertexAttribL3dEXT MANGLE(VertexAttribL3dEXT)
#define glVertexAttribL3d MANGLE(VertexAttribL3d)
#define glVertexAttribL3dvEXT MANGLE(VertexAttribL3dvEXT)
#define glVertexAttribL3dv MANGLE(VertexAttribL3dv)
#define glVertexAttribL3i64NV MANGLE(VertexAttribL3i64NV)
#define glVertexAttribL3i64vNV MANGLE(VertexAttribL3i64vNV)
#define glVertexAttribL3ui64NV MANGLE(VertexAttribL3ui64NV)
#define glVertexAttribL3ui64vNV MANGLE(VertexAttribL3ui64vNV)
#define glVertexAttribL4dEXT MANGLE(VertexAttribL4dEXT)
#define glVertexAttribL4d MANGLE(VertexAttribL4d)
#define glVertexAttribL4dvEXT MANGLE(VertexAttribL4dvEXT)
#define glVertexAttribL4dv MANGLE(VertexAttribL4dv)
#define glVertexAttribL4i64NV MANGLE(VertexAttribL4i64NV)
#define glVertexAttribL4i64vNV MANGLE(VertexAttribL4i64vNV)
#define glVertexAttribL4ui64NV MANGLE(VertexAttribL4ui64NV)
#define glVertexAttribL4ui64vNV MANGLE(VertexAttribL4ui64vNV)
#define glVertexAttribLFormatNV MANGLE(VertexAttribLFormatNV)
#define glVertexAttribLPointerEXT MANGLE(VertexAttribLPointerEXT)
#define glVertexAttribLPointer MANGLE(VertexAttribLPointer)
#define glVertexAttribP1ui MANGLE(VertexAttribP1ui)
#define glVertexAttribP1uiv MANGLE(VertexAttribP1uiv)
#define glVertexAttribP2ui MANGLE(VertexAttribP2ui)
#define glVertexAttribP2uiv MANGLE(VertexAttribP2uiv)
#define glVertexAttribP3ui MANGLE(VertexAttribP3ui)
#define glVertexAttribP3uiv MANGLE(VertexAttribP3uiv)
#define glVertexAttribP4ui MANGLE(VertexAttribP4ui)
#define glVertexAttribP4uiv MANGLE(VertexAttribP4uiv)
#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
#define glVertexAttribPointer MANGLE(VertexAttribPointer)
#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
@@ -1868,6 +2185,12 @@
#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
#define glVertexFormatNV MANGLE(VertexFormatNV)
#define glVertexP2ui MANGLE(VertexP2ui)
#define glVertexP2uiv MANGLE(VertexP2uiv)
#define glVertexP3ui MANGLE(VertexP3ui)
#define glVertexP3uiv MANGLE(VertexP3uiv)
#define glVertexP4ui MANGLE(VertexP4ui)
#define glVertexP4uiv MANGLE(VertexP4uiv)
#define glVertexPointerEXT MANGLE(VertexPointerEXT)
#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
#define glVertexPointer MANGLE(VertexPointer)
@@ -1913,6 +2236,9 @@
#define glVideoCaptureStreamParameterdvNV MANGLE(VideoCaptureStreamParameterdvNV)
#define glVideoCaptureStreamParameterfvNV MANGLE(VideoCaptureStreamParameterfvNV)
#define glVideoCaptureStreamParameterivNV MANGLE(VideoCaptureStreamParameterivNV)
#define glViewportArrayv MANGLE(ViewportArrayv)
#define glViewportIndexedf MANGLE(ViewportIndexedf)
#define glViewportIndexedfv MANGLE(ViewportIndexedfv)
#define glViewport MANGLE(Viewport)
#define glWaitSync MANGLE(WaitSync)
#define glWeightbvARB MANGLE(WeightbvARB)

View File

@@ -29,9 +29,9 @@ extern "C" {
*/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2010-11-03 18:59:30 -0700 (Wed, 03 Nov 2010) $ */
/* glext.h last updated $Date: 2010-12-09 02:15:08 -0800 (Thu, 09 Dec 2010) $ */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 66
#define GL_GLEXT_VERSION 67
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -5026,6 +5026,12 @@ extern "C" {
#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
#endif
#ifndef GL_EXT_texture_sRGB_decode
#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
#define GL_DECODE_EXT 0x8A49
#define GL_SKIP_DECODE_EXT 0x8A4A
#endif
/*************************************************************/
@@ -11031,6 +11037,10 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
#define GL_AMD_depth_clamp_separate 1
#endif
#ifndef GL_EXT_texture_sRGB_decode
#define GL_EXT_texture_sRGB_decode 1
#endif
#ifdef __cplusplus
}

View File

@@ -251,6 +251,15 @@ struct __DRItexBufferExtensionRec {
GLint target,
GLint format,
__DRIdrawable *pDraw);
/**
* Method to release texture buffer in case some special platform
* need this.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
__DRIdrawable *pDraw);
};
/**
@@ -490,6 +499,7 @@ struct __DRIuseInvalidateExtensionRec {
#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
#define __DRI_ATTRIB_YINVERTED 47
#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
/* __DRI_ATTRIB_RENDER_TYPE */
#define __DRI_ATTRIB_RGBA_BIT 0x01
@@ -647,7 +657,7 @@ struct __DRIlegacyExtensionRec {
* conjunction with the core extension.
*/
#define __DRI_SWRAST "DRI_SWRast"
#define __DRI_SWRAST_VERSION 1
#define __DRI_SWRAST_VERSION 2
struct __DRIswrastExtensionRec {
__DRIextension base;
@@ -660,6 +670,13 @@ struct __DRIswrastExtensionRec {
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
/* Since version 2 */
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
};
/**
@@ -769,6 +786,14 @@ struct __DRIdri2ExtensionRec {
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
__DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
unsigned int attachment,
unsigned int format,
int width,
int height);
void (*releaseBuffer)(__DRIscreen *screen,
__DRIbuffer *buffer);
};

View File

@@ -194,5 +194,8 @@ def generate(env):
env.AppendUnique(SHLINKFLAGS = ['-Wl,--enable-stdcall-fixup'])
#env.AppendUnique(SHLINKFLAGS = ['-Wl,--kill-at'])
# Avoid depending on gcc runtime DLLs
env.AppendUnique(LINKFLAGS = ['-static-libgcc'])
def exists(env):
return find(env)

View File

@@ -56,6 +56,8 @@ def quietCommandLines(env):
env['SHLINKCOMSTR'] = " Linking $TARGET ..."
env['LDMODULECOMSTR'] = " Linking $TARGET ..."
env['SWIGCOMSTR'] = " Generating $TARGET ..."
env['LEXCOMSTR'] = " Generating $TARGET ..."
env['YACCCOMSTR'] = " Generating $TARGET ..."
env['CODEGENCOMSTR'] = " Generating $TARGET ..."

52
scons/gallium.py Normal file → Executable file
View File

@@ -35,6 +35,7 @@ import os
import os.path
import re
import subprocess
import platform as _platform
import SCons.Action
import SCons.Builder
@@ -141,6 +142,10 @@ def pkg_config_modules(env, name, modules):
def generate(env):
"""Common environment generation code"""
# Tell tools which machine to compile for
env['TARGET_ARCH'] = env['machine']
env['MSVS_ARCH'] = env['machine']
# Toolchain
platform = env['platform']
if env['toolchain'] == 'default':
@@ -175,6 +180,10 @@ def generate(env):
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
env['msvc'] = env['CC'] == 'cl'
if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
# MSVC x64 support is broken in earlier versions of scons
env.EnsurePythonVersion(2, 0)
# shortcuts
machine = env['machine']
platform = env['platform']
@@ -183,6 +192,27 @@ def generate(env):
gcc = env['gcc']
msvc = env['msvc']
# Determine whether we are cross compiling; in particular, whether we need
# to compile code generators with a different compiler as the target code.
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()))
host_machine = {
'x86': 'x86',
'i386': 'x86',
'i486': 'x86',
'i586': 'x86',
'i686': 'x86',
'ppc' : 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
}.get(host_machine, 'generic')
env['crosscompile'] = platform != host_platform
if machine == 'x86_64' and host_machine != 'x86_64':
env['crosscompile'] = True
env['hostonly'] = False
# Backwards compatability with the debug= profile= options
if env['build'] == 'debug':
if not env['debug']:
@@ -349,12 +379,15 @@ def generate(env):
'-m32',
#'-march=pentium4',
]
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
and (platform != 'windows' or env['build'] == 'debug' or True):
# NOTE: We need to ensure stack is realigned given that we
# produce shared objects, and have no control over the stack
# alignment policy of the application. Therefore we need
# -mstackrealign ore -mincoming-stack-boundary=2.
#
# XXX: -O and -mstackrealign causes stack corruption on MinGW
#
# XXX: We could have SSE without -mstackrealign if we always used
# __attribute__((force_align_arg_pointer)), but that's not
# always the case.
@@ -402,13 +435,19 @@ def generate(env):
'/Od', # disable optimizations
'/Oi', # enable intrinsic functions
'/Oy-', # disable frame pointer omission
'/GL-', # disable whole program optimization
]
else:
ccflags += [
'/O2', # optimize for speed
]
if env['build'] == 'release':
ccflags += [
'/GL', # enable whole program optimization
]
else:
ccflags += [
'/GL-', # disable whole program optimization
]
ccflags += [
'/fp:fast', # fast floating point
'/W3', # warning level
@@ -498,7 +537,7 @@ def generate(env):
else:
env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
if msvc:
if env['build'] != 'debug':
if env['build'] == 'release':
# enable Link-time Code Generation
linkflags += ['/LTCG']
env.Append(ARFLAGS = ['/LTCG'])
@@ -551,13 +590,18 @@ def generate(env):
env.Append(LINKFLAGS = linkflags)
env.Append(SHLINKFLAGS = shlinkflags)
# We have C++ in several libraries, so always link with the C++ compiler
if env['gcc']:
env['LINK'] = env['CXX']
# Default libs
env.Append(LIBS = [])
# Load tools
env.Tool('lex')
env.Tool('yacc')
if env['llvm']:
env.Tool('llvm')
env.Tool('udis86')
pkg_config_modules(env, 'x11', ['x11', 'xext'])
pkg_config_modules(env, 'drm', ['libdrm'])

View File

@@ -142,13 +142,11 @@ def generate(env):
try:
env.ParseConfig('llvm-config --cppflags')
env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')
env.ParseConfig('llvm-config --libs')
env.ParseConfig('llvm-config --ldflags')
except OSError:
print 'scons: llvm-config version %s failed' % llvm_version
return
else:
env['LINK'] = env['CXX']
assert llvm_version is not None
env['llvm'] = True

View File

@@ -1,44 +0,0 @@
"""udis86
Tool-specific initialization for udis86
"""
#
# Copyright (c) 2009 VMware, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
def generate(env):
conf = env.Configure()
if conf.CheckHeader('udis86.h'): # and conf.CheckLib('udis86'):
env['UDIS86'] = True
env.Prepend(LIBS = ['udis86'])
else:
env['UDIS86'] = False
conf.Finish()
def exists(env):
return True
# vim:set ts=4 sw=4 et:

View File

@@ -1,72 +1,101 @@
# Either one of, or both of, MESA_BUILD_CLASSIC and MESA_BUILD_GALLIUM must be
# set. When MESA_BUILD_GALLIUM is not set, EGL consists of
#
# libmesa_classic_egl
# libmesa_egl
#
# and the rules for it can be found in egl/drivers/android/Android.mk.
#
# When MESA_BUILD_GALLIUM is set, EGL consists of
#
# libmesa_st_egl
# libmesa_egl
# libmesa_st_mesa
# libmesa_pipe_<DRIVER>
# libmesa_winsys_<DRIVER>
# libmesa_gallium
# <plus libmesa_classic_egl if MESA_BUILD_CLASSIC is also set>
#
# and the rules for it can be found in gallium/targets/Android.mk
#
# When MESA_BUILD_CLASSIC is set, DRI drivers are created. A DRI driver
# consists of
#
# libmesa_classic_mesa
# libmesa_glsl
# <driver-specific objects>
#
# and the rules for it can be found in mesa/drivers/Android.mk.
#
# As for gralloc, the goal is to provide a single module that is able to
# detect and support the hardware. This is not the case yet though.
LOCAL_PATH := $(call my-dir)
# build classic static libraries
# DRI drivers
MESA_BUILD_CLASSIC := false
# build gallium static libraries
MESA_BUILD_GALLIUM := false
# build gralloc.i915
MESA_BUILD_I915 := false
# build libGLES_i915c
MESA_BUILD_I915C := false
MESA_BUILD_I965C := false
# build libGLES_swrast
# Gallium drivers
MESA_BUILD_GALLIUM := false
MESA_BUILD_I915G := false
MESA_BUILD_R600G := false
MESA_BUILD_SWRAST := false
# build gralloc.vmwgfx
# gralloc modules
MESA_BUILD_INTEL := false
MESA_BUILD_RADEON := false
MESA_BUILD_VMWGFX := false
# build libGLES_i915g
MESA_BUILD_I915G := false
# for testing purpose
#BOARD_USES_I915C := true
#BOARD_USES_I915G := true
#BOARD_USES_I965C := true
#BOARD_USES_VMWGFX := true
MESA_GRALLOC_NAME :=
MESA_GLES_NAME :=
MESA_DO_BUILD := false
ifeq ($(strip $(BOARD_USES_I915C)),true)
MESA_BUILD_CLASSIC := true
MESA_BUILD_I915 := true
MESA_BUILD_I915C := true
# gralloc
MESA_BUILD_INTEL := true
MESA_GRALLOC_NAME := i915
MESA_GLES_NAME := i915c
MESA_DO_BUILD := true
endif
ifeq ($(strip $(BOARD_USES_I915G)),true)
MESA_BUILD_GALLIUM := true
MESA_BUILD_I915 := true
MESA_BUILD_I915G := true
# gralloc
MESA_BUILD_INTEL := true
MESA_GRALLOC_NAME := i915
MESA_GLES_NAME := i915g
MESA_DO_BUILD := true
endif
ifeq ($(strip $(BOARD_USES_I965C)),true)
MESA_BUILD_CLASSIC := true
MESA_BUILD_I915 := true
MESA_BUILD_I965C := true
# gralloc
MESA_BUILD_INTEL := true
MESA_GRALLOC_NAME := i915
MESA_GLES_NAME := i965c
MESA_DO_BUILD := true
endif
ifeq ($(strip $(BOARD_USES_R600G)),true)
MESA_BUILD_GALLIUM := true
MESA_BUILD_R600G := true
# gralloc
MESA_BUILD_RADEON := true
MESA_DO_BUILD := true
endif
ifeq ($(strip $(BOARD_USES_VMWGFX)),true)
MESA_BUILD_GALLIUM := true
MESA_BUILD_SWRAST := true
# gralloc
MESA_BUILD_VMWGFX := true
MESA_GRALLOC_NAME := vmwgfx
MESA_GLES_NAME := swrast
MESA_DO_BUILD := true
endif
ifneq ($(strip $(MESA_GRALLOC_NAME) $(MESA_GLES_NAME)),)
ifeq ($(strip $(MESA_DO_BUILD)),true)
# build the real modules
include $(call all-subdir-makefiles)
@@ -74,7 +103,7 @@ include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
symlink := $(TARGET_OUT_SHARED_LIBRARIES)/hw/gralloc.$(TARGET_PRODUCT)$(TARGET_SHLIB_SUFFIX)
symlink_to := gralloc.$(MESA_GRALLOC_NAME)$(TARGET_SHLIB_SUFFIX)
symlink_to := gralloc.mesa$(TARGET_SHLIB_SUFFIX)
$(symlink): PRIVATE_TO := $(symlink_to)
$(symlink): $(TARGET_OUT_SHARED_LIBRARIES)/hw/$(symlink_to)
@echo "Symlink: $@ -> $(PRIVATE_TO)"
@@ -83,14 +112,4 @@ $(symlink): $(TARGET_OUT_SHARED_LIBRARIES)/hw/$(symlink_to)
$(hide) ln -sf $(PRIVATE_TO) $@
ALL_PREBUILT += $(symlink)
symlink := $(TARGET_OUT_SHARED_LIBRARIES)/egl/libGLES_mesa$(TARGET_SHLIB_SUFFIX)
symlink_to := libGLES_$(MESA_GLES_NAME)$(TARGET_SHLIB_SUFFIX)
$(symlink): PRIVATE_TO := $(symlink_to)
$(symlink): $(TARGET_OUT_SHARED_LIBRARIES)/egl/$(symlink_to)
@echo "Symlink: $@ -> $(PRIVATE_TO)"
@mkdir -p $(dir $@)
@rm -rf $@
$(hide) ln -sf $(PRIVATE_TO) $@
ALL_PREBUILT += $(symlink)
endif # MESA_GRALLOC_NAME || MESA_GLES_NAME
endif # MESA_DO_BUILD

View File

@@ -1,17 +1,32 @@
Import('*')
SConscript('mapi/vgapi/SConscript')
if env['platform'] == 'windows':
SConscript('egl/main/SConscript')
SConscript('talloc/SConscript')
SConscript('getopt/SConscript')
SConscript('glsl/SConscript')
if env['hostonly']:
# We are just compiling the things necessary on the host for cross
# compilation
Return()
# When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
# used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
# in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to
# enable OpenGL ES support.
SConscript('mapi/glapi/SConscript')
SConscript('mesa/SConscript')
SConscript('mapi/vgapi/SConscript')
if env['platform'] != 'embedded':
SConscript('egl/main/SConscript')
SConscript('glut/glx/SConscript')
if env['gles']:
SConscript('mapi/shared-glapi/SConscript')
SConscript('gallium/SConscript')

View File

@@ -1,5 +1,9 @@
# Android.mk for EGL
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# from main/Makefile
SOURCES = \
eglapi.c \
@@ -20,8 +24,6 @@ SOURCES = \
eglsurface.c \
eglsync.c
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(addprefix main/, $(SOURCES))
@@ -29,9 +31,17 @@ LOCAL_CFLAGS := \
-DPTHREADS \
-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_ANDROID \
-D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \
-D_EGL_OS_UNIX=1 \
-fvisibility=hidden \
-Wno-sign-compare
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_ANDROID
endif
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GALLIUM
endif
LOCAL_C_INCLUDES := \
external/mesa/include
@@ -48,8 +58,9 @@ LOCAL_SRC_FILES := \
drivers/android/droid_core.c \
drivers/android/droid_image.c
LOCAL_CFLAGS := \
-D_EGL_MAIN=_eglBuiltInDriverANDROID \
-DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" \
-DPTHREADS \
-fvisibility=hidden \
-Wno-sign-compare
@@ -60,9 +71,41 @@ LOCAL_C_INCLUDES := \
external/mesa/src/egl/main \
external/mesa/src/gralloc \
external/drm \
external/drm/include/drm
external/drm/include/drm \
external/mesa/src/mesa/drivers \
external/mesa/src/gallium/include \
external/mesa/src/gallium/winsys
LOCAL_MODULE := libmesa_classic_egl
include $(BUILD_STATIC_LIBRARY)
# build libGLES if gallium is not enabled
ifneq ($(strip $(MESA_BUILD_GALLIUM)),true)
include $(CLEAR_VARS)
LOCAL_SRC_FILES :=
LOCAL_CFLAGS :=
LOCAL_C_INCLUDES :=
LOCAL_STATIC_LIBRARIES :=
LOCAL_WHOLE_STATIC_LIBRARIES := \
libmesa_classic_egl \
libmesa_egl
LOCAL_SHARED_LIBRARIES := \
libglapi \
libdrm \
libdl \
libhardware \
liblog \
libcutils
LOCAL_MODULE := libGLES_mesa
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
include $(BUILD_SHARED_LIBRARY)
endif # MESA_BUILD_GALLIUM
endif # MESA_BUILD_CLASSIC

View File

@@ -3,8 +3,13 @@
TOP = ../..
include $(TOP)/configs/current
SUBDIRS = main drivers
SUBDIRS =
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
SUBDIRS += wayland
endif
SUBDIRS += drivers main
default: subdirs

View File

@@ -2,6 +2,7 @@
#
# Drivers should define
#
# EGL_BUILTIN, the driver is built-in or external
# EGL_DRIVER, the driver name
# EGL_SOURCES, the driver sources
# EGL_INCLUDES, the include pathes
@@ -12,32 +13,45 @@
#
EGL_DRIVER_PATH = $(TOP)/$(LIB_DIR)/egl/$(EGL_DRIVER)
EGL_DRIVER_PATH = $(TOP)/$(LIB_DIR)/egl/$(EGL_DRIVER).so
EGL_OBJECTS = $(EGL_SOURCES:.c=.o)
# built-in or external
ifeq ($(EGL_BUILTIN),true)
EGL_TARGET = lib$(EGL_DRIVER).a
EGL_INSTALL =
else
EGL_TARGET = $(EGL_DRIVER_PATH)
EGL_INSTALL = install-so
endif
default: depend $(EGL_DRIVER_PATH)
default: depend $(EGL_TARGET)
$(EGL_DRIVER_PATH): $(EGL_DRIVER)
$(EGL_DRIVER_PATH): $(EGL_DRIVER).so
@$(INSTALL) -d $(TOP)/$(LIB_DIR)/egl
$(INSTALL) $< $(TOP)/$(LIB_DIR)/egl
$(EGL_DRIVER): $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER) -noprefix \
$(EGL_DRIVER).so: $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER).so -noprefix \
-linker '$(CC)' -ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
$(MKLIB_OPTIONS) \
$(EGL_OBJECTS) $(EGL_LIBS) -l$(EGL_LIB)
lib$(EGL_DRIVER).a: $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER) -static $(EGL_OBJECTS)
.c.o:
$(CC) -c $(EGL_INCLUDES) $(CFLAGS) $(EGL_CFLAGS) $< -o $@
install: $(EGL_DRIVER_PATH)
install-so: $(EGL_DRIVER_PATH)
$(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
$(MINSTALL) $(EGL_DRIVER_PATH) $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
install: $(EGL_INSTALL)
clean:
rm -f $(EGL_DRIVER)
rm -f $(EGL_DRIVER).so
rm -f lib$(EGL_DRIVER).a
rm -f $(EGL_OBJECTS)
rm -f depend depend.bak

View File

@@ -27,9 +27,11 @@
#define LOG_TAG "MESA-EGL"
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
#include <cutils/log.h>
#include "glapi/glapi.h"
#include "droid.h"
static const __DRIuseInvalidateExtension use_invalidate = {
@@ -157,6 +159,9 @@ droid_get_buffers_with_format(__DRIdrawable * driDrawable,
return NULL;
}
dsurf->base.Width = dsurf->buffer->width;
dsurf->base.Height = dsurf->buffer->height;
if (width)
*width = dsurf->buffer->width;
if (height)
@@ -216,6 +221,7 @@ static const EGLint droid_to_egl_attribute_map[] = {
0, /* __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE */
0, /* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
EGL_Y_INVERTED_NOK, /* __DRI_ATTRIB_YINVERTED */
0, /* __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE */
};
static struct droid_egl_config *
@@ -226,7 +232,7 @@ droid_add_config(_EGLDisplay *dpy, const __DRIconfig *dri_config, int id,
struct droid_egl_display *ddpy;
_EGLConfig base;
unsigned int attrib, value, double_buffer;
EGLint key, bind_to_texture_rgb, bind_to_texture_rgba;
EGLint key;
int dri_masks[4] = { 0, 0, 0, 0 };
int i;
@@ -235,8 +241,6 @@ droid_add_config(_EGLDisplay *dpy, const __DRIconfig *dri_config, int id,
i = 0;
double_buffer = 0;
bind_to_texture_rgb = 0;
bind_to_texture_rgba = 0;
while (ddpy->core->indexConfigAttrib(dri_config, i++, &attrib, &value)) {
switch (attrib) {
@@ -260,14 +264,6 @@ droid_add_config(_EGLDisplay *dpy, const __DRIconfig *dri_config, int id,
_eglSetConfigKey(&base, EGL_CONFIG_CAVEAT, value);
break;
case __DRI_ATTRIB_BIND_TO_TEXTURE_RGB:
bind_to_texture_rgb = value;
break;
case __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA:
bind_to_texture_rgba = value;
break;
case __DRI_ATTRIB_DOUBLE_BUFFER:
double_buffer = value;
break;
@@ -315,15 +311,9 @@ droid_add_config(_EGLDisplay *dpy, const __DRIconfig *dri_config, int id,
_eglSetConfigKey(&base, EGL_NATIVE_RENDERABLE, EGL_TRUE);
_eglSetConfigKey(&base, EGL_SURFACE_TYPE, surface_type);
if (surface_type & (EGL_PIXMAP_BIT | EGL_PBUFFER_BIT)) {
_eglSetConfigKey(&base, EGL_BIND_TO_TEXTURE_RGB, bind_to_texture_rgb);
if (_eglGetConfigKey(&base, EGL_ALPHA_SIZE) > 0)
_eglSetConfigKey(&base,
EGL_BIND_TO_TEXTURE_RGBA, bind_to_texture_rgba);
}
_eglSetConfigKey(&base, EGL_RENDERABLE_TYPE, dpy->ClientAPIsMask);
_eglSetConfigKey(&base, EGL_CONFORMANT, dpy->ClientAPIsMask);
_eglSetConfigKey(&base, EGL_RENDERABLE_TYPE, dpy->ClientAPIs);
_eglSetConfigKey(&base, EGL_CONFORMANT, dpy->ClientAPIs);
if (!_eglValidateConfig(&base, EGL_FALSE)) {
_eglLog(_EGL_DEBUG, "DRI2: failed to validate config %d", id);
@@ -462,15 +452,15 @@ droid_create_screen(_EGLDisplay *dpy)
if (ddpy->dri2->base.version >= 2)
api_mask = ddpy->dri2->getAPIMask(ddpy->dri_screen);
else
api_mask = __DRI_API_OPENGL;
api_mask = 1 << __DRI_API_OPENGL;
dpy->ClientAPIsMask = 0;
dpy->ClientAPIs = 0;
if (api_mask & (1 <<__DRI_API_OPENGL))
dpy->ClientAPIsMask |= EGL_OPENGL_BIT;
dpy->ClientAPIs |= EGL_OPENGL_BIT;
if (api_mask & (1 <<__DRI_API_GLES))
dpy->ClientAPIsMask |= EGL_OPENGL_ES_BIT;
dpy->ClientAPIs |= EGL_OPENGL_ES_BIT;
if (api_mask & (1 << __DRI_API_GLES2))
dpy->ClientAPIsMask |= EGL_OPENGL_ES2_BIT;
dpy->ClientAPIs |= EGL_OPENGL_ES2_BIT;
if (ddpy->dri2->base.version >= 2) {
dpy->Extensions.KHR_surfaceless_gles1 = EGL_TRUE;
@@ -482,26 +472,110 @@ droid_create_screen(_EGLDisplay *dpy)
}
static EGLBoolean
droid_load_driver(_EGLDisplay *disp)
droid_load_driver(_EGLDisplay *dpy, const char *driver_name)
{
struct droid_egl_display *ddpy = disp->DriverData;
struct droid_egl_display *ddpy = droid_egl_display(dpy);
const __DRIextension **extensions;
char path[PATH_MAX], *base = NULL;
void *handle;
extensions = __driDriverExtensions;
if (geteuid() == getuid()) {
/* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
base = getenv("LIBGL_DRIVERS_PATH");
}
if (!base)
base = DEFAULT_DRIVER_DIR;
snprintf(path, sizeof(path), "%s/%s_dri.so", base, driver_name);
if (!droid_bind_extensions(ddpy, droid_driver_extensions, extensions))
handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
if (!handle) {
_eglLog(_EGL_WARNING, "DRI2: failed to load %s: %s", path, dlerror());
return EGL_FALSE;
}
_eglLog(_EGL_DEBUG, "DRI2: dlopen(%s)", path);
extensions = dlsym(handle, __DRI_DRIVER_EXTENSIONS);
if (!extensions) {
_eglLog(_EGL_WARNING, "DRI2: driver exports no extensions");
dlclose(handle);
return EGL_FALSE;
}
if (!droid_bind_extensions(ddpy, droid_driver_extensions, extensions)) {
dlclose(handle);
return EGL_FALSE;
}
ddpy->dri_handle = handle;
return EGL_TRUE;
}
static EGLBoolean
droid_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy,
EGLint *major, EGLint *minor)
#include <xf86drm.h>
/* for i915 */
#include <i915_drm.h>
#include "dri/intel/intel_chipset.h"
/* for radeon */
#include <radeon_drm.h>
#include "radeon/drm/radeon_drm_public.h"
static const char *
droid_get_driver_name(int fd)
{
drmVersionPtr version;
char *name = NULL;
version = drmGetVersion(fd);
if (!version) {
_eglLog(_EGL_WARNING, "invalid drm fd");
return NULL;
}
if (!version->name) {
_eglLog(_EGL_WARNING, "unable to determine the driver name");
drmFreeVersion(version);
return NULL;
}
if (strcmp(version->name, "i915") == 0) {
struct drm_i915_getparam gp;
int id, ret;
memset(&gp, 0, sizeof(gp));
gp.param = I915_PARAM_CHIPSET_ID;
gp.value = &id;
ret = drmCommandWriteRead(fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
if (ret) {
_eglLog(_EGL_WARNING, "failed to get param for i915");
}
else {
name = (IS_965(id)) ? "i965" : "i915";
}
}
else if (strcmp(version->name, "radeon") == 0) {
struct drm_radeon_info info;
int id, ret;
memset(&info, 0, sizeof(info));
info.request = RADEON_INFO_DEVICE_ID;
info.value = (long) &id;
ret = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info));
if (ret) {
_eglLog(_EGL_WARNING, "failed to get info for radeon");
}
else {
name = (is_r3xx(id)) ? "r300" : "r600";
}
}
drmFreeVersion(version);
return name;
}
static int
droid_open_device(void)
{
struct droid_egl_display *ddpy;
int fd = -1, err, i;
const hw_module_t *mod;
int fd = -1, err;
err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &mod);
if (!err) {
@@ -513,17 +587,34 @@ droid_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy,
}
if (err || fd < 0) {
_eglLog(_EGL_WARNING, "fail to get drm fd");
return EGL_FALSE;
fd = -1;
}
return fd;
}
static EGLBoolean
droid_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
{
struct droid_egl_display *ddpy;
const char *driver_name;
int fd;
fd = droid_open_device();
if (fd < 0)
return EGL_FALSE;
driver_name = droid_get_driver_name(fd);
if (!driver_name)
return EGL_FALSE;
ddpy = calloc(1, sizeof(*ddpy));
if (!ddpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
ddpy->fd = fd;
dpy->DriverData = (void *) ddpy;
ddpy->fd = fd;
if (!droid_load_driver(dpy))
if (!droid_load_driver(dpy, driver_name))
return EGL_FALSE;
ddpy->loader_extension.base.name = __DRI_DRI2_LOADER;
@@ -552,8 +643,8 @@ droid_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy,
dpy->Extensions.KHR_image_base = EGL_TRUE;
/* we're supporting EGL 1.4 */
*major = 1;
*minor = 4;
dpy->VersionMajor = 1;
dpy->VersionMinor = 4;
return EGL_TRUE;
}
@@ -567,19 +658,26 @@ droid_terminate(_EGLDriver *drv, _EGLDisplay *dpy)
_eglCleanupDisplay(dpy);
ddpy->core->destroyScreen(ddpy->dri_screen);
dlclose(ddpy->dri_handle);
free(ddpy);
dpy->DriverData = NULL;
return EGL_TRUE;
}
static EGLBoolean
droid_initialize(_EGLDriver *drv, _EGLDisplay *dpy,
EGLint *major, EGLint *minor)
droid_initialize(_EGLDriver *drv, _EGLDisplay *dpy)
{
/* not until swrast_dri is supported */
if (dpy->Options.UseFallback)
return EGL_FALSE;
switch (dpy->Platform) {
case _EGL_PLATFORM_ANDROID:
return droid_initialize_android(drv, dpy, major, minor);
if (dpy->Options.TestOnly)
return EGL_TRUE;
return droid_initialize_android(drv, dpy);
default:
return EGL_FALSE;
}
@@ -587,17 +685,10 @@ droid_initialize(_EGLDriver *drv, _EGLDisplay *dpy,
static _EGLProc
droid_get_proc_address(_EGLDriver *drv, const char *procname)
{
return (_EGLProc) _glapi_get_proc_address(procname);
}
static void
droid_unload(_EGLDriver *drv)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
free(ddrv);
return ddrv->get_proc_address(procname);
}
static void
@@ -621,6 +712,30 @@ droid_log(EGLint level, const char *msg)
}
}
static void
droid_unload(_EGLDriver *drv)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
free(ddrv);
}
#include "glapi/glapi.h" /* for _glapi_get_proc_address */
static EGLBoolean
droid_load(_EGLDriver *drv)
{
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
ddrv->get_proc_address = (_EGLProc (*)(const char *)) _glapi_get_proc_address;
ddrv->glFlush = (void (*)(void))
ddrv->get_proc_address("glFlush");
ddrv->glFinish = (void (*)(void))
ddrv->get_proc_address("glFinish");
return EGL_TRUE;
}
_EGLDriver *
droid_create_driver(void)
{
@@ -630,6 +745,9 @@ droid_create_driver(void)
if (!ddrv)
return NULL;
if (!droid_load(&ddrv->base))
return NULL;
_eglSetLogProc(droid_log);
ddrv->base.Name = "Droid";
@@ -640,10 +758,5 @@ droid_create_driver(void)
ddrv->base.API.Terminate = droid_terminate;
ddrv->base.API.GetProcAddress = droid_get_proc_address;
ddrv->glFlush =
(void (*)(void)) droid_get_proc_address(&ddrv->base, "glFlush");
ddrv->glFinish =
(void (*)(void)) droid_get_proc_address(&ddrv->base, "glFinish");
return &ddrv->base;
}

View File

@@ -50,6 +50,7 @@ struct droid_egl_driver
{
_EGLDriver base;
_EGLProc (*get_proc_address)(const char *procname);
void (*glFlush)(void);
void (*glFinish)(void);
};
@@ -58,6 +59,8 @@ struct droid_egl_display
{
int fd;
void *dri_handle;
__DRIscreen *dri_screen;
const __DRIconfig **dri_configs;
__DRIcoreExtension *core;

View File

@@ -105,6 +105,24 @@ droid_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
return NULL;
}
static EGLBoolean
droid_destroy_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
{
struct droid_egl_display *ddpy = droid_egl_display(disp);
struct droid_egl_context *dctx = droid_egl_context(ctx);
(void) drv;
if (!_eglPutContext(ctx))
return EGL_TRUE;
(*ddpy->core->destroyContext)(dctx->dri_context);
free(dctx);
return EGL_TRUE;
}
static _EGLSurface *
droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
@@ -203,7 +221,9 @@ droid_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
(*ddpy->core->destroyDrawable)(dsurf->dri_drawable);
droid_enqueue_buffer(dsurf);
if (dsurf->buffer)
droid_enqueue_buffer(dsurf);
dsurf->window->common.decRef(&dsurf->window->common);
free(surf);
@@ -247,8 +267,7 @@ droid_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
__DRIcontext *old_cctx = droid_egl_context(old_ctx)->dri_context;
ddpy->core->unbindContext(old_cctx);
}
/* no destroy? */
_eglPutContext(old_ctx);
droid_destroy_context(drv, disp, old_ctx);
}
return EGL_TRUE;
@@ -317,6 +336,7 @@ droid_init_core_functions(_EGLDriver *drv)
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
ddrv->base.API.CreateContext = droid_create_context;
ddrv->base.API.DestroyContext = droid_destroy_context;
ddrv->base.API.CreateWindowSurface = droid_create_window_surface;
ddrv->base.API.CreatePixmapSurface = droid_create_pixmap_surface;
ddrv->base.API.CreatePbufferSurface = droid_create_pbuffer_surface;

View File

@@ -28,7 +28,7 @@
#include "droid.h"
_EGLDriver *
_eglMain(const char *args)
_EGL_MAIN(const char *args)
{
_EGLDriver *drv;

View File

@@ -3,8 +3,8 @@
TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER = egl_dri2.so
EGL_SOURCES = egl_dri2.c
EGL_DRIVER = egl_dri2
EGL_SOURCES = egl_dri2.c platform_x11.c platform_drm.c
EGL_INCLUDES = \
-I$(TOP)/include \
@@ -15,6 +15,22 @@ EGL_INCLUDES = \
$(LIBUDEV_CFLAGS) \
$(LIBDRM_CFLAGS)
EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(LIBDRM_LIBS)
EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
EGL_CFLAGS = -D_EGL_MAIN=_eglBuiltInDriverDRI2
EGL_BUILTIN = true
ifeq ($(SHARED_GLAPI),1)
EGL_CFLAGS += -DHAVE_SHARED_GLAPI
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_wayland.c
EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \
-I$(TOP)/src/egl/wayland/wayland-egl \
-I$(TOP)/src/egl/wayland/wayland-drm
EGL_LIBS += $(WAYLAND_LIBS) \
$(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif
include ../Makefile.template

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,199 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#ifndef EGL_DRI2_INCLUDED
#define EGL_DRI2_INCLUDED
#include <xcb/xcb.h>
#include <xcb/dri2.h>
#include <xcb/xfixes.h>
#include <X11/Xlib-xcb.h>
#ifdef HAVE_WAYLAND_PLATFORM
#include <wayland-client.h>
#include "wayland-drm.h"
#include "wayland-egl-priv.h"
#endif
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include "eglconfig.h"
#include "eglcontext.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglcurrent.h"
#include "egllog.h"
#include "eglsurface.h"
#include "eglimage.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
struct dri2_egl_driver
{
_EGLDriver base;
void *handle;
_EGLProc (*get_proc_address)(const char *procname);
void (*glFlush)(void);
};
struct dri2_egl_display
{
xcb_connection_t *conn;
int dri2_major;
int dri2_minor;
__DRIscreen *dri_screen;
const __DRIconfig **driver_configs;
void *driver;
__DRIcoreExtension *core;
__DRIdri2Extension *dri2;
__DRIswrastExtension *swrast;
__DRI2flushExtension *flush;
__DRItexBufferExtension *tex_buffer;
__DRIimageExtension *image;
int fd;
char *device_name;
char *driver_name;
__DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[3];
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_display *wl_dpy;
struct wl_drm *wl_server_drm;
#endif
int (*authenticate) (_EGLDisplay *disp, uint32_t id);
};
struct dri2_egl_context
{
_EGLContext base;
__DRIcontext *dri_context;
};
#ifdef HAVE_WAYLAND_PLATFORM
enum wayland_buffer_type {
WL_BUFFER_FRONT,
WL_BUFFER_BACK,
WL_BUFFER_COUNT
};
#define __DRI_BUFFER_COUNT 10
#endif
enum dri2_surface_type {
DRI2_WINDOW_SURFACE,
DRI2_PIXMAP_SURFACE,
DRI2_PBUFFER_SURFACE
};
struct dri2_egl_surface
{
_EGLSurface base;
__DRIdrawable *dri_drawable;
xcb_drawable_t drawable;
__DRIbuffer buffers[5];
int buffer_count;
xcb_xfixes_region_t region;
int have_fake_front;
int swap_interval;
int depth;
int bytes_per_pixel;
xcb_gcontext_t gc;
xcb_gcontext_t swapgc;
enum dri2_surface_type type;
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_window *wl_win;
struct wl_egl_pixmap *wl_pix;
struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT];
int dx;
int dy;
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
__DRIbuffer *pending_buffer;
EGLBoolean block_swap_buffers;
#endif
};
struct dri2_egl_buffer {
__DRIbuffer *dri_buffer;
struct dri2_egl_display *dri2_dpy;
};
struct dri2_egl_config
{
_EGLConfig base;
const __DRIconfig *dri_single_config;
const __DRIconfig *dri_double_config;
};
struct dri2_egl_image
{
_EGLImage base;
__DRIimage *dri_image;
};
/* standard typecasts */
_EGL_DRIVER_STANDARD_TYPECASTS(dri2_egl)
_EGL_DRIVER_TYPECAST(dri2_egl_image, _EGLImage, obj)
extern const __DRIimageLookupExtension image_lookup_extension;
extern const __DRIuseInvalidateExtension use_invalidate;
EGLBoolean
dri2_load_driver(_EGLDisplay *disp);
EGLBoolean
dri2_create_screen(_EGLDisplay *disp);
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list);
_EGLImage *
dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list);
EGLBoolean
dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp);
EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp);
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp);
char *
dri2_get_driver_for_fd(int fd);
#endif /* EGL_DRI2_INCLUDED */

View File

@@ -0,0 +1,737 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <xf86drm.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_LIBUDEV
#include <libudev.h>
#endif
#include "egl_dri2.h"
#ifdef HAVE_LIBUDEV
struct dri2_driver_map {
int vendor_id;
const char *driver;
const int *chip_ids;
int num_chips_ids;
};
const int i915_chip_ids[] = {
0x3577, /* PCI_CHIP_I830_M */
0x2562, /* PCI_CHIP_845_G */
0x3582, /* PCI_CHIP_I855_GM */
0x2572, /* PCI_CHIP_I865_G */
0x2582, /* PCI_CHIP_I915_G */
0x258a, /* PCI_CHIP_E7221_G */
0x2592, /* PCI_CHIP_I915_GM */
0x2772, /* PCI_CHIP_I945_G */
0x27a2, /* PCI_CHIP_I945_GM */
0x27ae, /* PCI_CHIP_I945_GME */
0x29b2, /* PCI_CHIP_Q35_G */
0x29c2, /* PCI_CHIP_G33_G */
0x29d2, /* PCI_CHIP_Q33_G */
0xa001, /* PCI_CHIP_IGD_G */
0xa011, /* Pineview */
};
const int i965_chip_ids[] = {
0x0042, /* PCI_CHIP_ILD_G */
0x0046, /* PCI_CHIP_ILM_G */
0x0102, /* PCI_CHIP_SANDYBRIDGE_GT1 */
0x0106, /* PCI_CHIP_SANDYBRIDGE_M_GT1 */
0x010a, /* PCI_CHIP_SANDYBRIDGE_S */
0x0112, /* PCI_CHIP_SANDYBRIDGE_GT2 */
0x0116, /* PCI_CHIP_SANDYBRIDGE_M_GT2 */
0x0122, /* PCI_CHIP_SANDYBRIDGE_GT2_PLUS */
0x0126, /* PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS */
0x29a2, /* PCI_CHIP_I965_G */
0x2992, /* PCI_CHIP_I965_Q */
0x2982, /* PCI_CHIP_I965_G_1 */
0x2972, /* PCI_CHIP_I946_GZ */
0x2a02, /* PCI_CHIP_I965_GM */
0x2a12, /* PCI_CHIP_I965_GME */
0x2a42, /* PCI_CHIP_GM45_GM */
0x2e02, /* PCI_CHIP_IGD_E_G */
0x2e12, /* PCI_CHIP_Q45_G */
0x2e22, /* PCI_CHIP_G45_G */
0x2e32, /* PCI_CHIP_G41_G */
0x2e42, /* PCI_CHIP_B43_G */
0x2e92, /* PCI_CHIP_B43_G1 */
};
const int r100_chip_ids[] = {
0x4C57, /* PCI_CHIP_RADEON_LW */
0x4C58, /* PCI_CHIP_RADEON_LX */
0x4C59, /* PCI_CHIP_RADEON_LY */
0x4C5A, /* PCI_CHIP_RADEON_LZ */
0x5144, /* PCI_CHIP_RADEON_QD */
0x5145, /* PCI_CHIP_RADEON_QE */
0x5146, /* PCI_CHIP_RADEON_QF */
0x5147, /* PCI_CHIP_RADEON_QG */
0x5159, /* PCI_CHIP_RADEON_QY */
0x515A, /* PCI_CHIP_RADEON_QZ */
0x5157, /* PCI_CHIP_RV200_QW */
0x5158, /* PCI_CHIP_RV200_QX */
0x515E, /* PCI_CHIP_RN50_515E */
0x5969, /* PCI_CHIP_RN50_5969 */
0x4136, /* PCI_CHIP_RS100_4136 */
0x4336, /* PCI_CHIP_RS100_4336 */
0x4137, /* PCI_CHIP_RS200_4137 */
0x4337, /* PCI_CHIP_RS200_4337 */
0x4237, /* PCI_CHIP_RS250_4237 */
0x4437, /* PCI_CHIP_RS250_4437 */
};
const int r200_chip_ids[] = {
0x5148, /* PCI_CHIP_R200_QH */
0x514C, /* PCI_CHIP_R200_QL */
0x514D, /* PCI_CHIP_R200_QM */
0x4242, /* PCI_CHIP_R200_BB */
0x4966, /* PCI_CHIP_RV250_If */
0x4967, /* PCI_CHIP_RV250_Ig */
0x4C64, /* PCI_CHIP_RV250_Ld */
0x4C66, /* PCI_CHIP_RV250_Lf */
0x4C67, /* PCI_CHIP_RV250_Lg */
0x5960, /* PCI_CHIP_RV280_5960 */
0x5961, /* PCI_CHIP_RV280_5961 */
0x5962, /* PCI_CHIP_RV280_5962 */
0x5964, /* PCI_CHIP_RV280_5964 */
0x5965, /* PCI_CHIP_RV280_5965 */
0x5C61, /* PCI_CHIP_RV280_5C61 */
0x5C63, /* PCI_CHIP_RV280_5C63 */
0x5834, /* PCI_CHIP_RS300_5834 */
0x5835, /* PCI_CHIP_RS300_5835 */
0x7834, /* PCI_CHIP_RS350_7834 */
0x7835, /* PCI_CHIP_RS350_7835 */
};
const int r300_chip_ids[] = {
0x4144, /* PCI_CHIP_R300_AD */
0x4145, /* PCI_CHIP_R300_AE */
0x4146, /* PCI_CHIP_R300_AF */
0x4147, /* PCI_CHIP_R300_AG */
0x4E44, /* PCI_CHIP_R300_ND */
0x4E45, /* PCI_CHIP_R300_NE */
0x4E46, /* PCI_CHIP_R300_NF */
0x4E47, /* PCI_CHIP_R300_NG */
0x4E48, /* PCI_CHIP_R350_NH */
0x4E49, /* PCI_CHIP_R350_NI */
0x4E4B, /* PCI_CHIP_R350_NK */
0x4148, /* PCI_CHIP_R350_AH */
0x4149, /* PCI_CHIP_R350_AI */
0x414A, /* PCI_CHIP_R350_AJ */
0x414B, /* PCI_CHIP_R350_AK */
0x4E4A, /* PCI_CHIP_R360_NJ */
0x4150, /* PCI_CHIP_RV350_AP */
0x4151, /* PCI_CHIP_RV350_AQ */
0x4152, /* PCI_CHIP_RV350_AR */
0x4153, /* PCI_CHIP_RV350_AS */
0x4154, /* PCI_CHIP_RV350_AT */
0x4155, /* PCI_CHIP_RV350_AU */
0x4156, /* PCI_CHIP_RV350_AV */
0x4E50, /* PCI_CHIP_RV350_NP */
0x4E51, /* PCI_CHIP_RV350_NQ */
0x4E52, /* PCI_CHIP_RV350_NR */
0x4E53, /* PCI_CHIP_RV350_NS */
0x4E54, /* PCI_CHIP_RV350_NT */
0x4E56, /* PCI_CHIP_RV350_NV */
0x5460, /* PCI_CHIP_RV370_5460 */
0x5462, /* PCI_CHIP_RV370_5462 */
0x5464, /* PCI_CHIP_RV370_5464 */
0x5B60, /* PCI_CHIP_RV370_5B60 */
0x5B62, /* PCI_CHIP_RV370_5B62 */
0x5B63, /* PCI_CHIP_RV370_5B63 */
0x5B64, /* PCI_CHIP_RV370_5B64 */
0x5B65, /* PCI_CHIP_RV370_5B65 */
0x3150, /* PCI_CHIP_RV380_3150 */
0x3152, /* PCI_CHIP_RV380_3152 */
0x3154, /* PCI_CHIP_RV380_3154 */
0x3155, /* PCI_CHIP_RV380_3155 */
0x3E50, /* PCI_CHIP_RV380_3E50 */
0x3E54, /* PCI_CHIP_RV380_3E54 */
0x4A48, /* PCI_CHIP_R420_JH */
0x4A49, /* PCI_CHIP_R420_JI */
0x4A4A, /* PCI_CHIP_R420_JJ */
0x4A4B, /* PCI_CHIP_R420_JK */
0x4A4C, /* PCI_CHIP_R420_JL */
0x4A4D, /* PCI_CHIP_R420_JM */
0x4A4E, /* PCI_CHIP_R420_JN */
0x4A4F, /* PCI_CHIP_R420_JO */
0x4A50, /* PCI_CHIP_R420_JP */
0x4A54, /* PCI_CHIP_R420_JT */
0x5548, /* PCI_CHIP_R423_UH */
0x5549, /* PCI_CHIP_R423_UI */
0x554A, /* PCI_CHIP_R423_UJ */
0x554B, /* PCI_CHIP_R423_UK */
0x5550, /* PCI_CHIP_R423_5550 */
0x5551, /* PCI_CHIP_R423_UQ */
0x5552, /* PCI_CHIP_R423_UR */
0x5554, /* PCI_CHIP_R423_UT */
0x5D57, /* PCI_CHIP_R423_5D57 */
0x554C, /* PCI_CHIP_R430_554C */
0x554D, /* PCI_CHIP_R430_554D */
0x554E, /* PCI_CHIP_R430_554E */
0x554F, /* PCI_CHIP_R430_554F */
0x5D48, /* PCI_CHIP_R430_5D48 */
0x5D49, /* PCI_CHIP_R430_5D49 */
0x5D4A, /* PCI_CHIP_R430_5D4A */
0x5D4C, /* PCI_CHIP_R480_5D4C */
0x5D4D, /* PCI_CHIP_R480_5D4D */
0x5D4E, /* PCI_CHIP_R480_5D4E */
0x5D4F, /* PCI_CHIP_R480_5D4F */
0x5D50, /* PCI_CHIP_R480_5D50 */
0x5D52, /* PCI_CHIP_R480_5D52 */
0x4B49, /* PCI_CHIP_R481_4B49 */
0x4B4A, /* PCI_CHIP_R481_4B4A */
0x4B4B, /* PCI_CHIP_R481_4B4B */
0x4B4C, /* PCI_CHIP_R481_4B4C */
0x564A, /* PCI_CHIP_RV410_564A */
0x564B, /* PCI_CHIP_RV410_564B */
0x564F, /* PCI_CHIP_RV410_564F */
0x5652, /* PCI_CHIP_RV410_5652 */
0x5653, /* PCI_CHIP_RV410_5653 */
0x5657, /* PCI_CHIP_RV410_5657 */
0x5E48, /* PCI_CHIP_RV410_5E48 */
0x5E4A, /* PCI_CHIP_RV410_5E4A */
0x5E4B, /* PCI_CHIP_RV410_5E4B */
0x5E4C, /* PCI_CHIP_RV410_5E4C */
0x5E4D, /* PCI_CHIP_RV410_5E4D */
0x5E4F, /* PCI_CHIP_RV410_5E4F */
0x5A41, /* PCI_CHIP_RS400_5A41 */
0x5A42, /* PCI_CHIP_RS400_5A42 */
0x5A61, /* PCI_CHIP_RC410_5A61 */
0x5A62, /* PCI_CHIP_RC410_5A62 */
0x5954, /* PCI_CHIP_RS480_5954 */
0x5955, /* PCI_CHIP_RS480_5955 */
0x5974, /* PCI_CHIP_RS482_5974 */
0x5975, /* PCI_CHIP_RS482_5975 */
0x7100, /* PCI_CHIP_R520_7100 */
0x7101, /* PCI_CHIP_R520_7101 */
0x7102, /* PCI_CHIP_R520_7102 */
0x7103, /* PCI_CHIP_R520_7103 */
0x7104, /* PCI_CHIP_R520_7104 */
0x7105, /* PCI_CHIP_R520_7105 */
0x7106, /* PCI_CHIP_R520_7106 */
0x7108, /* PCI_CHIP_R520_7108 */
0x7109, /* PCI_CHIP_R520_7109 */
0x710A, /* PCI_CHIP_R520_710A */
0x710B, /* PCI_CHIP_R520_710B */
0x710C, /* PCI_CHIP_R520_710C */
0x710E, /* PCI_CHIP_R520_710E */
0x710F, /* PCI_CHIP_R520_710F */
0x7140, /* PCI_CHIP_RV515_7140 */
0x7141, /* PCI_CHIP_RV515_7141 */
0x7142, /* PCI_CHIP_RV515_7142 */
0x7143, /* PCI_CHIP_RV515_7143 */
0x7144, /* PCI_CHIP_RV515_7144 */
0x7145, /* PCI_CHIP_RV515_7145 */
0x7146, /* PCI_CHIP_RV515_7146 */
0x7147, /* PCI_CHIP_RV515_7147 */
0x7149, /* PCI_CHIP_RV515_7149 */
0x714A, /* PCI_CHIP_RV515_714A */
0x714B, /* PCI_CHIP_RV515_714B */
0x714C, /* PCI_CHIP_RV515_714C */
0x714D, /* PCI_CHIP_RV515_714D */
0x714E, /* PCI_CHIP_RV515_714E */
0x714F, /* PCI_CHIP_RV515_714F */
0x7151, /* PCI_CHIP_RV515_7151 */
0x7152, /* PCI_CHIP_RV515_7152 */
0x7153, /* PCI_CHIP_RV515_7153 */
0x715E, /* PCI_CHIP_RV515_715E */
0x715F, /* PCI_CHIP_RV515_715F */
0x7180, /* PCI_CHIP_RV515_7180 */
0x7181, /* PCI_CHIP_RV515_7181 */
0x7183, /* PCI_CHIP_RV515_7183 */
0x7186, /* PCI_CHIP_RV515_7186 */
0x7187, /* PCI_CHIP_RV515_7187 */
0x7188, /* PCI_CHIP_RV515_7188 */
0x718A, /* PCI_CHIP_RV515_718A */
0x718B, /* PCI_CHIP_RV515_718B */
0x718C, /* PCI_CHIP_RV515_718C */
0x718D, /* PCI_CHIP_RV515_718D */
0x718F, /* PCI_CHIP_RV515_718F */
0x7193, /* PCI_CHIP_RV515_7193 */
0x7196, /* PCI_CHIP_RV515_7196 */
0x719B, /* PCI_CHIP_RV515_719B */
0x719F, /* PCI_CHIP_RV515_719F */
0x7200, /* PCI_CHIP_RV515_7200 */
0x7210, /* PCI_CHIP_RV515_7210 */
0x7211, /* PCI_CHIP_RV515_7211 */
0x71C0, /* PCI_CHIP_RV530_71C0 */
0x71C1, /* PCI_CHIP_RV530_71C1 */
0x71C2, /* PCI_CHIP_RV530_71C2 */
0x71C3, /* PCI_CHIP_RV530_71C3 */
0x71C4, /* PCI_CHIP_RV530_71C4 */
0x71C5, /* PCI_CHIP_RV530_71C5 */
0x71C6, /* PCI_CHIP_RV530_71C6 */
0x71C7, /* PCI_CHIP_RV530_71C7 */
0x71CD, /* PCI_CHIP_RV530_71CD */
0x71CE, /* PCI_CHIP_RV530_71CE */
0x71D2, /* PCI_CHIP_RV530_71D2 */
0x71D4, /* PCI_CHIP_RV530_71D4 */
0x71D5, /* PCI_CHIP_RV530_71D5 */
0x71D6, /* PCI_CHIP_RV530_71D6 */
0x71DA, /* PCI_CHIP_RV530_71DA */
0x71DE, /* PCI_CHIP_RV530_71DE */
0x7281, /* PCI_CHIP_RV560_7281 */
0x7283, /* PCI_CHIP_RV560_7283 */
0x7287, /* PCI_CHIP_RV560_7287 */
0x7290, /* PCI_CHIP_RV560_7290 */
0x7291, /* PCI_CHIP_RV560_7291 */
0x7293, /* PCI_CHIP_RV560_7293 */
0x7297, /* PCI_CHIP_RV560_7297 */
0x7280, /* PCI_CHIP_RV570_7280 */
0x7288, /* PCI_CHIP_RV570_7288 */
0x7289, /* PCI_CHIP_RV570_7289 */
0x728B, /* PCI_CHIP_RV570_728B */
0x728C, /* PCI_CHIP_RV570_728C */
0x7240, /* PCI_CHIP_R580_7240 */
0x7243, /* PCI_CHIP_R580_7243 */
0x7244, /* PCI_CHIP_R580_7244 */
0x7245, /* PCI_CHIP_R580_7245 */
0x7246, /* PCI_CHIP_R580_7246 */
0x7247, /* PCI_CHIP_R580_7247 */
0x7248, /* PCI_CHIP_R580_7248 */
0x7249, /* PCI_CHIP_R580_7249 */
0x724A, /* PCI_CHIP_R580_724A */
0x724B, /* PCI_CHIP_R580_724B */
0x724C, /* PCI_CHIP_R580_724C */
0x724D, /* PCI_CHIP_R580_724D */
0x724E, /* PCI_CHIP_R580_724E */
0x724F, /* PCI_CHIP_R580_724F */
0x7284, /* PCI_CHIP_R580_7284 */
0x793F, /* PCI_CHIP_RS600_793F */
0x7941, /* PCI_CHIP_RS600_7941 */
0x7942, /* PCI_CHIP_RS600_7942 */
0x791E, /* PCI_CHIP_RS690_791E */
0x791F, /* PCI_CHIP_RS690_791F */
0x796C, /* PCI_CHIP_RS740_796C */
0x796D, /* PCI_CHIP_RS740_796D */
0x796E, /* PCI_CHIP_RS740_796E */
0x796F, /* PCI_CHIP_RS740_796F */
};
const int r600_chip_ids[] = {
0x9400, /* PCI_CHIP_R600_9400 */
0x9401, /* PCI_CHIP_R600_9401 */
0x9402, /* PCI_CHIP_R600_9402 */
0x9403, /* PCI_CHIP_R600_9403 */
0x9405, /* PCI_CHIP_R600_9405 */
0x940A, /* PCI_CHIP_R600_940A */
0x940B, /* PCI_CHIP_R600_940B */
0x940F, /* PCI_CHIP_R600_940F */
0x94C0, /* PCI_CHIP_RV610_94C0 */
0x94C1, /* PCI_CHIP_RV610_94C1 */
0x94C3, /* PCI_CHIP_RV610_94C3 */
0x94C4, /* PCI_CHIP_RV610_94C4 */
0x94C5, /* PCI_CHIP_RV610_94C5 */
0x94C6, /* PCI_CHIP_RV610_94C6 */
0x94C7, /* PCI_CHIP_RV610_94C7 */
0x94C8, /* PCI_CHIP_RV610_94C8 */
0x94C9, /* PCI_CHIP_RV610_94C9 */
0x94CB, /* PCI_CHIP_RV610_94CB */
0x94CC, /* PCI_CHIP_RV610_94CC */
0x94CD, /* PCI_CHIP_RV610_94CD */
0x9580, /* PCI_CHIP_RV630_9580 */
0x9581, /* PCI_CHIP_RV630_9581 */
0x9583, /* PCI_CHIP_RV630_9583 */
0x9586, /* PCI_CHIP_RV630_9586 */
0x9587, /* PCI_CHIP_RV630_9587 */
0x9588, /* PCI_CHIP_RV630_9588 */
0x9589, /* PCI_CHIP_RV630_9589 */
0x958A, /* PCI_CHIP_RV630_958A */
0x958B, /* PCI_CHIP_RV630_958B */
0x958C, /* PCI_CHIP_RV630_958C */
0x958D, /* PCI_CHIP_RV630_958D */
0x958E, /* PCI_CHIP_RV630_958E */
0x958F, /* PCI_CHIP_RV630_958F */
0x9500, /* PCI_CHIP_RV670_9500 */
0x9501, /* PCI_CHIP_RV670_9501 */
0x9504, /* PCI_CHIP_RV670_9504 */
0x9505, /* PCI_CHIP_RV670_9505 */
0x9506, /* PCI_CHIP_RV670_9506 */
0x9507, /* PCI_CHIP_RV670_9507 */
0x9508, /* PCI_CHIP_RV670_9508 */
0x9509, /* PCI_CHIP_RV670_9509 */
0x950F, /* PCI_CHIP_RV670_950F */
0x9511, /* PCI_CHIP_RV670_9511 */
0x9515, /* PCI_CHIP_RV670_9515 */
0x9517, /* PCI_CHIP_RV670_9517 */
0x9519, /* PCI_CHIP_RV670_9519 */
0x95C0, /* PCI_CHIP_RV620_95C0 */
0x95C2, /* PCI_CHIP_RV620_95C2 */
0x95C4, /* PCI_CHIP_RV620_95C4 */
0x95C5, /* PCI_CHIP_RV620_95C5 */
0x95C6, /* PCI_CHIP_RV620_95C6 */
0x95C7, /* PCI_CHIP_RV620_95C7 */
0x95C9, /* PCI_CHIP_RV620_95C9 */
0x95CC, /* PCI_CHIP_RV620_95CC */
0x95CD, /* PCI_CHIP_RV620_95CD */
0x95CE, /* PCI_CHIP_RV620_95CE */
0x95CF, /* PCI_CHIP_RV620_95CF */
0x9590, /* PCI_CHIP_RV635_9590 */
0x9591, /* PCI_CHIP_RV635_9591 */
0x9593, /* PCI_CHIP_RV635_9593 */
0x9595, /* PCI_CHIP_RV635_9595 */
0x9596, /* PCI_CHIP_RV635_9596 */
0x9597, /* PCI_CHIP_RV635_9597 */
0x9598, /* PCI_CHIP_RV635_9598 */
0x9599, /* PCI_CHIP_RV635_9599 */
0x959B, /* PCI_CHIP_RV635_959B */
0x9610, /* PCI_CHIP_RS780_9610 */
0x9611, /* PCI_CHIP_RS780_9611 */
0x9612, /* PCI_CHIP_RS780_9612 */
0x9613, /* PCI_CHIP_RS780_9613 */
0x9614, /* PCI_CHIP_RS780_9614 */
0x9615, /* PCI_CHIP_RS780_9615 */
0x9616, /* PCI_CHIP_RS780_9616 */
0x9710, /* PCI_CHIP_RS880_9710 */
0x9711, /* PCI_CHIP_RS880_9711 */
0x9712, /* PCI_CHIP_RS880_9712 */
0x9713, /* PCI_CHIP_RS880_9713 */
0x9714, /* PCI_CHIP_RS880_9714 */
0x9715, /* PCI_CHIP_RS880_9715 */
0x9440, /* PCI_CHIP_RV770_9440 */
0x9441, /* PCI_CHIP_RV770_9441 */
0x9442, /* PCI_CHIP_RV770_9442 */
0x9443, /* PCI_CHIP_RV770_9443 */
0x9444, /* PCI_CHIP_RV770_9444 */
0x9446, /* PCI_CHIP_RV770_9446 */
0x944A, /* PCI_CHIP_RV770_944A */
0x944B, /* PCI_CHIP_RV770_944B */
0x944C, /* PCI_CHIP_RV770_944C */
0x944E, /* PCI_CHIP_RV770_944E */
0x9450, /* PCI_CHIP_RV770_9450 */
0x9452, /* PCI_CHIP_RV770_9452 */
0x9456, /* PCI_CHIP_RV770_9456 */
0x945A, /* PCI_CHIP_RV770_945A */
0x945B, /* PCI_CHIP_RV770_945B */
0x945E, /* PCI_CHIP_RV770_945E */
0x9460, /* PCI_CHIP_RV790_9460 */
0x9462, /* PCI_CHIP_RV790_9462 */
0x946A, /* PCI_CHIP_RV770_946A */
0x946B, /* PCI_CHIP_RV770_946B */
0x947A, /* PCI_CHIP_RV770_947A */
0x947B, /* PCI_CHIP_RV770_947B */
0x9480, /* PCI_CHIP_RV730_9480 */
0x9487, /* PCI_CHIP_RV730_9487 */
0x9488, /* PCI_CHIP_RV730_9488 */
0x9489, /* PCI_CHIP_RV730_9489 */
0x948A, /* PCI_CHIP_RV730_948A */
0x948F, /* PCI_CHIP_RV730_948F */
0x9490, /* PCI_CHIP_RV730_9490 */
0x9491, /* PCI_CHIP_RV730_9491 */
0x9495, /* PCI_CHIP_RV730_9495 */
0x9498, /* PCI_CHIP_RV730_9498 */
0x949C, /* PCI_CHIP_RV730_949C */
0x949E, /* PCI_CHIP_RV730_949E */
0x949F, /* PCI_CHIP_RV730_949F */
0x9540, /* PCI_CHIP_RV710_9540 */
0x9541, /* PCI_CHIP_RV710_9541 */
0x9542, /* PCI_CHIP_RV710_9542 */
0x954E, /* PCI_CHIP_RV710_954E */
0x954F, /* PCI_CHIP_RV710_954F */
0x9552, /* PCI_CHIP_RV710_9552 */
0x9553, /* PCI_CHIP_RV710_9553 */
0x9555, /* PCI_CHIP_RV710_9555 */
0x9557, /* PCI_CHIP_RV710_9557 */
0x955F, /* PCI_CHIP_RV710_955F */
0x94A0, /* PCI_CHIP_RV740_94A0 */
0x94A1, /* PCI_CHIP_RV740_94A1 */
0x94A3, /* PCI_CHIP_RV740_94A3 */
0x94B1, /* PCI_CHIP_RV740_94B1 */
0x94B3, /* PCI_CHIP_RV740_94B3 */
0x94B4, /* PCI_CHIP_RV740_94B4 */
0x94B5, /* PCI_CHIP_RV740_94B5 */
0x94B9, /* PCI_CHIP_RV740_94B9 */
0x68E0, /* PCI_CHIP_CEDAR_68E0 */
0x68E1, /* PCI_CHIP_CEDAR_68E1 */
0x68E4, /* PCI_CHIP_CEDAR_68E4 */
0x68E5, /* PCI_CHIP_CEDAR_68E5 */
0x68E8, /* PCI_CHIP_CEDAR_68E8 */
0x68E9, /* PCI_CHIP_CEDAR_68E9 */
0x68F1, /* PCI_CHIP_CEDAR_68F1 */
0x68F8, /* PCI_CHIP_CEDAR_68F8 */
0x68F9, /* PCI_CHIP_CEDAR_68F9 */
0x68FE, /* PCI_CHIP_CEDAR_68FE */
0x68C0, /* PCI_CHIP_REDWOOD_68C0 */
0x68C1, /* PCI_CHIP_REDWOOD_68C1 */
0x68C8, /* PCI_CHIP_REDWOOD_68C8 */
0x68C9, /* PCI_CHIP_REDWOOD_68C9 */
0x68D8, /* PCI_CHIP_REDWOOD_68D8 */
0x68D9, /* PCI_CHIP_REDWOOD_68D9 */
0x68DA, /* PCI_CHIP_REDWOOD_68DA */
0x68DE, /* PCI_CHIP_REDWOOD_68DE */
0x68A0, /* PCI_CHIP_JUNIPER_68A0 */
0x68A1, /* PCI_CHIP_JUNIPER_68A1 */
0x68A8, /* PCI_CHIP_JUNIPER_68A8 */
0x68A9, /* PCI_CHIP_JUNIPER_68A9 */
0x68B0, /* PCI_CHIP_JUNIPER_68B0 */
0x68B8, /* PCI_CHIP_JUNIPER_68B8 */
0x68B9, /* PCI_CHIP_JUNIPER_68B9 */
0x68BE, /* PCI_CHIP_JUNIPER_68BE */
0x6880, /* PCI_CHIP_CYPRESS_6880 */
0x6888, /* PCI_CHIP_CYPRESS_6888 */
0x6889, /* PCI_CHIP_CYPRESS_6889 */
0x688A, /* PCI_CHIP_CYPRESS_688A */
0x6898, /* PCI_CHIP_CYPRESS_6898 */
0x6899, /* PCI_CHIP_CYPRESS_6899 */
0x689E, /* PCI_CHIP_CYPRESS_689E */
0x689C, /* PCI_CHIP_HEMLOCK_689C */
0x689D, /* PCI_CHIP_HEMLOCK_689D */
0x9802, /* PCI_CHIP_PALM_9802 */
0x9803, /* PCI_CHIP_PALM_9803 */
0x9804, /* PCI_CHIP_PALM_9804 */
0x9805, /* PCI_CHIP_PALM_9805 */
0x6720, /* PCI_CHIP_BARTS_6720 */
0x6721, /* PCI_CHIP_BARTS_6721 */
0x6722, /* PCI_CHIP_BARTS_6722 */
0x6723, /* PCI_CHIP_BARTS_6723 */
0x6724, /* PCI_CHIP_BARTS_6724 */
0x6725, /* PCI_CHIP_BARTS_6725 */
0x6726, /* PCI_CHIP_BARTS_6726 */
0x6727, /* PCI_CHIP_BARTS_6727 */
0x6728, /* PCI_CHIP_BARTS_6728 */
0x6729, /* PCI_CHIP_BARTS_6729 */
0x6738, /* PCI_CHIP_BARTS_6738 */
0x6739, /* PCI_CHIP_BARTS_6738 */
0x6740, /* PCI_CHIP_TURKS_6740 */
0x6741, /* PCI_CHIP_TURKS_6741 */
0x6742, /* PCI_CHIP_TURKS_6742 */
0x6743, /* PCI_CHIP_TURKS_6743 */
0x6744, /* PCI_CHIP_TURKS_6744 */
0x6745, /* PCI_CHIP_TURKS_6745 */
0x6746, /* PCI_CHIP_TURKS_6746 */
0x6747, /* PCI_CHIP_TURKS_6747 */
0x6748, /* PCI_CHIP_TURKS_6748 */
0x6749, /* PCI_CHIP_TURKS_6749 */
0x6750, /* PCI_CHIP_TURKS_6750 */
0x6758, /* PCI_CHIP_TURKS_6758 */
0x6759, /* PCI_CHIP_TURKS_6759 */
0x6760, /* PCI_CHIP_CAICOS_6760 */
0x6761, /* PCI_CHIP_CAICOS_6761 */
0x6762, /* PCI_CHIP_CAICOS_6762 */
0x6763, /* PCI_CHIP_CAICOS_6763 */
0x6764, /* PCI_CHIP_CAICOS_6764 */
0x6765, /* PCI_CHIP_CAICOS_6765 */
0x6766, /* PCI_CHIP_CAICOS_6766 */
0x6767, /* PCI_CHIP_CAICOS_6767 */
0x6768, /* PCI_CHIP_CAICOS_6768 */
0x6770, /* PCI_CHIP_CAICOS_6770 */
0x6779, /* PCI_CHIP_CAICOS_6779 */
};
const struct dri2_driver_map driver_map[] = {
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
{ 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
{ 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
{ 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
{ 0x10de, "nouveau", NULL, -1 },
};
static char *
dri2_get_device_name(int fd)
{
struct udev *udev;
struct udev_device *device;
struct stat buf;
char *device_name;
udev = udev_new();
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
goto out;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
goto out;
}
device_name = udev_device_get_devnode(device);
if (!device_name)
goto out;
device_name = strdup(device_name);
out:
udev_device_unref(device);
udev_unref(udev);
return device_name;
}
char *
dri2_get_driver_for_fd(int fd)
{
struct udev *udev;
struct udev_device *device, *parent;
struct stat buf;
const char *pci_id;
char *driver = NULL;
int vendor_id, chip_id, i, j;
udev = udev_new();
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
goto out;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
goto out;
}
parent = udev_device_get_parent(device);
if (parent == NULL) {
_eglLog(_EGL_WARNING, "DRI2: could not get parent device");
goto out;
}
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (pci_id == NULL || sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
_eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID");
goto out;
}
for (i = 0; i < ARRAY_SIZE(driver_map); i++) {
if (vendor_id != driver_map[i].vendor_id)
continue;
if (driver_map[i].num_chips_ids == -1) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
for (j = 0; j < driver_map[i].num_chips_ids; j++)
if (driver_map[i].chip_ids[j] == chip_id) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
}
out:
udev_device_unref(device);
udev_unref(udev);
return driver;
}
static int
dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
return drmAuthMagic(dri2_dpy->fd, id);
}
EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
int i;
dri2_dpy = malloc(sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
dri2_dpy->fd = (int) disp->PlatformDisplay;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL)
return _eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name");
dri2_dpy->device_name = dri2_get_device_name(dri2_dpy->fd);
if (dri2_dpy->device_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
goto cleanup_driver_name;
}
if (!dri2_load_driver(disp))
goto cleanup_device_name;
dri2_dpy->extensions[0] = &image_lookup_extension.base;
dri2_dpy->extensions[1] = &use_invalidate.base;
dri2_dpy->extensions[2] = NULL;
if (!dri2_create_screen(disp))
goto cleanup_driver;
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0, 0, NULL);
disp->Extensions.MESA_drm_image = EGL_TRUE;
disp->Extensions.KHR_image_base = EGL_TRUE;
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
#ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
#endif
dri2_dpy->authenticate = dri2_drm_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_device_name:
free(dri2_dpy->device_name);
cleanup_driver_name:
free(dri2_dpy->driver_name);
return EGL_FALSE;
}
#endif

View File

@@ -0,0 +1,707 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>
#include "egl_dri2.h"
#include <wayland-client.h>
#include "wayland-drm-client-protocol.h"
static void
sync_callback(void *data)
{
int *done = data;
*done = 1;
}
static void
force_roundtrip(struct wl_display *display)
{
int done = 0;
wl_display_sync_callback(display, sync_callback, &done);
wl_display_iterate(display, WL_DISPLAY_WRITABLE);
while (!done)
wl_display_iterate(display, WL_DISPLAY_READABLE);
}
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
struct dri2_egl_buffer *dri2_buf;
int i;
(void) drv;
dri2_surf = malloc(sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
return NULL;
}
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf;
for (i = 0; i < WL_BUFFER_COUNT; ++i)
dri2_surf->wl_drm_buffer[i] = NULL;
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
dri2_surf->dri_buffers[i] = NULL;
dri2_surf->pending_buffer = NULL;
dri2_surf->block_swap_buffers = EGL_FALSE;
switch (type) {
case EGL_WINDOW_BIT:
dri2_surf->wl_win = (struct wl_egl_window *) window;
dri2_surf->type = DRI2_WINDOW_SURFACE;
dri2_surf->base.Width = -1;
dri2_surf->base.Height = -1;
break;
case EGL_PIXMAP_BIT:
dri2_surf->wl_pix = (struct wl_egl_pixmap *) window;
dri2_surf->type = DRI2_PIXMAP_SURFACE;
dri2_surf->base.Width = dri2_surf->wl_pix->width;
dri2_surf->base.Height = dri2_surf->wl_pix->height;
if (dri2_surf->wl_pix->name > 0) {
dri2_buf = dri2_surf->wl_pix->driver_private;
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = dri2_buf->dri_buffer;
}
break;
default:
goto cleanup_surf;
}
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
type == EGL_WINDOW_BIT ?
dri2_conf->dri_double_config :
dri2_conf->dri_single_config,
dri2_surf);
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
goto cleanup_dri_drawable;
}
return &dri2_surf->base;
cleanup_dri_drawable:
dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
cleanup_surf:
free(dri2_surf);
return NULL;
}
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
}
static _EGLSurface *
dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativePixmapType pixmap,
const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
pixmap, attrib_list);
}
/**
* Called via eglDestroySurface(), drv->API.DestroySurface().
*/
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
int i;
(void) drv;
if (!_eglPutSurface(surf))
return EGL_TRUE;
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
for (i = 0; i < WL_BUFFER_COUNT; ++i)
if (dri2_surf->wl_drm_buffer[i])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
if (dri2_surf->dri_buffers[i] && !(i == __DRI_BUFFER_FRONT_LEFT &&
dri2_surf->type == DRI2_PIXMAP_SURFACE))
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
free(surf);
return EGL_TRUE;
}
static void
dri2_wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
{
struct dri2_egl_buffer *dri2_buf = egl_pixmap->driver_private;
assert(dri2_buf);
dri2_buf->dri2_dpy->dri2->releaseBuffer(dri2_buf->dri2_dpy->dri_screen,
dri2_buf->dri_buffer);
free(dri2_buf);
egl_pixmap->driver_private = NULL;
egl_pixmap->destroy = NULL;
egl_pixmap->name = 0;
}
static void
dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
(void) format;
switch (dri2_surf->type) {
case DRI2_WINDOW_SURFACE:
/* allocate a front buffer for our double-buffered window*/
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
__DRI_BUFFER_FRONT_LEFT, format,
dri2_surf->base.Width, dri2_surf->base.Height);
break;
default:
break;
}
}
static void
dri2_process_front_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct dri2_egl_buffer *dri2_buf;
switch (dri2_surf->type) {
case DRI2_PIXMAP_SURFACE:
dri2_buf = malloc(sizeof *dri2_buf);
if (!dri2_buf)
return;
dri2_buf->dri_buffer = dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT];
dri2_buf->dri2_dpy = dri2_dpy;
dri2_surf->wl_pix->name = dri2_buf->dri_buffer->name;
dri2_surf->wl_pix->stride = dri2_buf->dri_buffer->pitch;
dri2_surf->wl_pix->driver_private = dri2_buf;
dri2_surf->wl_pix->destroy = dri2_wl_egl_pixmap_destroy;
break;
default:
break;
}
}
static void
dri2_release_pending_buffer(void *data)
{
struct dri2_egl_surface *dri2_surf = data;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
/* FIXME: print internal error */
if (!dri2_surf->pending_buffer)
return;
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->pending_buffer);
dri2_surf->pending_buffer = NULL;
}
static void
dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
int i;
for (i = 0; i < __DRI_BUFFER_COUNT; ++i) {
if (dri2_surf->dri_buffers[i]) {
switch (i) {
case __DRI_BUFFER_FRONT_LEFT:
if (dri2_surf->pending_buffer)
force_roundtrip(dri2_dpy->wl_dpy->display);
dri2_surf->pending_buffer = dri2_surf->dri_buffers[i];
wl_display_sync_callback(dri2_dpy->wl_dpy->display,
dri2_release_pending_buffer, dri2_surf);
break;
default:
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
break;
}
dri2_surf->dri_buffers[i] = NULL;
}
}
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
int i;
if (dri2_surf->type == DRI2_WINDOW_SURFACE &&
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
dri2_surf->base.Height != dri2_surf->wl_win->height)) {
dri2_release_buffers(dri2_surf);
dri2_surf->base.Width = dri2_surf->wl_win->width;
dri2_surf->base.Height = dri2_surf->wl_win->height;
dri2_surf->dx = dri2_surf->wl_win->dx;
dri2_surf->dy = dri2_surf->wl_win->dy;
for (i = 0; i < WL_BUFFER_COUNT; ++i) {
if (dri2_surf->wl_drm_buffer[i])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
dri2_surf->wl_drm_buffer[i] = NULL;
}
}
dri2_surf->buffer_count = 0;
for (i = 0; i < 2*count; i+=2) {
assert(attachments[i] < __DRI_BUFFER_COUNT);
assert(dri2_surf->buffer_count < 5);
if (dri2_surf->dri_buffers[attachments[i]] == NULL) {
dri2_surf->dri_buffers[attachments[i]] =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
attachments[i], attachments[i+1],
dri2_surf->base.Width, dri2_surf->base.Height);
if (!dri2_surf->dri_buffers[attachments[i]])
continue;
if (attachments[i] == __DRI_BUFFER_FRONT_LEFT)
dri2_process_front_buffer(dri2_surf, attachments[i+1]);
else if (attachments[i] == __DRI_BUFFER_BACK_LEFT)
dri2_process_back_buffer(dri2_surf, attachments[i+1]);
}
memcpy(&dri2_surf->buffers[dri2_surf->buffer_count],
dri2_surf->dri_buffers[attachments[i]],
sizeof(__DRIbuffer));
dri2_surf->buffer_count++;
}
assert(dri2_surf->type == DRI2_PIXMAP_SURFACE ||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
*out_count = dri2_surf->buffer_count;
if (dri2_surf->buffer_count == 0)
return NULL;
*width = dri2_surf->base.Width;
*height = dri2_surf->base.Height;
return dri2_surf->buffers;
}
static __DRIbuffer *
dri2_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
unsigned int *attachments_with_format;
__DRIbuffer *buffer;
const unsigned int format = 32;
int i;
attachments_with_format = calloc(count * 2, sizeof(unsigned int));
if (!attachments_with_format) {
*out_count = 0;
return NULL;
}
for (i = 0; i < count; ++i) {
attachments_with_format[2*i] = attachments[i];
attachments_with_format[2*i + 1] = format;
}
buffer =
dri2_get_buffers_with_format(driDrawable,
width, height,
attachments_with_format, count,
out_count, loaderPrivate);
free(attachments_with_format);
return buffer;
}
static void
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
/* FIXME: Does EGL support front buffer rendering at all? */
#if 0
struct dri2_egl_surface *dri2_surf = loaderPrivate;
dri2WaitGL(dri2_surf);
#else
(void) loaderPrivate;
#endif
}
static struct wl_buffer *
wayland_create_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
return wl_drm_create_buffer(dri2_dpy->wl_dpy->drm, buffer->name,
dri2_surf->base.Width, dri2_surf->base.Height,
buffer->pitch, dri2_surf->wl_win->visual);
}
static void
wayland_frame_callback(void *data, uint32_t time)
{
struct dri2_egl_surface *dri2_surf = data;
dri2_surf->block_swap_buffers = EGL_FALSE;
}
static inline void
pointer_swap(const void **p1, const void **p2)
{
const void *tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
/**
* Called via eglSwapBuffers(), drv->API.SwapBuffers().
*/
static EGLBoolean
dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
while (dri2_surf->block_swap_buffers)
wl_display_iterate(dri2_dpy->wl_dpy->display, WL_DISPLAY_READABLE);
dri2_surf->block_swap_buffers = EGL_TRUE;
wl_display_frame_callback(dri2_dpy->wl_dpy->display,
wayland_frame_callback, dri2_surf);
if (dri2_surf->type == DRI2_WINDOW_SURFACE) {
pointer_swap(
(const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
(const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]->attachment =
__DRI_BUFFER_FRONT_LEFT;
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment =
__DRI_BUFFER_BACK_LEFT;
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
(const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_BACK]);
if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT])
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] =
wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]);
wl_surface_attach(dri2_surf->wl_win->surface,
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
dri2_surf->dx, dri2_surf->dy);
dri2_surf->wl_win->attached_width = dri2_surf->base.Width;
dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
/* reset resize growing parameters */
dri2_surf->dx = 0;
dri2_surf->dy = 0;
wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height);
}
_EGLContext *ctx;
if (dri2_drv->glFlush) {
ctx = _eglGetCurrentContext();
if (ctx && ctx->DrawSurface == &dri2_surf->base)
dri2_drv->glFlush();
}
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
return EGL_TRUE;
}
/**
* Called via eglCreateImageKHR(), drv->API.CreateImageKHR().
*/
static _EGLImage *
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct wl_egl_pixmap *wl_egl_pixmap = (struct wl_egl_pixmap *) buffer;
struct dri2_egl_buffer *dri2_buf;
EGLint wl_attr_list[] = {
EGL_WIDTH, 0,
EGL_HEIGHT, 0,
EGL_DRM_BUFFER_STRIDE_MESA, 0,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA,
EGL_NONE
};
dri2_buf = malloc(sizeof *dri2_buf);
if (!dri2_buf)
return NULL;
dri2_buf->dri2_dpy = dri2_dpy;
dri2_buf->dri_buffer =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
__DRI_BUFFER_FRONT_LEFT, 32,
wl_egl_pixmap->width,
wl_egl_pixmap->height);
wl_egl_pixmap->name = dri2_buf->dri_buffer->name;
wl_egl_pixmap->stride = dri2_buf->dri_buffer->pitch;
wl_egl_pixmap->destroy = dri2_wl_egl_pixmap_destroy;
wl_egl_pixmap->driver_private = dri2_buf;
wl_attr_list[1] = wl_egl_pixmap->width;
wl_attr_list[3] = wl_egl_pixmap->height;
wl_attr_list[5] = wl_egl_pixmap->stride / 4;
return dri2_create_image_khr(disp->Driver, disp, ctx, EGL_DRM_BUFFER_MESA,
(EGLClientBuffer)(intptr_t) wl_egl_pixmap->name, wl_attr_list);
}
static _EGLImage *
dri2_wayland_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{
(void) drv;
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
}
}
static int
dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret = 0;
dri2_dpy->wl_dpy->authenticated = false;
wl_drm_authenticate(dri2_dpy->wl_dpy->drm, id);
force_roundtrip(dri2_dpy->wl_dpy->display);
if (!dri2_dpy->wl_dpy->authenticated)
ret = -1;
/* reset authenticated */
dri2_dpy->wl_dpy->authenticated = true;
return ret;
}
/**
* Called via eglTerminate(), drv->API.Terminate().
*/
static EGLBoolean
dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
close(dri2_dpy->fd);
dlclose(dri2_dpy->driver);
free(dri2_dpy->driver_name);
free(dri2_dpy);
disp->DriverData = NULL;
return EGL_TRUE;
}
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
int i;
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.CreatePixmapSurface = dri2_create_pixmap_surface;
drv->API.DestroySurface = dri2_destroy_surface;
drv->API.SwapBuffers = dri2_swap_buffers;
drv->API.CreateImageKHR = dri2_wayland_create_image_khr;
drv->API.Terminate = dri2_terminate;
dri2_dpy = malloc(sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
dri2_dpy->wl_dpy = disp->PlatformDisplay;
if (dri2_dpy->wl_dpy->fd == -1)
force_roundtrip(dri2_dpy->wl_dpy->display);
if (dri2_dpy->wl_dpy->fd == -1)
goto cleanup_dpy;
dri2_dpy->fd = dup(dri2_dpy->wl_dpy->fd);
if (dri2_dpy->fd < 0) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to dup fd");
goto cleanup_dpy;
}
if (!dri2_dpy->wl_dpy->authenticated)
force_roundtrip(dri2_dpy->wl_dpy->display);
if (!dri2_dpy->wl_dpy->authenticated)
goto cleanup_dpy;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name");
goto cleanup_fd;
}
dri2_dpy->device_name = strdup(dri2_dpy->wl_dpy->device_name);
if (dri2_dpy->device_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
goto cleanup_driver_name;
}
if (!dri2_load_driver(disp))
goto cleanup_device_name;
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
dri2_get_buffers_with_format;
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
dri2_dpy->extensions[1] = &image_lookup_extension.base;
dri2_dpy->extensions[2] = NULL;
if (!dri2_create_screen(disp))
goto cleanup_driver;
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0,
EGL_WINDOW_BIT | EGL_PIXMAP_BIT, NULL);
disp->Extensions.MESA_drm_image = EGL_TRUE;
disp->Extensions.KHR_image_base = EGL_TRUE;
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
dri2_dpy->authenticate = dri2_wayland_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_device_name:
free(dri2_dpy->device_name);
cleanup_driver_name:
free(dri2_dpy->driver_name);
cleanup_fd:
close(dri2_dpy->fd);
cleanup_dpy:
free(dri2_dpy);
return EGL_FALSE;
}

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER = egl_glx.so
EGL_DRIVER = egl_glx
EGL_SOURCES = egl_glx.c
EGL_INCLUDES = \
@@ -11,6 +11,9 @@ EGL_INCLUDES = \
-I$(TOP)/src/egl/main
EGL_CFLAGS = $(X11_CFLAGS)
EGL_LIBS = $(X11_LIBS) -lGL
EGL_LIBS = $(X11_LIBS) $(DLOPEN_LIBS)
EGL_CFLAGS += -D_EGL_MAIN=_eglBuiltInDriverGLX
EGL_BUILTIN = true
include ../Makefile.template

View File

@@ -36,8 +36,8 @@
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
#include <EGL/egl.h>
#include <dlfcn.h>
#include "GL/glx.h"
#include "eglconfig.h"
#include "eglcontext.h"
@@ -54,10 +54,66 @@
#error "GL/glx.h must be equal to or greater than GLX 1.4"
#endif
/* GLX 1.0 */
typedef GLXContext (*GLXCREATECONTEXTPROC)( Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct );
typedef void (*GLXDESTROYCONTEXTPROC)( Display *dpy, GLXContext ctx );
typedef Bool (*GLXMAKECURRENTPROC)( Display *dpy, GLXDrawable drawable, GLXContext ctx);
typedef void (*GLXSWAPBUFFERSPROC)( Display *dpy, GLXDrawable drawable );
typedef GLXPixmap (*GLXCREATEGLXPIXMAPPROC)( Display *dpy, XVisualInfo *visual, Pixmap pixmap );
typedef void (*GLXDESTROYGLXPIXMAPPROC)( Display *dpy, GLXPixmap pixmap );
typedef Bool (*GLXQUERYVERSIONPROC)( Display *dpy, int *maj, int *min );
typedef int (*GLXGETCONFIGPROC)( Display *dpy, XVisualInfo *visual, int attrib, int *value );
typedef void (*GLXWAITGLPROC)( void );
typedef void (*GLXWAITXPROC)( void );
/* GLX 1.1 */
typedef const char *(*GLXQUERYEXTENSIONSSTRINGPROC)( Display *dpy, int screen );
typedef const char *(*GLXQUERYSERVERSTRINGPROC)( Display *dpy, int screen, int name );
typedef const char *(*GLXGETCLIENTSTRINGPROC)( Display *dpy, int name );
/** subclass of _EGLDriver */
struct GLX_egl_driver
{
_EGLDriver Base; /**< base class */
void *handle;
/* GLX 1.0 */
GLXCREATECONTEXTPROC glXCreateContext;
GLXDESTROYCONTEXTPROC glXDestroyContext;
GLXMAKECURRENTPROC glXMakeCurrent;
GLXSWAPBUFFERSPROC glXSwapBuffers;
GLXCREATEGLXPIXMAPPROC glXCreateGLXPixmap;
GLXDESTROYGLXPIXMAPPROC glXDestroyGLXPixmap;
GLXQUERYVERSIONPROC glXQueryVersion;
GLXGETCONFIGPROC glXGetConfig;
GLXWAITGLPROC glXWaitGL;
GLXWAITXPROC glXWaitX;
/* GLX 1.1 */
GLXQUERYEXTENSIONSSTRINGPROC glXQueryExtensionsString;
GLXQUERYSERVERSTRINGPROC glXQueryServerString;
GLXGETCLIENTSTRINGPROC glXGetClientString;
/* GLX 1.3 or (GLX_SGI_make_current_read and GLX_SGIX_fbconfig) */
PFNGLXGETFBCONFIGSPROC glXGetFBConfigs;
PFNGLXGETFBCONFIGATTRIBPROC glXGetFBConfigAttrib;
PFNGLXGETVISUALFROMFBCONFIGPROC glXGetVisualFromFBConfig;
PFNGLXCREATEWINDOWPROC glXCreateWindow;
PFNGLXDESTROYWINDOWPROC glXDestroyWindow;
PFNGLXCREATEPIXMAPPROC glXCreatePixmap;
PFNGLXDESTROYPIXMAPPROC glXDestroyPixmap;
PFNGLXCREATEPBUFFERPROC glXCreatePbuffer;
PFNGLXDESTROYPBUFFERPROC glXDestroyPbuffer;
PFNGLXCREATENEWCONTEXTPROC glXCreateNewContext;
PFNGLXMAKECONTEXTCURRENTPROC glXMakeContextCurrent;
/* GLX 1.4 or GLX_ARB_get_proc_address */
PFNGLXGETPROCADDRESSPROC glXGetProcAddress;
/* GLX_SGIX_pbuffer */
PFNGLXCREATEGLXPBUFFERSGIXPROC glXCreateGLXPbufferSGIX;
PFNGLXDESTROYGLXPBUFFERSGIXPROC glXDestroyGLXPbufferSGIX;
};
@@ -76,14 +132,9 @@ struct GLX_egl_display
EGLBoolean have_fbconfig;
EGLBoolean have_pbuffer;
/* GLX_SGIX_pbuffer */
PFNGLXCREATEGLXPBUFFERSGIXPROC glXCreateGLXPbufferSGIX;
PFNGLXDESTROYGLXPBUFFERSGIXPROC glXDestroyGLXPbufferSGIX;
/* workaround quirks of different GLX implementations */
EGLBoolean single_buffered_quirk;
EGLBoolean glx_window_quirk;
};
@@ -168,19 +219,21 @@ static const struct {
static EGLBoolean
convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
convert_fbconfig(struct GLX_egl_driver *GLX_drv,
struct GLX_egl_display *GLX_dpy, GLXFBConfig fbconfig,
struct GLX_egl_config *GLX_conf)
{
Display *dpy = GLX_dpy->dpy;
int err, attr, val;
unsigned i;
/* must have rgba bit */
err = glXGetFBConfigAttrib(dpy, fbconfig, GLX_RENDER_TYPE, &val);
err = GLX_drv->glXGetFBConfigAttrib(dpy, fbconfig, GLX_RENDER_TYPE, &val);
if (err || !(val & GLX_RGBA_BIT))
return EGL_FALSE;
/* must know whether it is double-buffered */
err = glXGetFBConfigAttrib(dpy, fbconfig, GLX_DOUBLEBUFFER, &val);
err = GLX_drv->glXGetFBConfigAttrib(dpy, fbconfig, GLX_DOUBLEBUFFER, &val);
if (err)
return EGL_FALSE;
GLX_conf->double_buffered = val;
@@ -196,7 +249,7 @@ convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
if (!egl_attr)
continue;
err = glXGetFBConfigAttrib(dpy, fbconfig, attr, &val);
err = GLX_drv->glXGetFBConfigAttrib(dpy, fbconfig, attr, &val);
if (err) {
if (err == GLX_BAD_ATTRIBUTE) {
err = 0;
@@ -303,21 +356,23 @@ static const struct {
};
static EGLBoolean
convert_visual(Display *dpy, XVisualInfo *vinfo,
convert_visual(struct GLX_egl_driver *GLX_drv,
struct GLX_egl_display *GLX_dpy, XVisualInfo *vinfo,
struct GLX_egl_config *GLX_conf)
{
Display *dpy = GLX_dpy->dpy;
int err, attr, val;
unsigned i;
/* the visual must support OpenGL and RGBA buffer */
err = glXGetConfig(dpy, vinfo, GLX_USE_GL, &val);
err = GLX_drv->glXGetConfig(dpy, vinfo, GLX_USE_GL, &val);
if (!err && val)
err = glXGetConfig(dpy, vinfo, GLX_RGBA, &val);
err = GLX_drv->glXGetConfig(dpy, vinfo, GLX_RGBA, &val);
if (err || !val)
return EGL_FALSE;
/* must know whether it is double-buffered */
err = glXGetConfig(dpy, vinfo, GLX_DOUBLEBUFFER, &val);
err = GLX_drv->glXGetConfig(dpy, vinfo, GLX_DOUBLEBUFFER, &val);
if (err)
return EGL_FALSE;
GLX_conf->double_buffered = val;
@@ -341,7 +396,7 @@ convert_visual(Display *dpy, XVisualInfo *vinfo,
if (!egl_attr)
continue;
err = glXGetConfig(dpy, vinfo, attr, &val);
err = GLX_drv->glXGetConfig(dpy, vinfo, attr, &val);
if (err) {
if (err == GLX_BAD_ATTRIBUTE) {
err = 0;
@@ -406,14 +461,16 @@ fix_config(struct GLX_egl_display *GLX_dpy, struct GLX_egl_config *GLX_conf)
static EGLBoolean
create_configs(_EGLDisplay *dpy, struct GLX_egl_display *GLX_dpy,
EGLint screen)
create_configs(_EGLDriver *drv, _EGLDisplay *dpy, EGLint screen)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(dpy);
EGLint num_configs = 0, i;
EGLint id = 1;
if (GLX_dpy->have_fbconfig) {
GLX_dpy->fbconfigs = glXGetFBConfigs(GLX_dpy->dpy, screen, &num_configs);
GLX_dpy->fbconfigs =
GLX_drv->glXGetFBConfigs(GLX_dpy->dpy, screen, &num_configs);
}
else {
XVisualInfo vinfo_template;
@@ -434,10 +491,14 @@ create_configs(_EGLDisplay *dpy, struct GLX_egl_display *GLX_dpy,
memset(&template, 0, sizeof(template));
_eglInitConfig(&template.Base, dpy, id);
if (GLX_dpy->have_fbconfig)
ok = convert_fbconfig(GLX_dpy->dpy, GLX_dpy->fbconfigs[i], &template);
else
ok = convert_visual(GLX_dpy->dpy, &GLX_dpy->visuals[i], &template);
if (GLX_dpy->have_fbconfig) {
ok = convert_fbconfig(GLX_drv, GLX_dpy,
GLX_dpy->fbconfigs[i], &template);
}
else {
ok = convert_visual(GLX_drv, GLX_dpy,
&GLX_dpy->visuals[i], &template);
}
if (!ok)
continue;
@@ -462,13 +523,12 @@ create_configs(_EGLDisplay *dpy, struct GLX_egl_display *GLX_dpy,
static void
check_extensions(struct GLX_egl_display *GLX_dpy, EGLint screen)
check_extensions(struct GLX_egl_driver *GLX_drv,
struct GLX_egl_display *GLX_dpy, EGLint screen)
{
GLX_dpy->extensions =
glXQueryExtensionsString(GLX_dpy->dpy, screen);
GLX_drv->glXQueryExtensionsString(GLX_dpy->dpy, screen);
if (GLX_dpy->extensions) {
/* glXGetProcAddress is assumed */
if (strstr(GLX_dpy->extensions, "GLX_SGI_make_current_read")) {
/* GLX 1.3 entry points are used */
GLX_dpy->have_make_current_read = EGL_TRUE;
@@ -480,13 +540,8 @@ check_extensions(struct GLX_egl_display *GLX_dpy, EGLint screen)
}
if (strstr(GLX_dpy->extensions, "GLX_SGIX_pbuffer")) {
GLX_dpy->glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)
glXGetProcAddress((const GLubyte *) "glXCreateGLXPbufferSGIX");
GLX_dpy->glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)
glXGetProcAddress((const GLubyte *) "glXDestroyGLXPbufferSGIX");
if (GLX_dpy->glXCreateGLXPbufferSGIX &&
GLX_dpy->glXDestroyGLXPbufferSGIX &&
if (GLX_drv->glXCreateGLXPbufferSGIX &&
GLX_drv->glXDestroyGLXPbufferSGIX &&
GLX_dpy->have_fbconfig)
GLX_dpy->have_pbuffer = EGL_TRUE;
}
@@ -502,16 +557,17 @@ check_extensions(struct GLX_egl_display *GLX_dpy, EGLint screen)
static void
check_quirks(struct GLX_egl_display *GLX_dpy, EGLint screen)
check_quirks(struct GLX_egl_driver *GLX_drv,
struct GLX_egl_display *GLX_dpy, EGLint screen)
{
const char *vendor;
GLX_dpy->single_buffered_quirk = EGL_TRUE;
GLX_dpy->glx_window_quirk = EGL_TRUE;
vendor = glXGetClientString(GLX_dpy->dpy, GLX_VENDOR);
vendor = GLX_drv->glXGetClientString(GLX_dpy->dpy, GLX_VENDOR);
if (vendor && strstr(vendor, "NVIDIA")) {
vendor = glXQueryServerString(GLX_dpy->dpy, screen, GLX_VENDOR);
vendor = GLX_drv->glXQueryServerString(GLX_dpy->dpy, screen, GLX_VENDOR);
if (vendor && strstr(vendor, "NVIDIA")) {
_eglLog(_EGL_DEBUG, "disable quirks");
GLX_dpy->single_buffered_quirk = EGL_FALSE;
@@ -525,16 +581,21 @@ check_quirks(struct GLX_egl_display *GLX_dpy, EGLint screen)
* Called via eglInitialize(), GLX_drv->API.Initialize().
*/
static EGLBoolean
GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
EGLint *major, EGLint *minor)
GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy;
(void) drv;
if (disp->Platform != _EGL_PLATFORM_X11)
return EGL_FALSE;
/* this is a fallback driver */
if (!disp->Options.UseFallback)
return EGL_FALSE;
if (disp->Options.TestOnly)
return EGL_TRUE;
GLX_dpy = CALLOC_STRUCT(GLX_egl_display);
if (!GLX_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
@@ -549,7 +610,8 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
}
}
if (!glXQueryVersion(GLX_dpy->dpy, &GLX_dpy->glx_maj, &GLX_dpy->glx_min)) {
if (!GLX_drv->glXQueryVersion(GLX_dpy->dpy,
&GLX_dpy->glx_maj, &GLX_dpy->glx_min)) {
_eglLog(_EGL_WARNING, "GLX: glXQueryVersion failed");
if (!disp->PlatformDisplay)
XCloseDisplay(GLX_dpy->dpy);
@@ -557,10 +619,13 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
return EGL_FALSE;
}
check_extensions(GLX_dpy, DefaultScreen(GLX_dpy->dpy));
check_quirks(GLX_dpy, DefaultScreen(GLX_dpy->dpy));
disp->DriverData = (void *) GLX_dpy;
disp->ClientAPIs = EGL_OPENGL_BIT;
create_configs(disp, GLX_dpy, DefaultScreen(GLX_dpy->dpy));
check_extensions(GLX_drv, GLX_dpy, DefaultScreen(GLX_dpy->dpy));
check_quirks(GLX_drv, GLX_dpy, DefaultScreen(GLX_dpy->dpy));
create_configs(drv, disp, DefaultScreen(GLX_dpy->dpy));
if (!_eglGetArraySize(disp->Configs)) {
_eglLog(_EGL_WARNING, "GLX: failed to create any config");
if (!disp->PlatformDisplay)
@@ -569,16 +634,14 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
return EGL_FALSE;
}
disp->DriverData = (void *) GLX_dpy;
disp->ClientAPIsMask = EGL_OPENGL_BIT;
/* we're supporting EGL 1.4 */
*major = 1;
*minor = 4;
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
}
/**
* Called via eglTerminate(), drv->API.Terminate().
*/
@@ -612,12 +675,11 @@ static _EGLContext *
GLX_eglCreateContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
_EGLContext *share_list, const EGLint *attrib_list)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_context *GLX_ctx = CALLOC_STRUCT(GLX_egl_context);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_context *GLX_ctx_shared = GLX_egl_context(share_list);
(void) drv;
if (!GLX_ctx) {
_eglError(EGL_BAD_ALLOC, "eglCreateContext");
return NULL;
@@ -628,19 +690,19 @@ GLX_eglCreateContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
return NULL;
}
if (GLX_dpy->have_fbconfig)
GLX_ctx->context =
glXCreateNewContext(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_RGBA_TYPE,
GLX_ctx_shared ? GLX_ctx_shared->context : NULL,
GL_TRUE);
else
GLX_ctx->context =
glXCreateContext(GLX_dpy->dpy,
&GLX_dpy->visuals[GLX_egl_config_index(conf)],
GLX_ctx_shared ? GLX_ctx_shared->context : NULL,
GL_TRUE);
if (GLX_dpy->have_fbconfig) {
GLX_ctx->context = GLX_drv->glXCreateNewContext(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_RGBA_TYPE,
GLX_ctx_shared ? GLX_ctx_shared->context : NULL,
GL_TRUE);
}
else {
GLX_ctx->context = GLX_drv->glXCreateContext(GLX_dpy->dpy,
&GLX_dpy->visuals[GLX_egl_config_index(conf)],
GLX_ctx_shared ? GLX_ctx_shared->context : NULL,
GL_TRUE);
}
if (!GLX_ctx->context) {
free(GLX_ctx);
return NULL;
@@ -673,6 +735,7 @@ static EGLBoolean
GLX_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
_EGLSurface *rsurf, _EGLContext *ctx)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_dsurf = GLX_egl_surface(dsurf);
struct GLX_egl_surface *GLX_rsurf = GLX_egl_surface(rsurf);
@@ -683,8 +746,6 @@ GLX_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
GLXContext cctx;
EGLBoolean ret = EGL_FALSE;
(void) drv;
/* make new bindings */
if (!_eglBindContext(ctx, dsurf, rsurf, &old_ctx, &old_dsurf, &old_rsurf))
return EGL_FALSE;
@@ -694,9 +755,9 @@ GLX_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
cctx = (GLX_ctx) ? GLX_ctx->context : NULL;
if (GLX_dpy->have_make_current_read)
ret = glXMakeContextCurrent(GLX_dpy->dpy, ddraw, rdraw, cctx);
ret = GLX_drv->glXMakeContextCurrent(GLX_dpy->dpy, ddraw, rdraw, cctx);
else if (ddraw == rdraw)
ret = glXMakeCurrent(GLX_dpy->dpy, ddraw, cctx);
ret = GLX_drv->glXMakeCurrent(GLX_dpy->dpy, ddraw, cctx);
if (ret) {
if (_eglPutSurface(old_dsurf))
@@ -747,12 +808,11 @@ GLX_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf;
uint width, height;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreateWindowSurface");
@@ -767,13 +827,14 @@ GLX_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *disp,
GLX_surf->drawable = window;
if (GLX_dpy->have_1_3 && !GLX_dpy->glx_window_quirk)
GLX_surf->glx_drawable =
glXCreateWindow(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->drawable, NULL);
else
if (GLX_dpy->have_1_3 && !GLX_dpy->glx_window_quirk) {
GLX_surf->glx_drawable = GLX_drv->glXCreateWindow(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->drawable, NULL);
}
else {
GLX_surf->glx_drawable = GLX_surf->drawable;
}
if (!GLX_surf->glx_drawable) {
free(GLX_surf);
@@ -781,7 +842,7 @@ GLX_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *disp,
}
if (GLX_dpy->have_1_3 && !GLX_dpy->glx_window_quirk)
GLX_surf->destroy = glXDestroyWindow;
GLX_surf->destroy = GLX_drv->glXDestroyWindow;
get_drawable_size(GLX_dpy->dpy, window, &width, &height);
GLX_surf->Base.Width = width;
@@ -795,12 +856,11 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativePixmapType pixmap,
const EGLint *attrib_list)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf;
uint width, height;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreatePixmapSurface");
@@ -816,25 +876,25 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *disp,
GLX_surf->drawable = pixmap;
if (GLX_dpy->have_1_3) {
GLX_surf->glx_drawable =
glXCreatePixmap(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->drawable, NULL);
GLX_surf->glx_drawable = GLX_drv->glXCreatePixmap(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->drawable, NULL);
}
else if (GLX_dpy->have_fbconfig) {
GLXFBConfig fbconfig = GLX_dpy->fbconfigs[GLX_egl_config_index(conf)];
XVisualInfo *vinfo = glXGetVisualFromFBConfig(GLX_dpy->dpy, fbconfig);
XVisualInfo *vinfo;
vinfo = GLX_drv->glXGetVisualFromFBConfig(GLX_dpy->dpy, fbconfig);
if (vinfo) {
GLX_surf->glx_drawable =
glXCreateGLXPixmap(GLX_dpy->dpy, vinfo, GLX_surf->drawable);
GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPixmap(GLX_dpy->dpy,
vinfo, GLX_surf->drawable);
XFree(vinfo);
}
}
else {
GLX_surf->glx_drawable =
glXCreateGLXPixmap(GLX_dpy->dpy,
&GLX_dpy->visuals[GLX_egl_config_index(conf)],
GLX_surf->drawable);
GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPixmap(GLX_dpy->dpy,
&GLX_dpy->visuals[GLX_egl_config_index(conf)],
GLX_surf->drawable);
}
if (!GLX_surf->glx_drawable) {
@@ -843,7 +903,7 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *disp,
}
GLX_surf->destroy = (GLX_dpy->have_1_3) ?
glXDestroyPixmap : glXDestroyGLXPixmap;
GLX_drv->glXDestroyPixmap : GLX_drv->glXDestroyGLXPixmap;
get_drawable_size(GLX_dpy->dpy, pixmap, &width, &height);
GLX_surf->Base.Width = width;
@@ -856,13 +916,12 @@ static _EGLSurface *
GLX_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, const EGLint *attrib_list)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf;
int attribs[5];
int i;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreatePbufferSurface");
@@ -892,14 +951,11 @@ GLX_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *disp,
}
attribs[i] = None;
GLX_surf->glx_drawable =
glXCreatePbuffer(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
attribs);
GLX_surf->glx_drawable = GLX_drv->glXCreatePbuffer(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)], attribs);
}
else if (GLX_dpy->have_pbuffer) {
GLX_surf->glx_drawable = GLX_dpy->glXCreateGLXPbufferSGIX(
GLX_dpy->dpy,
GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPbufferSGIX(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->Base.Width,
GLX_surf->Base.Height,
@@ -912,7 +968,7 @@ GLX_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *disp,
}
GLX_surf->destroy = (GLX_dpy->have_1_3) ?
glXDestroyPbuffer : GLX_dpy->glXDestroyGLXPbufferSGIX;
GLX_drv->glXDestroyPbuffer : GLX_drv->glXDestroyGLXPbufferSGIX;
return &GLX_surf->Base;
}
@@ -933,12 +989,11 @@ GLX_eglDestroySurface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
static EGLBoolean
GLX_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf = GLX_egl_surface(draw);
(void) drv;
glXSwapBuffers(GLX_dpy->dpy, GLX_surf->glx_drawable);
GLX_drv->glXSwapBuffers(GLX_dpy->dpy, GLX_surf->glx_drawable);
return EGL_TRUE;
}
@@ -949,31 +1004,33 @@ GLX_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
static _EGLProc
GLX_eglGetProcAddress(_EGLDriver *drv, const char *procname)
{
(void) drv;
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
return (_EGLProc) glXGetProcAddress((const GLubyte *) procname);
return (_EGLProc) GLX_drv->glXGetProcAddress((const GLubyte *) procname);
}
static EGLBoolean
GLX_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
{
(void) drv;
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
(void) dpy;
(void) ctx;
glXWaitGL();
GLX_drv->glXWaitGL();
return EGL_TRUE;
}
static EGLBoolean
GLX_eglWaitNative(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine)
{
(void) drv;
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
(void) dpy;
if (engine != EGL_CORE_NATIVE_ENGINE)
return _eglError(EGL_BAD_PARAMETER, "eglWaitNative");
glXWaitX();
GLX_drv->glXWaitX();
return EGL_TRUE;
}
@@ -981,16 +1038,90 @@ static void
GLX_Unload(_EGLDriver *drv)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
if (GLX_drv->handle)
dlclose(GLX_drv->handle);
free(GLX_drv);
}
static EGLBoolean
GLX_Load(_EGLDriver *drv)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
void *handle;
handle = dlopen("libGL.so", RTLD_LAZY | RTLD_LOCAL);
if (!handle)
goto fail;
GLX_drv->glXGetProcAddress = dlsym(handle, "glXGetProcAddress");
if (!GLX_drv->glXGetProcAddress)
GLX_drv->glXGetProcAddress = dlsym(handle, "glXGetProcAddressARB");
if (!GLX_drv->glXGetProcAddress)
goto fail;
#define GET_PROC(proc_type, proc_name, check) \
do { \
GLX_drv->proc_name = (proc_type) \
GLX_drv->glXGetProcAddress((const GLubyte *) #proc_name); \
if (check && !GLX_drv->proc_name) goto fail; \
} while (0)
/* GLX 1.0 */
GET_PROC(GLXCREATECONTEXTPROC, glXCreateContext, EGL_TRUE);
GET_PROC(GLXDESTROYCONTEXTPROC, glXDestroyContext, EGL_TRUE);
GET_PROC(GLXMAKECURRENTPROC, glXMakeCurrent, EGL_TRUE);
GET_PROC(GLXSWAPBUFFERSPROC, glXSwapBuffers, EGL_TRUE);
GET_PROC(GLXCREATEGLXPIXMAPPROC, glXCreateGLXPixmap, EGL_TRUE);
GET_PROC(GLXDESTROYGLXPIXMAPPROC, glXDestroyGLXPixmap, EGL_TRUE);
GET_PROC(GLXQUERYVERSIONPROC, glXQueryVersion, EGL_TRUE);
GET_PROC(GLXGETCONFIGPROC, glXGetConfig, EGL_TRUE);
GET_PROC(GLXWAITGLPROC, glXWaitGL, EGL_TRUE);
GET_PROC(GLXWAITXPROC, glXWaitX, EGL_TRUE);
/* GLX 1.1 */
GET_PROC(GLXQUERYEXTENSIONSSTRINGPROC, glXQueryExtensionsString, EGL_TRUE);
GET_PROC(GLXQUERYSERVERSTRINGPROC, glXQueryServerString, EGL_TRUE);
GET_PROC(GLXGETCLIENTSTRINGPROC, glXGetClientString, EGL_TRUE);
/* GLX 1.3 */
GET_PROC(PFNGLXGETFBCONFIGSPROC, glXGetFBConfigs, EGL_FALSE);
GET_PROC(PFNGLXGETFBCONFIGATTRIBPROC, glXGetFBConfigAttrib, EGL_FALSE);
GET_PROC(PFNGLXGETVISUALFROMFBCONFIGPROC, glXGetVisualFromFBConfig, EGL_FALSE);
GET_PROC(PFNGLXCREATEWINDOWPROC, glXCreateWindow, EGL_FALSE);
GET_PROC(PFNGLXDESTROYWINDOWPROC, glXDestroyWindow, EGL_FALSE);
GET_PROC(PFNGLXCREATEPIXMAPPROC, glXCreatePixmap, EGL_FALSE);
GET_PROC(PFNGLXDESTROYPIXMAPPROC, glXDestroyPixmap, EGL_FALSE);
GET_PROC(PFNGLXCREATEPBUFFERPROC, glXCreatePbuffer, EGL_FALSE);
GET_PROC(PFNGLXDESTROYPBUFFERPROC, glXDestroyPbuffer, EGL_FALSE);
GET_PROC(PFNGLXCREATENEWCONTEXTPROC, glXCreateNewContext, EGL_FALSE);
GET_PROC(PFNGLXMAKECONTEXTCURRENTPROC, glXMakeContextCurrent, EGL_FALSE);
/* GLX_SGIX_pbuffer */
GET_PROC(PFNGLXCREATEGLXPBUFFERSGIXPROC,
glXCreateGLXPbufferSGIX, EGL_FALSE);
GET_PROC(PFNGLXDESTROYGLXPBUFFERSGIXPROC,
glXDestroyGLXPbufferSGIX, EGL_FALSE);
#undef GET_PROC
GLX_drv->handle = handle;
return EGL_TRUE;
fail:
if (handle)
dlclose(handle);
return EGL_FALSE;
}
/**
* This is the main entrypoint into the driver, called by libEGL.
* Create a new _EGLDriver object and init its dispatch table.
*/
_EGLDriver *
_eglMain(const char *args)
_EGL_MAIN(const char *args)
{
struct GLX_egl_driver *GLX_drv = CALLOC_STRUCT(GLX_egl_driver);
@@ -999,6 +1130,12 @@ _eglMain(const char *args)
if (!GLX_drv)
return NULL;
if (!GLX_Load(&GLX_drv->Base)) {
_eglLog(_EGL_WARNING, "GLX: failed to load GLX");
free(GLX_drv);
return NULL;
}
_eglInitDriverFallbacks(&GLX_drv->Base);
GLX_drv->Base.API.Initialize = GLX_eglInitialize;
GLX_drv->Base.API.Terminate = GLX_eglTerminate;

View File

@@ -52,12 +52,31 @@ OBJECTS = $(SOURCES:.c=.o)
# use dl*() to load drivers
LOCAL_CFLAGS = -D_EGL_OS_UNIX=1
LOCAL_LIBS =
# egl_dri2 and egl_glx are built-ins
ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif
EGL_LIB_DEPS += $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
endif
ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a
EGL_LIB_DEPS += $(X11_LIBS) $(DLOPEN_LIBS)
endif
# translate --with-egl-platforms to _EGLPlatformType
EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM
ifeq ($(firstword $(EGL_PLATFORMS)),x11)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11
endif
ifeq ($(firstword $(EGL_PLATFORMS)),wayland)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WAYLAND
endif
ifeq ($(firstword $(EGL_PLATFORMS)),drm)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM
endif
@@ -80,11 +99,12 @@ default: depend library
# EGL Library
library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS)
$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS) $(LOCAL_LIBS)
$(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(EGL_MAJOR) -minor $(EGL_MINOR) \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
$(EGL_LIB_DEPS) $(OBJECTS)
-L$(TOP)/$(LIB_DIR) $(EGL_LIB_DEPS) \
$(OBJECTS) $(LOCAL_LIBS)
install-headers:
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/KHR

View File

@@ -7,13 +7,23 @@ Import('*')
env = env.Clone()
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
'_EGL_BUILT_IN_DRIVER_GALLIUM',
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
'_EGL_OS_WINDOWS',
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
if env['platform'] == 'windows':
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
'_EGL_OS_WINDOWS',
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
else:
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11',
'_EGL_OS_UNIX',
])
env.Append(CPPPATH = [
'#/include',
])
@@ -38,15 +48,9 @@ egl_sources = [
'eglsync.c',
]
egl = env.SharedLibrary(
target = 'libEGL',
source = egl_sources + ['egl.def'],
egl = env.ConvenienceLibrary(
target = 'egl',
source = egl_sources,
)
installed_egl = env.InstallSharedLibrary(egl, version=(1, 4, 0))
env.Alias('egl', installed_egl)
egl = [env.FindIxes(egl, 'LIBPREFIX', 'LIBSUFFIX')]
Export('egl')

View File

@@ -57,7 +57,6 @@
#include <stdlib.h>
#include <string.h>
#include "eglstring.h"
#include "eglcontext.h"
#include "egldisplay.h"
#include "egltypedefs.h"
@@ -294,16 +293,14 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
if (!_eglMatchDriver(disp, EGL_FALSE))
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
_eglsnprintf(disp->Version, sizeof(disp->Version), "%d.%d (%s)",
disp->APImajor, disp->APIminor, disp->Driver->Name);
/* limit to APIs supported by core */
disp->ClientAPIsMask &= _EGL_API_ALL_BITS;
disp->ClientAPIs &= _EGL_API_ALL_BITS;
}
/* Update applications version of major and minor if not NULL */
if ((major != NULL) && (minor != NULL)) {
*major = disp->APImajor;
*minor = disp->APIminor;
*major = disp->VersionMajor;
*minor = disp->VersionMinor;
}
RETURN_EGL_SUCCESS(disp, EGL_TRUE);
@@ -917,11 +914,12 @@ eglGetProcAddress(const char *procname)
{ "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA },
{ "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA },
#endif
#ifdef EGL_WL_bind_display
{ "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL },
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
#endif
#ifdef EGL_ANDROID_swap_rectangle
{ "eglSetSwapRectangleANDROID", (_EGLProc) eglSetSwapRectangleANDROID },
#endif
#ifdef EGL_ANDROID_get_render_buffer
{ "eglGetRenderBufferANDROID", (_EGLProc) eglGetRenderBufferANDROID },
#endif
{ NULL, NULL }
};
@@ -1501,8 +1499,47 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image,
#endif
#ifdef EGL_ANDROID_swap_rectangle
#ifdef EGL_WL_bind_wayland_display
struct wl_display;
EGLBoolean EGLAPIENTRY
eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.WL_bind_wayland_display);
if (!display)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
ret = drv->API.BindWaylandDisplayWL(drv, disp, display);
RETURN_EGL_EVAL(disp, ret);
}
EGLBoolean EGLAPIENTRY
eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.WL_bind_wayland_display);
if (!display)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
ret = drv->API.UnbindWaylandDisplayWL(drv, disp, display);
RETURN_EGL_EVAL(disp, ret);
}
#endif
#ifdef EGL_ANDROID_swap_rectangle
EGLBoolean EGLAPIENTRY
eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw,
EGLint left, EGLint top,
@@ -1522,27 +1559,4 @@ eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw,
RETURN_EGL_EVAL(disp, ret);
}
#endif
#ifdef EGL_ANDROID_get_render_buffer
EGLClientBuffer EGLAPIENTRY
eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLSurface *surf = _eglLookupSurface(draw, disp);
_EGLDriver *drv;
EGLClientBuffer ret;
_EGL_CHECK_SURFACE(disp, surf, NULL, drv);
if (!disp->Extensions.ANDROID_get_render_buffer)
RETURN_EGL_EVAL(disp, NULL);
ret = drv->API.GetRenderBufferANDROID(drv, disp, surf);
RETURN_EGL_EVAL(disp, ret);
}
#endif

View File

@@ -12,7 +12,7 @@ typedef void (*_EGLProc)(void);
*/
/* driver funcs */
typedef EGLBoolean (*Initialize_t)(_EGLDriver *, _EGLDisplay *dpy, EGLint *major, EGLint *minor);
typedef EGLBoolean (*Initialize_t)(_EGLDriver *, _EGLDisplay *dpy);
typedef EGLBoolean (*Terminate_t)(_EGLDriver *, _EGLDisplay *dpy);
/* config funcs */
@@ -95,12 +95,14 @@ typedef _EGLImage *(*CreateDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, c
typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#ifdef EGL_ANDROID_swap_rectangle
typedef EGLBoolean (*SetSwapRectangleANDROID_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw, EGLint left, EGLint top, EGLint width, EGLint height);
#ifdef EGL_WL_bind_wayland_display
struct wl_display;
typedef EGLBoolean (*BindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
#endif
#ifdef EGL_ANDROID_get_render_buffer
typedef EGLClientBuffer (*GetRenderBufferANDROID_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw);
#ifdef EGL_ANDROID_swap_rectangle
typedef EGLBoolean (*SetSwapRectangleANDROID_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif
/**
@@ -178,12 +180,14 @@ struct _egl_api
ExportDRMImageMESA_t ExportDRMImageMESA;
#endif
#ifdef EGL_WL_bind_wayland_display
BindWaylandDisplayWL_t BindWaylandDisplayWL;
UnbindWaylandDisplayWL_t UnbindWaylandDisplayWL;
#endif
#ifdef EGL_ANDROID_swap_rectangle
SetSwapRectangleANDROID_t SetSwapRectangleANDROID;
#endif
#ifdef EGL_ANDROID_get_render_buffer
GetRenderBufferANDROID_t GetRenderBufferANDROID;
#endif
};
#endif /* EGLAPI_INCLUDED */

View File

@@ -286,6 +286,9 @@ _eglError(EGLint errCode, const char *msg)
case EGL_BAD_SURFACE:
s = "EGL_BAD_SURFACE";
break;
case EGL_NOT_INITIALIZED:
s = "EGL_NOT_INITIALIZED";
break;
#ifdef EGL_MESA_screen_surface
case EGL_BAD_SCREEN_MESA:
s = "EGL_BAD_SCREEN_MESA";
@@ -295,7 +298,7 @@ _eglError(EGLint errCode, const char *msg)
break;
#endif
default:
s = "other";
s = "other EGL error";
}
_eglLog(_EGL_DEBUG, "EGL user error 0x%x (%s) in %s\n", errCode, s, msg);
}

View File

@@ -27,6 +27,7 @@ _eglGetNativePlatformFromEnv(void)
} egl_platforms[_EGL_NUM_PLATFORMS] = {
{ _EGL_PLATFORM_WINDOWS, "gdi" },
{ _EGL_PLATFORM_X11, "x11" },
{ _EGL_PLATFORM_WAYLAND, "wayland" },
{ _EGL_PLATFORM_DRM, "drm" },
{ _EGL_PLATFORM_FBDEV, "fbdev" },
{ _EGL_PLATFORM_ANDROID, "android" }

View File

@@ -11,6 +11,7 @@
enum _egl_platform_type {
_EGL_PLATFORM_WINDOWS,
_EGL_PLATFORM_X11,
_EGL_PLATFORM_WAYLAND,
_EGL_PLATFORM_DRM,
_EGL_PLATFORM_FBDEV,
_EGL_PLATFORM_ANDROID,
@@ -58,6 +59,8 @@ struct _egl_extensions
EGLBoolean MESA_drm_display;
EGLBoolean MESA_drm_image;
EGLBoolean WL_bind_wayland_display;
EGLBoolean KHR_image_base;
EGLBoolean KHR_image_pixmap;
EGLBoolean KHR_vg_parent_image;
@@ -78,9 +81,6 @@ struct _egl_extensions
EGLBoolean ANDROID_image_native_buffer;
EGLBoolean ANDROID_swap_rectangle;
EGLBoolean ANDROID_get_render_buffer;
char String[_EGL_MAX_EXTENSIONS_LEN];
};
@@ -91,21 +91,29 @@ struct _egl_display
_EGLMutex Mutex;
_EGLPlatformType Platform;
void *PlatformDisplay;
_EGLPlatformType Platform; /**< The type of the platform display */
void *PlatformDisplay; /**< A pointer to the platform display */
EGLBoolean Initialized; /**< True if the display is initialized */
_EGLDriver *Driver;
void *DriverData; /* private to driver */
_EGLDriver *Driver; /**< Matched driver of the display */
EGLBoolean Initialized; /**< True if the display is initialized */
int APImajor, APIminor; /**< as returned by eglInitialize() */
char Version[1000]; /**< initialized from APImajor/minor, DriverName */
/* options that affect how the driver initializes the display */
struct {
EGLBoolean TestOnly; /**< Driver should not set fields when true */
EGLBoolean UseFallback; /**< Use fallback driver (sw or less features) */
} Options;
/** Bitmask of supported APIs (EGL_xx_BIT) set by the driver during init */
EGLint ClientAPIsMask;
char ClientAPIs[1000]; /**< updated by eglQueryString */
/* these fields are set by the driver during init */
void *DriverData; /**< Driver private data */
EGLint VersionMajor; /**< EGL major version */
EGLint VersionMinor; /**< EGL minor version */
EGLint ClientAPIs; /**< Bitmask of APIs supported (EGL_xxx_BIT) */
_EGLExtensions Extensions; /**< Extensions supported */
_EGLExtensions Extensions;
/* these fields are derived from above */
char VersionString[1000]; /**< EGL_VERSION */
char ClientAPIsString[1000]; /**< EGL_CLIENT_APIS */
char ExtensionsString[_EGL_MAX_EXTENSIONS_LEN]; /**< EGL_EXTENSIONS */
_EGLArray *Screens;
_EGLArray *Configs;

View File

@@ -25,6 +25,7 @@
typedef struct _egl_module {
char *Path;
_EGLMain_t BuiltIn;
void *Handle;
_EGLDriver *Driver;
} _EGLModule;
@@ -32,6 +33,24 @@ typedef struct _egl_module {
static _EGL_DECLARE_MUTEX(_eglModuleMutex);
static _EGLArray *_eglModules;
const struct {
const char *name;
_EGLMain_t main;
} _eglBuiltInDrivers[] = {
#ifdef _EGL_BUILT_IN_DRIVER_GALLIUM
{ "egl_gallium", _eglBuiltInDriverGALLIUM },
#endif
#ifdef _EGL_BUILT_IN_DRIVER_ANDROID
{ "egl_android", _eglBuiltInDriverANDROID },
#endif
#ifdef _EGL_BUILT_IN_DRIVER_DRI2
{ "egl_dri2", _eglBuiltInDriverDRI2 },
#endif
#ifdef _EGL_BUILT_IN_DRIVER_GLX
{ "egl_glx", _eglBuiltInDriverGLX },
#endif
{ NULL, NULL }
};
/**
* Wrappers for dlopen/dlclose()
@@ -86,30 +105,6 @@ library_suffix(void)
}
#else /* _EGL_PLATFORM_NO_OS */
typedef void *lib_handle;
static INLINE void *
open_library(const char *filename)
{
return (void *) filename;
}
static INLINE void
close_library(void *lib)
{
}
static const char *
library_suffix(void)
{
return NULL;
}
#endif
@@ -147,16 +142,11 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle)
else {
error = dlerror();
}
#else /* _EGL_PLATFORM_NO_OS */
mainFunc = (_EGLMain_t) _eglMain;
#endif
if (!lib) {
_eglLog(_EGL_WARNING, "Could not open driver %s (%s)",
driverPath, error);
if (!getenv("EGL_DRIVER"))
_eglLog(_EGL_WARNING,
"The driver can be overridden by setting EGL_DRIVER");
return NULL;
}
@@ -183,9 +173,18 @@ _eglLoadModule(_EGLModule *mod)
lib_handle lib;
_EGLDriver *drv;
mainFunc = _eglOpenLibrary(mod->Path, &lib);
if (!mainFunc)
return EGL_FALSE;
if (mod->Driver)
return EGL_TRUE;
if (mod->BuiltIn) {
lib = (lib_handle) NULL;
mainFunc = mod->BuiltIn;
}
else {
mainFunc = _eglOpenLibrary(mod->Path, &lib);
if (!mainFunc)
return EGL_FALSE;
}
drv = mainFunc(NULL);
if (!drv) {
@@ -212,11 +211,22 @@ _eglLoadModule(_EGLModule *mod)
static void
_eglUnloadModule(_EGLModule *mod)
{
#if defined(_EGL_OS_UNIX)
/* destroy the driver */
if (mod->Driver && mod->Driver->Unload)
mod->Driver->Unload(mod->Driver);
/*
* XXX At this point (atexit), the module might be the last reference to
* libEGL. Closing the module might unmap libEGL and give problems.
*/
#if 0
if (mod->Handle)
close_library(mod->Handle);
#endif
#elif defined(_EGL_OS_WINDOWS)
/* XXX Windows unloads DLLs before atexit */
#endif
mod->Driver = NULL;
mod->Handle = NULL;
@@ -327,68 +337,6 @@ _eglLoaderFile(const char *dir, size_t len, void *loader_data)
}
/**
* A loader function for use with _eglPreloadForEach. The loader data is the
* pattern (prefix) of the files to look for.
*/
static EGLBoolean
_eglLoaderPattern(const char *dir, size_t len, void *loader_data)
{
#if defined(_EGL_OS_UNIX)
const char *prefix, *suffix;
size_t prefix_len, suffix_len;
DIR *dirp;
struct dirent *dirent;
char path[1024];
if (len + 2 > sizeof(path))
return EGL_TRUE;
if (len) {
memcpy(path, dir, len);
path[len++] = '/';
}
path[len] = '\0';
dirp = opendir(path);
if (!dirp)
return EGL_TRUE;
prefix = (const char *) loader_data;
prefix_len = strlen(prefix);
suffix = library_suffix();
suffix_len = (suffix) ? strlen(suffix) : 0;
while ((dirent = readdir(dirp))) {
size_t dirent_len = strlen(dirent->d_name);
const char *p;
/* match the prefix */
if (strncmp(dirent->d_name, prefix, prefix_len) != 0)
continue;
/* match the suffix */
if (suffix) {
p = dirent->d_name + dirent_len - suffix_len;
if (p < dirent->d_name || strcmp(p, suffix) != 0)
continue;
}
/* make a full path and add it to the module array */
if (len + dirent_len + 1 <= sizeof(path)) {
strcpy(path + len, dirent->d_name);
_eglAddModule(path);
}
}
closedir(dirp);
return EGL_TRUE;
#else /* _EGL_OS_UNIX */
/* stop immediately */
return EGL_FALSE;
#endif
}
/**
* Run the callback function on each driver directory.
*
@@ -487,11 +435,12 @@ _eglGetSearchPath(void)
*
* The user driver is specified by EGL_DRIVER.
*/
static void
static EGLBoolean
_eglAddUserDriver(void)
{
const char *search_path = _eglGetSearchPath();
char *env;
size_t name_len = 0;
env = getenv("EGL_DRIVER");
#if defined(_EGL_OS_UNIX)
@@ -503,39 +452,73 @@ _eglAddUserDriver(void)
env = NULL;
}
}
#endif /* _EGL_OS_UNIX */
else if (env) {
char *suffix = strchr(env, '.');
name_len = (suffix) ? suffix - env : strlen(env);
}
#else
if (env)
name_len = strlen(env);
#endif /* _EGL_OS_UNIX */
/*
* Try built-in drivers first if we know the driver name. This makes sure
* we do not load the outdated external driver that is still on the
* filesystem.
*/
if (name_len) {
_EGLModule *mod;
EGLint i;
for (i = 0; _eglBuiltInDrivers[i].name; i++) {
if (strlen(_eglBuiltInDrivers[i].name) == name_len &&
!strncmp(_eglBuiltInDrivers[i].name, env, name_len)) {
mod = _eglAddModule(env);
if (mod)
mod->BuiltIn = _eglBuiltInDrivers[i].main;
return EGL_TRUE;
}
}
}
/* otherwise, treat env as a path */
if (env) {
_eglPreloadForEach(search_path, _eglLoaderFile, (void *) env);
return EGL_TRUE;
}
return EGL_FALSE;
}
/**
* Add default drivers to the module array.
* Add egl_gallium to the module array.
*/
static void
_eglAddDefaultDrivers(void)
_eglAddGalliumDriver(void)
{
const char *search_path = _eglGetSearchPath();
EGLint i;
#if defined(_EGL_OS_WINDOWS)
const char *DefaultDriverNames[] = {
"egl_gallium"
};
#elif defined(_EGL_OS_UNIX)
const char *DefaultDriverNames[] = {
"egl_gallium",
"egl_dri2",
"egl_glx"
};
#else /* _EGL_PLATFORM_NO_OS */
const char *DefaultDriverNames[] = {
"<builtin>"
};
#ifndef _EGL_BUILT_IN_DRIVER_GALLIUM
void *external = (void *) "egl_gallium";
_eglPreloadForEach(_eglGetSearchPath(), _eglLoaderFile, external);
#endif
}
for (i = 0; i < ARRAY_SIZE(DefaultDriverNames); i++) {
void *name = (void *) DefaultDriverNames[i];
_eglPreloadForEach(search_path, _eglLoaderFile, name);
/**
* Add built-in drivers to the module array.
*/
static void
_eglAddBuiltInDrivers(void)
{
_EGLModule *mod;
EGLint i;
for (i = 0; _eglBuiltInDrivers[i].name; i++) {
mod = _eglAddModule(_eglBuiltInDrivers[i].name);
if (mod)
mod->BuiltIn = _eglBuiltInDrivers[i].main;
}
}
@@ -550,113 +533,96 @@ _eglAddDrivers(void)
if (_eglModules)
return EGL_TRUE;
/* the order here decides the priorities of the drivers */
_eglAddUserDriver();
_eglAddDefaultDrivers();
_eglPreloadForEach(_eglGetSearchPath(), _eglLoaderPattern, (void *) "egl_");
if (!_eglAddUserDriver()) {
/*
* Add other drivers only when EGL_DRIVER is not set. The order here
* decides the priorities.
*/
_eglAddGalliumDriver();
_eglAddBuiltInDrivers();
}
return (_eglModules != NULL);
}
/**
* Match a display to a driver. The display is initialized unless use_probe is
* true.
*
* The matching is done by finding the first driver that can initialize the
* display, or when use_probe is true, the driver with highest score.
* A helper function for _eglMatchDriver. It finds the first driver that can
* initialize the display and return.
*/
static _EGLDriver *
_eglMatchAndInitialize(_EGLDisplay *dpy)
{
_EGLDriver *drv = NULL;
EGLint i = 0;
if (!_eglAddDrivers()) {
_eglLog(_EGL_WARNING, "failed to find any driver");
return NULL;
}
if (dpy->Driver) {
drv = dpy->Driver;
/* no re-matching? */
if (!drv->API.Initialize(drv, dpy))
drv = NULL;
return drv;
}
while (i < _eglModules->Size) {
_EGLModule *mod = (_EGLModule *) _eglModules->Elements[i];
if (!_eglLoadModule(mod)) {
/* remove invalid modules */
_eglEraseArray(_eglModules, i, _eglFreeModule);
continue;
}
if (mod->Driver->API.Initialize(mod->Driver, dpy)) {
drv = mod->Driver;
break;
}
else {
i++;
}
}
return drv;
}
/**
* Match a display to a driver. The display is initialized unless test_only is
* true. The matching is done by finding the first driver that can initialize
* the display.
*/
_EGLDriver *
_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean use_probe)
_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only)
{
_EGLModule *mod;
_EGLDriver *best_drv = NULL;
EGLint best_score = 0;
EGLint major, minor, i;
_EGLDriver *best_drv;
assert(!dpy->Initialized);
_eglLockMutex(&_eglModuleMutex);
if (!_eglAddDrivers()) {
_eglUnlockMutex(&_eglModuleMutex);
return EGL_FALSE;
}
/* set options */
dpy->Options.TestOnly = test_only;
dpy->Options.UseFallback = EGL_FALSE;
/* match the loaded modules */
for (i = 0; i < _eglModules->Size; i++) {
mod = (_EGLModule *) _eglModules->Elements[i];
if (!mod->Driver)
break;
if (use_probe) {
EGLint score = (mod->Driver->Probe) ?
mod->Driver->Probe(mod->Driver, dpy) : 1;
if (score > best_score) {
best_drv = mod->Driver;
best_score = score;
}
}
else {
if (mod->Driver->API.Initialize(mod->Driver, dpy, &major, &minor)) {
best_drv = mod->Driver;
best_score = 100;
}
}
/* perfect match */
if (best_score >= 100)
break;
}
/* load more modules */
best_drv = _eglMatchAndInitialize(dpy);
if (!best_drv) {
EGLint first_unloaded = i;
while (i < _eglModules->Size) {
mod = (_EGLModule *) _eglModules->Elements[i];
assert(!mod->Driver);
if (!_eglLoadModule(mod)) {
/* remove invalid modules */
_eglEraseArray(_eglModules, i, _eglFreeModule);
continue;
}
if (use_probe) {
best_score = (mod->Driver->Probe) ?
mod->Driver->Probe(mod->Driver, dpy) : 1;
}
else {
if (mod->Driver->API.Initialize(mod->Driver, dpy, &major, &minor))
best_score = 100;
}
if (best_score > 0) {
best_drv = mod->Driver;
/* loaded modules come before unloaded ones */
if (first_unloaded != i) {
void *tmp = _eglModules->Elements[i];
_eglModules->Elements[i] =
_eglModules->Elements[first_unloaded];
_eglModules->Elements[first_unloaded] = tmp;
}
break;
}
else {
_eglUnloadModule(mod);
i++;
}
}
dpy->Options.UseFallback = EGL_TRUE;
best_drv = _eglMatchAndInitialize(dpy);
}
_eglUnlockMutex(&_eglModuleMutex);
if (best_drv) {
_eglLog(_EGL_DEBUG, "the best driver is %s (score %d)",
best_drv->Name, best_score);
if (!use_probe) {
_eglLog(_EGL_DEBUG, "the best driver is %s%s",
best_drv->Name, (test_only) ? " (test only) " : "");
if (!test_only) {
dpy->Driver = best_drv;
dpy->Initialized = EGL_TRUE;
dpy->APImajor = major;
dpy->APIminor = minor;
}
}
@@ -700,12 +666,7 @@ _eglUnloadDrivers(void)
{
/* this is called at atexit time */
if (_eglModules) {
#if defined(_EGL_OS_UNIX)
_eglDestroyArray(_eglModules, _eglFreeModule);
#elif defined(_EGL_OS_WINDOWS)
/* XXX Windows unloads DLLs before atexit */
_eglDestroyArray(_eglModules, NULL);
#endif
_eglModules = NULL;
}
}

View File

@@ -43,16 +43,6 @@ struct _egl_driver
{
const char *Name; /**< name of this driver */
/**
* Probe a display and return a score.
*
* Roughly,
* 50 means the driver supports the display;
* 90 means the driver can accelerate the display;
* 100 means a perfect match.
*/
EGLint (*Probe)(_EGLDriver *drv, _EGLDisplay *dpy);
/**
* Release the driver resource.
*
@@ -64,12 +54,28 @@ struct _egl_driver
};
extern _EGLDriver *
_eglBuiltInDriverGALLIUM(const char *args);
extern _EGLDriver *
_eglBuiltInDriverANDROID(const char *args);
extern _EGLDriver *
_eglBuiltInDriverDRI2(const char *args);
extern _EGLDriver *
_eglBuiltInDriverGLX(const char *args);
PUBLIC _EGLDriver *
_eglMain(const char *args);
extern _EGLDriver *
_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean probe_only);
_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only);
extern __eglMustCastToProperFunctionPointerType

View File

@@ -36,6 +36,8 @@
#include "eglcurrent.h"
#include "eglmisc.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglstring.h"
/**
@@ -73,11 +75,11 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
do { \
if (dpy->Extensions.ext) { \
_eglAppendExtension(&exts, "EGL_" #ext); \
assert(exts <= dpy->Extensions.String + _EGL_MAX_EXTENSIONS_LEN); \
assert(exts <= dpy->ExtensionsString + _EGL_MAX_EXTENSIONS_LEN); \
} \
} while (0)
char *exts = dpy->Extensions.String;
char *exts = dpy->ExtensionsString;
if (exts[0])
return;
@@ -87,6 +89,8 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(MESA_drm_display);
_EGL_CHECK_EXTENSION(MESA_drm_image);
_EGL_CHECK_EXTENSION(WL_bind_wayland_display);
_EGL_CHECK_EXTENSION(KHR_image_base);
_EGL_CHECK_EXTENSION(KHR_image_pixmap);
if (dpy->Extensions.KHR_image_base && dpy->Extensions.KHR_image_pixmap)
@@ -110,7 +114,6 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
_EGL_CHECK_EXTENSION(ANDROID_swap_rectangle);
_EGL_CHECK_EXTENSION(ANDROID_get_render_buffer);
#undef _EGL_CHECK_EXTENSION
}
@@ -118,24 +121,24 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
static void
_eglUpdateAPIsString(_EGLDisplay *dpy)
{
char *apis = dpy->ClientAPIs;
char *apis = dpy->ClientAPIsString;
if (apis[0] || !dpy->ClientAPIsMask)
if (apis[0] || !dpy->ClientAPIs)
return;
if (dpy->ClientAPIsMask & EGL_OPENGL_BIT)
if (dpy->ClientAPIs & EGL_OPENGL_BIT)
strcat(apis, "OpenGL ");
if (dpy->ClientAPIsMask & EGL_OPENGL_ES_BIT)
if (dpy->ClientAPIs & EGL_OPENGL_ES_BIT)
strcat(apis, "OpenGL_ES ");
if (dpy->ClientAPIsMask & EGL_OPENGL_ES2_BIT)
if (dpy->ClientAPIs & EGL_OPENGL_ES2_BIT)
strcat(apis, "OpenGL_ES2 ");
if (dpy->ClientAPIsMask & EGL_OPENVG_BIT)
if (dpy->ClientAPIs & EGL_OPENVG_BIT)
strcat(apis, "OpenVG ");
assert(strlen(apis) < sizeof(dpy->ClientAPIs));
assert(strlen(apis) < sizeof(dpy->ClientAPIsString));
}
@@ -143,20 +146,21 @@ const char *
_eglQueryString(_EGLDriver *drv, _EGLDisplay *dpy, EGLint name)
{
(void) drv;
(void) dpy;
switch (name) {
case EGL_VENDOR:
return _EGL_VENDOR_STRING;
case EGL_VERSION:
return dpy->Version;
_eglsnprintf(dpy->VersionString, sizeof(dpy->VersionString),
"%d.%d (%s)", dpy->VersionMajor, dpy->VersionMinor,
dpy->Driver->Name);
return dpy->VersionString;
case EGL_EXTENSIONS:
_eglUpdateExtensionsString(dpy);
return dpy->Extensions.String;
#ifdef EGL_VERSION_1_2
return dpy->ExtensionsString;
case EGL_CLIENT_APIS:
_eglUpdateAPIsString(dpy);
return dpy->ClientAPIs;
#endif
return dpy->ClientAPIsString;
default:
_eglError(EGL_BAD_PARAMETER, "eglQueryString");
return NULL;

View File

@@ -2,6 +2,7 @@
#define EGLSTRING_INCLUDED
#include <string.h>
#include <stdio.h>
#ifdef _EGL_OS_WINDOWS
#define _eglstrcasecmp _stricmp

30
src/egl/wayland/Makefile Normal file
View File

@@ -0,0 +1,30 @@
# src/egl/wayland/Makefile
TOP = ../../..
include $(TOP)/configs/current
SUBDIRS = wayland-drm wayland-egl
default: subdirs
subdirs:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
install:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
done
clean:
-@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done

View File

@@ -0,0 +1,3 @@
wayland-drm-client-protocol.h
wayland-drm-server-protocol.h
wayland-drm-protocol.c

View File

@@ -0,0 +1,45 @@
# src/egl/wayland/wayland-drm/Makefile
TOP = ../../../..
include $(TOP)/configs/current
GEN_SOURCES = wayland-drm-protocol.c
GEN_HEADERS = wayland-drm-client-protocol.h wayland-drm-server-protocol.h
wayland_drm_SOURCES = wayland-drm.c $(GEN_SOURCES)
wayland_drm_OBJECTS = $(wayland_drm_SOURCES:.c=.o)
wayland_drm_INCLUDES = \
$(WAYLAND_CFLAGS) \
-I$(TOP)/src/egl/main
# Generate protocol sources
prefix=$(shell pkg-config --variable=prefix wayland-server)
exec_prefx=$(shell pkg-config --variable=exec_prefix wayland-server)
wayland_protocoldir = $(PWD)/protocol
wayland_scanner=$(exec_prefix)/bin/wayland-scanner
default: depend libwayland-drm.a $(GEN_SOURCES) $(GEN_HEADERS)
libwayland-drm.a: $(wayland_drm_OBJECTS) Makefile
$(MKLIB) -o wayland-drm -static $(wayland_drm_OBJECTS)
depend:
rm -f depend
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(wayland_drm_INCLUDES) $(wayland_drm_SOURCES) 2> /dev/null
clean:
rm -rf libwayland-drm.a $(wayland_drm_OBJECTS) \
$(GEN_SOURCES) $(GEN_HEADERS)
install:
@echo -n ""
$(wayland_drm_OBJECTS): %.o: %.c $(GEN_HEADERS)
$(CC) -c $(wayland_drm_INCLUDES) $(CFLAGS) $< -o $@
include $(prefix)/share/aclocal/wayland-scanner.mk
sinclude depend

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="drm">
<!-- drm support. This object is created by the server and published
using the display's global event. -->
<interface name="drm" version="1">
<!-- Call this request with the magic received from drmGetMagic().
It will be passed on to the drmAuthMagic() or
DRIAuthConnection() call. This authentication must be
completed before create_buffer could be used. -->
<request name="authenticate">
<arg name="id" type="uint"/>
</request>
<!-- Create a wayland buffer for the named DRM buffer. The DRM
surface must have a name using the flink ioctl -->
<request name="create_buffer">
<arg name="id" type="new_id" interface="buffer"/>
<arg name="name" type="uint"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="stride" type="uint"/>
<arg name="visual" type="object" interface="visual"/>
</request>
<!-- Notification of the path of the drm device which is used by
the server. The client should use this device for creating
local buffers. Only buffers created from this device should
be be passed to the server using this drm object's
create_buffer request. -->
<event name="device">
<arg name="name" type="string"/>
</event>
<!-- Raised if the authenticate request succeeded -->
<event name="authenticated"/>
</interface>
</protocol>

View File

@@ -0,0 +1,203 @@
/*
* Copyright © 2011 Kristian Høgsberg
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <wayland-server.h>
#include "wayland-drm.h"
#include "wayland-drm-server-protocol.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglimage.h"
#include "egltypedefs.h"
struct wl_drm {
struct wl_object object;
struct wl_display *display;
_EGLDisplay *edisp;
char *device_name;
authenticate_t authenticate;
};
static void
drm_buffer_damage(struct wl_buffer *buffer_base,
struct wl_surface *surface,
int32_t x, int32_t y, int32_t width, int32_t height)
{
}
static void
destroy_buffer(struct wl_resource *resource, struct wl_client *client)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) resource;
_EGLDriver *drv = buffer->drm->edisp->Driver;
drv->API.DestroyImageKHR(drv, buffer->drm->edisp, buffer->image);
free(buffer);
}
static void
buffer_destroy(struct wl_client *client, struct wl_buffer *buffer)
{
wl_resource_destroy(&buffer->resource, client);
}
const static struct wl_buffer_interface buffer_interface = {
buffer_destroy
};
static void
drm_create_buffer(struct wl_client *client, struct wl_drm *drm,
uint32_t id, uint32_t name, int32_t width, int32_t height,
uint32_t stride, struct wl_visual *visual)
{
struct wl_drm_buffer *buffer;
EGLint attribs[] = {
EGL_WIDTH, 0,
EGL_HEIGHT, 0,
EGL_DRM_BUFFER_STRIDE_MESA, 0,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA,
EGL_NONE
};
_EGLDriver *drv = drm->edisp->Driver;
buffer = malloc(sizeof *buffer);
if (buffer == NULL) {
wl_client_post_no_memory(client);
return;
}
buffer->drm = drm;
buffer->buffer.compositor = NULL;
buffer->buffer.width = width;
buffer->buffer.height = height;
buffer->buffer.visual = visual;
buffer->buffer.attach = NULL;
buffer->buffer.damage = drm_buffer_damage;
if (visual->object.interface != &wl_visual_interface) {
/* FIXME: Define a real exception event instead of
* abusing this one */
wl_client_post_event(client,
(struct wl_object *) drm->display,
WL_DISPLAY_INVALID_OBJECT, 0);
fprintf(stderr, "invalid visual in create_buffer\n");
return;
}
attribs[1] = width;
attribs[3] = height;
attribs[5] = stride / 4;
buffer->image = drv->API.CreateImageKHR(drv, drm->edisp,
EGL_NO_CONTEXT,
EGL_DRM_BUFFER_MESA,
(EGLClientBuffer) (intptr_t) name,
attribs);
if (buffer->image == NULL) {
/* FIXME: Define a real exception event instead of
* abusing this one */
wl_client_post_event(client,
(struct wl_object *) drm->display,
WL_DISPLAY_INVALID_OBJECT, 0);
fprintf(stderr, "failed to create image for name %d\n", name);
return;
}
buffer->buffer.resource.object.id = id;
buffer->buffer.resource.object.interface = &wl_buffer_interface;
buffer->buffer.resource.object.implementation = (void (**)(void))
&buffer_interface;
buffer->buffer.resource.destroy = destroy_buffer;
wl_client_add_resource(client, &buffer->buffer.resource);
}
static void
drm_authenticate(struct wl_client *client,
struct wl_drm *drm, uint32_t id)
{
if (drm->authenticate(drm->edisp, id) < 0)
wl_client_post_event(client,
(struct wl_object *) drm->display,
WL_DISPLAY_INVALID_OBJECT, 0);
else
wl_client_post_event(client, &drm->object,
WL_DRM_AUTHENTICATED);
}
const static struct wl_drm_interface drm_interface = {
drm_authenticate,
drm_create_buffer
};
static void
post_drm_device(struct wl_client *client, struct wl_object *global)
{
struct wl_drm *drm = (struct wl_drm *) global;
wl_client_post_event(client, global, WL_DRM_DEVICE, drm->device_name);
}
struct wl_drm *
wayland_drm_init(struct wl_display *display, _EGLDisplay *disp,
authenticate_t authenticate, char *device_name)
{
struct wl_drm *drm;
drm = malloc(sizeof *drm);
drm->display = display;
drm->edisp = disp;
drm->authenticate = authenticate;
drm->device_name = strdup(device_name);
drm->object.interface = &wl_drm_interface;
drm->object.implementation = (void (**)(void)) &drm_interface;
wl_display_add_object(display, &drm->object);
wl_display_add_global(display, &drm->object, post_drm_device);
return drm;
}
void
wayland_drm_destroy(struct wl_drm *drm)
{
free(drm->device_name);
/* FIXME: need wl_display_del_{object,global} */
free(drm);
}

View File

@@ -0,0 +1,26 @@
#ifndef WAYLAND_DRM_H
#define WAYLAND_DRM_H
#include "egldisplay.h"
#include "eglimage.h"
#include <wayland-server.h>
struct wl_drm;
typedef int (*authenticate_t) (_EGLDisplay *disp, uint32_t id);
struct wl_drm_buffer {
struct wl_buffer buffer;
struct wl_drm *drm;
_EGLImage *image;
};
struct wl_drm *
wayland_drm_init(struct wl_display *display, _EGLDisplay *disp,
authenticate_t authenticate, char *device_name);
void
wayland_drm_destroy(struct wl_drm *drm);
#endif

View File

@@ -0,0 +1,71 @@
# src/egl/wayland/wayland-egl/Makefile
TOP = ../../../..
include $(TOP)/configs/current
INCLUDE_DIRS = -I$(TOP)/include \
-I$(TOP)/include/EGL \
-I$(TOP)/src/egl/wayland/wayland-drm
HEADERS = wayland-egl-priv.h
SOURCES = wayland-egl.c
OBJECTS = $(SOURCES:.c=.o)
LOCAL_CFLAGS = $(LIBDRM_CFLAGS) \
$(WAYLAND_CFLAGS)
LOCAL_LIBS =
.c.o:
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@
default: depend library
# wayland-egl Library
library: $(TOP)/$(LIB_DIR)/$(WAYLAND_EGL_LIB_NAME)
$(TOP)/$(LIB_DIR)/$(WAYLAND_EGL_LIB_NAME): $(OBJECTS) $(LOCAL_LIBS)
$(MKLIB) -o $(WAYLAND_EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-L$(TOP)/$(LIB_DIR) $(WAYLAND_EGL_LIB_DEPS) \
$(OBJECTS) $(LOCAL_LIBS)
PKG_CONFIG_DIR = $(INSTALL_LIB_DIR)/pkgconfig
gl_pcedit = sed \
-e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
-e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
-e 's,@WAYLAND_EGL_PC_REQ_PRIV@,$(WAYLAND_EGL_PC_REQ_PRIV),' \
-e 's,@WAYLAND_EGL_PC_LIB_PRIV@,$(WAYLAND_EGL_PC_LIB_PRIV),' \
-e 's,@WAYLAND_EGL_PC_CFLAGS@,$(WAYLAND_EGL_PC_CFLAGS),' \
-e 's,@WAYLAND_EGL_LIB@,$(WAYLAND_EGL_LIB),'
wayland-egl.pc: wayland-egl.pc.in
$(gl_pcedit) $< > $@
install: default wayland-egl.pc
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
$(MINSTALL) $(TOP)/$(LIB_DIR)/$(WAYLAND_EGL_LIB_GLOB) \
$(DESTDIR)$(INSTALL_LIB_DIR)
$(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR)
$(INSTALL) -m 644 wayland-egl.pc $(DESTDIR)$(PKG_CONFIG_DIR)
clean:
-rm -f *.o
-rm -f depend depend.bak
depend: $(SOURCES) $(HEADERS)
@ echo "running $(MKDEP)"
@ rm -f depend
@ touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
$(SOURCES) $(HEADERS) > /dev/null 2>/dev/null
-include depend
# DO NOT DELETE

View File

@@ -0,0 +1,60 @@
#ifndef _WAYLAND_EGL_PRIV_H
#define _WAYLAND_EGL_PRIV_H
#ifdef __cplusplus
extern "C" {
#endif
/* GCC visibility */
#if defined(__GNUC__) && __GNUC__ >= 4
#define WL_EGL_EXPORT __attribute__ ((visibility("default")))
#else
#define WL_EGL_EXPORT
#endif
#include <stdbool.h>
#include <wayland-client.h>
struct wl_egl_display {
struct wl_display *display;
struct wl_drm *drm;
int fd;
char *device_name;
bool authenticated;
void (*glFlush)(void);
};
struct wl_egl_window {
struct wl_surface *surface;
struct wl_visual *visual;
int width;
int height;
int dx;
int dy;
int attached_width;
int attached_height;
};
struct wl_egl_pixmap {
struct wl_egl_display *display;
struct wl_visual *visual;
int name;
int width;
int height;
int stride;
void (*destroy) (struct wl_egl_pixmap *egl_pixmap);
void *driver_private;
};
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,226 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <dlfcn.h>
#include <wayland-client.h>
#include "wayland-egl.h"
#include "wayland-egl-priv.h"
#include "wayland-drm-client-protocol.h"
#include <xf86drm.h>
static void
drm_handle_device(void *data, struct wl_drm *drm, const char *device)
{
struct wl_egl_display *egl_display = data;
drm_magic_t magic;
egl_display->device_name = strdup(device);
egl_display->fd = open(egl_display->device_name, O_RDWR);
if (egl_display->fd == -1) {
fprintf(stderr, "wayland-egl: could not open %s (%s)",
egl_display->device_name, strerror(errno));
return;
}
drmGetMagic(egl_display->fd, &magic);
wl_drm_authenticate(egl_display->drm, magic);
}
static void
drm_handle_authenticated(void *data, struct wl_drm *drm)
{
struct wl_egl_display *egl_display = data;
egl_display->authenticated = true;
}
static const struct wl_drm_listener drm_listener = {
drm_handle_device,
drm_handle_authenticated
};
static void
wl_display_handle_global(struct wl_display *display, uint32_t id,
const char *interface, uint32_t version, void *data)
{
struct wl_egl_display *egl_display = data;
if (strcmp(interface, "drm") == 0) {
egl_display->drm = wl_drm_create(display, id);
wl_drm_add_listener(egl_display->drm, &drm_listener,
egl_display);
}
}
/* stolen from egl_dri2:dri2_load() */
static void *
get_flush_address() {
void *handle;
void *(*get_proc_address)(const char *procname);
handle = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);
if (handle) {
get_proc_address = (void* (*)(const char *))
dlsym(handle, "_glapi_get_proc_address");
/* no need to keep a reference */
dlclose(handle);
}
/*
* If glapi is not available, loading DRI drivers will fail. Ideally, we
* should load one of libGL, libGLESv1_CM, or libGLESv2 and go on. But if
* the app has loaded another one of them with RTLD_LOCAL, there may be
* unexpected behaviors later because there will be two copies of glapi
* (with global variables of the same names!) in the memory.
*/
if (!get_proc_address) {
fprintf(stderr, "failed to find _glapi_get_proc_address");
return NULL;
}
return get_proc_address("glFlush");
}
WL_EGL_EXPORT struct wl_egl_display *
wl_egl_display_create(struct wl_display *display)
{
struct wl_egl_display *egl_display;
egl_display = malloc(sizeof *egl_display);
if (!egl_display)
return NULL;
egl_display->display = display;
egl_display->drm = NULL;
egl_display->fd = -1;
egl_display->device_name = NULL;
egl_display->authenticated = false;
egl_display->glFlush = (void (*)(void)) get_flush_address();
wl_display_add_global_listener(display, wl_display_handle_global,
egl_display);
return egl_display;
}
WL_EGL_EXPORT void
wl_egl_display_destroy(struct wl_egl_display *egl_display)
{
free(egl_display->device_name);
close(egl_display->fd);
wl_drm_destroy(egl_display->drm);
free(egl_display);
}
WL_EGL_EXPORT void
wl_egl_window_resize(struct wl_egl_window *egl_window,
int width, int height,
int dx, int dy)
{
egl_window->width = width;
egl_window->height = height;
egl_window->dx = dx;
egl_window->dy = dy;
}
WL_EGL_EXPORT struct wl_egl_window *
wl_egl_window_create(struct wl_egl_display *egl_display,
struct wl_surface *surface,
int width, int height,
struct wl_visual *visual)
{
struct wl_egl_window *egl_window;
egl_window = malloc(sizeof *egl_window);
if (!egl_window)
return NULL;
egl_window->surface = surface;
egl_window->visual = visual;
wl_egl_window_resize(egl_window, width, height, 0, 0);
egl_window->attached_width = 0;
egl_window->attached_height = 0;
return egl_window;
}
WL_EGL_EXPORT void
wl_egl_window_destroy(struct wl_egl_window *egl_window)
{
free(egl_window);
}
WL_EGL_EXPORT void
wl_egl_window_get_attached_size(struct wl_egl_window *egl_window,
int *width, int *height)
{
if (width)
*width = egl_window->attached_width;
if (height)
*height = egl_window->attached_height;
}
WL_EGL_EXPORT struct wl_egl_pixmap *
wl_egl_pixmap_create(struct wl_egl_display *egl_display,
int width, int height,
struct wl_visual *visual, uint32_t flags)
{
struct wl_egl_pixmap *egl_pixmap;
egl_pixmap = malloc(sizeof *egl_pixmap);
if (egl_pixmap == NULL)
return NULL;
egl_pixmap->display = egl_display;
egl_pixmap->width = width;
egl_pixmap->height = height;
egl_pixmap->visual = visual;
egl_pixmap->name = 0;
egl_pixmap->stride = 0;
egl_pixmap->destroy = NULL;
return egl_pixmap;
}
WL_EGL_EXPORT void
wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
{
if (egl_pixmap->destroy)
egl_pixmap->destroy(egl_pixmap);
free(egl_pixmap);
}
WL_EGL_EXPORT struct wl_buffer *
wl_egl_pixmap_create_buffer(struct wl_egl_display *egl_display,
struct wl_egl_pixmap *egl_pixmap)
{
if (egl_pixmap->name == 0)
return NULL;
return wl_drm_create_buffer(egl_display->drm, egl_pixmap->name,
egl_pixmap->width, egl_pixmap->height,
egl_pixmap->stride, egl_pixmap->visual);
}
WL_EGL_EXPORT void
wl_egl_pixmap_flush(struct wl_egl_display *egl_display,
struct wl_egl_pixmap *egl_pixmap)
{
if (egl_display->glFlush)
egl_display->glFlush();
}

View File

@@ -0,0 +1,12 @@
prefix=@INSTALL_DIR@
exec_prefix=${prefix}
libdir=@INSTALL_LIB_DIR@
includedir=@INSTALL_INC_DIR@
Name: wayland-egl
Description: Mesa wayland-egl library
Requires.private: @WAYLAND_EGL_PC_REQ_PRIV@
Version: @VERSION@
Libs: -L${libdir} -l@WAYLAND_EGL_LIB@
Libs.private: @WAYLAND_EGL_PC_LIB_PRIV@
Cflags: -I${includedir} @WAYLAND_EGL_PC_CFLAGS@

View File

@@ -42,6 +42,7 @@ if env['drm']:
# SConscript([
# 'drivers/nouveau/SConscript',
# 'drivers/nv50/SConscript',
# 'drivers/nvc0/SConscript',
# 'drivers/nvfx/SConscript',
# ])
@@ -55,6 +56,7 @@ SConscript('winsys/sw/null/SConscript')
SConscript('state_trackers/python/SConscript')
if env['platform'] != 'embedded':
SConscript('state_trackers/vega/SConscript')
SConscript('state_trackers/egl/SConscript')
if env['x11']:
SConscript('state_trackers/glx/xlib/SConscript')
@@ -66,10 +68,7 @@ if env['platform'] != 'embedded':
SConscript('state_trackers/xorg/SConscript')
if env['platform'] == 'windows':
SConscript([
'state_trackers/egl/SConscript',
'state_trackers/wgl/SConscript',
])
SConscript('state_trackers/wgl/SConscript')
#
# Winsys
@@ -85,6 +84,11 @@ SConscript([
'targets/graw-null/SConscript',
])
if env['platform'] != 'embedded':
SConscript([
'targets/egl-static/SConscript'
])
if env['x11']:
SConscript([
'targets/graw-xlib/SConscript',
@@ -95,7 +99,6 @@ if env['platform'] == 'windows':
SConscript([
'targets/graw-gdi/SConscript',
'targets/libgl-gdi/SConscript',
#'egl-gdi/SConscript',
])
if env['dri']:

View File

@@ -108,7 +108,9 @@ C_SOURCES = \
util/u_draw_quad.c \
util/u_format.c \
util/u_format_other.c \
util/u_format_latc.c \
util/u_format_s3tc.c \
util/u_format_rgtc.c \
util/u_format_srgb.c \
util/u_format_table.c \
util/u_format_tests.c \
@@ -127,6 +129,7 @@ C_SOURCES = \
util/u_network.c \
util/u_math.c \
util/u_mm.c \
util/u_pstipple.c \
util/u_rect.c \
util/u_ringbuffer.c \
util/u_sampler.c \
@@ -140,7 +143,8 @@ C_SOURCES = \
util/u_tile.c \
util/u_transfer.c \
util/u_resource.c \
util/u_upload_mgr.c
util/u_upload_mgr.c \
util/u_vbuf_mgr.c
GENERATED_SOURCES = \
indices/u_indices_gen.c \

View File

@@ -110,7 +110,9 @@ C_SOURCES = \
util/u_draw_quad.c \
util/u_format.c \
util/u_format_other.c \
util/u_format_latc.c \
util/u_format_s3tc.c \
util/u_format_rgtc.c \
util/u_format_srgb.c \
util/u_format_table.c \
util/u_format_tests.c \
@@ -129,6 +131,7 @@ C_SOURCES = \
util/u_network.c \
util/u_math.c \
util/u_mm.c \
util/u_pstipple.c \
util/u_rect.c \
util/u_ringbuffer.c \
util/u_sampler.c \
@@ -142,7 +145,8 @@ C_SOURCES = \
util/u_tile.c \
util/u_transfer.c \
util/u_resource.c \
util/u_upload_mgr.c
util/u_upload_mgr.c \
util/u_vbuf_mgr.c
# Disabling until pipe-video branch gets merged in
#vl/vl_bitstream_parser.c \
@@ -157,7 +161,6 @@ GALLIVM_SOURCES = \
gallivm/lp_bld_bitarit.c \
gallivm/lp_bld_const.c \
gallivm/lp_bld_conv.c \
gallivm/lp_bld_debug.c \
gallivm/lp_bld_flow.c \
gallivm/lp_bld_format_aos.c \
gallivm/lp_bld_format_soa.c \
@@ -185,6 +188,7 @@ GALLIVM_SOURCES = \
draw/draw_pt_fetch_shade_pipeline_llvm.c
GALLIVM_CPP_SOURCES = \
gallivm/lp_bld_debug.cpp \
gallivm/lp_bld_misc.cpp
GENERATED_SOURCES = \

View File

@@ -157,7 +157,9 @@ source = [
'util/u_draw_quad.c',
'util/u_format.c',
'util/u_format_other.c',
'util/u_format_latc.c',
'util/u_format_s3tc.c',
'util/u_format_rgtc.c',
'util/u_format_srgb.c',
'util/u_format_table.c',
'util/u_format_tests.c',
@@ -176,6 +178,7 @@ source = [
'util/u_network.c',
'util/u_math.c',
'util/u_mm.c',
'util/u_pstipple.c',
'util/u_rect.c',
'util/u_resource.c',
'util/u_ringbuffer.c',
@@ -190,6 +193,7 @@ source = [
'util/u_tile.c',
'util/u_transfer.c',
'util/u_upload_mgr.c',
'util/u_vbuf_mgr.c',
# Disabling until pipe-video branch gets merged in
#'vl/vl_bitstream_parser.c',
#'vl/vl_mpeg12_mc_renderer.c',
@@ -199,16 +203,13 @@ source = [
]
if env['llvm']:
if env['UDIS86']:
env.Append(CPPDEFINES = [('HAVE_UDIS86', '1')])
source += [
'gallivm/lp_bld_arit.c',
'gallivm/lp_bld_assert.c',
'gallivm/lp_bld_bitarit.c',
'gallivm/lp_bld_const.c',
'gallivm/lp_bld_conv.c',
'gallivm/lp_bld_debug.c',
'gallivm/lp_bld_debug.cpp',
'gallivm/lp_bld_flow.c',
'gallivm/lp_bld_format_aos.c',
'gallivm/lp_bld_format_soa.c',

View File

@@ -47,41 +47,45 @@
#include "cso_cache/cso_hash.h"
#include "cso_context.h"
struct cso_context {
struct pipe_context *pipe;
struct cso_cache *cache;
/**
* Info related to samplers and sampler views.
* We have one of these for fragment samplers and another for vertex samplers.
*/
struct sampler_info
{
struct {
void *samplers[PIPE_MAX_SAMPLERS];
unsigned nr_samplers;
void *vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS];
unsigned nr_vertex_samplers;
} hw;
void *samplers[PIPE_MAX_SAMPLERS];
unsigned nr_samplers;
void *vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS];
unsigned nr_vertex_samplers;
unsigned nr_samplers_saved;
void *samplers_saved[PIPE_MAX_SAMPLERS];
unsigned nr_samplers_saved;
unsigned nr_vertex_samplers_saved;
void *vertex_samplers_saved[PIPE_MAX_VERTEX_SAMPLERS];
struct pipe_sampler_view *views[PIPE_MAX_SAMPLERS];
unsigned nr_views;
uint nr_fragment_sampler_views;
struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
struct pipe_sampler_view *views_saved[PIPE_MAX_SAMPLERS];
unsigned nr_views_saved;
};
uint nr_vertex_sampler_views;
struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
uint nr_fragment_sampler_views_saved;
struct pipe_sampler_view *fragment_sampler_views_saved[PIPE_MAX_SAMPLERS];
uint nr_vertex_sampler_views_saved;
struct pipe_sampler_view *vertex_sampler_views_saved[PIPE_MAX_VERTEX_SAMPLERS];
struct cso_context {
struct pipe_context *pipe;
struct cso_cache *cache;
struct sampler_info fragment_samplers;
struct sampler_info vertex_samplers;
uint nr_vertex_buffers;
struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
uint nr_vertex_buffers_saved;
struct pipe_vertex_buffer vertex_buffers_saved[PIPE_MAX_ATTRIBS];
/** Current and saved state.
* The saved state is used as a 1-deep stack.
@@ -252,6 +256,8 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
if (ctx == NULL)
goto out;
assert(PIPE_MAX_SAMPLERS == PIPE_MAX_VERTEX_SAMPLERS);
ctx->cache = cso_cache_create();
if (ctx->cache == NULL)
goto out;
@@ -278,7 +284,8 @@ out:
void cso_release_all( struct cso_context *ctx )
{
unsigned i;
struct sampler_info *info;
if (ctx->pipe) {
ctx->pipe->bind_blend_state( ctx->pipe, NULL );
ctx->pipe->bind_rasterizer_state( ctx->pipe, NULL );
@@ -294,19 +301,30 @@ void cso_release_all( struct cso_context *ctx )
ctx->pipe->set_vertex_sampler_views(ctx->pipe, 0, NULL);
}
/* free fragment samplers, views */
info = &ctx->fragment_samplers;
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
pipe_sampler_view_reference(&ctx->fragment_sampler_views[i], NULL);
pipe_sampler_view_reference(&ctx->fragment_sampler_views_saved[i], NULL);
pipe_sampler_view_reference(&info->views[i], NULL);
pipe_sampler_view_reference(&info->views_saved[i], NULL);
}
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
pipe_sampler_view_reference(&ctx->vertex_sampler_views[i], NULL);
pipe_sampler_view_reference(&ctx->vertex_sampler_views_saved[i], NULL);
/* free vertex samplers, views */
info = &ctx->vertex_samplers;
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
pipe_sampler_view_reference(&info->views_saved[i], NULL);
}
util_unreference_framebuffer_state(&ctx->fb);
util_unreference_framebuffer_state(&ctx->fb_saved);
util_copy_vertex_buffers(ctx->vertex_buffers,
&ctx->nr_vertex_buffers,
NULL, 0);
util_copy_vertex_buffers(ctx->vertex_buffers_saved,
&ctx->nr_vertex_buffers_saved,
NULL, 0);
if (ctx->cache) {
cso_cache_delete( ctx->cache );
ctx->cache = NULL;
@@ -395,233 +413,6 @@ void cso_restore_blend(struct cso_context *ctx)
enum pipe_error cso_single_sampler(struct cso_context *ctx,
unsigned idx,
const struct pipe_sampler_state *templ)
{
void *handle = NULL;
if (templ != NULL) {
unsigned key_size = sizeof(struct pipe_sampler_state);
unsigned hash_key = cso_construct_key((void*)templ, key_size);
struct cso_hash_iter iter = cso_find_state_template(ctx->cache,
hash_key, CSO_SAMPLER,
(void*)templ, key_size);
if (cso_hash_iter_is_null(iter)) {
struct cso_sampler *cso = MALLOC(sizeof(struct cso_sampler));
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_sampler_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_sampler_state;
cso->context = ctx->pipe;
iter = cso_insert_state(ctx->cache, hash_key, CSO_SAMPLER, cso);
if (cso_hash_iter_is_null(iter)) {
FREE(cso);
return PIPE_ERROR_OUT_OF_MEMORY;
}
handle = cso->data;
}
else {
handle = ((struct cso_sampler *)cso_hash_iter_data(iter))->data;
}
}
ctx->samplers[idx] = handle;
return PIPE_OK;
}
enum pipe_error
cso_single_vertex_sampler(struct cso_context *ctx,
unsigned idx,
const struct pipe_sampler_state *templ)
{
void *handle = NULL;
if (templ != NULL) {
unsigned key_size = sizeof(struct pipe_sampler_state);
unsigned hash_key = cso_construct_key((void*)templ, key_size);
struct cso_hash_iter iter = cso_find_state_template(ctx->cache,
hash_key, CSO_SAMPLER,
(void*)templ, key_size);
if (cso_hash_iter_is_null(iter)) {
struct cso_sampler *cso = MALLOC(sizeof(struct cso_sampler));
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_sampler_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_sampler_state;
cso->context = ctx->pipe;
iter = cso_insert_state(ctx->cache, hash_key, CSO_SAMPLER, cso);
if (cso_hash_iter_is_null(iter)) {
FREE(cso);
return PIPE_ERROR_OUT_OF_MEMORY;
}
handle = cso->data;
}
else {
handle = ((struct cso_sampler *)cso_hash_iter_data(iter))->data;
}
}
ctx->vertex_samplers[idx] = handle;
return PIPE_OK;
}
void cso_single_sampler_done( struct cso_context *ctx )
{
unsigned i;
/* find highest non-null sampler */
for (i = PIPE_MAX_SAMPLERS; i > 0; i--) {
if (ctx->samplers[i - 1] != NULL)
break;
}
ctx->nr_samplers = i;
if (ctx->hw.nr_samplers != ctx->nr_samplers ||
memcmp(ctx->hw.samplers,
ctx->samplers,
ctx->nr_samplers * sizeof(void *)) != 0)
{
memcpy(ctx->hw.samplers, ctx->samplers, ctx->nr_samplers * sizeof(void *));
ctx->hw.nr_samplers = ctx->nr_samplers;
ctx->pipe->bind_fragment_sampler_states(ctx->pipe, ctx->nr_samplers, ctx->samplers);
}
}
void
cso_single_vertex_sampler_done(struct cso_context *ctx)
{
unsigned i;
/* find highest non-null sampler */
for (i = PIPE_MAX_VERTEX_SAMPLERS; i > 0; i--) {
if (ctx->vertex_samplers[i - 1] != NULL)
break;
}
ctx->nr_vertex_samplers = i;
if (ctx->hw.nr_vertex_samplers != ctx->nr_vertex_samplers ||
memcmp(ctx->hw.vertex_samplers,
ctx->vertex_samplers,
ctx->nr_vertex_samplers * sizeof(void *)) != 0)
{
memcpy(ctx->hw.vertex_samplers,
ctx->vertex_samplers,
ctx->nr_vertex_samplers * sizeof(void *));
ctx->hw.nr_vertex_samplers = ctx->nr_vertex_samplers;
ctx->pipe->bind_vertex_sampler_states(ctx->pipe,
ctx->nr_vertex_samplers,
ctx->vertex_samplers);
}
}
/*
* If the function encouters any errors it will return the
* last one. Done to always try to set as many samplers
* as possible.
*/
enum pipe_error cso_set_samplers( struct cso_context *ctx,
unsigned nr,
const struct pipe_sampler_state **templates )
{
unsigned i;
enum pipe_error temp, error = PIPE_OK;
/* TODO: fastpath
*/
for (i = 0; i < nr; i++) {
temp = cso_single_sampler( ctx, i, templates[i] );
if (temp != PIPE_OK)
error = temp;
}
for ( ; i < ctx->nr_samplers; i++) {
temp = cso_single_sampler( ctx, i, NULL );
if (temp != PIPE_OK)
error = temp;
}
cso_single_sampler_done( ctx );
return error;
}
void cso_save_samplers(struct cso_context *ctx)
{
ctx->nr_samplers_saved = ctx->nr_samplers;
memcpy(ctx->samplers_saved, ctx->samplers, sizeof(ctx->samplers));
}
void cso_restore_samplers(struct cso_context *ctx)
{
ctx->nr_samplers = ctx->nr_samplers_saved;
memcpy(ctx->samplers, ctx->samplers_saved, sizeof(ctx->samplers));
cso_single_sampler_done( ctx );
}
/*
* If the function encouters any errors it will return the
* last one. Done to always try to set as many samplers
* as possible.
*/
enum pipe_error cso_set_vertex_samplers(struct cso_context *ctx,
unsigned nr,
const struct pipe_sampler_state **templates)
{
unsigned i;
enum pipe_error temp, error = PIPE_OK;
/* TODO: fastpath
*/
for (i = 0; i < nr; i++) {
temp = cso_single_vertex_sampler( ctx, i, templates[i] );
if (temp != PIPE_OK)
error = temp;
}
for ( ; i < ctx->nr_samplers; i++) {
temp = cso_single_vertex_sampler( ctx, i, NULL );
if (temp != PIPE_OK)
error = temp;
}
cso_single_vertex_sampler_done( ctx );
return error;
}
void
cso_save_vertex_samplers(struct cso_context *ctx)
{
ctx->nr_vertex_samplers_saved = ctx->nr_vertex_samplers;
memcpy(ctx->vertex_samplers_saved, ctx->vertex_samplers, sizeof(ctx->vertex_samplers));
}
void
cso_restore_vertex_samplers(struct cso_context *ctx)
{
ctx->nr_vertex_samplers = ctx->nr_vertex_samplers_saved;
memcpy(ctx->vertex_samplers, ctx->vertex_samplers_saved, sizeof(ctx->vertex_samplers));
cso_single_vertex_sampler_done(ctx);
}
enum pipe_error cso_set_depth_stencil_alpha(struct cso_context *ctx,
const struct pipe_depth_stencil_alpha_state *templ)
{
@@ -1143,121 +934,361 @@ void cso_restore_vertex_elements(struct cso_context *ctx)
ctx->velements_saved = NULL;
}
/* fragment sampler view state */
/* vertex buffers */
void cso_set_vertex_buffers(struct cso_context *ctx,
unsigned count,
const struct pipe_vertex_buffer *buffers)
{
if (count != ctx->nr_vertex_buffers ||
memcmp(buffers, ctx->vertex_buffers,
sizeof(struct pipe_vertex_buffer) * count) != 0) {
util_copy_vertex_buffers(ctx->vertex_buffers, &ctx->nr_vertex_buffers,
buffers, count);
ctx->pipe->set_vertex_buffers(ctx->pipe, count, buffers);
}
}
void cso_save_vertex_buffers(struct cso_context *ctx)
{
util_copy_vertex_buffers(ctx->vertex_buffers_saved,
&ctx->nr_vertex_buffers_saved,
ctx->vertex_buffers,
ctx->nr_vertex_buffers);
}
void cso_restore_vertex_buffers(struct cso_context *ctx)
{
util_copy_vertex_buffers(ctx->vertex_buffers,
&ctx->nr_vertex_buffers,
ctx->vertex_buffers_saved,
ctx->nr_vertex_buffers_saved);
ctx->pipe->set_vertex_buffers(ctx->pipe, ctx->nr_vertex_buffers,
ctx->vertex_buffers);
}
/**************** fragment/vertex sampler view state *************************/
static enum pipe_error
single_sampler(struct cso_context *ctx,
struct sampler_info *info,
unsigned idx,
const struct pipe_sampler_state *templ)
{
void *handle = NULL;
if (templ != NULL) {
unsigned key_size = sizeof(struct pipe_sampler_state);
unsigned hash_key = cso_construct_key((void*)templ, key_size);
struct cso_hash_iter iter =
cso_find_state_template(ctx->cache,
hash_key, CSO_SAMPLER,
(void *) templ, key_size);
if (cso_hash_iter_is_null(iter)) {
struct cso_sampler *cso = MALLOC(sizeof(struct cso_sampler));
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_sampler_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_sampler_state;
cso->context = ctx->pipe;
iter = cso_insert_state(ctx->cache, hash_key, CSO_SAMPLER, cso);
if (cso_hash_iter_is_null(iter)) {
FREE(cso);
return PIPE_ERROR_OUT_OF_MEMORY;
}
handle = cso->data;
}
else {
handle = ((struct cso_sampler *)cso_hash_iter_data(iter))->data;
}
}
info->samplers[idx] = handle;
return PIPE_OK;
}
enum pipe_error
cso_single_sampler(struct cso_context *ctx,
unsigned idx,
const struct pipe_sampler_state *templ)
{
return single_sampler(ctx, &ctx->fragment_samplers, idx, templ);
}
enum pipe_error
cso_single_vertex_sampler(struct cso_context *ctx,
unsigned idx,
const struct pipe_sampler_state *templ)
{
return single_sampler(ctx, &ctx->vertex_samplers, idx, templ);
}
static void
single_sampler_done(struct cso_context *ctx,
struct sampler_info *info)
{
unsigned i;
/* find highest non-null sampler */
for (i = PIPE_MAX_SAMPLERS; i > 0; i--) {
if (info->samplers[i - 1] != NULL)
break;
}
info->nr_samplers = i;
if (info->hw.nr_samplers != info->nr_samplers ||
memcmp(info->hw.samplers,
info->samplers,
info->nr_samplers * sizeof(void *)) != 0)
{
memcpy(info->hw.samplers,
info->samplers,
info->nr_samplers * sizeof(void *));
info->hw.nr_samplers = info->nr_samplers;
if (info == &ctx->fragment_samplers) {
ctx->pipe->bind_fragment_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
}
else if (info == &ctx->vertex_samplers) {
ctx->pipe->bind_vertex_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
}
else {
assert(0);
}
}
}
void
cso_set_fragment_sampler_views(struct cso_context *cso,
cso_single_sampler_done( struct cso_context *ctx )
{
single_sampler_done(ctx, &ctx->fragment_samplers);
}
void
cso_single_vertex_sampler_done(struct cso_context *ctx)
{
single_sampler_done(ctx, &ctx->vertex_samplers);
}
/*
* If the function encouters any errors it will return the
* last one. Done to always try to set as many samplers
* as possible.
*/
static enum pipe_error
set_samplers(struct cso_context *ctx,
struct sampler_info *info,
unsigned nr,
const struct pipe_sampler_state **templates)
{
unsigned i;
enum pipe_error temp, error = PIPE_OK;
/* TODO: fastpath
*/
for (i = 0; i < nr; i++) {
temp = single_sampler(ctx, info, i, templates[i]);
if (temp != PIPE_OK)
error = temp;
}
for ( ; i < info->nr_samplers; i++) {
temp = single_sampler(ctx, info, i, NULL);
if (temp != PIPE_OK)
error = temp;
}
single_sampler_done(ctx, info);
return error;
}
enum pipe_error
cso_set_samplers(struct cso_context *ctx,
unsigned nr,
const struct pipe_sampler_state **templates)
{
return set_samplers(ctx, &ctx->fragment_samplers, nr, templates);
}
enum pipe_error
cso_set_vertex_samplers(struct cso_context *ctx,
unsigned nr,
const struct pipe_sampler_state **templates)
{
return set_samplers(ctx, &ctx->vertex_samplers, nr, templates);
}
static void
save_samplers(struct cso_context *ctx, struct sampler_info *info)
{
info->nr_samplers_saved = info->nr_samplers;
memcpy(info->samplers_saved, info->samplers, sizeof(info->samplers));
}
void
cso_save_samplers(struct cso_context *ctx)
{
save_samplers(ctx, &ctx->fragment_samplers);
}
void
cso_save_vertex_samplers(struct cso_context *ctx)
{
save_samplers(ctx, &ctx->vertex_samplers);
}
static void
restore_samplers(struct cso_context *ctx, struct sampler_info *info)
{
info->nr_samplers = info->nr_samplers_saved;
memcpy(info->samplers, info->samplers_saved, sizeof(info->samplers));
single_sampler_done(ctx, info);
}
void
cso_restore_samplers(struct cso_context *ctx)
{
restore_samplers(ctx, &ctx->fragment_samplers);
}
void
cso_restore_vertex_samplers(struct cso_context *ctx)
{
restore_samplers(ctx, &ctx->vertex_samplers);
}
static void
set_sampler_views(struct cso_context *ctx,
struct sampler_info *info,
void (*set_views)(struct pipe_context *,
unsigned num_views,
struct pipe_sampler_view **),
uint count,
struct pipe_sampler_view **views)
{
uint i;
/* reference new views */
for (i = 0; i < count; i++) {
pipe_sampler_view_reference(&info->views[i], views[i]);
}
/* unref extra old views, if any */
for (; i < info->nr_views; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
}
info->nr_views = count;
/* bind the new sampler views */
set_views(ctx->pipe, count, info->views);
}
void
cso_set_fragment_sampler_views(struct cso_context *ctx,
uint count,
struct pipe_sampler_view **views)
{
uint i;
for (i = 0; i < count; i++) {
pipe_sampler_view_reference(&cso->fragment_sampler_views[i], views[i]);
}
for (; i < cso->nr_fragment_sampler_views; i++) {
pipe_sampler_view_reference(&cso->fragment_sampler_views[i], NULL);
}
cso->pipe->set_fragment_sampler_views(cso->pipe,
MAX2(count, cso->nr_fragment_sampler_views),
cso->fragment_sampler_views);
cso->nr_fragment_sampler_views = count;
set_sampler_views(ctx, &ctx->fragment_samplers,
ctx->pipe->set_fragment_sampler_views,
count, views);
}
void
cso_save_fragment_sampler_views(struct cso_context *cso)
{
uint i;
cso->nr_fragment_sampler_views_saved = cso->nr_fragment_sampler_views;
for (i = 0; i < cso->nr_fragment_sampler_views; i++) {
assert(!cso->fragment_sampler_views_saved[i]);
pipe_sampler_view_reference(&cso->fragment_sampler_views_saved[i],
cso->fragment_sampler_views[i]);
}
}
void
cso_restore_fragment_sampler_views(struct cso_context *cso)
{
uint i;
for (i = 0; i < cso->nr_fragment_sampler_views_saved; i++) {
pipe_sampler_view_reference(&cso->fragment_sampler_views[i], cso->fragment_sampler_views_saved[i]);
pipe_sampler_view_reference(&cso->fragment_sampler_views_saved[i], NULL);
}
for (; i < cso->nr_fragment_sampler_views; i++) {
pipe_sampler_view_reference(&cso->fragment_sampler_views[i], NULL);
}
cso->pipe->set_fragment_sampler_views(cso->pipe,
MAX2(cso->nr_fragment_sampler_views, cso->nr_fragment_sampler_views_saved),
cso->fragment_sampler_views);
cso->nr_fragment_sampler_views = cso->nr_fragment_sampler_views_saved;
cso->nr_fragment_sampler_views_saved = 0;
}
/* vertex sampler view state */
void
cso_set_vertex_sampler_views(struct cso_context *cso,
cso_set_vertex_sampler_views(struct cso_context *ctx,
uint count,
struct pipe_sampler_view **views)
{
uint i;
for (i = 0; i < count; i++) {
pipe_sampler_view_reference(&cso->vertex_sampler_views[i], views[i]);
}
for (; i < cso->nr_vertex_sampler_views; i++) {
pipe_sampler_view_reference(&cso->vertex_sampler_views[i], NULL);
}
cso->pipe->set_vertex_sampler_views(cso->pipe,
MAX2(count, cso->nr_vertex_sampler_views),
cso->vertex_sampler_views);
cso->nr_vertex_sampler_views = count;
set_sampler_views(ctx, &ctx->vertex_samplers,
ctx->pipe->set_vertex_sampler_views,
count, views);
}
void
cso_save_vertex_sampler_views(struct cso_context *cso)
static void
save_sampler_views(struct cso_context *ctx,
struct sampler_info *info)
{
uint i;
cso->nr_vertex_sampler_views_saved = cso->nr_vertex_sampler_views;
info->nr_views_saved = info->nr_views;
for (i = 0; i < cso->nr_vertex_sampler_views; i++) {
assert(!cso->vertex_sampler_views_saved[i]);
pipe_sampler_view_reference(&cso->vertex_sampler_views_saved[i],
cso->vertex_sampler_views[i]);
for (i = 0; i < info->nr_views; i++) {
assert(!info->views_saved[i]);
pipe_sampler_view_reference(&info->views_saved[i], info->views[i]);
}
}
void
cso_restore_vertex_sampler_views(struct cso_context *cso)
cso_save_fragment_sampler_views(struct cso_context *ctx)
{
save_sampler_views(ctx, &ctx->fragment_samplers);
}
void
cso_save_vertex_sampler_views(struct cso_context *ctx)
{
save_sampler_views(ctx, &ctx->vertex_samplers);
}
static void
restore_sampler_views(struct cso_context *ctx,
struct sampler_info *info,
void (*set_views)(struct pipe_context *,
unsigned num_views,
struct pipe_sampler_view **))
{
uint i;
for (i = 0; i < cso->nr_vertex_sampler_views_saved; i++) {
pipe_sampler_view_reference(&cso->vertex_sampler_views[i], cso->vertex_sampler_views_saved[i]);
pipe_sampler_view_reference(&cso->vertex_sampler_views_saved[i], NULL);
for (i = 0; i < info->nr_views_saved; i++) {
pipe_sampler_view_reference(&info->views[i], info->views_saved[i]);
pipe_sampler_view_reference(&info->views_saved[i], NULL);
}
for (; i < cso->nr_vertex_sampler_views; i++) {
pipe_sampler_view_reference(&cso->vertex_sampler_views[i], NULL);
for (; i < info->nr_views; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
}
cso->pipe->set_vertex_sampler_views(cso->pipe,
MAX2(cso->nr_vertex_sampler_views, cso->nr_vertex_sampler_views_saved),
cso->vertex_sampler_views);
/* bind the old/saved sampler views */
set_views(ctx->pipe, info->nr_views_saved, info->views);
cso->nr_vertex_sampler_views = cso->nr_vertex_sampler_views_saved;
cso->nr_vertex_sampler_views_saved = 0;
info->nr_views = info->nr_views_saved;
info->nr_views_saved = 0;
}
void
cso_restore_fragment_sampler_views(struct cso_context *ctx)
{
restore_sampler_views(ctx, &ctx->fragment_samplers,
ctx->pipe->set_fragment_sampler_views);
}
void
cso_restore_vertex_sampler_views(struct cso_context *ctx)
{
restore_sampler_views(ctx, &ctx->vertex_samplers,
ctx->pipe->set_vertex_sampler_views);
}

View File

@@ -110,6 +110,13 @@ void cso_save_vertex_elements(struct cso_context *ctx);
void cso_restore_vertex_elements(struct cso_context *ctx);
void cso_set_vertex_buffers(struct cso_context *ctx,
unsigned count,
const struct pipe_vertex_buffer *buffers);
void cso_save_vertex_buffers(struct cso_context *ctx);
void cso_restore_vertex_buffers(struct cso_context *ctx);
/* These aren't really sensible -- most of the time the api provides
* object semantics for shaders anyway, and the cases where it doesn't
* (eg mesa's internall-generated texenv programs), it will be up to

View File

@@ -35,6 +35,7 @@
#include "util/u_memory.h"
#include "util/u_math.h"
#include "util/u_cpu_detect.h"
#include "util/u_inlines.h"
#include "draw_context.h"
#include "draw_vs.h"
#include "draw_gs.h"
@@ -87,8 +88,14 @@ draw_create_gallivm(struct pipe_context *pipe, struct gallivm_state *gallivm)
goto fail;
#if HAVE_LLVM
if (draw_get_option_use_llvm() && gallivm) {
draw->llvm = draw_llvm_create(draw, gallivm);
if (draw_get_option_use_llvm()) {
if (!gallivm) {
gallivm = gallivm_create();
draw->own_gallivm = gallivm;
}
if (gallivm)
draw->llvm = draw_llvm_create(draw, gallivm);
}
#endif
@@ -164,6 +171,10 @@ void draw_destroy( struct draw_context *draw )
}
}
for (i = 0; i < draw->pt.nr_vertex_buffers; i++) {
pipe_resource_reference(&draw->pt.vertex_buffer[i].buffer, NULL);
}
/* Not so fast -- we're just borrowing this at the moment.
*
if (draw->render)
@@ -175,8 +186,11 @@ void draw_destroy( struct draw_context *draw )
draw_vs_destroy( draw );
draw_gs_destroy( draw );
#ifdef HAVE_LLVM
if(draw->llvm)
if (draw->llvm)
draw_llvm_destroy( draw->llvm );
if (draw->own_gallivm)
gallivm_destroy(draw->own_gallivm);
#endif
FREE( draw );
@@ -307,8 +321,9 @@ draw_set_vertex_buffers(struct draw_context *draw,
{
assert(count <= PIPE_MAX_ATTRIBS);
memcpy(draw->pt.vertex_buffer, buffers, count * sizeof(buffers[0]));
draw->pt.nr_vertex_buffers = count;
util_copy_vertex_buffers(draw->pt.vertex_buffer,
&draw->pt.nr_vertex_buffers,
buffers, count);
}
@@ -395,7 +410,7 @@ void
draw_wide_line_threshold(struct draw_context *draw, float threshold)
{
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
draw->pipeline.wide_line_threshold = threshold;
draw->pipeline.wide_line_threshold = roundf(threshold);
}

View File

@@ -214,13 +214,12 @@ static LLVMTypeRef
create_jit_vertex_buffer_type(struct gallivm_state *gallivm)
{
LLVMTargetDataRef target = gallivm->target;
LLVMTypeRef elem_types[4];
LLVMTypeRef elem_types[3];
LLVMTypeRef vb_type;
elem_types[0] =
elem_types[1] =
elem_types[2] = LLVMInt32TypeInContext(gallivm->context);
elem_types[3] = LLVMPointerType(LLVMOpaqueTypeInContext(gallivm->context), 0); /* vs_constants */
elem_types[1] = LLVMInt32TypeInContext(gallivm->context);
elem_types[2] = LLVMPointerType(LLVMInt8TypeInContext(gallivm->context), 0); /* vs_constants */
vb_type = LLVMStructTypeInContext(gallivm->context, elem_types,
Elements(elem_types), 0);
@@ -230,7 +229,7 @@ create_jit_vertex_buffer_type(struct gallivm_state *gallivm)
LP_CHECK_MEMBER_OFFSET(struct pipe_vertex_buffer, stride,
target, vb_type, 0);
LP_CHECK_MEMBER_OFFSET(struct pipe_vertex_buffer, buffer_offset,
target, vb_type, 2);
target, vb_type, 1);
LP_CHECK_STRUCT_SIZE(struct pipe_vertex_buffer, target, vb_type);
@@ -437,6 +436,7 @@ generate_vs(struct draw_llvm *llvm,
LLVMBuilderRef builder,
LLVMValueRef (*outputs)[NUM_CHANNELS],
const LLVMValueRef (*inputs)[NUM_CHANNELS],
LLVMValueRef system_values_array,
LLVMValueRef context_ptr,
struct lp_build_sampler_soa *draw_sampler)
{
@@ -468,6 +468,7 @@ generate_vs(struct draw_llvm *llvm,
vs_type,
NULL /*struct lp_build_mask_context *mask*/,
consts_ptr,
system_values_array,
NULL /*pos*/,
inputs,
outputs,
@@ -509,9 +510,7 @@ generate_fetch(struct gallivm_state *gallivm,
LLVMValueRef vbuffer_ptr = LLVMBuildGEP(builder, vbuffers_ptr,
&indices, 1, "");
LLVMValueRef vb_stride = draw_jit_vbuffer_stride(gallivm, vbuf);
LLVMValueRef vb_max_index = draw_jit_vbuffer_max_index(gallivm, vbuf);
LLVMValueRef vb_buffer_offset = draw_jit_vbuffer_offset(gallivm, vbuf);
LLVMValueRef cond;
LLVMValueRef stride;
if (velem->instance_divisor) {
@@ -521,10 +520,6 @@ generate_fetch(struct gallivm_state *gallivm,
"instance_divisor");
}
/* limit index to min(index, vb_max_index) */
cond = LLVMBuildICmp(builder, LLVMIntULE, index, vb_max_index, "");
index = LLVMBuildSelect(builder, cond, index, vb_max_index, "");
stride = LLVMBuildMul(builder, vb_stride, index, "");
vbuffer_ptr = LLVMBuildLoad(builder, vbuffer_ptr, "vbuffer");
@@ -1118,7 +1113,9 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
LLVMValueRef start, end, count, stride, step, io_itr;
LLVMValueRef io_ptr, vbuffers_ptr, vb_ptr;
LLVMValueRef instance_id;
LLVMValueRef system_values_array;
struct draw_context *draw = llvm->draw;
const struct tgsi_shader_info *vs_info = &draw->vs.vertex_shader->info;
unsigned i, j;
struct lp_build_context bld;
struct lp_build_loop_state lp_loop;
@@ -1179,6 +1176,9 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
lp_build_context_init(&bld, llvm->gallivm, lp_type_int(32));
system_values_array = lp_build_system_values_array(gallivm, vs_info,
instance_id, NULL);
end = lp_build_add(&bld, start, count);
step = lp_build_const_int32(gallivm, max_vertices);
@@ -1233,6 +1233,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
builder,
outputs,
ptr_aos,
system_values_array,
context_ptr,
sampler);
@@ -1263,8 +1264,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
/* store clipmask in vertex header and positions in data */
convert_to_aos(gallivm, io, outputs, clipmask,
draw->vs.vertex_shader->info.num_outputs,
max_vertices);
vs_info->num_outputs, max_vertices);
}
lp_build_loop_end_cond(&lp_loop, end, step, LLVMIntUGE);
@@ -1315,7 +1315,9 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
LLVMValueRef fetch_elts, fetch_count, stride, step, io_itr;
LLVMValueRef io_ptr, vbuffers_ptr, vb_ptr;
LLVMValueRef instance_id;
LLVMValueRef system_values_array;
struct draw_context *draw = llvm->draw;
const struct tgsi_shader_info *vs_info = &draw->vs.vertex_shader->info;
unsigned i, j;
struct lp_build_context bld;
struct lp_build_loop_state lp_loop;
@@ -1376,6 +1378,10 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
lp_build_context_init(&bld, gallivm, lp_type_int(32));
system_values_array = lp_build_system_values_array(gallivm, vs_info,
instance_id, NULL);
step = lp_build_const_int32(gallivm, max_vertices);
/* code generated texture sampling */
@@ -1438,6 +1444,7 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
builder,
outputs,
ptr_aos,
system_values_array,
context_ptr,
sampler);
@@ -1471,8 +1478,7 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian
* and transformed positions in data
*/
convert_to_aos(gallivm, io, outputs, clipmask,
draw->vs.vertex_shader->info.num_outputs,
max_vertices);
vs_info->num_outputs, max_vertices);
}
lp_build_loop_end_cond(&lp_loop, fetch_count, step, LLVMIntUGE);
@@ -1610,16 +1616,14 @@ draw_llvm_destroy_variant(struct draw_llvm_variant *variant)
struct draw_llvm *llvm = variant->llvm;
if (variant->function_elts) {
if (variant->function_elts)
LLVMFreeMachineCodeForFunction(llvm->gallivm->engine,
variant->function_elts);
LLVMFreeMachineCodeForFunction(llvm->gallivm->engine,
variant->function_elts);
LLVMDeleteFunction(variant->function_elts);
}
if (variant->function) {
if (variant->function)
LLVMFreeMachineCodeForFunction(llvm->gallivm->engine,
variant->function);
LLVMFreeMachineCodeForFunction(llvm->gallivm->engine,
variant->function);
LLVMDeleteFunction(variant->function);
}

View File

@@ -133,11 +133,8 @@ struct draw_jit_context
#define draw_jit_vbuffer_stride(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 0, "stride")
#define draw_jit_vbuffer_max_index(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 1, "max_index")
#define draw_jit_vbuffer_offset(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, 2, "buffer_offset")
lp_build_struct_get(_gallivm, _ptr, 1, "buffer_offset")
typedef int
@@ -229,7 +226,6 @@ struct draw_llvm_variant
/* key is variable-sized, must be last */
struct draw_llvm_variant_key key;
/* key is variable-sized, must be last */
};
struct llvm_vertex_shader {

View File

@@ -64,8 +64,8 @@ boolean draw_pipeline_init( struct draw_context *draw )
return FALSE;
/* these defaults are oriented toward the needs of softpipe */
draw->pipeline.wide_point_threshold = 1000000.0; /* infinity */
draw->pipeline.wide_line_threshold = 1.0;
draw->pipeline.wide_point_threshold = 1000000.0f; /* infinity */
draw->pipeline.wide_line_threshold = 1.0f;
draw->pipeline.wide_point_sprites = FALSE;
draw->pipeline.line_stipple = TRUE;
draw->pipeline.point_sprite = TRUE;

View File

@@ -55,9 +55,16 @@
/**
* Max texture level for the alpha texture used for antialiasing
* Size for the alpha texture used for antialiasing
*/
#define MAX_TEXTURE_LEVEL 5 /* 32 x 32 */
#define TEXTURE_SIZE_LOG2 5 /* 32 x 32 */
/**
* Max texture level for the alpha texture used for antialiasing
*
* Don't use the 1x1 and 2x2 mipmap levels.
*/
#define MAX_TEXTURE_LEVEL (TEXTURE_SIZE_LOG2 - 2)
/**
@@ -403,8 +410,8 @@ aaline_create_texture(struct aaline_stage *aaline)
texTemp.target = PIPE_TEXTURE_2D;
texTemp.format = PIPE_FORMAT_A8_UNORM; /* XXX verify supported by driver! */
texTemp.last_level = MAX_TEXTURE_LEVEL;
texTemp.width0 = 1 << MAX_TEXTURE_LEVEL;
texTemp.height0 = 1 << MAX_TEXTURE_LEVEL;
texTemp.width0 = 1 << TEXTURE_SIZE_LOG2;
texTemp.height0 = 1 << TEXTURE_SIZE_LOG2;
texTemp.depth0 = 1;
texTemp.array_size = 1;
texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
@@ -461,7 +468,7 @@ aaline_create_texture(struct aaline_stage *aaline)
d = 200; /* tuneable */
}
else if (i == 0 || j == 0 || i == size - 1 || j == size - 1) {
d = 0;
d = 35; /* edge texel */
}
else {
d = 255;
@@ -498,8 +505,7 @@ aaline_create_sampler(struct aaline_stage *aaline)
sampler.mag_img_filter = PIPE_TEX_FILTER_LINEAR;
sampler.normalized_coords = 1;
sampler.min_lod = 0.0f;
/* avoid using the 1x1 and 2x2 mipmap levels */
sampler.max_lod = MAX_TEXTURE_LEVEL - 2;
sampler.max_lod = MAX_TEXTURE_LEVEL;
aaline->sampler_cso = pipe->create_sampler_state(pipe, &sampler);
if (aaline->sampler_cso == NULL)

View File

@@ -874,6 +874,8 @@ draw_install_aapoint_stage(struct draw_context *draw,
{
struct aapoint_stage *aapoint;
pipe->draw = (void *) draw;
/*
* Create / install AA point drawing / prim stage
*/

View File

@@ -27,8 +27,9 @@
/**
* Polygon stipple stage: implement polygon stipple with texture map and
* fragment program. The fragment program samples the texture and does
* a fragment kill for the stipple-failing fragments.
* fragment program. The fragment program samples the texture using the
* fragment window coordinate register and does a fragment kill for the
* stipple-failing fragments.
*
* Authors: Brian Paul
*/
@@ -114,7 +115,8 @@ struct pstip_stage
/**
* Subclass of tgsi_transform_context, used for transforming the
* user's fragment shader to add the special AA instructions.
* user's fragment shader to add the extra texture sample and fragment kill
* instructions.
*/
struct pstip_transform_context {
struct tgsi_transform_context base;
@@ -386,13 +388,6 @@ pstip_update_texture(struct pstip_stage *pstip)
uint i, j;
ubyte *data;
/* XXX: want to avoid flushing just because we use stipple:
*
* Flush should no longer be necessary if driver is properly
* interleaving drawing and transfers on a given context:
*/
pipe->flush( pipe, PIPE_FLUSH_TEXTURE_CACHE, NULL );
transfer = pipe_get_transfer(pipe, pstip->texture, 0, 0,
PIPE_TRANSFER_WRITE, 0, 0, 32, 32);
data = pipe->transfer_map(pipe, transfer);
@@ -658,16 +653,16 @@ pstip_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *fs)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
struct pstip_fragment_shader *aafs = CALLOC_STRUCT(pstip_fragment_shader);
struct pstip_fragment_shader *pstipfs = CALLOC_STRUCT(pstip_fragment_shader);
if (aafs) {
aafs->state = *fs;
if (pstipfs) {
pstipfs->state = *fs;
/* pass-through */
aafs->driver_fs = pstip->driver_create_fs_state(pstip->pipe, fs);
pstipfs->driver_fs = pstip->driver_create_fs_state(pstip->pipe, fs);
}
return aafs;
return pstipfs;
}
@@ -675,12 +670,12 @@ static void
pstip_bind_fs_state(struct pipe_context *pipe, void *fs)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
struct pstip_fragment_shader *aafs = (struct pstip_fragment_shader *) fs;
struct pstip_fragment_shader *pstipfs = (struct pstip_fragment_shader *) fs;
/* save current */
pstip->fs = aafs;
pstip->fs = pstipfs;
/* pass-through */
pstip->driver_bind_fs_state(pstip->pipe,
(aafs ? aafs->driver_fs : NULL));
(pstipfs ? pstipfs->driver_fs : NULL));
}
@@ -688,14 +683,14 @@ static void
pstip_delete_fs_state(struct pipe_context *pipe, void *fs)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
struct pstip_fragment_shader *aafs = (struct pstip_fragment_shader *) fs;
struct pstip_fragment_shader *pstipfs = (struct pstip_fragment_shader *) fs;
/* pass-through */
pstip->driver_delete_fs_state(pstip->pipe, aafs->driver_fs);
pstip->driver_delete_fs_state(pstip->pipe, pstipfs->driver_fs);
if (aafs->pstip_fs)
pstip->driver_delete_fs_state(pstip->pipe, aafs->pstip_fs);
if (pstipfs->pstip_fs)
pstip->driver_delete_fs_state(pstip->pipe, pstipfs->pstip_fs);
FREE(aafs);
FREE(pstipfs);
}

View File

@@ -29,6 +29,7 @@
*/
#include "util/u_memory.h"
#include "util/u_math.h"
#include "pipe/p_defines.h"
#include "draw_private.h"
#include "draw_pipe.h"
@@ -86,7 +87,7 @@ draw_need_pipeline(const struct draw_context *draw,
return TRUE;
/* wide lines */
if (rasterizer->line_width > draw->pipeline.wide_line_threshold)
if (roundf(rasterizer->line_width) > draw->pipeline.wide_line_threshold)
return TRUE;
/* AA lines */
@@ -169,7 +170,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
stage->next = next;
/* drawing wide lines? */
wide_lines = (rast->line_width > draw->pipeline.wide_line_threshold
wide_lines = (roundf(rast->line_width) > draw->pipeline.wide_line_threshold
&& !rast->line_smooth);
/* drawing large/sprite points (but not AA points)? */

View File

@@ -286,6 +286,7 @@ struct draw_context
#ifdef HAVE_LLVM
struct draw_llvm *llvm;
struct gallivm_state *own_gallivm;
#endif
struct pipe_sampler_view *sampler_views[PIPE_MAX_VERTEX_SAMPLERS];

View File

@@ -459,10 +459,9 @@ draw_vbo(struct draw_context *draw,
}
debug_printf("Buffers:\n");
for (i = 0; i < draw->pt.nr_vertex_buffers; i++) {
debug_printf(" %u: stride=%u maxindex=%u offset=%u ptr=%p\n",
debug_printf(" %u: stride=%u offset=%u ptr=%p\n",
i,
draw->pt.vertex_buffer[i].stride,
draw->pt.vertex_buffer[i].max_index,
draw->pt.vertex_buffer[i].buffer_offset,
draw->pt.user.vbuffer[i]);
}

View File

@@ -139,7 +139,7 @@ void draw_pt_fetch_run( struct pt_fetch *fetch,
((char *)draw->pt.user.vbuffer[i] +
draw->pt.vertex_buffer[i].buffer_offset),
draw->pt.vertex_buffer[i].stride,
draw->pt.vertex_buffer[i].max_index);
draw->pt.user.max_index);
}
translate->run_elts( translate,
@@ -166,7 +166,7 @@ void draw_pt_fetch_run_linear( struct pt_fetch *fetch,
((char *)draw->pt.user.vbuffer[i] +
draw->pt.vertex_buffer[i].buffer_offset),
draw->pt.vertex_buffer[i].stride,
draw->pt.vertex_buffer[i].max_index);
draw->pt.user.max_index);
}
translate->run( translate,

View File

@@ -186,7 +186,7 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
((char *)draw->pt.user.vbuffer[i] +
draw->pt.vertex_buffer[i].buffer_offset),
draw->pt.vertex_buffer[i].stride,
draw->pt.vertex_buffer[i].max_index);
draw->pt.user.max_index);
}
*max_vertices = (draw->render->max_vertex_buffer_bytes /

View File

@@ -58,8 +58,8 @@ struct fetch_shade_emit {
const ubyte *src[PIPE_MAX_ATTRIBS];
unsigned prim;
struct draw_vs_varient_key key;
struct draw_vs_varient *active;
struct draw_vs_variant_key key;
struct draw_vs_variant *active;
const struct vertex_info *vinfo;
@@ -150,7 +150,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
}
fse->active = draw_vs_lookup_varient( draw->vs.vertex_shader,
fse->active = draw_vs_lookup_variant( draw->vs.vertex_shader,
&fse->key );
if (!fse->active) {
@@ -169,7 +169,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
((const ubyte *) draw->pt.user.vbuffer[i] +
draw->pt.vertex_buffer[i].buffer_offset),
draw->pt.vertex_buffer[i].stride,
draw->pt.vertex_buffer[i].max_index );
draw->pt.user.max_index );
}
*max_vertices = (draw->render->max_vertex_buffer_bytes /

Some files were not shown because too many files have changed in this diff Show More