From 6336cf0ea28e2cf4085da77f02920c25c5195881 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 19 May 2025 16:32:21 +0300 Subject: [PATCH] brw: store the remapping table for wa_18019110168 in constant data That way it can be accessed at runtime. Signed-off-by: Lionel Landwerlin Reviewed-by: Ivan Briano Part-of: --- src/intel/compiler/brw_compile_mesh.cpp | 19 ++++++++++++++++++- src/intel/compiler/brw_compiler.h | 9 +++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_compile_mesh.cpp b/src/intel/compiler/brw_compile_mesh.cpp index 2053bbe5f8e..f5fdb253cb3 100644 --- a/src/intel/compiler/brw_compile_mesh.cpp +++ b/src/intel/compiler/brw_compile_mesh.cpp @@ -1315,6 +1315,23 @@ brw_compile_mesh(const struct brw_compiler *compiler, g.generate_code(selected->cfg, selected->dispatch_width, selected->shader_stats, selected->performance_analysis.require(), params->base.stats); - g.add_const_data(nir->constant_data, nir->constant_data_size); + if (prog_data->map.wa_18019110168_active) { + uint8_t *const_data = + (uint8_t *) rzalloc_size(params->base.mem_ctx, + nir->constant_data_size + + sizeof(prog_data->map.per_primitive_offsets)); + memcpy(const_data, nir->constant_data, nir->constant_data_size); + memcpy(const_data + nir->constant_data_size, + prog_data->map.per_primitive_offsets, + sizeof(prog_data->map.per_primitive_offsets)); + g.add_const_data(const_data, + nir->constant_data_size + + sizeof(prog_data->map.per_primitive_offset)); + prog_data->wa_18019110168_mapping_offset = + prog_data->base.base.const_data_offset + nir->constant_data_size; + } else { + g.add_const_data(nir->constant_data, nir->constant_data_size); + } + return g.get_assembly(); } diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index bb4343d5572..09cc3263fca 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -1306,6 +1306,15 @@ struct brw_mesh_prog_data { bool uses_drawid; bool autostrip_enable; + + /** + * Offset in the program where the remapping table for Wa_18019110168 is + * located. + * + * The remapping table has the same format as + * intel_vue_map::varying_to_slot[] + */ + uint32_t wa_18019110168_mapping_offset; }; /* brw_any_prog_data is prog_data for any stage that maps to an API stage */