glsl: keep track of ssbo variable being accessed, add access params
Currently any access params (coherent/volatile/restrict) are being lost when lowering to the ssbo load/store intrinsics. Keep track of the variable being used, and bake its access params in as the last arg of the load/store intrinsics. If the variable is accessed via an instance block, then 'variable' points to the instance block variable and not the field inside the instance block that we are accessing. In order to check access parameters for the field itself we need to detect this case and keep track of the corresponding field struct so we can extract the specific field access information from there instead. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1) v1 -> v2: add tracking of struct field v2 -> v3: minor adjustments based on Iago's feedback Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
@@ -142,7 +142,7 @@ lower_shared_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
|
||||
|
||||
setup_buffer_access(mem_ctx, var, deref,
|
||||
&offset, &const_offset,
|
||||
&row_major, &matrix_columns, packing);
|
||||
&row_major, &matrix_columns, NULL, packing);
|
||||
|
||||
/* Now that we've calculated the offset to the start of the
|
||||
* dereference, walk over the type and emit loads into a temporary.
|
||||
@@ -210,7 +210,7 @@ lower_shared_reference_visitor::handle_assignment(ir_assignment *ir)
|
||||
|
||||
setup_buffer_access(mem_ctx, var, deref,
|
||||
&offset, &const_offset,
|
||||
&row_major, &matrix_columns, packing);
|
||||
&row_major, &matrix_columns, NULL, packing);
|
||||
|
||||
deref = new(mem_ctx) ir_dereference_variable(store_var);
|
||||
|
||||
@@ -370,7 +370,7 @@ lower_shared_reference_visitor::lower_shared_atomic_intrinsic(ir_call *ir)
|
||||
|
||||
setup_buffer_access(mem_ctx, var, deref,
|
||||
&offset, &const_offset,
|
||||
&row_major, &matrix_columns, packing);
|
||||
&row_major, &matrix_columns, NULL, packing);
|
||||
|
||||
assert(offset);
|
||||
assert(!row_major);
|
||||
|
||||
Reference in New Issue
Block a user