This patch fix an assertion in in-parameter-struct and normal-parameter-struct.
However, both tests still fail because _mesa_get_sampler_uniform_value handles global uniform samplers only. Looking at the specification, it's not really clear that sampler*D are valid as a structure member. >From GLSL Specification 1.10, Section 4.1.7: 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 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev