summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniforms.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2012-04-10 10:40:11 -0700
committerIan Romanick <ian.d.romanick@intel.com>2012-05-23 11:42:07 -0700
commitb610881317a7775a7ffe5f032099d8b2dc45eff0 (patch)
tree76bcf256e9998f96236488b940a642ddb35cab6f /src/mesa/main/uniforms.c
parenta2e623054b5d8eafebc7499efe93e4bceae16ead (diff)
downloadexternal_mesa3d-b610881317a7775a7ffe5f032099d8b2dc45eff0.zip
external_mesa3d-b610881317a7775a7ffe5f032099d8b2dc45eff0.tar.gz
external_mesa3d-b610881317a7775a7ffe5f032099d8b2dc45eff0.tar.bz2
glsl: Initialize samplers to 0, propagate sampler values to the gl_program
The spec requires that samplers be initialized to 0. Since this differs from the 1-to-1 mapping of samplers to texture units assumed by ARB assembly shaders (and the gl_program structure), be sure to propagate this date from the gl_shader_program to the gl_program. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> CC: Vadim Girlin <vadimgirlin@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49088
Diffstat (limited to 'src/mesa/main/uniforms.c')
-rw-r--r--src/mesa/main/uniforms.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index be1e172..e6604b1 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -65,6 +65,7 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg,
{
GLuint s;
+ memcpy(prog->SamplerUnits, shProg->SamplerUnits, sizeof(prog->SamplerUnits));
memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
for (s = 0; s < MAX_SAMPLERS; s++) {