diff options
author | Eric Anholt <[email protected]> | 2010-04-20 12:26:49 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-04-20 12:46:23 -0700 |
commit | 1407daf9bc9e0452a171aaca2ab8e389ccca5462 (patch) | |
tree | 65682a6795cb33c86f665586e95bccec177a71e1 /src/mesa/drivers/dri | |
parent | ac3529eec4d08c2d9633d7b1bba8413cc507f3c1 (diff) |
i915: Map sampler indices to texture units correctly for fragment shaders.
Fixes hang with "gst-launch-0.10 videotestsrc ! video/x-raw-rgb !
glupload ! gleffects effect=heat ! glimagesink" which uses 2 samplers
pointing at GL_TEXTURE1 and GL_TEXTURE2, and piglit
glsl-fs-sampler-numbering.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_fragprog.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 906d5855a75..9f12e2c632e 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -255,8 +255,10 @@ translate_tex_src_target(struct i915_fragment_program *p, GLubyte bit) #define EMIT_TEX( OP ) \ do { \ GLuint dim = translate_tex_src_target( p, inst->TexSrcTarget ); \ + const struct gl_fragment_program *program = p->ctx->FragmentProgram._Current; \ + GLuint unit = program->Base.SamplerUnits[inst->TexSrcUnit]; \ GLuint sampler = i915_emit_decl(p, REG_TYPE_S, \ - inst->TexSrcUnit, dim); \ + unit, dim); \ GLuint coord = src_vector( p, &inst->SrcReg[0], program); \ /* Texel lookup */ \ \ |