From 0126beb3b209c58b090700f8dc57a9a8fb76b00d Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 17 Jul 2025 15:22:54 +0200 Subject: [PATCH] vkd3d-shader/ir: Rename enum vkd3d_data_type to vsir_data_type. --- libs/vkd3d-shader/d3d_asm.c | 4 +- libs/vkd3d-shader/d3dbc.c | 2 +- libs/vkd3d-shader/dxil.c | 40 +++++------ libs/vkd3d-shader/glsl.c | 18 ++--- libs/vkd3d-shader/hlsl_codegen.c | 8 +-- libs/vkd3d-shader/ir.c | 86 ++++++++++++------------ libs/vkd3d-shader/msl.c | 22 +++--- libs/vkd3d-shader/spirv.c | 20 +++--- libs/vkd3d-shader/tpf.c | 18 ++--- libs/vkd3d-shader/vkd3d_shader_main.c | 6 +- libs/vkd3d-shader/vkd3d_shader_private.h | 36 +++++----- 11 files changed, 129 insertions(+), 131 deletions(-) diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index ae9278f68..faeaeb649 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -384,7 +384,7 @@ static void shader_print_resource_type(struct vkd3d_d3d_asm_compiler *compiler, compiler->colours.error, type, compiler->colours.reset); } -static void shader_print_data_type(struct vkd3d_d3d_asm_compiler *compiler, enum vkd3d_data_type type) +static void shader_print_data_type(struct vkd3d_d3d_asm_compiler *compiler, enum vsir_data_type type) { static const char *const data_type_names[] = { @@ -412,7 +412,7 @@ static void shader_print_data_type(struct vkd3d_d3d_asm_compiler *compiler, enum compiler->colours.error, type, compiler->colours.reset); } -static void shader_dump_resource_data_type(struct vkd3d_d3d_asm_compiler *compiler, const enum vkd3d_data_type *type) +static void shader_dump_resource_data_type(struct vkd3d_d3d_asm_compiler *compiler, const enum vsir_data_type *type) { int i; diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index eeb4deff6..7a324960e 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -1101,7 +1101,7 @@ static void shader_sm1_read_semantic(struct vkd3d_shader_sm1_parser *sm1, } static void shader_sm1_read_immconst(struct vkd3d_shader_sm1_parser *sm1, const uint32_t **ptr, - struct vkd3d_shader_src_param *src_param, enum vsir_dimension dimension, enum vkd3d_data_type data_type) + struct vkd3d_shader_src_param *src_param, enum vsir_dimension dimension, enum vsir_data_type data_type) { unsigned int count = dimension == VSIR_DIMENSION_VEC4 ? 4 : 1; diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index db74a7bfb..5214add1a 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -882,9 +882,9 @@ struct sm6_descriptor_info struct vkd3d_shader_register_range range; enum vkd3d_shader_resource_type resource_type; enum dxil_resource_kind kind; - enum vkd3d_data_type resource_data_type; + enum vsir_data_type resource_data_type; enum vkd3d_shader_register_type reg_type; - enum vkd3d_data_type reg_data_type; + enum vsir_data_type reg_data_type; }; struct sm6_parser @@ -2467,13 +2467,13 @@ static struct vkd3d_shader_dst_param *instruction_dst_params_alloc(struct vkd3d_ } static void register_init_with_id(struct vkd3d_shader_register *reg, - enum vkd3d_shader_register_type reg_type, enum vkd3d_data_type data_type, unsigned int id) + enum vkd3d_shader_register_type reg_type, enum vsir_data_type data_type, unsigned int id) { vsir_register_init(reg, reg_type, data_type, 1); reg->idx[0].offset = id; } -static enum vkd3d_data_type vkd3d_data_type_from_sm6_type(const struct sm6_type *type) +static enum vsir_data_type vsir_data_type_from_dxil(const struct sm6_type *type) { if (type->class == TYPE_CLASS_INTEGER) { @@ -2594,10 +2594,10 @@ static void sm6_register_from_value(struct vkd3d_shader_register *reg, const str struct sm6_parser *sm6) { const struct sm6_type *scalar_type; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; scalar_type = sm6_type_get_scalar_type(value->type, 0); - data_type = vkd3d_data_type_from_sm6_type(scalar_type); + data_type = vsir_data_type_from_dxil(scalar_type); switch (value->value_type) { @@ -3237,7 +3237,7 @@ static enum vkd3d_result value_allocate_constant_array(struct sm6_value *dst, co dst->u.data = icb; icb->register_idx = sm6->icb_count++; - icb->data_type = vkd3d_data_type_from_sm6_type(elem_type); + icb->data_type = vsir_data_type_from_dxil(elem_type); icb->element_count = type->u.array.count; icb->component_count = 1; icb->is_null = !operands; @@ -3690,7 +3690,7 @@ static void sm6_parser_declare_indexable_temp(struct sm6_parser *sm6, const stru unsigned int count, unsigned int alignment, bool has_function_scope, unsigned int init, struct vkd3d_shader_instruction *ins, struct sm6_value *dst) { - enum vkd3d_data_type data_type = vkd3d_data_type_from_sm6_type(elem_type); + enum vsir_data_type data_type = vsir_data_type_from_dxil(elem_type); if (ins) vsir_instruction_init(ins, &sm6->p.location, VSIR_OP_DCL_INDEXABLE_TEMP); @@ -4078,7 +4078,7 @@ static void dst_param_io_init(struct vkd3d_shader_dst_param *param, param->shift = 0; /* DXIL types do not have signedness. Load signed elements as unsigned. */ component_type = e->component_type == VKD3D_SHADER_COMPONENT_INT ? VKD3D_SHADER_COMPONENT_UINT : e->component_type; - vsir_register_init(¶m->reg, reg_type, vkd3d_data_type_from_component_type(component_type), 0); + vsir_register_init(¶m->reg, reg_type, vsir_data_type_from_component_type(component_type), 0); param->reg.dimension = VSIR_DIMENSION_VEC4; } @@ -5169,7 +5169,7 @@ static void sm6_parser_emit_dx_cbuffer_load(struct sm6_parser *sm6, enum dx_intr type = sm6_type_get_scalar_type(dst->type, 0); VKD3D_ASSERT(type); - src_param->reg.data_type = vkd3d_data_type_from_sm6_type(type); + src_param->reg.data_type = vsir_data_type_from_dxil(type); if (data_type_is_64_bit(src_param->reg.data_type)) src_param->swizzle = vsir_swizzle_64_from_32(src_param->swizzle); else @@ -5179,7 +5179,7 @@ static void sm6_parser_emit_dx_cbuffer_load(struct sm6_parser *sm6, enum dx_intr } static void sm6_parser_dcl_register_builtin(struct sm6_parser *sm6, enum vkd3d_shader_opcode handler_idx, - enum vkd3d_shader_register_type reg_type, enum vkd3d_data_type data_type, unsigned int component_count) + enum vkd3d_shader_register_type reg_type, enum vsir_data_type data_type, unsigned int component_count) { struct vkd3d_shader_dst_param *dst_param; struct vkd3d_shader_instruction *ins; @@ -5194,8 +5194,8 @@ static void sm6_parser_dcl_register_builtin(struct sm6_parser *sm6, enum vkd3d_s } } -static void sm6_parser_emit_dx_input_register_mov(struct sm6_parser *sm6, - struct vkd3d_shader_instruction *ins, enum vkd3d_shader_register_type reg_type, enum vkd3d_data_type data_type) +static void sm6_parser_emit_dx_input_register_mov(struct sm6_parser *sm6, struct vkd3d_shader_instruction *ins, + enum vkd3d_shader_register_type reg_type, enum vsir_data_type data_type) { struct vkd3d_shader_src_param *src_param; @@ -9031,7 +9031,7 @@ static enum vkd3d_shader_resource_type shader_resource_type_from_dxil_resource_k } } -static const enum vkd3d_data_type data_type_table[] = +static const enum vsir_data_type data_type_table[] = { [COMPONENT_TYPE_INVALID] = VKD3D_DATA_UNUSED, [COMPONENT_TYPE_I1] = VKD3D_DATA_UNUSED, @@ -9054,10 +9054,10 @@ static const enum vkd3d_data_type data_type_table[] = [COMPONENT_TYPE_PACKEDU8X32] = VKD3D_DATA_UNUSED, }; -static enum vkd3d_data_type vkd3d_data_type_from_dxil_component_type(enum dxil_component_type type, +static enum vsir_data_type vsir_data_type_from_dxil_component_type(enum dxil_component_type type, struct sm6_parser *sm6) { - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; if (type >= ARRAY_SIZE(data_type_table) || (data_type = data_type_table[type]) == VKD3D_DATA_UNUSED) { @@ -9072,7 +9072,7 @@ static enum vkd3d_data_type vkd3d_data_type_from_dxil_component_type(enum dxil_c struct resource_additional_values { - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; unsigned int byte_stride; }; @@ -9113,7 +9113,7 @@ static bool resources_load_additional_values(struct resource_additional_values * "An untyped resource has type %u.", value); return false; } - info->data_type = vkd3d_data_type_from_dxil_component_type(value, sm6); + info->data_type = vsir_data_type_from_dxil_component_type(value, sm6); break; case RESOURCE_TAG_ELEMENT_STRIDE: @@ -9241,8 +9241,8 @@ static struct vkd3d_shader_resource *sm6_parser_resources_load_common_info(struc } static void init_resource_declaration(struct vkd3d_shader_resource *resource, - enum vkd3d_shader_register_type reg_type, enum vkd3d_data_type data_type, unsigned int id, - const struct vkd3d_shader_register_range *range) + enum vkd3d_shader_register_type reg_type, enum vsir_data_type data_type, + unsigned int id, const struct vkd3d_shader_register_range *range) { struct vkd3d_shader_dst_param *param = &resource->reg; diff --git a/libs/vkd3d-shader/glsl.c b/libs/vkd3d-shader/glsl.c index b3e3d1079..0217f61cc 100644 --- a/libs/vkd3d-shader/glsl.c +++ b/libs/vkd3d-shader/glsl.c @@ -328,7 +328,7 @@ static void glsl_src_cleanup(struct glsl_src *src, struct vkd3d_string_buffer_ca } static void shader_glsl_print_bitcast(struct vkd3d_string_buffer *dst, struct vkd3d_glsl_generator *gen, - const char *src, enum vkd3d_data_type dst_data_type, enum vkd3d_data_type src_data_type, unsigned int size) + const char *src, enum vsir_data_type dst_data_type, enum vsir_data_type src_data_type, unsigned int size) { if (dst_data_type == VKD3D_DATA_UNORM || dst_data_type == VKD3D_DATA_SNORM) dst_data_type = VKD3D_DATA_FLOAT; @@ -381,11 +381,11 @@ static void shader_glsl_print_bitcast(struct vkd3d_string_buffer *dst, struct vk } static void shader_glsl_print_src(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, - const struct vkd3d_shader_src_param *vsir_src, uint32_t mask, enum vkd3d_data_type data_type) + const struct vkd3d_shader_src_param *vsir_src, uint32_t mask, enum vsir_data_type data_type) { const struct vkd3d_shader_register *reg = &vsir_src->reg; struct vkd3d_string_buffer *register_name, *str; - enum vkd3d_data_type src_data_type; + enum vsir_data_type src_data_type; unsigned int size; register_name = vkd3d_string_buffer_get(&gen->string_buffers); @@ -492,7 +492,7 @@ static void shader_glsl_print_subscript(struct vkd3d_string_buffer *buffer, stru } static void VKD3D_PRINTF_FUNC(4, 0) shader_glsl_vprint_assignment(struct vkd3d_glsl_generator *gen, - struct glsl_dst *dst, enum vkd3d_data_type data_type, const char *format, va_list args) + struct glsl_dst *dst, enum vsir_data_type data_type, const char *format, va_list args) { struct vkd3d_string_buffer *buffer = gen->buffer; uint32_t modifiers = dst->vsir->modifiers; @@ -550,7 +550,7 @@ static void VKD3D_PRINTF_FUNC(3, 4) shader_glsl_print_assignment( } static void VKD3D_PRINTF_FUNC(4, 5) shader_glsl_print_assignment_ext(struct vkd3d_glsl_generator *gen, - struct glsl_dst *dst, enum vkd3d_data_type data_type, const char *format, ...) + struct glsl_dst *dst, enum vsir_data_type data_type, const char *format, ...) { va_list args; @@ -797,7 +797,7 @@ static void shader_glsl_ld(struct vkd3d_glsl_generator *gen, const struct vkd3d_ const struct vkd3d_shader_descriptor_info1 *d; enum vkd3d_shader_resource_type resource_type; struct vkd3d_string_buffer *fetch; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; struct glsl_src coord; struct glsl_dst dst; uint32_t coord_mask; @@ -912,7 +912,7 @@ static void shader_glsl_sample(struct vkd3d_glsl_generator *gen, const struct vk enum vkd3d_shader_resource_type resource_type; unsigned int component_idx, coord_size; struct vkd3d_string_buffer *sample; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; struct glsl_dst dst; bias = ins->opcode == VSIR_OP_SAMPLE_B; @@ -1061,7 +1061,7 @@ static void shader_glsl_load_uav_typed(struct vkd3d_glsl_generator *gen, const s enum vkd3d_shader_resource_type resource_type; unsigned int uav_id, uav_idx, uav_space; struct vkd3d_string_buffer *load; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; struct glsl_src coord; struct glsl_dst dst; uint32_t coord_mask; @@ -1121,7 +1121,7 @@ static void shader_glsl_store_uav_typed(struct vkd3d_glsl_generator *gen, const enum vkd3d_shader_resource_type resource_type; unsigned int uav_id, uav_idx, uav_space; struct vkd3d_string_buffer *image_data; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; struct glsl_src image_coord; uint32_t coord_mask; diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index cd1a849c0..bfe5966ca 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -8225,7 +8225,7 @@ static void generate_vsir_signature(struct hlsl_ctx *ctx, } } -static enum vkd3d_data_type vsir_data_type_from_hlsl_type(struct hlsl_ctx *ctx, const struct hlsl_type *type) +static enum vsir_data_type vsir_data_type_from_hlsl_type(struct hlsl_ctx *ctx, const struct hlsl_type *type) { if (hlsl_version_lt(ctx, 4, 0)) return VKD3D_DATA_FLOAT; @@ -8256,7 +8256,7 @@ static enum vkd3d_data_type vsir_data_type_from_hlsl_type(struct hlsl_ctx *ctx, return VKD3D_DATA_UNUSED; } -static enum vkd3d_data_type vsir_data_type_from_hlsl_instruction(struct hlsl_ctx *ctx, +static enum vsir_data_type vsir_data_type_from_hlsl_instruction(struct hlsl_ctx *ctx, const struct hlsl_ir_node *instr) { return vsir_data_type_from_hlsl_type(ctx, instr->data_type); @@ -8455,7 +8455,7 @@ static struct vkd3d_shader_instruction *generate_vsir_add_program_instruction( static void vsir_src_from_hlsl_constant_value(struct vkd3d_shader_src_param *src, struct hlsl_ctx *ctx, const struct hlsl_constant_value *value, - enum vkd3d_data_type type, unsigned int width, unsigned int map_writemask) + enum vsir_data_type type, unsigned int width, unsigned int map_writemask) { unsigned int i, j; @@ -12167,7 +12167,7 @@ static enum vkd3d_shader_resource_type sm4_generate_vsir_get_resource_type(const } } -static enum vkd3d_data_type sm4_generate_vsir_get_format_type(const struct hlsl_type *type) +static enum vsir_data_type sm4_generate_vsir_get_format_type(const struct hlsl_type *type) { const struct hlsl_type *format = type->e.resource.format; diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 895dea626..b467989ae 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -555,7 +555,7 @@ static uint32_t vsir_combine_swizzles(uint32_t first, uint32_t second) } void vsir_register_init(struct vkd3d_shader_register *reg, enum vkd3d_shader_register_type reg_type, - enum vkd3d_data_type data_type, unsigned int idx_count) + enum vsir_data_type data_type, unsigned int idx_count) { reg->type = reg_type; reg->precision = VKD3D_SHADER_REGISTER_PRECISION_DEFAULT; @@ -581,7 +581,7 @@ static inline bool shader_register_is_phase_instance_id(const struct vkd3d_shade } void vsir_src_param_init(struct vkd3d_shader_src_param *param, enum vkd3d_shader_register_type reg_type, - enum vkd3d_data_type data_type, unsigned int idx_count) + enum vsir_data_type data_type, unsigned int idx_count) { vsir_register_init(¶m->reg, reg_type, data_type, idx_count); param->swizzle = 0; @@ -597,7 +597,7 @@ static void src_param_init_const_uint(struct vkd3d_shader_src_param *src, uint32 static void vsir_src_param_init_io(struct vkd3d_shader_src_param *src, enum vkd3d_shader_register_type reg_type, const struct signature_element *e, unsigned int idx_count) { - vsir_src_param_init(src, reg_type, vkd3d_data_type_from_component_type(e->component_type), idx_count); + vsir_src_param_init(src, reg_type, vsir_data_type_from_component_type(e->component_type), idx_count); src->reg.dimension = VSIR_DIMENSION_VEC4; src->swizzle = vsir_swizzle_from_writemask(e->mask); } @@ -609,13 +609,13 @@ void vsir_src_param_init_label(struct vkd3d_shader_src_param *param, unsigned in param->reg.idx[0].offset = label_id; } -static void src_param_init_parameter(struct vkd3d_shader_src_param *src, uint32_t idx, enum vkd3d_data_type type) +static void src_param_init_parameter(struct vkd3d_shader_src_param *src, uint32_t idx, enum vsir_data_type type) { vsir_src_param_init(src, VKD3DSPR_PARAMETER, type, 1); src->reg.idx[0].offset = idx; } -static void src_param_init_parameter_vec4(struct vkd3d_shader_src_param *src, uint32_t idx, enum vkd3d_data_type type) +static void src_param_init_parameter_vec4(struct vkd3d_shader_src_param *src, uint32_t idx, enum vsir_data_type type) { vsir_src_param_init(src, VKD3DSPR_PARAMETER, type, 1); src->reg.idx[0].offset = idx; @@ -641,7 +641,7 @@ static void vsir_src_param_init_sampler(struct vkd3d_shader_src_param *src, unsi } static void src_param_init_ssa(struct vkd3d_shader_src_param *src, unsigned int idx, - enum vkd3d_data_type data_type, enum vsir_dimension dimension) + enum vsir_data_type data_type, enum vsir_dimension dimension) { vsir_src_param_init(src, VKD3DSPR_SSA, data_type, 1); src->reg.idx[0].offset = idx; @@ -653,8 +653,8 @@ static void src_param_init_ssa(struct vkd3d_shader_src_param *src, unsigned int } } -static void src_param_init_ssa_scalar(struct vkd3d_shader_src_param *src, unsigned int idx, - enum vkd3d_data_type data_type) +static void src_param_init_ssa_scalar(struct vkd3d_shader_src_param *src, + unsigned int idx, enum vsir_data_type data_type) { src_param_init_ssa(src, idx, data_type, VSIR_DIMENSION_SCALAR); } @@ -701,7 +701,7 @@ static void src_param_init_temp_uint(struct vkd3d_shader_src_param *src, unsigne } void vsir_dst_param_init(struct vkd3d_shader_dst_param *param, enum vkd3d_shader_register_type reg_type, - enum vkd3d_data_type data_type, unsigned int idx_count) + enum vsir_data_type data_type, unsigned int idx_count) { vsir_register_init(¶m->reg, reg_type, data_type, idx_count); param->write_mask = VKD3DSP_WRITEMASK_0; @@ -712,7 +712,7 @@ void vsir_dst_param_init(struct vkd3d_shader_dst_param *param, enum vkd3d_shader static void vsir_dst_param_init_io(struct vkd3d_shader_dst_param *dst, enum vkd3d_shader_register_type reg_type, const struct signature_element *e, unsigned int idx_count) { - vsir_dst_param_init(dst, reg_type, vkd3d_data_type_from_component_type(e->component_type), idx_count); + vsir_dst_param_init(dst, reg_type, vsir_data_type_from_component_type(e->component_type), idx_count); dst->reg.dimension = VSIR_DIMENSION_VEC4; dst->write_mask = e->mask; } @@ -725,7 +725,7 @@ void vsir_dst_param_init_null(struct vkd3d_shader_dst_param *dst) } static void dst_param_init_ssa(struct vkd3d_shader_dst_param *dst, unsigned int idx, - enum vkd3d_data_type data_type, enum vsir_dimension dimension) + enum vsir_data_type data_type, enum vsir_dimension dimension) { vsir_dst_param_init(dst, VKD3DSPR_SSA, data_type, 1); dst->reg.idx[0].offset = idx; @@ -737,8 +737,8 @@ static void dst_param_init_ssa(struct vkd3d_shader_dst_param *dst, unsigned int } } -static void dst_param_init_ssa_scalar(struct vkd3d_shader_dst_param *dst, unsigned int idx, - enum vkd3d_data_type data_type) +static void dst_param_init_ssa_scalar(struct vkd3d_shader_dst_param *dst, + unsigned int idx, enum vsir_data_type data_type) { dst_param_init_ssa(dst, idx, data_type, VSIR_DIMENSION_SCALAR); } @@ -778,7 +778,7 @@ static void dst_param_init_temp_uint(struct vkd3d_shader_dst_param *dst, unsigne } static void dst_param_init_output(struct vkd3d_shader_dst_param *dst, - enum vkd3d_data_type data_type, uint32_t idx, uint32_t write_mask) + enum vsir_data_type data_type, uint32_t idx, uint32_t write_mask) { vsir_dst_param_init(dst, VKD3DSPR_OUTPUT, data_type, 1); dst->reg.idx[0].offset = idx; @@ -850,8 +850,8 @@ static void vkd3d_shader_instruction_make_nop(struct vkd3d_shader_instruction *i vsir_instruction_init(ins, &location, VSIR_OP_NOP); } -static bool get_opcode_from_rel_op(enum vkd3d_shader_rel_op rel_op, enum vkd3d_data_type data_type, - enum vkd3d_shader_opcode *opcode, bool *requires_swap) +static bool get_opcode_from_rel_op(enum vkd3d_shader_rel_op rel_op, + enum vsir_data_type data_type, enum vkd3d_shader_opcode *opcode, bool *requires_swap) { switch (rel_op) { @@ -7819,7 +7819,7 @@ static enum vkd3d_result insert_vertex_fog_before_ret(struct vsir_program *progr /* Write the position or specular output. */ vsir_instruction_init_with_params(program, ins, &loc, VSIR_OP_MOV, 1, 1); - dst_param_init_output(&ins->dst[0], vkd3d_data_type_from_component_type(e->component_type), + dst_param_init_output(&ins->dst[0], vsir_data_type_from_component_type(e->component_type), source_signature_idx, e->mask); src_param_init_temp_float4(&ins->src[0], temp); ++ins; @@ -8840,7 +8840,7 @@ struct validation_context struct validation_context_ssa_data { enum vsir_dimension dimension; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; size_t first_seen; uint32_t write_mask; uint32_t read_mask; @@ -9544,7 +9544,7 @@ static void vsir_validate_register(struct validation_context *ctx, validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_PRECISION, "Invalid register precision %#x.", reg->precision); - if (reg->data_type >= VKD3D_DATA_COUNT) + if (reg->data_type >= VSIR_DATA_TYPE_COUNT) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE, "Invalid register data type %#x.", reg->data_type); @@ -10486,7 +10486,7 @@ static void vsir_validate_descriptors(struct validation_context *ctx) "Descriptor %u has invalid resource type %#x for descriptor type %#x.", i, descriptor->resource_type, descriptor->type); - if (descriptor->resource_data_type >= VKD3D_DATA_COUNT) + if (descriptor->resource_data_type >= VSIR_DATA_TYPE_COUNT) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE, "Descriptor %u has invalid resource data type %#x.", i, descriptor->resource_data_type); else if ((descriptor->resource_data_type == VKD3D_DATA_UNUSED) @@ -10589,9 +10589,9 @@ static void vsir_validate_hull_shader_phase(struct validation_context *ctx, } static void vsir_validate_elementwise_operation(struct validation_context *ctx, - const struct vkd3d_shader_instruction *instruction, const bool types[VKD3D_DATA_COUNT]) + const struct vkd3d_shader_instruction *instruction, const bool types[VSIR_DATA_TYPE_COUNT]) { - enum vkd3d_data_type dst_data_type; + enum vsir_data_type dst_data_type; unsigned int i; if (instruction->dst_count < 1) @@ -10599,7 +10599,7 @@ static void vsir_validate_elementwise_operation(struct validation_context *ctx, dst_data_type = instruction->dst[0].reg.data_type; - if (dst_data_type >= VKD3D_DATA_COUNT) + if (dst_data_type >= VSIR_DATA_TYPE_COUNT) return; if (!types[dst_data_type]) @@ -10621,7 +10621,7 @@ static void vsir_validate_elementwise_operation(struct validation_context *ctx, static void vsir_validate_double_elementwise_operation(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool types[VKD3D_DATA_COUNT] = + static const bool types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_DOUBLE] = true, }; @@ -10632,7 +10632,7 @@ static void vsir_validate_double_elementwise_operation(struct validation_context static void vsir_validate_float_elementwise_operation(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool types[VKD3D_DATA_COUNT] = + static const bool types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_FLOAT] = true, }; @@ -10643,7 +10643,7 @@ static void vsir_validate_float_elementwise_operation(struct validation_context static void vsir_validate_integer_elementwise_operation(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool types[VKD3D_DATA_COUNT] = + static const bool types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_INT] = true, [VKD3D_DATA_UINT] = true, @@ -10656,7 +10656,7 @@ static void vsir_validate_integer_elementwise_operation(struct validation_contex static void vsir_validate_logic_elementwise_operation(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool types[VKD3D_DATA_COUNT] = + static const bool types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_INT] = true, [VKD3D_DATA_UINT] = true, @@ -10668,9 +10668,9 @@ static void vsir_validate_logic_elementwise_operation(struct validation_context } static void vsir_validate_comparison_operation(struct validation_context *ctx, - const struct vkd3d_shader_instruction *instruction, const bool types[VKD3D_DATA_COUNT]) + const struct vkd3d_shader_instruction *instruction, const bool types[VSIR_DATA_TYPE_COUNT]) { - enum vkd3d_data_type dst_data_type, src_data_type; + enum vsir_data_type dst_data_type, src_data_type; unsigned int i; if (instruction->dst_count < 1) @@ -10688,7 +10688,7 @@ static void vsir_validate_comparison_operation(struct validation_context *ctx, src_data_type = instruction->src[0].reg.data_type; - if (src_data_type >= VKD3D_DATA_COUNT) + if (src_data_type >= VSIR_DATA_TYPE_COUNT) return; if (!types[src_data_type]) @@ -10710,7 +10710,7 @@ static void vsir_validate_comparison_operation(struct validation_context *ctx, static void vsir_validate_double_comparison_operation(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool types[VKD3D_DATA_COUNT] = + static const bool types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_DOUBLE] = true, }; @@ -10721,7 +10721,7 @@ static void vsir_validate_double_comparison_operation(struct validation_context static void vsir_validate_float_comparison_operation(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool types[VKD3D_DATA_COUNT] = + static const bool types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_FLOAT] = true, }; @@ -10732,7 +10732,7 @@ static void vsir_validate_float_comparison_operation(struct validation_context * static void vsir_validate_integer_comparison_operation(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool types[VKD3D_DATA_COUNT] = + static const bool types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_INT] = true, [VKD3D_DATA_UINT] = true, @@ -10744,9 +10744,9 @@ static void vsir_validate_integer_comparison_operation(struct validation_context static void vsir_validate_cast_operation(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction, - const bool src_types[VKD3D_DATA_COUNT], const bool dst_types[VKD3D_DATA_COUNT]) + const bool src_types[VSIR_DATA_TYPE_COUNT], const bool dst_types[VSIR_DATA_TYPE_COUNT]) { - enum vkd3d_data_type dst_data_type, src_data_type; + enum vsir_data_type dst_data_type, src_data_type; if (instruction->dst_count < 1 || instruction->src_count < 1) return; @@ -10754,7 +10754,7 @@ static void vsir_validate_cast_operation(struct validation_context *ctx, dst_data_type = instruction->dst[0].reg.data_type; src_data_type = instruction->src[0].reg.data_type; - if (src_data_type >= VKD3D_DATA_COUNT || dst_data_type >= VKD3D_DATA_COUNT) + if (src_data_type >= VSIR_DATA_TYPE_COUNT || dst_data_type >= VSIR_DATA_TYPE_COUNT) return; if (!src_types[src_data_type]) @@ -11283,13 +11283,13 @@ static void vsir_validate_endswitch(struct validation_context *ctx, const struct static void vsir_validate_ftoi(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool src_types[VKD3D_DATA_COUNT] = + static const bool src_types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_FLOAT] = true, [VKD3D_DATA_DOUBLE] = true, [VKD3D_DATA_HALF] = true, }; - static const bool dst_types[VKD3D_DATA_COUNT] = + static const bool dst_types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_INT] = true, [VKD3D_DATA_UINT] = true, @@ -11300,13 +11300,13 @@ static void vsir_validate_ftoi(struct validation_context *ctx, const struct vkd3 static void vsir_validate_ftou(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool src_types[VKD3D_DATA_COUNT] = + static const bool src_types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_FLOAT] = true, [VKD3D_DATA_DOUBLE] = true, [VKD3D_DATA_HALF] = true, }; - static const bool dst_types[VKD3D_DATA_COUNT] = + static const bool dst_types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_UINT] = true, }; @@ -11328,14 +11328,14 @@ static void vsir_validate_ifc(struct validation_context *ctx, const struct vkd3d static void vsir_validate_itof(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool src_types[VKD3D_DATA_COUNT] = + static const bool src_types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_INT] = true, [VKD3D_DATA_UINT] = true, [VKD3D_DATA_UINT64] = true, [VKD3D_DATA_BOOL] = true, }; - static const bool dst_types[VKD3D_DATA_COUNT] = + static const bool dst_types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_FLOAT] = true, [VKD3D_DATA_DOUBLE] = true, @@ -11347,7 +11347,7 @@ static void vsir_validate_itof(struct validation_context *ctx, const struct vkd3 static void vsir_validate_itoi(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction) { - static const bool types[VKD3D_DATA_COUNT] = + static const bool types[VSIR_DATA_TYPE_COUNT] = { [VKD3D_DATA_INT] = true, [VKD3D_DATA_UINT] = true, diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index 032b55043..0841fc6c3 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -133,7 +133,7 @@ static void msl_print_indent(struct vkd3d_string_buffer *buffer, unsigned int in } static void msl_print_resource_datatype(struct msl_generator *gen, - struct vkd3d_string_buffer *buffer, enum vkd3d_data_type data_type) + struct vkd3d_string_buffer *buffer, enum vsir_data_type data_type) { switch (data_type) { @@ -157,7 +157,7 @@ static void msl_print_resource_datatype(struct msl_generator *gen, } static void msl_print_register_datatype(struct vkd3d_string_buffer *buffer, - struct msl_generator *gen, enum vkd3d_data_type data_type) + struct msl_generator *gen, enum vsir_data_type data_type) { vkd3d_string_buffer_printf(buffer, "."); switch (data_type) @@ -345,7 +345,7 @@ static void msl_print_sampler_name(struct vkd3d_string_buffer *buffer, unsigned } static void msl_print_srv_name(struct vkd3d_string_buffer *buffer, struct msl_generator *gen, unsigned int binding, - const struct msl_resource_type_info *resource_type_info, enum vkd3d_data_type resource_data_type, bool compare) + const struct msl_resource_type_info *resource_type_info, enum vsir_data_type resource_data_type, bool compare) { vkd3d_string_buffer_printf(buffer, "descriptors[%u].as<%s%s%s<", binding, compare ? "depth" : "texture", resource_type_info->type_suffix, @@ -355,7 +355,7 @@ static void msl_print_srv_name(struct vkd3d_string_buffer *buffer, struct msl_ge } static void msl_print_uav_name(struct vkd3d_string_buffer *buffer, struct msl_generator *gen, unsigned int binding, - const struct msl_resource_type_info *resource_type_info, enum vkd3d_data_type resource_data_type) + const struct msl_resource_type_info *resource_type_info, enum vsir_data_type resource_data_type) { vkd3d_string_buffer_printf(buffer, "descriptors[%u].astype_suffix, @@ -523,7 +523,7 @@ static void msl_src_cleanup(struct msl_src *src, struct vkd3d_string_buffer_cach } static void msl_print_bitcast(struct vkd3d_string_buffer *dst, struct msl_generator *gen, const char *src, - enum vkd3d_data_type dst_data_type, enum msl_data_type src_data_type, enum vsir_dimension dimension) + enum vsir_data_type dst_data_type, enum msl_data_type src_data_type, enum vsir_dimension dimension) { bool write_cast = false; @@ -561,7 +561,7 @@ static void msl_print_bitcast(struct vkd3d_string_buffer *dst, struct msl_genera } static void msl_print_src_with_type(struct vkd3d_string_buffer *buffer, struct msl_generator *gen, - const struct vkd3d_shader_src_param *vsir_src, uint32_t mask, enum vkd3d_data_type data_type) + const struct vkd3d_shader_src_param *vsir_src, uint32_t mask, enum vsir_data_type data_type) { const struct vkd3d_shader_register *reg = &vsir_src->reg; struct vkd3d_string_buffer *register_name, *str; @@ -947,7 +947,7 @@ static void msl_ld(struct msl_generator *gen, const struct vkd3d_shader_instruct const struct vkd3d_shader_descriptor_binding *binding; enum vkd3d_shader_resource_type resource_type; struct vkd3d_string_buffer *read; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; unsigned int srv_binding; uint32_t coord_mask; struct msl_dst dst; @@ -1047,7 +1047,7 @@ static void msl_sample(struct msl_generator *gen, const struct vkd3d_shader_inst enum vkd3d_shader_resource_type resource_type; unsigned int srv_binding, sampler_binding; struct vkd3d_string_buffer *sample; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; unsigned int component_idx; uint32_t coord_mask; struct msl_dst dst; @@ -1257,7 +1257,7 @@ static void msl_store_uav_typed(struct msl_generator *gen, const struct vkd3d_sh enum vkd3d_shader_resource_type resource_type; unsigned int uav_id, uav_idx, uav_space; struct vkd3d_string_buffer *image_data; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; unsigned int uav_binding; uint32_t coord_mask; @@ -1882,7 +1882,7 @@ static void msl_generate_entrypoint_prologue(struct msl_generator *gen) switch (e->sysval_semantic) { case VKD3D_SHADER_SV_NONE: - msl_print_register_datatype(buffer, gen, vkd3d_data_type_from_component_type(e->component_type)); + msl_print_register_datatype(buffer, gen, vsir_data_type_from_component_type(e->component_type)); msl_print_write_mask(buffer, e->mask); vkd3d_string_buffer_printf(buffer, " = input.shader_in_%u", i); break; @@ -1944,7 +1944,7 @@ static void msl_generate_entrypoint_epilogue(struct msl_generator *gen) vkd3d_string_buffer_printf(buffer, " output.shader_out_%u", i); msl_print_write_mask(buffer, e->mask); vkd3d_string_buffer_printf(buffer, " = %s_out[%u]", gen->prefix, e->register_index); - msl_print_register_datatype(buffer, gen, vkd3d_data_type_from_component_type(e->component_type)); + msl_print_register_datatype(buffer, gen, vsir_data_type_from_component_type(e->component_type)); msl_print_write_mask(buffer, e->mask); break; case VKD3D_SHADER_SV_DEPTH: diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 616f9ed28..950771bc5 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2568,7 +2568,7 @@ static uint32_t vkd3d_spirv_get_type_id(struct vkd3d_spirv_builder *builder, } static uint32_t vkd3d_spirv_get_type_id_for_data_type(struct vkd3d_spirv_builder *builder, - enum vkd3d_data_type data_type, unsigned int component_count) + enum vsir_data_type data_type, unsigned int component_count) { enum vkd3d_shader_component_type component_type; @@ -3012,7 +3012,7 @@ struct vkd3d_hull_shader_variables struct ssa_register_info { - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; uint8_t write_mask; uint32_t id; }; @@ -3985,7 +3985,7 @@ static uint32_t spirv_compiler_alloc_spec_constant_id(struct spirv_compiler *com static uint32_t spirv_compiler_emit_spec_constant(struct spirv_compiler *compiler, enum vkd3d_shader_parameter_name name, uint32_t spec_id, - enum vkd3d_data_type type, unsigned int component_count) + enum vsir_data_type type, unsigned int component_count) { uint32_t scalar_type_id, vector_type_id, id, default_value, components[4]; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; @@ -4024,7 +4024,7 @@ static uint32_t spirv_compiler_emit_spec_constant(struct spirv_compiler *compile static uint32_t spirv_compiler_get_spec_constant(struct spirv_compiler *compiler, enum vkd3d_shader_parameter_name name, uint32_t spec_id, - enum vkd3d_data_type type, unsigned int component_count) + enum vsir_data_type type, unsigned int component_count) { unsigned int i; @@ -4038,7 +4038,7 @@ static uint32_t spirv_compiler_get_spec_constant(struct spirv_compiler *compiler } static uint32_t spirv_compiler_get_buffer_parameter(struct spirv_compiler *compiler, - const struct vkd3d_shader_parameter1 *parameter, enum vkd3d_data_type type, unsigned int component_count) + const struct vkd3d_shader_parameter1 *parameter, enum vsir_data_type type, unsigned int component_count) { struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; unsigned int index = parameter - compiler->program->parameters; @@ -4054,7 +4054,7 @@ static uint32_t spirv_compiler_get_buffer_parameter(struct spirv_compiler *compi static const struct { - enum vkd3d_data_type type; + enum vsir_data_type type; unsigned int component_count; } parameter_data_type_map[] = @@ -4065,7 +4065,7 @@ parameter_data_type_map[] = }; static uint32_t spirv_compiler_emit_shader_parameter(struct spirv_compiler *compiler, - enum vkd3d_shader_parameter_name name, enum vkd3d_data_type type, unsigned int component_count) + enum vkd3d_shader_parameter_name name, enum vsir_data_type type, unsigned int component_count) { const struct vkd3d_shader_parameter1 *parameter; @@ -4479,7 +4479,7 @@ static uint32_t spirv_compiler_emit_vector_shuffle(struct spirv_compiler *compil } static uint32_t spirv_compiler_emit_int_to_bool(struct spirv_compiler *compiler, - enum vkd3d_shader_conditional_op condition, enum vkd3d_data_type data_type, + enum vkd3d_shader_conditional_op condition, enum vsir_data_type data_type, unsigned int component_count, uint32_t val_id) { struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; @@ -4903,7 +4903,7 @@ static uint32_t spirv_compiler_emit_load_src_with_type(struct spirv_compiler *co { struct vkd3d_shader_src_param src_param = *src; - src_param.reg.data_type = vkd3d_data_type_from_component_type(component_type); + src_param.reg.data_type = vsir_data_type_from_component_type(component_type); return spirv_compiler_emit_load_src(compiler, &src_param, write_mask); } @@ -5083,7 +5083,7 @@ static void spirv_compiler_emit_store_dst_swizzled(struct spirv_compiler *compil /* XXX: The register data type could be fixed by the shader parser. For SM5 * shaders the data types are stored in instructions modifiers. */ - typed_dst.reg.data_type = vkd3d_data_type_from_component_type(component_type); + typed_dst.reg.data_type = vsir_data_type_from_component_type(component_type); spirv_compiler_emit_store_dst(compiler, &typed_dst, val_id); } diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index c7eafbc79..c6d158045 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -748,7 +748,7 @@ static const enum vkd3d_shader_resource_type resource_type_table[] = /* VKD3D_SM4_RESOURCE_STRUCTURED_BUFFER */ VKD3D_SHADER_RESOURCE_BUFFER, }; -static const enum vkd3d_data_type data_type_table[] = +static const enum vsir_data_type data_type_table[] = { /* 0 */ VKD3D_DATA_FLOAT, /* VKD3D_SM4_DATA_UNORM */ VKD3D_DATA_UNORM, @@ -770,9 +770,9 @@ static bool shader_is_sm_5_1(const struct vkd3d_shader_sm4_parser *sm4) } static bool shader_sm4_read_src_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, - const uint32_t *end, enum vkd3d_data_type data_type, struct vkd3d_shader_src_param *src_param); + const uint32_t *end, enum vsir_data_type data_type, struct vkd3d_shader_src_param *src_param); static bool shader_sm4_read_dst_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, - const uint32_t *end, enum vkd3d_data_type data_type, struct vkd3d_shader_dst_param *dst_param); + const uint32_t *end, enum vsir_data_type data_type, struct vkd3d_shader_dst_param *dst_param); static bool shader_sm4_read_register_space(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, const uint32_t *end, unsigned int *register_space) @@ -873,7 +873,7 @@ static void shader_sm4_read_dcl_resource(struct vkd3d_shader_instruction *ins, u enum vkd3d_sm4_resource_type resource_type; const uint32_t *end = &tokens[token_count]; enum vkd3d_sm4_data_type data_type; - enum vkd3d_data_type reg_data_type; + enum vsir_data_type reg_data_type; uint32_t components; unsigned int i; @@ -1985,7 +1985,7 @@ static enum vkd3d_sm4_stat_field get_stat_field_from_sm4_opcode( return field_info->field; } -static enum vkd3d_data_type map_data_type(char t) +static enum vsir_data_type map_data_type(char t) { switch (t) { @@ -2036,7 +2036,7 @@ static bool shader_sm4_read_reg_idx(struct vkd3d_shader_sm4_parser *priv, const } static bool shader_sm4_read_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, const uint32_t *end, - enum vkd3d_data_type data_type, struct vkd3d_shader_register *param, enum vkd3d_shader_src_modifier *modifier) + enum vsir_data_type data_type, struct vkd3d_shader_register *param, enum vkd3d_shader_src_modifier *modifier) { const struct vkd3d_sm4_register_type_info *register_type_info; enum vkd3d_shader_register_type vsir_register_type; @@ -2354,7 +2354,7 @@ static bool shader_sm4_validate_input_output_register(struct vkd3d_shader_sm4_pa } static bool shader_sm4_read_src_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, - const uint32_t *end, enum vkd3d_data_type data_type, struct vkd3d_shader_src_param *src_param) + const uint32_t *end, enum vsir_data_type data_type, struct vkd3d_shader_src_param *src_param) { unsigned int dimension, mask; uint32_t token; @@ -2442,7 +2442,7 @@ static bool shader_sm4_read_src_param(struct vkd3d_shader_sm4_parser *priv, cons } static bool shader_sm4_read_dst_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, - const uint32_t *end, enum vkd3d_data_type data_type, struct vkd3d_shader_dst_param *dst_param) + const uint32_t *end, enum vsir_data_type data_type, struct vkd3d_shader_dst_param *dst_param) { enum vkd3d_sm4_swizzle_type swizzle_type; enum vkd3d_shader_src_modifier modifier; @@ -3838,7 +3838,7 @@ static void tpf_dcl_sampler(const struct tpf_compiler *tpf, const struct vkd3d_s write_sm4_instruction(tpf, &instr); } -static uint32_t pack_resource_data_type(const enum vkd3d_data_type *resource_data_type) +static uint32_t pack_resource_data_type(const enum vsir_data_type *resource_data_type) { unsigned int i, k, type = 0; diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index b66361114..af47cef1d 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -1084,7 +1084,7 @@ static void vkd3d_shader_scan_record_uav_atomic_op(struct vkd3d_shader_scan_cont static struct vkd3d_shader_descriptor_info1 *vkd3d_shader_scan_add_descriptor(struct vkd3d_shader_scan_context *context, enum vkd3d_shader_descriptor_type type, const struct vkd3d_shader_register *reg, const struct vkd3d_shader_register_range *range, enum vkd3d_shader_resource_type resource_type, - enum vkd3d_data_type resource_data_type) + enum vsir_data_type resource_data_type) { struct vkd3d_shader_scan_descriptor_info1 *info = context->scan_descriptor_info; struct vkd3d_shader_descriptor_info1 *d; @@ -1235,7 +1235,7 @@ static void vkd3d_shader_scan_combined_sampler_usage(struct vkd3d_shader_scan_co static void vkd3d_shader_scan_resource_declaration(struct vkd3d_shader_scan_context *context, const struct vkd3d_shader_resource *resource, enum vkd3d_shader_resource_type resource_type, - enum vkd3d_data_type resource_data_type, unsigned int sample_count, + enum vsir_data_type resource_data_type, unsigned int sample_count, unsigned int structure_stride, bool raw, uint32_t flags) { struct vkd3d_shader_descriptor_info1 *d; @@ -1522,7 +1522,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte return VKD3D_OK; } -static enum vkd3d_shader_resource_data_type vkd3d_resource_data_type_from_data_type(enum vkd3d_data_type data_type) +static enum vkd3d_shader_resource_data_type vkd3d_resource_data_type_from_data_type(enum vsir_data_type data_type) { switch (data_type) { diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index a6d96e816..29093df2a 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -708,7 +708,7 @@ enum vkd3d_shader_register_precision VKD3D_SHADER_REGISTER_PRECISION_INVALID = ~0u, }; -enum vkd3d_data_type +enum vsir_data_type { VKD3D_DATA_FLOAT, VKD3D_DATA_INT, @@ -726,26 +726,26 @@ enum vkd3d_data_type VKD3D_DATA_UINT16, VKD3D_DATA_HALF, - VKD3D_DATA_COUNT, + VSIR_DATA_TYPE_COUNT, }; -static inline bool data_type_is_integer(enum vkd3d_data_type data_type) +static inline bool data_type_is_integer(enum vsir_data_type data_type) { return data_type == VKD3D_DATA_INT || data_type == VKD3D_DATA_UINT8 || data_type == VKD3D_DATA_UINT16 || data_type == VKD3D_DATA_UINT || data_type == VKD3D_DATA_UINT64; } -static inline bool data_type_is_bool(enum vkd3d_data_type data_type) +static inline bool data_type_is_bool(enum vsir_data_type data_type) { return data_type == VKD3D_DATA_BOOL; } -static inline bool data_type_is_floating_point(enum vkd3d_data_type data_type) +static inline bool data_type_is_floating_point(enum vsir_data_type data_type) { return data_type == VKD3D_DATA_HALF || data_type == VKD3D_DATA_FLOAT || data_type == VKD3D_DATA_DOUBLE; } -static inline bool data_type_is_64_bit(enum vkd3d_data_type data_type) +static inline bool data_type_is_64_bit(enum vsir_data_type data_type) { return data_type == VKD3D_DATA_DOUBLE || data_type == VKD3D_DATA_UINT64; } @@ -942,7 +942,7 @@ struct vkd3d_shader_version struct vkd3d_shader_immediate_constant_buffer { unsigned int register_idx; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; /* total count is element_count * component_count */ unsigned int element_count; unsigned int component_count; @@ -955,7 +955,7 @@ struct vkd3d_shader_indexable_temp unsigned int register_idx; unsigned int register_size; unsigned int alignment; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; unsigned int component_count; bool has_function_scope; const struct vkd3d_shader_immediate_constant_buffer *initialiser; @@ -974,7 +974,7 @@ struct vkd3d_shader_register enum vkd3d_shader_register_type type; enum vkd3d_shader_register_precision precision; bool non_uniform; - enum vkd3d_data_type data_type; + enum vsir_data_type data_type; struct vkd3d_shader_register_index idx[3]; unsigned int idx_count; enum vsir_dimension dimension; @@ -991,7 +991,7 @@ struct vkd3d_shader_register }; void vsir_register_init(struct vkd3d_shader_register *reg, enum vkd3d_shader_register_type reg_type, - enum vkd3d_data_type data_type, unsigned int idx_count); + enum vsir_data_type data_type, unsigned int idx_count); static inline bool vsir_register_is_descriptor(const struct vkd3d_shader_register *reg) { @@ -1024,9 +1024,9 @@ struct vkd3d_shader_src_param }; void vsir_src_param_init(struct vkd3d_shader_src_param *param, enum vkd3d_shader_register_type reg_type, - enum vkd3d_data_type data_type, unsigned int idx_count); + enum vsir_data_type data_type, unsigned int idx_count); void vsir_dst_param_init(struct vkd3d_shader_dst_param *param, enum vkd3d_shader_register_type reg_type, - enum vkd3d_data_type data_type, unsigned int idx_count); + enum vsir_data_type data_type, unsigned int idx_count); void vsir_dst_param_init_null(struct vkd3d_shader_dst_param *dst); void vsir_src_param_init_label(struct vkd3d_shader_src_param *param, unsigned int label_id); @@ -1072,7 +1072,7 @@ struct vkd3d_shader_semantic unsigned int usage_idx; enum vkd3d_shader_resource_type resource_type; unsigned int sample_count; - enum vkd3d_data_type resource_data_type[VKD3D_VEC4_SIZE]; + enum vsir_data_type resource_data_type[VKD3D_VEC4_SIZE]; struct vkd3d_shader_resource resource; }; @@ -1285,7 +1285,7 @@ struct vkd3d_shader_instruction 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]; + enum vsir_data_type resource_data_type[VKD3D_VEC4_SIZE]; bool coissue, structured, raw; const struct vkd3d_shader_src_param *predicate; union @@ -1491,7 +1491,7 @@ struct vkd3d_shader_descriptor_info1 unsigned int register_index; unsigned int register_id; enum vkd3d_shader_resource_type resource_type; - enum vkd3d_data_type resource_data_type; + enum vsir_data_type resource_data_type; unsigned int flags; unsigned int sample_count; unsigned int buffer_size; @@ -1785,8 +1785,7 @@ int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info, int hlsl_compile_shader(const struct vkd3d_shader_code *hlsl, const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context); -static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_type( - enum vkd3d_data_type data_type) +static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_type( enum vsir_data_type data_type) { switch (data_type) { @@ -1814,8 +1813,7 @@ static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_ty } } -static inline enum vkd3d_data_type vkd3d_data_type_from_component_type( - enum vkd3d_shader_component_type component_type) +static inline enum vsir_data_type vsir_data_type_from_component_type(enum vkd3d_shader_component_type component_type) { switch (component_type) {