summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/lower_ubo_reference.cpp
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-05-11 10:49:19 +1000
committerDave Airlie <[email protected]>2016-06-06 15:58:37 +1000
commit78659ade404a0761968ab5240c812e4c3119d669 (patch)
tree1c290cc2d1460ace7d44c602cf2891561d4e410e /src/compiler/glsl/lower_ubo_reference.cpp
parentff2e569153d48bda347be729fc441852ab293138 (diff)
glsl: use enum glsl_interface_packing in more places. (v2)
Although the glsl_types.h stores this in a bitfield, we should hide that from everyone else. Hide the cast in an accessor method and use the enum everywhere. This makes things a bit nicer in gdb, and improves type safety. v2: fix a few pieces of interface I missed that caused some piglit regressions. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/compiler/glsl/lower_ubo_reference.cpp')
-rw-r--r--src/compiler/glsl/lower_ubo_reference.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/glsl/lower_ubo_reference.cpp b/src/compiler/glsl/lower_ubo_reference.cpp
index 749deedcd1c..c27de0b2565 100644
--- a/src/compiler/glsl/lower_ubo_reference.cpp
+++ b/src/compiler/glsl/lower_ubo_reference.cpp
@@ -61,7 +61,7 @@ public:
unsigned *const_offset,
bool *row_major,
int *matrix_columns,
- unsigned packing);
+ enum glsl_interface_packing packing);
uint32_t ssbo_access_params();
ir_expression *ubo_load(void *mem_ctx, const struct glsl_type *type,
ir_rvalue *offset);
@@ -99,7 +99,7 @@ public:
ir_expression *emit_ssbo_get_buffer_size(void *mem_ctx);
unsigned calculate_unsized_array_stride(ir_dereference *deref,
- unsigned packing);
+ enum glsl_interface_packing packing);
ir_call *lower_ssbo_atomic_intrinsic(ir_call *ir);
ir_call *check_for_ssbo_atomic_intrinsic(ir_call *ir);
@@ -273,7 +273,7 @@ lower_ubo_reference_visitor::setup_for_load_or_store(void *mem_ctx,
unsigned *const_offset,
bool *row_major,
int *matrix_columns,
- unsigned packing)
+ enum glsl_interface_packing packing)
{
/* Determine the name of the interface block */
ir_rvalue *nonconst_block_index;
@@ -344,7 +344,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
unsigned const_offset;
bool row_major;
int matrix_columns;
- unsigned packing = var->get_interface_type()->interface_packing;
+ enum glsl_interface_packing packing = var->get_interface_type_packing();
this->buffer_access_type =
var->is_in_shader_storage_block() ?
@@ -557,7 +557,7 @@ lower_ubo_reference_visitor::write_to_memory(void *mem_ctx,
unsigned const_offset;
bool row_major;
int matrix_columns;
- unsigned packing = var->get_interface_type()->interface_packing;
+ enum glsl_interface_packing packing = var->get_interface_type_packing();
this->buffer_access_type = ssbo_store_access;
this->variable = var;
@@ -666,7 +666,7 @@ lower_ubo_reference_visitor::emit_ssbo_get_buffer_size(void *mem_ctx)
unsigned
lower_ubo_reference_visitor::calculate_unsized_array_stride(ir_dereference *deref,
- unsigned packing)
+ enum glsl_interface_packing packing)
{
unsigned array_stride = 0;
@@ -736,7 +736,7 @@ lower_ubo_reference_visitor::process_ssbo_unsized_array_length(ir_rvalue **rvalu
unsigned const_offset;
bool row_major;
int matrix_columns;
- unsigned packing = var->get_interface_type()->interface_packing;
+ enum glsl_interface_packing packing = var->get_interface_type_packing();
int unsized_array_stride = calculate_unsized_array_stride(deref, packing);
this->buffer_access_type = ssbo_unsized_array_length_access;
@@ -970,7 +970,7 @@ lower_ubo_reference_visitor::lower_ssbo_atomic_intrinsic(ir_call *ir)
unsigned const_offset;
bool row_major;
int matrix_columns;
- unsigned packing = var->get_interface_type()->interface_packing;
+ enum glsl_interface_packing packing = var->get_interface_type_packing();
this->buffer_access_type = ssbo_atomic_access;
this->variable = var;