From c154d403d375690488f4526de27dd6a8344af827 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Tue, 1 Feb 2022 12:50:08 -0800 Subject: [PATCH] microsoft/compiler: Handle I/O vars larger than a vec4 Reviewed-by: Bill Kristiansen Reviewed-By: Sil Vilerino Part-of: --- src/microsoft/compiler/dxil_signature.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/microsoft/compiler/dxil_signature.c b/src/microsoft/compiler/dxil_signature.c index f316a38..a5e6f24 100644 --- a/src/microsoft/compiler/dxil_signature.c +++ b/src/microsoft/compiler/dxil_signature.c @@ -135,12 +135,14 @@ get_additional_semantic_info(nir_shader *s, nir_variable *var, struct semantic_i info->rows = 1; if (info->kind == DXIL_SEM_TARGET) { info->start_row = info->index; + info->cols = (uint8_t)glsl_get_components(type); } else if (is_depth || (info->kind == DXIL_SEM_PRIMITIVE_ID && is_gs_input) || info->kind == DXIL_SEM_COVERAGE || info->kind == DXIL_SEM_SAMPLE_INDEX) { // This turns into a 'N/A' mask in the disassembly info->start_row = -1; + info->cols = 1; } else if (info->kind == DXIL_SEM_TESS_FACTOR || info->kind == DXIL_SEM_INSIDE_TESS_FACTOR) { assert(var->data.compact); @@ -169,18 +171,12 @@ get_additional_semantic_info(nir_shader *s, nir_variable *var, struct semantic_i info->start_col = (uint8_t)var->data.location_frac; } else { info->start_row = next_row; - if (glsl_type_is_array(type)) { - info->rows = glsl_get_aoa_size(type); + info->rows = glsl_count_vec4_slots(type, false, false); + if (glsl_type_is_array(type)) type = glsl_get_array_element(type); - assert(info->rows); - } next_row += info->rows; info->start_col = (uint8_t)var->data.location_frac; - } - if (!info->cols) { - if (glsl_type_is_array(type)) - type = glsl_get_array_element(type); - info->cols = (uint8_t)glsl_get_components(type); + info->cols = MIN2(glsl_get_component_slots(type), 4); } return next_row; -- 2.7.4