Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 11 +++++++++++ libs/vkd3d-shader/trace.c | 4 ++++ libs/vkd3d-shader/vkd3d_shader_private.h | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index e88e5a16..bfc3cce0 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -442,6 +442,8 @@ enum vkd3d_sm4_resource_type VKD3D_SM4_RESOURCE_TEXTURE_2DARRAY = 0x8, VKD3D_SM4_RESOURCE_TEXTURE_2DMSARRAY = 0x9, VKD3D_SM4_RESOURCE_TEXTURE_CUBEARRAY = 0xa, + VKD3D_SM4_RESOURCE_RAW_BUFFER = 0xb, + VKD3D_SM4_RESOURCE_STRUCTURED_BUFFER = 0xc, };
enum vkd3d_sm4_data_type @@ -535,6 +537,8 @@ static const enum vkd3d_shader_resource_type resource_type_table[] = /* VKD3D_SM4_RESOURCE_TEXTURE_2DARRAY */ VKD3D_SHADER_RESOURCE_TEXTURE_2DARRAY, /* VKD3D_SM4_RESOURCE_TEXTURE_2DMSARRAY */ VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY, /* VKD3D_SM4_RESOURCE_TEXTURE_CUBEARRAY */ VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY, + /* VKD3D_SM4_RESOURCE_RAW_BUFFER */ VKD3D_SHADER_RESOURCE_BUFFER, + /* VKD3D_SM4_RESOURCE_STRUCTURED_BUFFER */ VKD3D_SHADER_RESOURCE_BUFFER, };
static const enum vkd3d_data_type data_type_table[] = @@ -1831,6 +1835,11 @@ 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;
+ if (resource_type == VKD3D_SM4_RESOURCE_RAW_BUFFER) + ins->raw = true; + else if (resource_type == VKD3D_SM4_RESOURCE_STRUCTURED_BUFFER) + ins->structured = true; + if (resource_type < ARRAY_SIZE(resource_type_table)) ins->resource_type = resource_type_table[resource_type]; else @@ -1899,6 +1908,8 @@ void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct vkd3d_sha ins->handler_idx = opcode_info->handler_idx; ins->flags = 0; ins->coissue = false; + ins->raw = false; + ins->structured = false; ins->predicate = NULL; ins->dst_count = strlen(opcode_info->dst_info); ins->dst = priv->dst_param; diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 52040ae4..4e355118 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -1639,6 +1639,10 @@ static void shader_dump_instruction(struct vkd3d_d3d_asm_compiler *compiler, if (ins->resource_type != VKD3D_SHADER_RESOURCE_NONE) { shader_addline(buffer, "_indexable("); + if (ins->raw) + vkd3d_string_buffer_printf(buffer, "raw_"); + if (ins->structured) + vkd3d_string_buffer_printf(buffer, "structured_"); shader_dump_resource_type(compiler, ins->resource_type); if (ins->resource_stride) shader_print_uint_literal(compiler, ", stride=", ins->resource_stride, ""); diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index d49b47d0..6101c385 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -789,7 +789,7 @@ struct vkd3d_shader_instruction enum vkd3d_shader_resource_type resource_type; unsigned int resource_stride; enum vkd3d_data_type resource_data_type[VKD3D_VEC4_SIZE]; - bool coissue; + bool coissue, structured, raw; const struct vkd3d_shader_src_param *predicate; union {