r600: fix emit_ssbo_store() wrmask compatibility
This issue was generating unwanted write accesses that could overwrite previous operations. Note: This functionality could also be tested with nir_lower_wrmasks. This problem seems to only affect the ssbos. This change was tested on cypress, barts and cayman. Here are the tests fixed: khr-gl4[3-6]/compute_shader/pipeline-pre-vs: fail pass khr-gl4[5-6]/direct_state_access/queries_functional: fail pass khr-gl4[5-6]/es_31_compatibility/shader_image_load_store/advanced-cast-cs: fail pass khr-gl4[5-6]/es_31_compatibility/shader_image_load_store/advanced-cast-fs: fail pass khr-gl4[5-6]/es_31_compatibility/shader_storage_buffer_object/advanced-switchbuffers-cs: fail pass khr-gl4[5-6]/es_31_compatibility/shader_storage_buffer_object/advanced-switchprograms-cs: fail pass khr-gl4[5-6]/es_31_compatibility/shader_storage_buffer_object/basic-operations-case1-cs: fail pass khr-gl4[3-6]/shader_storage_buffer_object/advanced-switchbuffers-cs: fail pass khr-gl4[3-6]/shader_storage_buffer_object/advanced-switchprograms-cs: fail pass khr-gl4[3-6]/shader_storage_buffer_object/basic-operations-case1-cs: fail pass khr-gl4[4-6]/texture_buffer/texture_buffer_max_size: fail pass khr-gles31/core/compute_shader/pipeline-pre-vs: fail pass khr-gles31/core/shader_image_load_store/advanced-cast-cs: fail pass khr-gles31/core/shader_image_load_store/advanced-cast-fs: fail pass khr-gles31/core/shader_storage_buffer_object/advanced-switchbuffers-cs: fail pass khr-gles31/core/shader_storage_buffer_object/advanced-switchprograms-cs: fail pass khr-gles31/core/shader_storage_buffer_object/basic-operations-case1-cs: fail pass khr-gles31/core/texture_buffer/texture_buffer_max_size: fail pass khr-glesext/texture_buffer/texture_buffer_max_size: fail pass Cc: mesa-stable Signed-off-by: Patrick Lerda <patrick9876@free.fr> Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35830>
This commit is contained in:
@@ -618,11 +618,15 @@ RatInstr::emit_ssbo_store(nir_intrinsic_instr *instr, Shader& shader)
|
||||
auto addr_base = vf.temp_register();
|
||||
|
||||
auto [offset, rat_id] = shader.evaluate_resource_offset(instr, 1);
|
||||
const unsigned wrmask = nir_intrinsic_write_mask(instr);
|
||||
|
||||
shader.emit_instruction(
|
||||
new AluInstr(op2_lshr_int, addr_base, orig_addr, vf.literal(2), AluInstr::write));
|
||||
|
||||
for (unsigned i = 0; i < nir_src_num_components(instr->src[0]); ++i) {
|
||||
if (!(BITFIELD_BIT(i) & wrmask))
|
||||
continue;
|
||||
|
||||
auto addr_vec = vf.temp_vec4(pin_group, {0, 1, 2, 7});
|
||||
if (i == 0) {
|
||||
shader.emit_instruction(
|
||||
|
||||
Reference in New Issue
Block a user