No subject


Sat Jan 21 07:14:24 PST 2012


Samplers can only be declared as function parameters or uniforms (see Section 4.3.5 “Uniform”).
Samplers are not allowed to be operands in expressions nor can they be assigned into.

On nvidia hardware, it seems to be supported. I would appreciate to know what other people think,
and what's the status of other hardware vendors since I don't have any ati/intel hardware here.

---
 src/glsl/opt_structure_splitting.cpp |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/glsl/opt_structure_splitting.cpp b/src/glsl/opt_structure_splitting.cpp
index 2c1f6bb..8b1f1b3 100644
--- a/src/glsl/opt_structure_splitting.cpp
+++ b/src/glsl/opt_structure_splitting.cpp
@@ -189,6 +189,7 @@ public:
    {
    }

+   virtual ir_visitor_status visit_leave(ir_texture *);
    virtual ir_visitor_status visit_leave(ir_assignment *);

    void split_deref(ir_dereference **deref);
@@ -259,6 +260,14 @@ ir_structure_splitting_visitor::handle_rvalue(ir_rvalue **rvalue)
 }

 ir_visitor_status
+ir_structure_splitting_visitor::visit_leave(ir_texture *ir)
+{
+   split_deref(&ir->sampler);
+
+   return ir_rvalue_visitor::visit_leave(ir);
+}
+
+ir_visitor_status
 ir_structure_splitting_visitor::visit_leave(ir_assignment *ir)
 {
    ir_dereference_variable *lhs_deref = ir->lhs->as_dereference_variable();
-- 
1.7.7.1.msysgit.0



More information about the mesa-dev mailing list