Shaun Ren
7ab7b2ab8b
vkd3d-shader/hlsl: Implement copy-propagation of derefs with a non-constant index.
...
We implement a transformation that propagates loads with a single
non-constant index in its deref path. Consider a load of the form
var[[a0][a1]...[i]...[an]], where ak are integral constants, and i is
an arbitrary non-constant node. If, for all j, the following holds:
var[[a0][a1]...[j]...[an]] = x[[c0*j + d0][c1*j + d1]...[cm*j + dm]],
where ck, dk are constants, then we can replace the load with
x[[c0*i + d0]...[cm*i + dm]]. This pass is implemented by
copy_propagation_replace_with_deref().
2025-03-12 18:16:59 +01:00
Shaun Ren
f484527cfb
vkd3d-shader/hlsl: Rename init_deref() to hlsl_init_deref().
2025-03-12 17:22:44 +01:00
Elizabeth Figura
f4042ba752
vkd3d-shader/hlsl: Add a hlsl_block_add_resource_store() helper.
2025-03-10 14:56:11 +01:00
Elizabeth Figura
e7ff5da5b1
vkd3d-shader/hlsl: Add a hlsl_block_add_index() helper.
2025-03-10 14:56:11 +01:00
Elizabeth Figura
e5cabeafe5
vkd3d-shader/hlsl: Add a hlsl_block_add_loop() helper.
2025-03-10 14:56:11 +01:00
Elizabeth Figura
62196b2bf1
vkd3d-shader/hlsl: Add a hlsl_block_add_if() helper.
2025-03-10 14:56:11 +01:00
Elizabeth Figura
20aa37237d
vkd3d-shader/hlsl: Add a hlsl_block_add_jump() helper.
2025-03-10 14:56:11 +01:00
Elizabeth Figura
18ca7affad
vkd3d-shader/hlsl: Make min16uint into a first-class type.
...
And properly implement translation into some binary enumerations.
2025-03-06 17:15:15 +01:00
Elizabeth Figura
3cf4a4e95e
vkd3d-shader/hlsl: Use common hlsl_type_is_integer() and hlsl_base_type_is_integer() helpers.
2025-03-06 17:15:15 +01:00
Elizabeth Figura
055625448b
vkd3d-shader/hlsl: Add a hlsl_block_add_simple_load() helper.
2025-03-05 14:12:12 +01:00
Elizabeth Figura
d52df527ba
vkd3d-shader/hlsl: Add a hlsl_block_add_load_index() helper.
2025-03-05 14:12:12 +01:00
Elizabeth Figura
009f5765df
vkd3d-shader/hlsl: Return void from hlsl_block_add_store_component().
2025-03-05 14:12:12 +01:00
Elizabeth Figura
9e3ac35669
vkd3d-shader/hlsl: Pass the target block to hlsl_new_store_component().
2025-03-05 14:12:12 +01:00
Elizabeth Figura
e76c596d56
vkd3d-shader/hlsl: Add a hlsl_block_add_simple_store() helper.
2025-03-03 17:48:03 +01:00
Elizabeth Figura
fc4f440245
vkd3d-shader/hlsl: Add a hlsl_block_add_store_index() helper.
2025-03-03 17:48:03 +01:00
Elizabeth Figura
eafc97bcb3
vkd3d-shader/hlsl: Pass the target block to hlsl_new_load_component().
2025-03-03 17:48:03 +01:00
Elizabeth Figura
d053f3665d
vkd3d-shader/hlsl: Pass a block to hlsl_new_void_expr().
2025-03-03 17:48:03 +01:00
Elizabeth Figura
662d60ad6b
vkd3d-shader/hlsl: Add a hlsl_block_add_expr() helper.
2025-03-03 17:48:03 +01:00
Francisco Casas
7cb1970952
vkd3d-shader/hlsl: Don't cast all expressions to float.
...
Instead, allow half, bool, int, and uint, expressions that map to the
same float op to reach sm1_generate_vsir_instr_expr().
2025-03-03 17:26:15 +01:00
Elizabeth Figura
2989373212
vkd3d-shader/hlsl: Add a hlsl_block_add_binary_expr() helper.
2025-02-24 16:19:07 +01:00
Elizabeth Figura
858b6a3e0b
vkd3d-shader/hlsl: Add a hlsl_block_add_cast() helper.
2025-02-24 16:19:07 +01:00
Elizabeth Figura
2e09257d94
vkd3d-shader/hlsl: Add a hlsl_block_add_unary_expr() helper.
2025-02-24 16:19:07 +01:00
Elizabeth Figura
b7ea23303e
vkd3d-shader/hlsl: Add a hlsl_block_add_float_constant() helper.
2025-02-24 16:19:07 +01:00
Elizabeth Figura
d5a2ff5c12
vkd3d-shader/hlsl: Add a hlsl_block_add_int_constant() helper.
2025-02-20 15:56:31 +01:00
Elizabeth Figura
992d20def3
vkd3d-shader/hlsl: Add a hlsl_block_add_uint_constant() helper.
2025-02-20 15:50:13 +01:00