mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_shift_operation().
This commit is contained in:
Notes:
Henri Verbeet
2025-09-10 12:04:15 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1720
@@ -11178,7 +11178,7 @@ static void vsir_validate_cast_operation(struct validation_context *ctx,
|
||||
static void vsir_validate_shift_operation(struct validation_context *ctx,
|
||||
const struct vkd3d_shader_instruction *instruction)
|
||||
{
|
||||
enum vsir_data_type data_type;
|
||||
enum vsir_data_type dst_data_type, src_data_type;
|
||||
|
||||
static const bool types[] =
|
||||
{
|
||||
@@ -11187,24 +11187,27 @@ static void vsir_validate_shift_operation(struct validation_context *ctx,
|
||||
[VSIR_DATA_U64] = true,
|
||||
};
|
||||
|
||||
data_type = instruction->dst[0].reg.data_type;
|
||||
if ((size_t)data_type >= ARRAY_SIZE(types) || !types[data_type])
|
||||
dst_data_type = instruction->dst[0].reg.data_type;
|
||||
if ((size_t)dst_data_type >= ARRAY_SIZE(types) || !types[dst_data_type])
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid destination data type %#x for shift operation \"%s\" (%#x).",
|
||||
data_type, vsir_opcode_get_name(instruction->opcode, "<unknown>"), instruction->opcode);
|
||||
|
||||
if (instruction->src[0].reg.data_type != data_type)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Data type %#x for source operand 0 doesn't match destination data type %#x "
|
||||
"for shift operation \"%s\" (%#x).",
|
||||
instruction->src[0].reg.data_type, data_type,
|
||||
"Invalid destination data type \"%s\" (%#x) for shift operation \"%s\" (%#x).",
|
||||
vsir_data_type_get_name(dst_data_type, "<unknown>"), dst_data_type,
|
||||
vsir_opcode_get_name(instruction->opcode, "<unknown>"), instruction->opcode);
|
||||
|
||||
data_type = instruction->src[1].reg.data_type;
|
||||
if ((size_t)data_type >= ARRAY_SIZE(types) || !types[data_type])
|
||||
if ((src_data_type = instruction->src[0].reg.data_type) != dst_data_type)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid source operand 1 data type %#x for shift operation \"%s\" (%#x).",
|
||||
data_type, vsir_opcode_get_name(instruction->opcode, "<unknown>"), instruction->opcode);
|
||||
"Data type \"%s\" (%#x) for source operand 0 doesn't match destination data type \"%s\" (%#x) "
|
||||
"for shift operation \"%s\" (%#x).",
|
||||
vsir_data_type_get_name(src_data_type, "<unknown>"), src_data_type,
|
||||
vsir_data_type_get_name(dst_data_type, "<unknown>"), dst_data_type,
|
||||
vsir_opcode_get_name(instruction->opcode, "<unknown>"), instruction->opcode);
|
||||
|
||||
src_data_type = instruction->src[1].reg.data_type;
|
||||
if ((size_t)src_data_type >= ARRAY_SIZE(types) || !types[src_data_type])
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid source operand 1 data type \"%s\" (%#x) for shift operation \"%s\" (%#x).",
|
||||
vsir_data_type_get_name(src_data_type, "<unknown>"), src_data_type,
|
||||
vsir_opcode_get_name(instruction->opcode, "<unknown>"), instruction->opcode);
|
||||
}
|
||||
|
||||
static void vsir_validate_branch(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction)
|
||||
|
Reference in New Issue
Block a user