vkd3d-shader/hlsl: Support resource arrays when writting SM4.

The new fixmes can be triggered in presence of object components within
structs (for SM5).

In shaders such as this one:

    struct apple
    {
        Texture2D tex : TEX;
        float4 color : COLOR;
    };

    float4 main(struct apple input) : sv_target
    {
        return input.tex.Load(int3(1, 2, 3));
    }

Or this one:

    struct
    {
        Texture2D tex;
        float4 color;
    } s;

    float4 main() : sv_target
    {
        return s.tex.Load(int3(1, 2, 3));
    }
This commit is contained in:
Francisco Casas
2023-04-25 14:03:50 -04:00
committed by Alexandre Julliard
parent a91e6d4563
commit ef7cf9b1ad
Notes: Alexandre Julliard 2023-05-08 22:34:16 +02: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/159
4 changed files with 89 additions and 58 deletions

View File

@@ -92,7 +92,7 @@ size (1, 1)
size (1, 1)
3.0 3.0 3.0 1.0
[pixel shader todo]
[pixel shader]
Texture2D tex[3];
struct foo {
@@ -111,8 +111,8 @@ float4 main() : sv_target
}
[test]
todo draw quad
todo probe all rgba (312, 312, 312, 111)
draw quad
probe all rgba (312, 312, 312, 111)
[pixel shader]

View File

@@ -24,7 +24,7 @@ size (1, 1)
% If a single component in a texture array is used, all registers are reserved.
[pixel shader todo]
[pixel shader]
Texture2D partially_used[2][2];
Texture2D tex;
@@ -34,8 +34,8 @@ float4 main() : sv_target
}
[test]
todo draw quad
todo probe all rgba (41.0, 41.0, 41.0, 1089.0)
draw quad
probe all rgba (41.0, 41.0, 41.0, 1089.0)
% If no component in a texture array is used, and it doesn't have a register reservation, no

View File

@@ -147,7 +147,7 @@ size (1, 1)
0.5 0.6 0.7 0.8
[pixel shader todo]
[pixel shader]
RWTexture2D<float4> u[2] : register(u2);
float4 main() : sv_target1
@@ -158,6 +158,6 @@ float4 main() : sv_target1
}
[test]
todo draw quad
draw quad
probe uav 2 (0, 0) rgba (1.1, 1.2, 1.3, 1.4)
probe uav 3 (0, 0) rgba (2.1, 2.2, 2.3, 2.4)