[Mesa-dev] [PATCH] Fix samplerCubeShadow support in shader compiler
Kenneth Graunke
kenneth at whitecape.org
Tue Dec 6 12:27:30 PST 2011
On 12/06/2011 11:11 AM, Anuj Phogat wrote:
> From: Anuj Phogat <anuj at aphogat.(none)>
>
> 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 at aphogat.(none)>
> ---
> src/glsl/builtins/tools/texture_builtins.py | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py
> index 27cc027..959020b 100755
> --- a/src/glsl/builtins/tools/texture_builtins.py
> +++ b/src/glsl/builtins/tools/texture_builtins.py
> @@ -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))",
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
By the way, you probably will want to run:
git config --global user.email "anuj.phogat at gmail.com"
I'll plan on committing this tomorrow unless anyone objects.
More information about the mesa-dev
mailing list