mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader: Get rid of the RESOURCE data type.
This commit is contained in:
parent
e58726310b
commit
8d85ea2dc5
Notes:
Henri Verbeet
2024-09-26 17:50:08 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1121
@ -675,7 +675,6 @@ static void shader_dump_data_type(struct vkd3d_d3d_asm_compiler *compiler, enum
|
||||
{
|
||||
[VKD3D_DATA_FLOAT ] = "float",
|
||||
[VKD3D_DATA_INT ] = "int",
|
||||
[VKD3D_DATA_RESOURCE ] = "resource",
|
||||
[VKD3D_DATA_UINT ] = "uint",
|
||||
[VKD3D_DATA_UNORM ] = "unorm",
|
||||
[VKD3D_DATA_SNORM ] = "snorm",
|
||||
@ -1227,7 +1226,6 @@ static void shader_print_register(struct vkd3d_d3d_asm_compiler *compiler, const
|
||||
case VKD3D_DATA_INT:
|
||||
shader_print_int_literal(compiler, "", reg->u.immconst_u32[0], "");
|
||||
break;
|
||||
case VKD3D_DATA_RESOURCE:
|
||||
case VKD3D_DATA_UINT:
|
||||
shader_print_uint_literal(compiler, "", reg->u.immconst_u32[0], "");
|
||||
break;
|
||||
@ -1263,7 +1261,6 @@ static void shader_print_register(struct vkd3d_d3d_asm_compiler *compiler, const
|
||||
shader_print_int_literal(compiler, ", ", reg->u.immconst_u32[2], "");
|
||||
shader_print_int_literal(compiler, ", ", reg->u.immconst_u32[3], "");
|
||||
break;
|
||||
case VKD3D_DATA_RESOURCE:
|
||||
case VKD3D_DATA_UINT:
|
||||
shader_print_uint_literal(compiler, "", reg->u.immconst_u32[0], "");
|
||||
shader_print_uint_literal(compiler, ", ", reg->u.immconst_u32[1], "");
|
||||
|
@ -8907,7 +8907,7 @@ static enum vkd3d_result sm6_parser_resources_load_srv(struct sm6_parser *sm6,
|
||||
d->resource_type = ins->resource_type;
|
||||
d->kind = kind;
|
||||
d->reg_type = VKD3DSPR_RESOURCE;
|
||||
d->reg_data_type = (ins->resource_type == VKD3D_SHADER_RESOURCE_BUFFER) ? VKD3D_DATA_UINT : VKD3D_DATA_RESOURCE;
|
||||
d->reg_data_type = (ins->resource_type == VKD3D_SHADER_RESOURCE_BUFFER) ? VKD3D_DATA_UINT : VKD3D_DATA_UNUSED;
|
||||
d->resource_data_type = (ins->opcode == VKD3DSIH_DCL)
|
||||
? ins->declaration.semantic.resource_data_type[0] : VKD3D_DATA_UNUSED;
|
||||
|
||||
|
@ -182,7 +182,7 @@ static void src_param_init_parameter(struct vkd3d_shader_src_param *src, uint32_
|
||||
|
||||
static void vsir_src_param_init_resource(struct vkd3d_shader_src_param *src, unsigned int id, unsigned int idx)
|
||||
{
|
||||
vsir_src_param_init(src, VKD3DSPR_RESOURCE, VKD3D_DATA_RESOURCE, 2);
|
||||
vsir_src_param_init(src, VKD3DSPR_RESOURCE, VKD3D_DATA_UNUSED, 2);
|
||||
src->reg.idx[0].offset = id;
|
||||
src->reg.idx[1].offset = idx;
|
||||
src->reg.dimension = VSIR_DIMENSION_VEC4;
|
||||
|
@ -896,7 +896,7 @@ static void shader_sm4_read_dcl_resource(struct vkd3d_shader_instruction *ins, u
|
||||
>> VKD3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT;
|
||||
}
|
||||
|
||||
reg_data_type = opcode == VKD3D_SM4_OP_DCL_RESOURCE ? VKD3D_DATA_RESOURCE : VKD3D_DATA_UNUSED;
|
||||
reg_data_type = VKD3D_DATA_UNUSED;
|
||||
shader_sm4_read_dst_param(priv, &tokens, end, reg_data_type, &semantic->resource.reg);
|
||||
shader_sm4_set_descriptor_register_range(priv, &semantic->resource.reg.reg, &semantic->resource.range);
|
||||
|
||||
@ -1351,7 +1351,7 @@ static void shader_sm5_read_dcl_resource_structured(struct vkd3d_shader_instruct
|
||||
struct vkd3d_shader_structured_resource *resource = &ins->declaration.structured_resource;
|
||||
const uint32_t *end = &tokens[token_count];
|
||||
|
||||
shader_sm4_read_dst_param(priv, &tokens, end, VKD3D_DATA_RESOURCE, &resource->resource.reg);
|
||||
shader_sm4_read_dst_param(priv, &tokens, end, VKD3D_DATA_UNUSED, &resource->resource.reg);
|
||||
shader_sm4_set_descriptor_register_range(priv, &resource->resource.reg.reg, &resource->resource.range);
|
||||
resource->byte_stride = *tokens++;
|
||||
if (resource->byte_stride % 4)
|
||||
@ -1365,7 +1365,7 @@ static void shader_sm5_read_dcl_resource_raw(struct vkd3d_shader_instruction *in
|
||||
struct vkd3d_shader_raw_resource *resource = &ins->declaration.raw_resource;
|
||||
const uint32_t *end = &tokens[token_count];
|
||||
|
||||
shader_sm4_read_dst_param(priv, &tokens, end, VKD3D_DATA_RESOURCE, &resource->resource.reg);
|
||||
shader_sm4_read_dst_param(priv, &tokens, end, VKD3D_DATA_UNUSED, &resource->resource.reg);
|
||||
shader_sm4_set_descriptor_register_range(priv, &resource->resource.reg.reg, &resource->resource.range);
|
||||
shader_sm4_read_register_space(priv, &tokens, end, &resource->resource.range.space);
|
||||
}
|
||||
@ -1471,8 +1471,8 @@ static void init_sm4_lookup_tables(struct vkd3d_sm4_lookup_tables *lookup)
|
||||
{VKD3D_SM4_OP_ISHR, VKD3DSIH_ISHR, "i", "ii"},
|
||||
{VKD3D_SM4_OP_ITOF, VKD3DSIH_ITOF, "f", "i"},
|
||||
{VKD3D_SM4_OP_LABEL, VKD3DSIH_LABEL, "", "O"},
|
||||
{VKD3D_SM4_OP_LD, VKD3DSIH_LD, "u", "iR"},
|
||||
{VKD3D_SM4_OP_LD2DMS, VKD3DSIH_LD2DMS, "u", "iRi"},
|
||||
{VKD3D_SM4_OP_LD, VKD3DSIH_LD, "u", "i*"},
|
||||
{VKD3D_SM4_OP_LD2DMS, VKD3DSIH_LD2DMS, "u", "i*i"},
|
||||
{VKD3D_SM4_OP_LOG, VKD3DSIH_LOG, "f", "f"},
|
||||
{VKD3D_SM4_OP_LOOP, VKD3DSIH_LOOP, "", ""},
|
||||
{VKD3D_SM4_OP_LT, VKD3DSIH_LTO, "u", "ff"},
|
||||
@ -1488,7 +1488,7 @@ static void init_sm4_lookup_tables(struct vkd3d_sm4_lookup_tables *lookup)
|
||||
{VKD3D_SM4_OP_NOP, VKD3DSIH_NOP, "", ""},
|
||||
{VKD3D_SM4_OP_NOT, VKD3DSIH_NOT, "u", "u"},
|
||||
{VKD3D_SM4_OP_OR, VKD3DSIH_OR, "u", "uu"},
|
||||
{VKD3D_SM4_OP_RESINFO, VKD3DSIH_RESINFO, "f", "iR"},
|
||||
{VKD3D_SM4_OP_RESINFO, VKD3DSIH_RESINFO, "f", "i*"},
|
||||
{VKD3D_SM4_OP_RET, VKD3DSIH_RET, "", ""},
|
||||
{VKD3D_SM4_OP_RETC, VKD3DSIH_RETP, "", "u",
|
||||
shader_sm4_read_conditional_op},
|
||||
@ -1497,12 +1497,12 @@ static void init_sm4_lookup_tables(struct vkd3d_sm4_lookup_tables *lookup)
|
||||
{VKD3D_SM4_OP_ROUND_PI, VKD3DSIH_ROUND_PI, "f", "f"},
|
||||
{VKD3D_SM4_OP_ROUND_Z, VKD3DSIH_ROUND_Z, "f", "f"},
|
||||
{VKD3D_SM4_OP_RSQ, VKD3DSIH_RSQ, "f", "f"},
|
||||
{VKD3D_SM4_OP_SAMPLE, VKD3DSIH_SAMPLE, "u", "fR*"},
|
||||
{VKD3D_SM4_OP_SAMPLE_C, VKD3DSIH_SAMPLE_C, "f", "fR*f"},
|
||||
{VKD3D_SM4_OP_SAMPLE_C_LZ, VKD3DSIH_SAMPLE_C_LZ, "f", "fR*f"},
|
||||
{VKD3D_SM4_OP_SAMPLE_LOD, VKD3DSIH_SAMPLE_LOD, "u", "fR*f"},
|
||||
{VKD3D_SM4_OP_SAMPLE_GRAD, VKD3DSIH_SAMPLE_GRAD, "u", "fR*ff"},
|
||||
{VKD3D_SM4_OP_SAMPLE_B, VKD3DSIH_SAMPLE_B, "u", "fR*f"},
|
||||
{VKD3D_SM4_OP_SAMPLE, VKD3DSIH_SAMPLE, "u", "f**"},
|
||||
{VKD3D_SM4_OP_SAMPLE_C, VKD3DSIH_SAMPLE_C, "f", "f**f"},
|
||||
{VKD3D_SM4_OP_SAMPLE_C_LZ, VKD3DSIH_SAMPLE_C_LZ, "f", "f**f"},
|
||||
{VKD3D_SM4_OP_SAMPLE_LOD, VKD3DSIH_SAMPLE_LOD, "u", "f**f"},
|
||||
{VKD3D_SM4_OP_SAMPLE_GRAD, VKD3DSIH_SAMPLE_GRAD, "u", "f**ff"},
|
||||
{VKD3D_SM4_OP_SAMPLE_B, VKD3DSIH_SAMPLE_B, "u", "f**f"},
|
||||
{VKD3D_SM4_OP_SQRT, VKD3DSIH_SQRT, "f", "f"},
|
||||
{VKD3D_SM4_OP_SWITCH, VKD3DSIH_SWITCH, "", "i"},
|
||||
{VKD3D_SM4_OP_SINCOS, VKD3DSIH_SINCOS, "ff", "f"},
|
||||
@ -1551,10 +1551,10 @@ static void init_sm4_lookup_tables(struct vkd3d_sm4_lookup_tables *lookup)
|
||||
shader_sm4_read_dcl_indexable_temp},
|
||||
{VKD3D_SM4_OP_DCL_GLOBAL_FLAGS, VKD3DSIH_DCL_GLOBAL_FLAGS, "", "",
|
||||
shader_sm4_read_dcl_global_flags},
|
||||
{VKD3D_SM4_OP_LOD, VKD3DSIH_LOD, "f", "fR*"},
|
||||
{VKD3D_SM4_OP_GATHER4, VKD3DSIH_GATHER4, "u", "fR*"},
|
||||
{VKD3D_SM4_OP_SAMPLE_POS, VKD3DSIH_SAMPLE_POS, "f", "Ru"},
|
||||
{VKD3D_SM4_OP_SAMPLE_INFO, VKD3DSIH_SAMPLE_INFO, "f", "R"},
|
||||
{VKD3D_SM4_OP_LOD, VKD3DSIH_LOD, "f", "f**"},
|
||||
{VKD3D_SM4_OP_GATHER4, VKD3DSIH_GATHER4, "u", "f**"},
|
||||
{VKD3D_SM4_OP_SAMPLE_POS, VKD3DSIH_SAMPLE_POS, "f", "*u"},
|
||||
{VKD3D_SM4_OP_SAMPLE_INFO, VKD3DSIH_SAMPLE_INFO, "f", "*"},
|
||||
{VKD3D_SM5_OP_HS_DECLS, VKD3DSIH_HS_DECLS, "", ""},
|
||||
{VKD3D_SM5_OP_HS_CONTROL_POINT_PHASE, VKD3DSIH_HS_CONTROL_POINT_PHASE, "", ""},
|
||||
{VKD3D_SM5_OP_HS_FORK_PHASE, VKD3DSIH_HS_FORK_PHASE, "", ""},
|
||||
@ -1568,9 +1568,9 @@ static void init_sm4_lookup_tables(struct vkd3d_sm4_lookup_tables *lookup)
|
||||
{VKD3D_SM5_OP_DERIV_RTX_FINE, VKD3DSIH_DSX_FINE, "f", "f"},
|
||||
{VKD3D_SM5_OP_DERIV_RTY_COARSE, VKD3DSIH_DSY_COARSE, "f", "f"},
|
||||
{VKD3D_SM5_OP_DERIV_RTY_FINE, VKD3DSIH_DSY_FINE, "f", "f"},
|
||||
{VKD3D_SM5_OP_GATHER4_C, VKD3DSIH_GATHER4_C, "f", "fR*f"},
|
||||
{VKD3D_SM5_OP_GATHER4_PO, VKD3DSIH_GATHER4_PO, "f", "fiR*"},
|
||||
{VKD3D_SM5_OP_GATHER4_PO_C, VKD3DSIH_GATHER4_PO_C, "f", "fiR*f"},
|
||||
{VKD3D_SM5_OP_GATHER4_C, VKD3DSIH_GATHER4_C, "f", "f**f"},
|
||||
{VKD3D_SM5_OP_GATHER4_PO, VKD3DSIH_GATHER4_PO, "f", "fi**"},
|
||||
{VKD3D_SM5_OP_GATHER4_PO_C, VKD3DSIH_GATHER4_PO_C, "f", "fi**f"},
|
||||
{VKD3D_SM5_OP_RCP, VKD3DSIH_RCP, "f", "f"},
|
||||
{VKD3D_SM5_OP_F32TOF16, VKD3DSIH_F32TOF16, "u", "f"},
|
||||
{VKD3D_SM5_OP_F16TOF32, VKD3DSIH_F16TOF32, "f", "u"},
|
||||
@ -1626,7 +1626,7 @@ static void init_sm4_lookup_tables(struct vkd3d_sm4_lookup_tables *lookup)
|
||||
{VKD3D_SM5_OP_STORE_UAV_TYPED, VKD3DSIH_STORE_UAV_TYPED, "*", "iu"},
|
||||
{VKD3D_SM5_OP_LD_RAW, VKD3DSIH_LD_RAW, "u", "i*"},
|
||||
{VKD3D_SM5_OP_STORE_RAW, VKD3DSIH_STORE_RAW, "*", "uu"},
|
||||
{VKD3D_SM5_OP_LD_STRUCTURED, VKD3DSIH_LD_STRUCTURED, "u", "iiR"},
|
||||
{VKD3D_SM5_OP_LD_STRUCTURED, VKD3DSIH_LD_STRUCTURED, "u", "ii*"},
|
||||
{VKD3D_SM5_OP_STORE_STRUCTURED, VKD3DSIH_STORE_STRUCTURED, "*", "iiu"},
|
||||
{VKD3D_SM5_OP_ATOMIC_AND, VKD3DSIH_ATOMIC_AND, "*", "iu"},
|
||||
{VKD3D_SM5_OP_ATOMIC_OR, VKD3DSIH_ATOMIC_OR, "*", "iu"},
|
||||
@ -1675,21 +1675,21 @@ static void init_sm4_lookup_tables(struct vkd3d_sm4_lookup_tables *lookup)
|
||||
{VKD3D_SM5_OP_DTOU, VKD3DSIH_DTOU, "u", "d"},
|
||||
{VKD3D_SM5_OP_ITOD, VKD3DSIH_ITOD, "d", "i"},
|
||||
{VKD3D_SM5_OP_UTOD, VKD3DSIH_UTOD, "d", "u"},
|
||||
{VKD3D_SM5_OP_GATHER4_S, VKD3DSIH_GATHER4_S, "uu", "fR*"},
|
||||
{VKD3D_SM5_OP_GATHER4_C_S, VKD3DSIH_GATHER4_C_S, "fu", "fR*f"},
|
||||
{VKD3D_SM5_OP_GATHER4_PO_S, VKD3DSIH_GATHER4_PO_S, "fu", "fiR*"},
|
||||
{VKD3D_SM5_OP_GATHER4_PO_C_S, VKD3DSIH_GATHER4_PO_C_S, "fu", "fiR*f"},
|
||||
{VKD3D_SM5_OP_LD_S, VKD3DSIH_LD_S, "uu", "iR"},
|
||||
{VKD3D_SM5_OP_LD2DMS_S, VKD3DSIH_LD2DMS_S, "uu", "iRi"},
|
||||
{VKD3D_SM5_OP_GATHER4_S, VKD3DSIH_GATHER4_S, "uu", "f**"},
|
||||
{VKD3D_SM5_OP_GATHER4_C_S, VKD3DSIH_GATHER4_C_S, "fu", "f**f"},
|
||||
{VKD3D_SM5_OP_GATHER4_PO_S, VKD3DSIH_GATHER4_PO_S, "fu", "fi**"},
|
||||
{VKD3D_SM5_OP_GATHER4_PO_C_S, VKD3DSIH_GATHER4_PO_C_S, "fu", "fi**f"},
|
||||
{VKD3D_SM5_OP_LD_S, VKD3DSIH_LD_S, "uu", "i*"},
|
||||
{VKD3D_SM5_OP_LD2DMS_S, VKD3DSIH_LD2DMS_S, "uu", "i*i"},
|
||||
{VKD3D_SM5_OP_LD_UAV_TYPED_S, VKD3DSIH_LD_UAV_TYPED_S, "uu", "iU"},
|
||||
{VKD3D_SM5_OP_LD_RAW_S, VKD3DSIH_LD_RAW_S, "uu", "iU"},
|
||||
{VKD3D_SM5_OP_LD_STRUCTURED_S, VKD3DSIH_LD_STRUCTURED_S, "uu", "iiR"},
|
||||
{VKD3D_SM5_OP_SAMPLE_LOD_S, VKD3DSIH_SAMPLE_LOD_S, "uu", "fR*f"},
|
||||
{VKD3D_SM5_OP_SAMPLE_C_LZ_S, VKD3DSIH_SAMPLE_C_LZ_S, "fu", "fR*f"},
|
||||
{VKD3D_SM5_OP_SAMPLE_CL_S, VKD3DSIH_SAMPLE_CL_S, "uu", "fR*f"},
|
||||
{VKD3D_SM5_OP_SAMPLE_B_CL_S, VKD3DSIH_SAMPLE_B_CL_S, "uu", "fR*ff"},
|
||||
{VKD3D_SM5_OP_SAMPLE_GRAD_CL_S, VKD3DSIH_SAMPLE_GRAD_CL_S, "uu", "fR*fff"},
|
||||
{VKD3D_SM5_OP_SAMPLE_C_CL_S, VKD3DSIH_SAMPLE_C_CL_S, "fu", "fR*ff"},
|
||||
{VKD3D_SM5_OP_LD_STRUCTURED_S, VKD3DSIH_LD_STRUCTURED_S, "uu", "ii*"},
|
||||
{VKD3D_SM5_OP_SAMPLE_LOD_S, VKD3DSIH_SAMPLE_LOD_S, "uu", "f**f"},
|
||||
{VKD3D_SM5_OP_SAMPLE_C_LZ_S, VKD3DSIH_SAMPLE_C_LZ_S, "fu", "f**f"},
|
||||
{VKD3D_SM5_OP_SAMPLE_CL_S, VKD3DSIH_SAMPLE_CL_S, "uu", "f**f"},
|
||||
{VKD3D_SM5_OP_SAMPLE_B_CL_S, VKD3DSIH_SAMPLE_B_CL_S, "uu", "f**ff"},
|
||||
{VKD3D_SM5_OP_SAMPLE_GRAD_CL_S, VKD3DSIH_SAMPLE_GRAD_CL_S, "uu", "f**fff"},
|
||||
{VKD3D_SM5_OP_SAMPLE_C_CL_S, VKD3DSIH_SAMPLE_C_CL_S, "fu", "f**ff"},
|
||||
{VKD3D_SM5_OP_CHECK_ACCESS_FULLY_MAPPED, VKD3DSIH_CHECK_ACCESS_FULLY_MAPPED, "u", "u"},
|
||||
};
|
||||
|
||||
@ -1980,8 +1980,6 @@ static enum vkd3d_data_type map_data_type(char t)
|
||||
return VKD3D_DATA_UINT;
|
||||
case 'O':
|
||||
return VKD3D_DATA_OPAQUE;
|
||||
case 'R':
|
||||
return VKD3D_DATA_RESOURCE;
|
||||
case '*':
|
||||
return VKD3D_DATA_UNUSED;
|
||||
default:
|
||||
|
@ -660,7 +660,6 @@ enum vkd3d_data_type
|
||||
{
|
||||
VKD3D_DATA_FLOAT,
|
||||
VKD3D_DATA_INT,
|
||||
VKD3D_DATA_RESOURCE,
|
||||
VKD3D_DATA_UINT,
|
||||
VKD3D_DATA_UNORM,
|
||||
VKD3D_DATA_SNORM,
|
||||
|
Loading…
x
Reference in New Issue
Block a user