glsl: Fix samplerCubeShadow support in shader compiler
authorAnuj Phogat <anuj.phogat@gmail.com>
Tue, 6 Dec 2011 19:11:03 +0000 (11:11 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 7 Dec 2011 23:11:29 +0000 (15:11 -0800)
This patch fixes the samplerCubeShadow support in GLSL shader compiler.
shader compiler was picking the 'r' texture coordinate for shadow comparison
when the expected behaviour is to use 'q' texture coordinate in case of cube
shadow maps.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/builtins/tools/texture_builtins.py

index 27cc027cd40650531b3497cbc98ff3a9956a008f..07d0a1b8d76a02f7bc4b180ad1fd829e9a3a2c22 100755 (executable)
@@ -105,7 +105,7 @@ def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
             print "1",
 
         # Shadow comparitor
-        if sampler_type == "2DArrayShadow": # a special case:
+        if sampler_type == "2DArrayShadow" or sampler_type == "CubeShadow": # a special case:
             print "(swiz w (var_ref P))",   # ...array layer is z; shadow is w
         elif sampler_type.endswith("Shadow"):
             print "(swiz z (var_ref P))",