vkd3d-shader/spirv: Handle the sequentially consistent ordering flag for atomic instructions.

This commit is contained in:
Conor McCarthy 2023-12-04 11:29:02 +10:00 committed by Alexandre Julliard
parent a8dd788f41
commit 68b31b7396
Notes: Alexandre Julliard 2024-03-27 23:07:08 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/707

View File

@ -9157,6 +9157,7 @@ static void spirv_compiler_emit_atomic_instruction(struct spirv_compiler *compil
const struct vkd3d_shader_dst_param *resource;
uint32_t coordinate_id, sample_id, pointer_id;
struct vkd3d_shader_register_info reg_info;
SpvMemorySemanticsMask memory_semantic;
struct vkd3d_shader_image image;
unsigned int structure_stride;
uint32_t coordinate_mask;
@ -9251,12 +9252,16 @@ static void spirv_compiler_emit_atomic_instruction(struct spirv_compiler *compil
if (instruction->flags & VKD3DARF_VOLATILE)
WARN("Ignoring 'volatile' attribute.\n");
memory_semantic = (instruction->flags & VKD3DARF_SEQ_CST)
? SpvMemorySemanticsSequentiallyConsistentMask
: SpvMemorySemanticsMaskNone;
operands[i++] = pointer_id;
operands[i++] = spirv_compiler_get_constant_uint(compiler, scope);
operands[i++] = spirv_compiler_get_constant_uint(compiler, SpvMemorySemanticsMaskNone);
operands[i++] = spirv_compiler_get_constant_uint(compiler, memory_semantic);
if (instruction->src_count >= 3)
{
operands[i++] = spirv_compiler_get_constant_uint(compiler, SpvMemorySemanticsMaskNone);
operands[i++] = spirv_compiler_get_constant_uint(compiler, memory_semantic);
operands[i++] = spirv_compiler_emit_load_src_with_type(compiler, &src[2], VKD3DSP_WRITEMASK_0, component_type);
}
operands[i++] = val_id;