wined3d: Read the sm4 sample count in DCL instructions.

Based on vkd3d commit ee52ad810635cf504a49d5267a5942fffb16836e.
This commit is contained in:
Zebediah Figura 2023-05-09 15:00:07 -05:00 committed by Alexandre Julliard
parent 2cfd75f7c5
commit d53fd40165
2 changed files with 11 additions and 0 deletions

View file

@ -49,6 +49,9 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode);
#define WINED3D_SM4_RESOURCE_TYPE_SHIFT 11
#define WINED3D_SM4_RESOURCE_TYPE_MASK (0xfu << WINED3D_SM4_RESOURCE_TYPE_SHIFT)
#define WINED3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT 16
#define WINED3D_SM4_RESOURCE_SAMPLE_COUNT_MASK (0xfu << WINED3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT)
#define WINED3D_SM4_PRIMITIVE_TYPE_SHIFT 11
#define WINED3D_SM4_PRIMITIVE_TYPE_MASK (0x3fu << WINED3D_SM4_PRIMITIVE_TYPE_SHIFT)
@ -592,6 +595,13 @@ static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins,
{
ins->declaration.semantic.resource_type = resource_type_table[resource_type];
}
if (ins->declaration.semantic.resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2DMS
|| ins->declaration.semantic.resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY)
{
ins->declaration.semantic.sample_count = (opcode_token & WINED3D_SM4_RESOURCE_SAMPLE_COUNT_MASK) >> WINED3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT;
}
reg_data_type = opcode == WINED3D_SM4_OP_DCL_RESOURCE ? WINED3D_DATA_RESOURCE : WINED3D_DATA_UAV;
shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], reg_data_type, &ins->declaration.semantic.reg);

View file

@ -1311,6 +1311,7 @@ struct wined3d_shader_semantic
enum wined3d_decl_usage usage;
UINT usage_idx;
enum wined3d_shader_resource_type resource_type;
unsigned int sample_count;
enum wined3d_data_type resource_data_type;
struct wined3d_shader_dst_param reg;
};