Commit Graph

637 Commits

Author SHA1 Message Date
d1df10ac86 vkd3d-shader/hlsl: Use dcl_output_siv for patch constant function sysval outputs. 2025-04-09 16:02:12 +02:00
f576ecc992 vkd3d-shader/hlsl: Introduce a compiler pass to vectorize stores. 2025-04-03 20:29:20 +02:00
1a999f74fc vkd3d-shader/hlsl: Introduce a compiler pass to vectorize expressions. 2025-04-03 20:29:20 +02:00
7aebed0eea vkd3d-shader/hlsl: Ensure that uniform objects are never written to in copy_propagation_transform_object_load(). 2025-04-02 18:49:52 +02:00
b1d8915440 vkd3d-shader/hlsl: Divert written uniform derefs to temps before copy-propagation passes.
The following pixel shader currently triggers an infinite loop during
copy propagation, which is fixed by this commit:

    sampler s;
    Texture2D t1, t2;

    float4 main() : sv_target
    {
        Texture2D t = t1;
        t1 = t2;
        t2 = t;
        return t1.Sample(s, float2(0, 0)) + t2.Sample(s, float2(0, 0));
    }

The infinite loop occurs because copy_propagation_transform_object_load()
replaces t1 in the resource_load(t1, ...) instruction
with t2, t1, t2, ... repeatedly.
2025-04-02 18:49:52 +02:00
3ead8d532b vkd3d-shader/hlsl: Allow non-constant deref propagation on SM1.
Note that we still have to preempt the propagation to SM1 pixel shader
uniforms. Otherwise this will turn the many constant derefs that appear
from the <index-val> copy generated in lower_index_loads() into a single
non-constant deref, causing it to allocate all the registers instead of
up until the last one used.
2025-04-02 18:27:16 +02:00
fd02d69dda vkd3d-shader/hlsl: Implement indirect addressing for d3dbc target profiles. 2025-04-02 18:26:03 +02:00
20b76f87bf vkd3d-shader/hlsl: Initialize the temp count for sm1. 2025-04-02 17:58:26 +02:00
7cb5a7bebc vkd3d-shader/hlsl: Leave the swizzle zero for VSIR_DIMENSION_NONE registers. 2025-04-02 17:58:26 +02:00
950f78041a vkd3d-shader/hlsl: Initialize the vsir dimension for sm1. 2025-04-02 17:58:26 +02:00
856f4b55f6 vkd3d-shader/hlsl: Set the correct index count for sm1 DEPTHOUT. 2025-04-02 17:58:26 +02:00
227e2cc0f5 vkd3d-shader/hlsl: Use vsir_*_from_hlsl_node() helpers in more places. 2025-04-02 17:58:18 +02:00
bd055fac1c vkd3d-shader/hlsl: Store geometry shader properties in struct vsir_program. 2025-03-18 15:46:02 +01:00
b1ace5763a vkd3d-shader/hlsl: Implement input semantics for geometry shaders. 2025-03-18 15:40:11 +01:00
8af3173955 vkd3d-shader/hlsl: Support input primitive arrays in geometry shaders. 2025-03-18 15:40:11 +01:00
ea99d2c2cd vkd3d-shader/hlsl: Lower integer modulus for d3dbc target profiles. 2025-03-18 15:27:04 +01:00
828afe188c vkd3d-shader/hlsl: Don't lower integer MOD and DIV on const passes for d3dbc target profiles.
These bitwise operations are not available in these profiles.
2025-03-18 15:27:03 +01:00
bc382c6835 vkd3d-shader/hlsl: Reuse shader model 1-3 constants. 2025-03-18 14:21:02 +01:00
c9a5f586b7 vkd3d-shader/hlsl: Zero-initialize "nonconst_i" and "ret_swizzle" in copy_propagation_replace_with_deref().
GCC without LTO is unable to determine that these are never used
uninitialized.
2025-03-13 13:59:05 +01:00
09b9f8ff9f vkd3d-shader/hlsl: Fix invalidation of the wrong components in copy-propagation.
Fixes: 1bba18aa75.
2025-03-12 22:14:25 +01:00
a87b1efbd2 vkd3d-shader/hlsl: Don't invalidate OOB constant derefs. 2025-03-12 22:09:57 +01:00
0642531c2a vkd3d-shader/hlsl: Introduce hlsl_block_add_swizzle(). 2025-03-12 22:02:31 +01:00
f8c53fae37 vkd3d-shader/hlsl: Introduce hlsl_block_add_resource_load(). 2025-03-12 22:02:21 +01:00
ae5261b98b vkd3d-shader/hlsl: Forbid output parameters in geometry shaders.
Outputs in geometry shaders must be written to streams.
2025-03-12 21:15:15 +01:00
4137ea5ab7 vkd3d-shader/hlsl: Validate stream output parameters in geometry shaders. 2025-03-12 21:13:59 +01:00