vkd3d-shader: Add force_tgsm_barriers config flag
Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
parent
7cfe17d2f5
commit
043fd304f8
|
@ -66,6 +66,7 @@ enum vkd3d_config_flags
|
|||
VKD3D_CONFIG_FLAG_FORCE_STATIC_CBV = 0x00000008,
|
||||
VKD3D_CONFIG_FLAG_DXR = 0x00000010,
|
||||
VKD3D_CONFIG_FLAG_MULTI_QUEUE = 0x00000020,
|
||||
VKD3D_CONFIG_FLAG_FORCE_TGSM_BARRIERS = 0x00000040,
|
||||
};
|
||||
|
||||
enum vkd3d_structure_type
|
||||
|
|
|
@ -9207,6 +9207,18 @@ static void vkd3d_dxbc_compiler_emit_store_uav_raw_structured(struct vkd3d_dxbc_
|
|||
}
|
||||
}
|
||||
|
||||
static void vkd3d_dxbc_compiler_emit_tgsm_barrier(struct vkd3d_dxbc_compiler *compiler)
|
||||
{
|
||||
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
|
||||
uint32_t memory_id, semantics_id;
|
||||
|
||||
memory_id = vkd3d_dxbc_compiler_get_constant_uint(compiler, SpvScopeWorkgroup);
|
||||
semantics_id = vkd3d_dxbc_compiler_get_constant_uint(compiler,
|
||||
SpvMemorySemanticsWorkgroupMemoryMask | SpvMemorySemanticsAcquireReleaseMask);
|
||||
|
||||
vkd3d_spirv_build_op_memory_barrier(builder, memory_id, semantics_id);
|
||||
}
|
||||
|
||||
static void vkd3d_dxbc_compiler_emit_store_tgsm(struct vkd3d_dxbc_compiler *compiler,
|
||||
const struct vkd3d_shader_instruction *instruction)
|
||||
{
|
||||
|
@ -9246,6 +9258,9 @@ static void vkd3d_dxbc_compiler_emit_store_tgsm(struct vkd3d_dxbc_compiler *comp
|
|||
ptr_id = vkd3d_spirv_build_op_access_chain1(builder, ptr_type_id, reg_info.id, coordinate_id);
|
||||
vkd3d_spirv_build_op_store(builder, ptr_id, data_id, SpvMemoryAccessMaskNone);
|
||||
}
|
||||
|
||||
if (compiler->compile_args->config_flags & VKD3D_CONFIG_FLAG_FORCE_TGSM_BARRIERS)
|
||||
vkd3d_dxbc_compiler_emit_tgsm_barrier(compiler);
|
||||
}
|
||||
|
||||
static void vkd3d_dxbc_compiler_emit_store_raw_structured(struct vkd3d_dxbc_compiler *compiler,
|
||||
|
|
|
@ -482,6 +482,7 @@ static const struct vkd3d_debug_option vkd3d_config_options[] =
|
|||
{"force_static_cbv", VKD3D_CONFIG_FLAG_FORCE_STATIC_CBV},
|
||||
{"dxr", VKD3D_CONFIG_FLAG_DXR},
|
||||
{"multi_queue", VKD3D_CONFIG_FLAG_MULTI_QUEUE},
|
||||
{"force_tgsm_barriers", VKD3D_CONFIG_FLAG_FORCE_TGSM_BARRIERS},
|
||||
};
|
||||
|
||||
static void vkd3d_config_flags_init_once(void)
|
||||
|
|
Loading…
Reference in New Issue