Signed-off-by: Isabella Bosia ibosia@codeweavers.com --- libs/vkd3d-shader/trace.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index fa35bc7..3d29d71 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -300,6 +300,11 @@ shader_input_sysval_semantic_names[] = {VKD3D_SIV_LINE_DENSITY_TESS_FACTOR, "finalLineDensityTessFactor"}, };
+static int shader_ver_ge(const struct vkd3d_shader_version *v, int major, int minor) +{ + return v->major > major || (v->major == major && v->minor >= minor); +} + static int VKD3D_PRINTF_FUNC(2, 3) shader_addline(struct vkd3d_string_buffer *buffer, const char *format, ...) { va_list args; @@ -579,7 +584,7 @@ static void shader_dump_decl_usage(struct vkd3d_string_buffer *buffer, else { /* Pixel shaders 3.0 don't have usage semantics. */ - if (shader_version->major < 3 && shader_version->type == VKD3D_SHADER_TYPE_PIXEL) + if (!shader_ver_ge(shader_version, 3, 0) && shader_version->type == VKD3D_SHADER_TYPE_PIXEL) return; else shader_addline(buffer, "_"); @@ -711,7 +716,7 @@ static void shader_dump_register(struct vkd3d_string_buffer *buffer, case VKD3DSPR_TEXCRDOUT: /* Vertex shaders >= 3.0 use general purpose output registers * (VKD3DSPR_OUTPUT), which can include an address token. */ - if (shader_version->major >= 3) + if (shader_ver_ge(shader_version, 3, 0)) shader_addline(buffer, "o"); else shader_addline(buffer, "oT"); @@ -1239,7 +1244,7 @@ static void shader_dump_instruction_flags(struct vkd3d_string_buffer *buffer, break;
case VKD3DSIH_TEX: - if (shader_version->major >= 2 && (ins->flags & VKD3DSI_TEXLD_PROJECT)) + if (shader_ver_ge(shader_version, 2, 0) && (ins->flags & VKD3DSI_TEXLD_PROJECT)) shader_addline(buffer, "p"); break;
@@ -1252,7 +1257,7 @@ static void shader_dump_instruction_flags(struct vkd3d_string_buffer *buffer, static void shader_dump_register_space(struct vkd3d_string_buffer *buffer, unsigned int register_space, const struct vkd3d_shader_version *shader_version) { - if (shader_version->major >= 5 && shader_version->minor >= 1) + if (shader_ver_ge(shader_version, 5, 1)) shader_addline(buffer, ", space=%u", register_space); }
@@ -1275,7 +1280,7 @@ static void shader_dump_instruction(struct vkd3d_string_buffer *buffer, case VKD3DSIH_DCL_CONSTANT_BUFFER: shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]); shader_dump_src_param(buffer, &ins->declaration.cb.src, shader_version); - if (shader_version->major >= 5 && shader_version->minor >= 1) + if (shader_ver_ge(shader_version, 5, 1)) shader_addline(buffer, "[%u]", ins->declaration.cb.size); shader_addline(buffer, ", %s", ins->flags & VKD3DSI_INDEXED_DYNAMIC ? "dynamicIndexed" : "immediateIndexed");
Signed-off-by: Isabella Bosia ibosia@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 973a80d..a62974a 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -1787,7 +1787,13 @@ static void shader_sm4_read_instruction_modifier(DWORD modifier, struct vkd3d_sh
if ((components & 0xfff0) != (components & 0xf) * 0x1110) FIXME("Components (%#x) have different data types.\n", components); - ins->resource_data_type = data_type_table[data_type]; + if (data_type < ARRAY_SIZE(data_type_table)) + ins->resource_data_type = data_type_table[data_type]; + else + { + FIXME("Unhandled data type %#x.\n", data_type); + ins->resource_data_type = VKD3D_DATA_FLOAT; + } break; }
@@ -1796,7 +1802,13 @@ static void shader_sm4_read_instruction_modifier(DWORD modifier, struct vkd3d_sh enum vkd3d_sm4_resource_type resource_type = (modifier & VKD3D_SM5_MODIFIER_RESOURCE_TYPE_MASK) >> VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT;
- ins->resource_type = resource_type_table[resource_type]; + if (resource_type < ARRAY_SIZE(resource_type_table)) + ins->resource_type = resource_type_table[resource_type]; + else + { + FIXME("Unhandled resource type %#x.\n", resource_type); + ins->resource_type = VKD3D_SHADER_RESOURCE_NONE; + } break; }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Isabella Bosia ibosia@codeweavers.com --- libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + 2 files changed, 2 insertions(+)
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 3d29d71..001c347 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -348,6 +348,7 @@ static void shader_dump_global_flags(struct vkd3d_string_buffer *buffer, DWORD g {VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL, "forceEarlyDepthStencil"}, {VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS, "enableRawAndStructuredBuffers"}, {VKD3DSGF_ENABLE_MINIMUM_PRECISION, "enableMinimumPrecision"}, + {VKD3DSGF_SKIP_OPTIMIZATION, "skipOptimization"}, };
for (i = 0; i < ARRAY_SIZE(global_flag_info); ++i) diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 1acb01f..00b2441 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -451,6 +451,7 @@ enum vkd3d_shader_global_flags VKD3DSGF_REFACTORING_ALLOWED = 0x01, VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL = 0x04, VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x08, + VKD3DSGF_SKIP_OPTIMIZATION = 0x10, VKD3DSGF_ENABLE_MINIMUM_PRECISION = 0x20 };
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Isabella Bosia ibosia@codeweavers.com --- libs/vkd3d-shader/trace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 001c347..9e2fb65 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -576,7 +576,9 @@ static void shader_dump_decl_usage(struct vkd3d_string_buffer *buffer, if (semantic->resource.reg.reg.type == VKD3DSPR_RESOURCE) shader_addline(buffer, "_resource_"); else - shader_addline(buffer, "_uav_"); + /* non typed UAVs don't go through this code path */ + shader_addline(buffer, "_uav_typed_"); + shader_dump_resource_type(buffer, semantic->resource_type); if (semantic->resource.reg.reg.type == VKD3DSPR_UAV) shader_dump_uav_flags(buffer, flags);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com