Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 7 +++++++ libs/vkd3d-shader/trace.c | 17 ++++++++++------- libs/vkd3d-shader/vkd3d_shader_private.h | 1 + 3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 6d32b1d2..e88e5a16 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -29,6 +29,9 @@ #define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT 6 #define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_MASK (0xfu << VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT)
+#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT 11 +#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_MASK (0xfffu << VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT) + #define VKD3D_SM4_AOFFIMMI_U_SHIFT 9 #define VKD3D_SM4_AOFFIMMI_U_MASK (0xfu << VKD3D_SM4_AOFFIMMI_U_SHIFT) #define VKD3D_SM4_AOFFIMMI_V_SHIFT 13 @@ -1835,6 +1838,9 @@ static void shader_sm4_read_instruction_modifier(DWORD modifier, struct vkd3d_sh FIXME("Unhandled resource type %#x.\n", resource_type); ins->resource_type = VKD3D_SHADER_RESOURCE_NONE; } + + ins->resource_stride + = (modifier & VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_MASK) >> VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT; break; }
@@ -1899,6 +1905,7 @@ void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct vkd3d_sha ins->src_count = strlen(opcode_info->src_info); ins->src = priv->src_param; ins->resource_type = VKD3D_SHADER_RESOURCE_NONE; + ins->resource_stride = 0; ins->resource_data_type[0] = VKD3D_DATA_FLOAT; ins->resource_data_type[1] = VKD3D_DATA_FLOAT; ins->resource_data_type[2] = VKD3D_DATA_FLOAT; diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 6e1b3a09..52040ae4 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -1635,20 +1635,23 @@ static void shader_dump_instruction(struct vkd3d_d3d_asm_compiler *compiler,
default: shader_dump_instruction_flags(compiler, ins); - if (vkd3d_shader_instruction_has_texel_offset(ins)) - { - shader_print_int_literal(compiler, "(", ins->texel_offset.u, ""); - shader_print_int_literal(compiler, ",", ins->texel_offset.v, ""); - shader_print_int_literal(compiler, ",", ins->texel_offset.w, ")"); - }
if (ins->resource_type != VKD3D_SHADER_RESOURCE_NONE) { - shader_addline(buffer, "("); + shader_addline(buffer, "_indexable("); shader_dump_resource_type(compiler, ins->resource_type); + if (ins->resource_stride) + shader_print_uint_literal(compiler, ", stride=", ins->resource_stride, ""); shader_addline(buffer, ")"); }
+ if (vkd3d_shader_instruction_has_texel_offset(ins)) + { + shader_print_int_literal(compiler, "(", ins->texel_offset.u, ""); + shader_print_int_literal(compiler, ",", ins->texel_offset.v, ""); + shader_print_int_literal(compiler, ",", ins->texel_offset.w, ")"); + } + if (ins->resource_data_type[0] != VKD3D_DATA_FLOAT || ins->resource_data_type[1] != VKD3D_DATA_FLOAT || ins->resource_data_type[2] != VKD3D_DATA_FLOAT diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index e9e10baf..d49b47d0 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -787,6 +787,7 @@ struct vkd3d_shader_instruction const struct vkd3d_shader_src_param *src; struct vkd3d_shader_texel_offset texel_offset; enum vkd3d_shader_resource_type resource_type; + unsigned int resource_stride; enum vkd3d_data_type resource_data_type[VKD3D_VEC4_SIZE]; bool coissue; const struct vkd3d_shader_src_param *predicate;