glsl: flag shaders which use gather4 at all
authorChris Forbes <chrisf@ijw.co.nz>
Wed, 25 Sep 2013 04:56:36 +0000 (16:56 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Wed, 2 Oct 2013 18:56:02 +0000 (07:56 +1300)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_set_program_inouts.cpp
src/mesa/main/mtypes.h

index 1267d6d71774cdc8f60b6f74c76ad168d0750283..ab23538c341ef2d6997fde0b8840a7b492a2e9df 100644 (file)
@@ -59,6 +59,7 @@ public:
    virtual ir_visitor_status visit_enter(ir_function_signature *);
    virtual ir_visitor_status visit_enter(ir_expression *);
    virtual ir_visitor_status visit_enter(ir_discard *);
+   virtual ir_visitor_status visit_enter(ir_texture *);
    virtual ir_visitor_status visit(ir_dereference_variable *);
 
 private:
@@ -319,6 +320,14 @@ ir_set_program_inouts_visitor::visit_enter(ir_discard *)
    return visit_continue;
 }
 
+ir_visitor_status
+ir_set_program_inouts_visitor::visit_enter(ir_texture *ir)
+{
+   if (ir->op == ir_tg4)
+      prog->UsesGather = true;
+   return visit_continue;
+}
+
 void
 do_set_program_inouts(exec_list *instructions, struct gl_program *prog,
                       GLenum shader_type)
index 3d414d5e76e7880d27e2ade6714923360efb1f52..514f81048d11394f1979539330994565db04eff5 100644 (file)
@@ -1963,6 +1963,8 @@ struct gl_program
    GLbitfield SamplersUsed;   /**< Bitfield of which samplers are used */
    GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */
 
+   GLboolean UsesGather; /**< Does this program use gather4 at all? */
+
 
    /** Named parameters, constants, etc. from program text */
    struct gl_program_parameter_list *Parameters;