From 1487764e239b4d9f3903b6188b2df15aad7b5f60 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 17 Jul 2025 16:51:18 +0200 Subject: [PATCH] vkd3d-shader/ir: Rename VKD3D_DATA_UINT64 to VSIR_DATA_U64. --- libs/vkd3d-shader/d3d_asm.c | 4 ++-- libs/vkd3d-shader/dxil.c | 8 ++++---- libs/vkd3d-shader/ir.c | 12 ++++++------ libs/vkd3d-shader/spirv.c | 14 +++++++------- libs/vkd3d-shader/vkd3d_shader_private.h | 8 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index 8c1b2bbe6..a15b7822c 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -394,7 +394,6 @@ static void shader_print_data_type(struct vkd3d_d3d_asm_compiler *compiler, enum [VKD3D_DATA_MIXED ] = "mixed", [VKD3D_DATA_CONTINUED] = "", [VKD3D_DATA_UNUSED ] = "", - [VKD3D_DATA_UINT64 ] = "uint64", [VKD3D_DATA_BOOL ] = "bool", [VSIR_DATA_F16 ] = "half", [VSIR_DATA_F32 ] = "float", @@ -403,6 +402,7 @@ static void shader_print_data_type(struct vkd3d_d3d_asm_compiler *compiler, enum [VSIR_DATA_U8 ] = "uint8", [VSIR_DATA_U16 ] = "uint16", [VSIR_DATA_U32 ] = "uint", + [VSIR_DATA_U64 ] = "uint64", }; if (type < ARRAY_SIZE(data_type_names)) @@ -806,7 +806,7 @@ static void shader_print_register(struct vkd3d_d3d_asm_compiler *compiler, const if (reg->dimension == VSIR_DIMENSION_VEC4) shader_print_double_literal(compiler, ", ", reg->u.immconst_f64[1], ""); } - else if (reg->data_type == VKD3D_DATA_UINT64) + else if (reg->data_type == VSIR_DATA_U64) { shader_print_uint64_literal(compiler, "", reg->u.immconst_u64[0], ""); if (reg->dimension == VSIR_DIMENSION_VEC4) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index b3bc93969..0a1e2fa69 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -2488,7 +2488,7 @@ static enum vsir_data_type vsir_data_type_from_dxil(const struct sm6_type *type) case 32: return VSIR_DATA_U32; case 64: - return VKD3D_DATA_UINT64; + return VSIR_DATA_U64; default: FIXME("Unhandled width %u.\n", type->u.width); return VSIR_DATA_U32; @@ -3267,7 +3267,7 @@ static enum vkd3d_result value_allocate_constant_array(struct sm6_value *dst, co break; case VSIR_DATA_F64: - case VKD3D_DATA_UINT64: + case VSIR_DATA_U64: data64 = (uint64_t *)icb->data; for (i = 0; i < count; ++i) data64[i] = operands[i]; @@ -8442,9 +8442,9 @@ static void sm6_block_emit_terminator(const struct sm6_block *block, struct sm6_ continue; } - if (src_params[0].reg.data_type == VKD3D_DATA_UINT64) + if (src_params[0].reg.data_type == VSIR_DATA_U64) { - vsir_src_param_init(&src_params[count], VKD3DSPR_IMMCONST64, VKD3D_DATA_UINT64, 0); + vsir_src_param_init(&src_params[count], VKD3DSPR_IMMCONST64, VSIR_DATA_U64, 0); src_params[count++].reg.u.immconst_u64[0] = switch_case->value; } else diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 03305c0a6..3cf6a4a5c 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -9884,7 +9884,7 @@ static void vsir_validate_io_src_param(struct validation_context *ctx, #define I32_BIT (1u << VSIR_DATA_I32) -#define U64_BIT (1u << VKD3D_DATA_UINT64) +#define U64_BIT (1u << VSIR_DATA_U64) #define U32_BIT (1u << VSIR_DATA_U32) #define U16_BIT (1u << VSIR_DATA_U16) @@ -10640,9 +10640,9 @@ static void vsir_validate_integer_elementwise_operation(struct validation_contex { static const bool types[VSIR_DATA_TYPE_COUNT] = { - [VKD3D_DATA_UINT64] = true, [VSIR_DATA_I32] = true, [VSIR_DATA_U32] = true, + [VSIR_DATA_U64] = true, }; vsir_validate_elementwise_operation(ctx, instruction, types); @@ -10653,10 +10653,10 @@ static void vsir_validate_logic_elementwise_operation(struct validation_context { static const bool types[VSIR_DATA_TYPE_COUNT] = { - [VKD3D_DATA_UINT64] = true, [VKD3D_DATA_BOOL] = true, [VSIR_DATA_I32] = true, [VSIR_DATA_U32] = true, + [VSIR_DATA_U64] = true, }; vsir_validate_elementwise_operation(ctx, instruction, types); @@ -10730,9 +10730,9 @@ static void vsir_validate_integer_comparison_operation(struct validation_context { static const bool types[VSIR_DATA_TYPE_COUNT] = { - [VKD3D_DATA_UINT64] = true, [VSIR_DATA_I32] = true, [VSIR_DATA_U32] = true, + [VSIR_DATA_U64] = true, }; vsir_validate_comparison_operation(ctx, instruction, types); @@ -11326,10 +11326,10 @@ static void vsir_validate_itof(struct validation_context *ctx, const struct vkd3 { static const bool src_types[VSIR_DATA_TYPE_COUNT] = { - [VKD3D_DATA_UINT64] = true, [VKD3D_DATA_BOOL] = true, [VSIR_DATA_I32] = true, [VSIR_DATA_U32] = true, + [VSIR_DATA_U64] = true, }; static const bool dst_types[VSIR_DATA_TYPE_COUNT] = { @@ -11345,10 +11345,10 @@ static void vsir_validate_itoi(struct validation_context *ctx, const struct vkd3 { static const bool types[VSIR_DATA_TYPE_COUNT] = { - [VKD3D_DATA_UINT64] = true, [VKD3D_DATA_BOOL] = true, [VSIR_DATA_I32] = true, [VSIR_DATA_U32] = true, + [VSIR_DATA_U64] = true, }; vsir_validate_cast_operation(ctx, instruction, types, types); diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index cf659f168..e5727037e 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -4491,7 +4491,7 @@ static uint32_t spirv_compiler_emit_int_to_bool(struct spirv_compiler *compiler, type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_BOOL, component_count); op = condition & VKD3D_SHADER_CONDITIONAL_OP_Z ? SpvOpIEqual : SpvOpINotEqual; return vkd3d_spirv_build_op_tr2(builder, &builder->function_stream, op, type_id, val_id, - data_type == VKD3D_DATA_UINT64 + data_type == VSIR_DATA_U64 ? spirv_compiler_get_constant_uint64_vector(compiler, 0, component_count) : spirv_compiler_get_constant_uint_vector(compiler, 0, component_count)); } @@ -4716,7 +4716,7 @@ static uint32_t spirv_compiler_emit_constant_array(struct spirv_compiler *compil &icb->data[component_count * i]); break; case VSIR_DATA_F64: - case VKD3D_DATA_UINT64: + case VSIR_DATA_U64: { uint64_t *data = (uint64_t *)icb->data; for (i = 0; i < element_count; ++i) @@ -7604,7 +7604,7 @@ static void spirv_compiler_emit_bool_cast(struct spirv_compiler *compiler, { val_id = spirv_compiler_emit_bool_to_int(compiler, 1, val_id, instruction->opcode == VSIR_OP_ITOI); } - else if (dst->reg.data_type == VKD3D_DATA_UINT64) + else if (dst->reg.data_type == VSIR_DATA_U64) { val_id = spirv_compiler_emit_bool_to_int64(compiler, 1, val_id, instruction->opcode == VSIR_OP_ITOI); } @@ -7630,7 +7630,7 @@ static enum vkd3d_result spirv_compiler_emit_alu_instruction(struct spirv_compil SpvOp op = SpvOpMax; bool check_zero; - if (src->reg.data_type == VKD3D_DATA_UINT64 && instruction->opcode == VSIR_OP_COUNTBITS) + if (src->reg.data_type == VSIR_DATA_U64 && instruction->opcode == VSIR_OP_COUNTBITS) { /* At least some drivers support this anyway, but if validation is enabled it will fail. */ FIXME("Unsupported 64-bit source for bit count.\n"); @@ -7700,7 +7700,7 @@ static enum vkd3d_result spirv_compiler_emit_alu_instruction(struct spirv_compil condition_id = spirv_compiler_emit_int_to_bool(compiler, VKD3D_SHADER_CONDITIONAL_OP_NZ, src[1].reg.data_type, component_count, src_ids[1]); - if (dst[0].reg.data_type == VKD3D_DATA_UINT64) + if (dst[0].reg.data_type == VSIR_DATA_U64) uint_max_id = spirv_compiler_get_constant_uint64_vector(compiler, UINT64_MAX, component_count); else uint_max_id = spirv_compiler_get_constant_uint_vector(compiler, UINT_MAX, component_count); @@ -7815,7 +7815,7 @@ static void spirv_compiler_emit_ext_glsl_instruction(struct spirv_compiler *comp unsigned int i, component_count; enum GLSLstd450 glsl_inst; - if (src[0].reg.data_type == VKD3D_DATA_UINT64 && (instruction->opcode == VSIR_OP_FIRSTBIT_HI + if (src[0].reg.data_type == VSIR_DATA_U64 && (instruction->opcode == VSIR_OP_FIRSTBIT_HI || instruction->opcode == VSIR_OP_FIRSTBIT_LO || instruction->opcode == VSIR_OP_FIRSTBIT_SHI)) { /* At least some drivers support this anyway, but if validation is enabled it will fail. */ @@ -8225,7 +8225,7 @@ static void spirv_compiler_emit_bitfield_instruction(struct spirv_compiler *comp component_type = vkd3d_component_type_from_data_type(dst->reg.data_type); type_id = vkd3d_spirv_get_type_id(builder, component_type, 1); - size = (src[src_count - 1].reg.data_type == VKD3D_DATA_UINT64) ? 0x40 : 0x20; + size = (src[src_count - 1].reg.data_type == VSIR_DATA_U64) ? 0x40 : 0x20; mask_id = spirv_compiler_get_constant_uint(compiler, size - 1); size_id = spirv_compiler_get_constant_uint(compiler, size); diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index c1141693e..872e34c35 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -716,7 +716,6 @@ enum vsir_data_type VKD3D_DATA_MIXED, VKD3D_DATA_CONTINUED, VKD3D_DATA_UNUSED, - VKD3D_DATA_UINT64, VKD3D_DATA_BOOL, VSIR_DATA_F16, @@ -728,6 +727,7 @@ enum vsir_data_type VSIR_DATA_U8, VSIR_DATA_U16, VSIR_DATA_U32, + VSIR_DATA_U64, VSIR_DATA_TYPE_COUNT, }; @@ -735,7 +735,7 @@ enum vsir_data_type static inline bool data_type_is_integer(enum vsir_data_type data_type) { return data_type == VSIR_DATA_I32 || data_type == VSIR_DATA_U8 || data_type == VSIR_DATA_U16 - || data_type == VSIR_DATA_U32 || data_type == VKD3D_DATA_UINT64; + || data_type == VSIR_DATA_U32 || data_type == VSIR_DATA_U64; } static inline bool data_type_is_bool(enum vsir_data_type data_type) @@ -750,7 +750,7 @@ static inline bool data_type_is_floating_point(enum vsir_data_type data_type) static inline bool data_type_is_64_bit(enum vsir_data_type data_type) { - return data_type == VSIR_DATA_F64 || data_type == VKD3D_DATA_UINT64; + return data_type == VSIR_DATA_F64 || data_type == VSIR_DATA_U64; } enum vsir_dimension @@ -1806,7 +1806,7 @@ static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_ty case VSIR_DATA_U16: /* Minimum precision. TODO: native 16-bit */ case VSIR_DATA_U32: return VKD3D_SHADER_COMPONENT_UINT; - case VKD3D_DATA_UINT64: + case VSIR_DATA_U64: return VKD3D_SHADER_COMPONENT_UINT64; case VKD3D_DATA_BOOL: return VKD3D_SHADER_COMPONENT_BOOL;