diff --git a/.pick_status.json b/.pick_status.json index 8554f98d7b4..3012694b7ae 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -22594,7 +22594,7 @@ "description": "nir: fix slot calculations for compact variables with location_frac", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 719d72c8c36..4093dbdb313 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -211,7 +211,7 @@ mark_whole_variable(nir_shader *shader, nir_variable *var, } const unsigned slots = - var->data.compact ? DIV_ROUND_UP(glsl_get_length(type), 4) + var->data.compact ? DIV_ROUND_UP(var->data.location_frac + glsl_get_length(type), 4) : glsl_count_attribute_slots(type, false); set_io_mask(shader, var, 0, slots, deref, is_output_read); @@ -288,7 +288,7 @@ try_mask_partial_io(nir_shader *shader, nir_variable *var, return false; const unsigned slots = - var->data.compact ? DIV_ROUND_UP(glsl_get_length(type), 4) + var->data.compact ? DIV_ROUND_UP(var->data.location_frac + glsl_get_length(type), 4) : glsl_count_attribute_slots(type, false); if (offset >= slots) { diff --git a/src/freedreno/vulkan/tu_shader.cc b/src/freedreno/vulkan/tu_shader.cc index 6620c6c1c57..90cb01860a2 100644 --- a/src/freedreno/vulkan/tu_shader.cc +++ b/src/freedreno/vulkan/tu_shader.cc @@ -927,7 +927,7 @@ tu_gather_xfb_info(nir_shader *nir, struct ir3_stream_output_info *info) nir_foreach_shader_out_variable(var, nir) { unsigned slots = - var->data.compact ? DIV_ROUND_UP(glsl_get_length(var->type), 4) + var->data.compact ? DIV_ROUND_UP(var->data.location_frac + glsl_get_length(var->type), 4) : glsl_count_attribute_slots(var->type, false); for (unsigned i = 0; i < slots; i++) output_map[var->data.location + i] = var->data.driver_location + i; diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c index d8d5d0e16d8..48c80b58383 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c @@ -477,7 +477,7 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir, type = glsl_get_array_element(type); } - unsigned attrib_count = variable->data.compact ? DIV_ROUND_UP(glsl_get_length(type), 4) : + unsigned attrib_count = variable->data.compact ? DIV_ROUND_UP(variable->data.location_frac + glsl_get_length(type), 4) : glsl_count_attribute_slots(type, nir->info.stage == MESA_SHADER_VERTEX); i = variable->data.driver_location; @@ -577,7 +577,7 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir, type = glsl_get_array_element(type); } - unsigned attrib_count = variable->data.compact ? DIV_ROUND_UP(glsl_get_length(type), 4) : + unsigned attrib_count = variable->data.compact ? DIV_ROUND_UP(variable->data.location_frac + glsl_get_length(type), 4) : glsl_count_attribute_slots(type, false); for (unsigned k = 0; k < attrib_count; k++, i++) { diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c index 3fb8d47b1b2..99d440d9142 100644 --- a/src/gallium/frontends/lavapipe/lvp_pipeline.c +++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c @@ -527,7 +527,7 @@ lvp_shader_xfb_init(struct lvp_shader *shader) memset(output_mapping, 0, sizeof(output_mapping)); nir_foreach_shader_out_variable(var, shader->pipeline_nir->nir) { - unsigned slots = var->data.compact ? DIV_ROUND_UP(glsl_get_length(var->type), 4) + unsigned slots = var->data.compact ? DIV_ROUND_UP(var->data.location_frac + glsl_get_length(var->type), 4) : glsl_count_attribute_slots(var->type, false); for (unsigned i = 0; i < slots; i++) output_mapping[var->data.location + i] = var->data.driver_location + i; diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index 7b4b49992b5..4a7cef76439 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -70,7 +70,7 @@ fs_visitor::nir_setup_outputs() nir_foreach_shader_out_variable(var, nir) { const int loc = var->data.driver_location; const unsigned var_vec4s = - var->data.compact ? DIV_ROUND_UP(glsl_get_length(var->type), 4) + var->data.compact ? DIV_ROUND_UP(var->data.location_frac + glsl_get_length(var->type), 4) : type_size_vec4(var->type, true); vec4s[loc] = MAX2(vec4s[loc], var_vec4s); }