From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d-shader/spirv.c | 2 +- libs/vkd3d-shader/trace.c | 34 +++++++++++++----------- libs/vkd3d-shader/vkd3d_shader_private.h | 7 ++--- 3 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 63a1a0e0b7c2..7d4a3b300a97 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -3468,7 +3468,7 @@ static void vkd3d_dxbc_compiler_emit_dcl_global_flags(struct vkd3d_dxbc_compiler const struct vkd3d_shader_instruction *instruction) { if (instruction->flags & ~(VKD3DSGF_REFACTORING_ALLOWED | VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS)) - FIXME("Unrecognized global flags %#x.\n", instruction->flags); + FIXME("Unhandled global flags %#x.\n", instruction->flags); else WARN("Unhandled global flags %#x.\n", instruction->flags); } diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 420ccea37f94..e0cb5bab6aea 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -398,26 +398,30 @@ static unsigned int shader_get_float_offset(enum vkd3d_shader_register_type regi
static void shader_dump_global_flags(struct vkd3d_string_buffer *buffer, DWORD global_flags) { - if (global_flags & VKD3DSGF_REFACTORING_ALLOWED) - { - shader_addline(buffer, "refactoringAllowed"); - global_flags &= ~VKD3DSGF_REFACTORING_ALLOWED; - if (global_flags) - shader_addline(buffer, " | "); - } + unsigned int i;
- if (global_flags & VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL) + static const struct { - shader_addline(buffer, "forceEarlyDepthStencil"); - global_flags &= ~VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL; - if (global_flags) - shader_addline(buffer, " | "); + unsigned int flag; + const char *name; } + global_flag_info[] = + { + {VKD3DSGF_REFACTORING_ALLOWED, "refactoringAllowed"}, + {VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL, "forceEarlyDepthStencil"}, + {VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS, "enableRawAndStructuredBuffers"}, + {VKD3DSGF_ENABLE_MINIMUM_PRECISION, "enableMinimumPrecision"}, + };
- if (global_flags & VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS) + for (i = 0; i < ARRAY_SIZE(global_flag_info); ++i) { - shader_addline(buffer, "enableRawAndStructuredBuffers"); - global_flags &= ~VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS; + if (global_flags & global_flag_info[i].flag) + { + shader_addline(buffer, global_flag_info[i].name); + global_flags &= ~global_flag_info[i].flag; + if (global_flags) + shader_addline(buffer, " | "); + } }
if (global_flags) diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index b1eadde08017..a2747acd09b2 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -439,9 +439,10 @@ enum vkd3d_shader_interpolation_mode
enum vkd3d_shader_global_flags { - VKD3DSGF_REFACTORING_ALLOWED = 0x1, - VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL = 0x4, - VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x8, + VKD3DSGF_REFACTORING_ALLOWED = 0x01, + VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL = 0x04, + VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x08, + VKD3DSGF_ENABLE_MINIMUM_PRECISION = 0x20 };
enum vkd3d_shader_sync_flags