i965: Copy shader->shadow_samplers to prog->ShadowSamplers.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 1 Jan 2015 01:38:05 +0000 (17:38 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 5 Jan 2015 05:31:40 +0000 (21:31 -0800)
ir_to_mesa does this - apparently we just forgot or something.

Without this, we'll guess the wrong texture swizzle (XYZW for color
instead of XXX1 for depth) when doing precompiles.

This cuts 26 shader recompiles in a time demo of "Counter Strike:
Global Offensive" (58 -> 32) on Sandybridge.  Haswell still has 0
recompiles.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87886
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/drivers/dri/i965/brw_shader.cpp

index e38dfd6635dbe1942d261a3fb7d5a9e122ed69dd..d76134b833581e342043640b4fe88cfc8f1e3434 100644 (file)
@@ -242,6 +242,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
       do_set_program_inouts(shader->base.ir, prog, shader->base.Stage);
 
       prog->SamplersUsed = shader->base.active_samplers;
+      prog->ShadowSamplers = shader->base.shadow_samplers;
       _mesa_update_shader_textures_used(shProg, prog);
 
       _mesa_reference_program(ctx, &shader->base.Program, prog);