From 43b8da3a8b70d54aa624cd485647b3288a0b7bbb Mon Sep 17 00:00:00 2001 From: George Ouzounoudis Date: Thu, 5 Jan 2023 18:21:38 -0600 Subject: [PATCH] nouveau/codegen: Support compact clip distances with arrayed_io Reviewed-by: M Henning Reviewed-by: Karol Herbst Part-of: --- src/nouveau/codegen/nv50_ir_from_nir.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/nouveau/codegen/nv50_ir_from_nir.cpp b/src/nouveau/codegen/nv50_ir_from_nir.cpp index 98af1a6..18e6166 100644 --- a/src/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/nouveau/codegen/nv50_ir_from_nir.cpp @@ -998,9 +998,15 @@ bool Converter::assignSlots() { if (var->data.compact) { assert(!var->data.patch); assert(!(nir->info.outputs_read & 1ull << slot)); - assert(glsl_type_is_array(type)); - assert(glsl_type_is_scalar(type->fields.array)); - assert(slots == glsl_get_length(type)); + if (nir_is_arrayed_io(var, nir->info.stage)) { + assert(glsl_type_is_array(type->fields.array)); + assert(glsl_type_is_scalar(type->fields.array->fields.array)); + assert(slots == glsl_get_length(type->fields.array)); + } else { + assert(glsl_type_is_array(type)); + 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)); uint32_t comps = BITFIELD_RANGE(var->data.location_frac, slots); @@ -1105,9 +1111,15 @@ bool Converter::assignSlots() { if (var->data.compact) { assert(!var->data.patch); assert(!(nir->info.outputs_read & 1ull << slot)); - assert(glsl_type_is_array(type)); - assert(glsl_type_is_scalar(type->fields.array)); - assert(slots == glsl_get_length(type)); + if (nir_is_arrayed_io(var, nir->info.stage)) { + assert(glsl_type_is_array(type->fields.array)); + assert(glsl_type_is_scalar(type->fields.array->fields.array)); + assert(slots == glsl_get_length(type->fields.array)); + } else { + assert(glsl_type_is_array(type)); + 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)); uint32_t comps = BITFIELD_RANGE(var->data.location_frac, slots); -- 2.7.4