return this->interface_type;
}
+ enum glsl_interface_packing get_interface_type_packing() const
+ {
+ return this->interface_type->get_interface_packing();
+ }
/**
* Get the max_ifc_array_access pointer
*
* also considered active, even if no member of the block is
* referenced."
*/
- if (var->get_interface_type()->interface_packing ==
- GLSL_INTERFACE_PACKING_PACKED)
+ if (var->get_interface_type_packing() == GLSL_INTERFACE_PACKING_PACKED)
return visit_continue;
/* Process the block. Bail if there was an error.
* std140 layout qualifier, all its instances have been already marked
* as used in link_uniform_block_active_visitor::visit(ir_variable *).
*/
- if (var->get_interface_type()->interface_packing ==
- GLSL_INTERFACE_PACKING_PACKED) {
+ if (var->get_interface_type_packing() == GLSL_INTERFACE_PACKING_PACKED) {
b->var = var;
process_arrays(this->mem_ctx, ir, b);
}
}
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 (packing == GLSL_INTERFACE_PACKING_STD430)
this->offset = glsl_align(
}
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 is the last field of a structure, apply rule #9. The
virtual void visit_field(const glsl_type *type, const char *name,
bool row_major, const glsl_type *,
- const unsigned packing,
+ const enum glsl_interface_packing packing,
bool last_field)
{
assert(this->index < this->num_variables);
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);
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;
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)
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);
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)
{
}
}
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;
}
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;
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());
*/
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);
/**
virtual void visit_field(const glsl_struct_field *field);
virtual void enter_record(const glsl_type *type, const char *name,
- bool row_major, const unsigned packing);
+ bool row_major, const enum glsl_interface_packing packing);
virtual void leave_record(const glsl_type *type, const char *name,
- bool row_major, const unsigned packing);
+ bool row_major, const enum glsl_interface_packing packing);
virtual void set_buffer_offset(unsigned offset);
*/
void 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);
};
bool *row_major,
int *matrix_columns,
const glsl_struct_field **struct_field,
- unsigned packing)
+ enum glsl_interface_packing packing)
{
*offset = new(mem_ctx) ir_constant(0u);
*row_major = is_dereferenced_thing_row_major(deref);
ir_rvalue **offset, unsigned *const_offset,
bool *row_major, int *matrix_columns,
const glsl_struct_field **struct_field,
- unsigned packing);
+ enum glsl_interface_packing packing);
};
} /* namespace lower_buffer_access */
bool row_major;
int matrix_columns;
assert(var->get_interface_type() == NULL);
- const unsigned packing = GLSL_INTERFACE_PACKING_STD430;
+ const enum glsl_interface_packing packing = GLSL_INTERFACE_PACKING_STD430;
setup_buffer_access(mem_ctx, var, deref,
&offset, &const_offset,
bool row_major;
int matrix_columns;
assert(var->get_interface_type() == NULL);
- const unsigned packing = GLSL_INTERFACE_PACKING_STD430;
+ const enum glsl_interface_packing packing = GLSL_INTERFACE_PACKING_STD430;
setup_buffer_access(mem_ctx, var, deref,
&offset, &const_offset,
bool row_major;
int matrix_columns;
assert(var->get_interface_type() == NULL);
- const unsigned packing = GLSL_INTERFACE_PACKING_STD430;
+ const enum glsl_interface_packing packing = GLSL_INTERFACE_PACKING_STD430;
buffer_access_type = shared_atomic_access;
setup_buffer_access(mem_ctx, var, deref,
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);
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);
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;
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() ?
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;
unsigned
lower_ubo_reference_visitor::calculate_unsized_array_stride(ir_dereference *deref,
- unsigned packing)
+ enum glsl_interface_packing packing)
{
unsigned array_stride = 0;
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;
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;
* layouts, do not eliminate it.
*/
if (entry->var->is_in_buffer_block()) {
- if (entry->var->get_interface_type()->interface_packing !=
+ if (entry->var->get_interface_type_packing() !=
GLSL_INTERFACE_PACKING_PACKED)
continue;
}
*/
bool record_compare(const glsl_type *b, bool match_locations = true) const;
+ /**
+ * Get the type interface packing.
+ */
+ enum glsl_interface_packing get_interface_packing() const
+ {
+ return (enum glsl_interface_packing)interface_packing;
+ }
+
private:
static mtx_t mutex;