Commit Graph

465 Commits

Author SHA1 Message Date
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
Francisco Casas
321fda9c26 vkd3d-shader/hlsl: Only use the temp copy for variables that are written.
This can save a significant amount of temp registers because it allows to
avoid referencing the temp (and having to store it) when not needed.

For instance, this patch lowers the number of required temps for the
following ps_2_0 shader from 24 to 19:

    int i;
    float3x3 mats[4];

    float4 main() : sv_target
    {
        return mul(mats[i], float3(1, 2, 3)).xyzz;
    }

Also, it is needed for SM1 vertex shader relative addressing since
non-constant loads are required to be directly on the uniform ('c'
registers) instead of the temp, and non-constant loads cannot be
transformed by copy propagation.
2025-02-20 15:44:09 +01:00
Shaun Ren
f5d216835a vkd3d-shader/hlsl: Add an "is_patch_constant_func" field to struct hlsl_ctx.
In anticipation of the need for is_patch_constant_func in
sm4_generate_vsir_reg_from_deref(), in order to generate vsir
registers from InputPatch/OutputPatch dereferences.
2025-02-03 16:00:38 +01:00