From cc809d4de9e8e94a8caa7bef58f0ac26e10fecd2 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 14 Dec 2023 22:15:28 -0800 Subject: [PATCH] nouveau: Use glsl_type C helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Jesse Natalie Acked-by: Marek Olšák Part-of: --- src/nouveau/codegen/nv50_ir_from_nir.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nouveau/codegen/nv50_ir_from_nir.cpp b/src/nouveau/codegen/nv50_ir_from_nir.cpp index 9bdc45b9cce..7543b4446b7 100644 --- a/src/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/nouveau/codegen/nv50_ir_from_nir.cpp @@ -889,13 +889,13 @@ static uint16_t calcSlots(const glsl_type *type, Program::Type stage, const shader_info &info, bool input, const nir_variable *var) { - if (!type->is_array()) - return type->count_attribute_slots(false); + if (!glsl_type_is_array(type)) + return glsl_count_attribute_slots(type, false); uint16_t slots; switch (stage) { case Program::TYPE_GEOMETRY: - slots = type->count_attribute_slots(false); + slots = glsl_count_attribute_slots(type, false); if (input) slots /= info.gs.vertices_in; break; @@ -903,12 +903,12 @@ calcSlots(const glsl_type *type, Program::Type stage, const shader_info &info, case Program::TYPE_TESSELLATION_EVAL: // remove first dimension if (var->data.patch || (!input && stage == Program::TYPE_TESSELLATION_EVAL)) - slots = type->count_attribute_slots(false); + slots = glsl_count_attribute_slots(type, false); else - slots = type->fields.array->count_attribute_slots(false); + slots = glsl_count_attribute_slots(type->fields.array, false); break; default: - slots = type->count_attribute_slots(false); + slots = glsl_count_attribute_slots(type, false); break; } @@ -917,10 +917,10 @@ calcSlots(const glsl_type *type, Program::Type stage, const shader_info &info, static uint8_t getMaskForType(const glsl_type *type, uint8_t slot) { - uint16_t comp = type->without_array()->components(); + uint16_t comp = glsl_get_components(glsl_without_array(type)); comp = comp ? comp : 4; - if (glsl_base_type_is_64bit(type->without_array()->base_type)) { + if (glsl_base_type_is_64bit(glsl_without_array(type)->base_type)) { comp *= 2; if (comp > 4) { if (slot % 2) @@ -1018,7 +1018,7 @@ bool Converter::assignSlots() { assert(glsl_type_is_scalar(type->fields.array)); assert(slots == glsl_get_length(type)); } - assert(!glsl_base_type_is_64bit(type->without_array()->base_type)); + assert(!glsl_base_type_is_64bit(glsl_without_array(type)->base_type)); uint32_t comps = BITFIELD_RANGE(var->data.location_frac, slots); assert(!(comps & ~0xff)); @@ -1122,7 +1122,7 @@ bool Converter::assignSlots() { assert(glsl_type_is_scalar(type->fields.array)); assert(slots == glsl_get_length(type)); } - assert(!glsl_base_type_is_64bit(type->without_array()->base_type)); + assert(!glsl_base_type_is_64bit(glsl_without_array(type)->base_type)); uint32_t comps = BITFIELD_RANGE(var->data.location_frac, slots); assert(!(comps & ~0xff));