From 78659ade404a0761968ab5240c812e4c3119d669 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 11 May 2016 10:49:19 +1000 Subject: 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 Reviewed-by: Ilia Mirkin --- src/compiler/glsl/link_uniforms.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/compiler/glsl/link_uniforms.cpp') diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index ff2989f8cff..3a2ac4d30d7 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -65,7 +65,7 @@ program_resource_visitor::process(const glsl_type *type, const char *name) unsigned record_array_count = 1; char *name_copy = ralloc_strdup(NULL, name); - unsigned packing = type->interface_packing; + enum glsl_interface_packing packing = type->get_interface_packing(); recursion(type, &name_copy, strlen(name), false, NULL, packing, false, record_array_count, NULL); @@ -79,9 +79,9 @@ program_resource_visitor::process(ir_variable *var) const bool row_major = var->data.matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR; - const unsigned packing = var->get_interface_type() ? - var->get_interface_type()->interface_packing : - var->type->interface_packing; + const enum glsl_interface_packing packing = var->get_interface_type() ? + var->get_interface_type_packing() : + var->type->get_interface_packing(); const glsl_type *t = var->data.from_named_ifc_block ? var->get_interface_type() : var->type; @@ -116,7 +116,7 @@ void program_resource_visitor::recursion(const glsl_type *t, char **name, size_t name_length, bool row_major, const glsl_type *record_type, - const unsigned packing, + const enum glsl_interface_packing packing, bool last_field, unsigned record_array_count, const glsl_struct_field *named_ifc_member) @@ -228,7 +228,7 @@ void program_resource_visitor::visit_field(const glsl_type *type, const char *name, bool row_major, const glsl_type *, - const unsigned, + const enum glsl_interface_packing, bool /* last_field */) { visit_field(type, name, row_major); @@ -243,13 +243,13 @@ program_resource_visitor::visit_field(const glsl_struct_field *field) void program_resource_visitor::enter_record(const glsl_type *, const char *, bool, - const unsigned) + const enum glsl_interface_packing) { } void program_resource_visitor::leave_record(const glsl_type *, const char *, bool, - const unsigned) + const enum glsl_interface_packing) { } @@ -660,7 +660,7 @@ private: } virtual void enter_record(const glsl_type *type, const char *, - bool row_major, const unsigned packing) { + bool row_major, const enum glsl_interface_packing packing) { assert(type->is_record()); if (this->buffer_block_index == -1) return; @@ -673,7 +673,7 @@ private: } virtual void leave_record(const glsl_type *type, const char *, - bool row_major, const unsigned packing) { + bool row_major, const enum glsl_interface_packing packing) { assert(type->is_record()); if (this->buffer_block_index == -1) return; @@ -687,7 +687,7 @@ private: virtual void visit_field(const glsl_type *type, const char *name, bool row_major, const glsl_type * /* record_type */, - const unsigned packing, + const enum glsl_interface_packing packing, bool /* last_field */) { assert(!type->without_array()->is_record()); -- cgit v1.2.3