mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-14 13:20:28 +01:00
glsl: Don't do constant variable on buffer variables
Since the backing storage for these is shared we cannot ensure that the value won't change by writes from other threads. Normally SSBO accesses are not guaranteed to be syncronized with other threads, except when memoryBarrier is used. So, we might be able to optimize some SSBO accesses, but for now we always take the safe path and emit the SSBO access. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
0b1111d985
commit
5dfea83ee6
1 changed files with 7 additions and 0 deletions
|
|
@ -115,6 +115,13 @@ ir_constant_variable_visitor::visit_enter(ir_assignment *ir)
|
|||
if (!var)
|
||||
return visit_continue;
|
||||
|
||||
/* Ignore buffer variables, since the underlying storage is shared
|
||||
* and we can't be sure that this variable won't be written by another
|
||||
* thread.
|
||||
*/
|
||||
if (var->data.mode == ir_var_shader_storage)
|
||||
return visit_continue;
|
||||
|
||||
constval = ir->rhs->constant_expression_value();
|
||||
if (!constval)
|
||||
return visit_continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue