diff options
author | Kenneth Graunke <[email protected]> | 2011-02-25 14:29:36 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2011-03-14 13:03:50 -0700 |
commit | 233b88eab9d8095523ebae3c4be1dbf2e2bd856a (patch) | |
tree | 7e39ea474572d67c90e82b16ae6cd029224e28d4 /src/glsl/builtins/tools | |
parent | cb3317b85a9b8916317cb733ef4e6f13eaf0d890 (diff) |
glsl: Explicitly specify a type when reading/printing ir_texture.
This is necessary for GLSL 1.30+ shadow sampling functions, which return
a single float rather than splatting the value to a vec4 based on
GL_DEPTH_TEXTURE_MODE.
Diffstat (limited to 'src/glsl/builtins/tools')
-rwxr-xr-x | src/glsl/builtins/tools/texture_builtins.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py index 2792dd8d097..2fbe79010f9 100755 --- a/src/glsl/builtins/tools/texture_builtins.py +++ b/src/glsl/builtins/tools/texture_builtins.py @@ -49,12 +49,13 @@ def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0): extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields) offset_dim = get_sampler_dim(sampler_type) - # Print parameters - print " (signature", if variant & Single: - print "float" + return_type = "float" else: - print g + "vec4" + return_type = g + "vec4" + + # Print parameters + print " (signature", return_type print " (parameters" print " (declare (in) " + g + "sampler" + sampler_type + " sampler)" print " (declare (in) " + vec_type("i" if tex_inst == "txf" else "", coord_dim + extra_dim) + " P)", @@ -72,7 +73,7 @@ def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0): if tex_inst == "txb": print "\n (declare (in) float bias)", - print ")\n ((return (" + tex_inst + " (var_ref sampler)", + print ")\n ((return (" + tex_inst, return_type, "(var_ref sampler)", # Coordinate if extra_dim > 0: |