mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Do not emit HLSL_OP1_ABS for unsigned types.
This commit is contained in:
committed by
Henri Verbeet
parent
cdc74a9377
commit
a06b9f6646
Notes:
Henri Verbeet
2025-05-14 15:27:19 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1497
@@ -3189,6 +3189,11 @@ static bool elementwise_intrinsic_uint_convert_args(struct hlsl_ctx *ctx,
|
||||
static bool intrinsic_abs(struct hlsl_ctx *ctx,
|
||||
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
const struct hlsl_type *type = params->args[0]->data_type;
|
||||
|
||||
if (!hlsl_type_is_floating_point(type) && !hlsl_type_is_signed_integer(type))
|
||||
return true;
|
||||
|
||||
return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_ABS, params->args[0], loc);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user