mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Fold some general unary identities.
The following unary identities are applied: ||x|| -> |x| |-x| -> |x| ~(~x) -> x f(g(x)) -> g(x), where f(), g() are floor() or ceil() functions. -(-x) -> x !!x -> x !(x == y) -> x != y, !(x < y) -> x >= y, etc (for integers).
This commit is contained in:
Notes:
Henri Verbeet
2025-08-21 16:34:36 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1648
@@ -1541,6 +1541,12 @@ static inline bool hlsl_var_has_buffer_offset_register_reservation(struct hlsl_c
|
||||
return var->reg_reservation.reg_type == 'c' && var->buffer == ctx->globals_buffer;
|
||||
}
|
||||
|
||||
static inline bool hlsl_is_comparison_op(enum hlsl_ir_expr_op op)
|
||||
{
|
||||
return op == HLSL_OP2_EQUAL || op == HLSL_OP2_GEQUAL
|
||||
|| op == HLSL_OP2_LESS || op == HLSL_OP2_NEQUAL;
|
||||
}
|
||||
|
||||
char *hlsl_sprintf_alloc(struct hlsl_ctx *ctx, const char *fmt, ...) VKD3D_PRINTF_FUNC(2, 3);
|
||||
|
||||
const char *debug_hlsl_expr_op(enum hlsl_ir_expr_op op);
|
||||
|
||||
Reference in New Issue
Block a user