vkd3d-shader/hlsl: Validate that non-uniform objects are not referenced.

Note that in the future we should call
validate_static_object_references() after DCE and pruning branches,
because shaders such as these compile (at least in more modern versions
of the native compiler):

Branch pruning:
```
static RWTexture2D<float> tex;

float4 main() : sv_target
{
    if (0)
    {
        tex[int2(0, 0)] = 2;
    }
    return 0;
}
```

DCE:
```
static Texture2D tex;
uniform uint i;

float4 main() : sv_target
{
    float4 unused = tex.Load(int3(0, 1, 2));

    return 0;
}
```

These are "todo" tests in hlsl-static-initializer.shader_test
that depend on this.
This commit is contained in:
Francisco Casas
2022-12-05 21:48:28 -03:00
committed by Alexandre Julliard
parent 97c9669544
commit 17d6a4411e
Notes: Alexandre Julliard 2023-01-19 22:45:10 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/54
2 changed files with 27 additions and 8 deletions

View File

@@ -157,7 +157,7 @@ todo draw quad
todo probe (0, 0) rgba (11.0, 12.0, 13.0, 11.0)
[pixel shader fail todo]
[pixel shader fail]
float4 main(Texture2D tex2) : sv_target
{
Texture2D tex1;