From 233b88eab9d8095523ebae3c4be1dbf2e2bd856a Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 25 Feb 2011 14:29:36 -0800 Subject: 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. --- src/glsl/ir.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/glsl/ir.h') diff --git a/src/glsl/ir.h b/src/glsl/ir.h index f2f902c0a77..39d4ebc7107 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -1191,16 +1191,16 @@ enum ir_texture_opcode { * selected from \c ir_texture_opcodes. In the printed IR, these will * appear as: * - * Texel offset (0 or an expression) - * | Projection divisor - * | | Shadow comparitor - * | | | - * v v v - * (tex 0 1 ( )) - * (txb 0 1 ( ) ) - * (txl 0 1 ( ) ) - * (txd 0 1 ( ) (dPdx dPdy)) - * (txf 0 ) + * Texel offset (0 or an expression) + * | Projection divisor + * | | Shadow comparitor + * | | | + * v v v + * (tex 0 1 ( )) + * (txb 0 1 ( ) ) + * (txl 0 1 ( ) ) + * (txd 0 1 ( ) (dPdx dPdy)) + * (txf 0 ) */ class ir_texture : public ir_rvalue { public: @@ -1226,8 +1226,8 @@ public: */ const char *opcode_string(); - /** Set the sampler and infer the type. */ - void set_sampler(ir_dereference *sampler); + /** Set the sampler and type. */ + void set_sampler(ir_dereference *sampler, const glsl_type *type); /** * Do a reverse-lookup to translate a string into an ir_texture_opcode. -- cgit v1.2.3