mesa/src/glsl/tests
Marek Olšák d4a06d77f5 mesa: fix GLSL program objects with more than 16 samplers combined
The problem is the sampler units are allocated from the same pool for all
shader stages, so if a vertex shader uses 12 samplers (0..11), the fragment
shader samplers start at index 12, leaving only 4 sampler units
for the fragment shader. The main cause is probably the fact that samplers
(texture unit -> sampler unit mapping, etc.) are tracked globally
for an entire program object.

This commit adapts the GLSL linker and core Mesa such that the sampler units
are assigned to sampler uniforms for each shader stage separately
(if a sampler uniform is used in all shader stages, it may occupy a different
sampler unit in each, and vice versa, an i-th sampler unit may refer to
a different sampler uniform in each shader stage), and the sampler-specific
variables are moved from gl_shader_program to gl_shader.

This doesn't require any driver changes, and it fixes piglit/max-samplers
for gallium and classic swrast. It also works with any number of shader
stages.

v2: - converted tabs to spaces
    - added an assertion to _mesa_get_sampler_uniform_value

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-05-28 13:05:30 +02:00
..
lower_jumps glsl: Add unit tests for lower_jumps.cpp 2011-07-22 09:45:11 -07:00
.gitignore Clean up .gitignore files 2013-01-10 22:01:31 +01:00
compare_ir glsl: Add unit tests for lower_jumps.cpp 2011-07-22 09:45:11 -07:00
copy_constant_to_storage_tests.cpp glsl/tests: Add test for uniform initialization by the linker 2012-05-23 11:42:08 -07:00
optimization-test glsl/build: Build tests via the glsl Makefile 2013-01-22 14:33:24 -08:00
ralloc_test.cpp ralloc: Add some basic unit tests. 2012-05-30 21:49:41 -07:00
set_uniform_initializer_tests.cpp mesa: fix GLSL program objects with more than 16 samplers combined 2013-05-28 13:05:30 +02:00
sexps.py glsl: Add unit tests for lower_jumps.cpp 2011-07-22 09:45:11 -07:00
uniform_initializer_utils.cpp glsl: Add GLSL_TYPE_INTERFACE 2013-01-25 09:07:33 -05:00
uniform_initializer_utils.h glsl/tests: Add test for uniform initialization by the linker 2012-05-23 11:42:08 -07:00