vkd3d-shader/hlsl: Lower separated samplers for SM1.

The combined sampler is created as a SAMPLER instead of a TEXTURE
because that fits all our current infrastructure. The only problem is
that in the CTAB it must appear as a Texture, so the new field
hlsl_type.is_combined_sampler is added.

Co-authored-by: Elizabeth Figura <zfigura@codeweavers.com>
This commit is contained in:
Francisco Casas
2024-12-03 17:05:48 -03:00
committed by Henri Verbeet
parent 58d318719c
commit 3a6bf3be24
Notes: Henri Verbeet 2024-12-10 15:58:19 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1303
9 changed files with 162 additions and 42 deletions

View File

@@ -95,8 +95,8 @@ float4 main() : sv_target
[test]
todo(msl) draw quad
if(sm<4) todo probe (0, 0) rgba (1, 1, 1, 11)
if(sm>=4) probe (0, 0) rgba (10, 10, 10, 11)
if(sm<4) probe (0, 0) rgba(1, 1, 1, 11)
if(sm>=4) probe (0, 0) rgba(10, 10, 10, 11)
[pixel shader]
@@ -110,8 +110,8 @@ float4 main() : sv_target
[test]
todo(msl) draw quad
if(sm<4) todo probe (0, 0) rgba (1, 1, 1, 11)
if(sm>=4) probe (0, 0) rgba (10, 10, 10, 11)
if(sm<4) probe (0, 0) rgba(1, 1, 1, 11)
if(sm>=4) probe (0, 0) rgba(10, 10, 10, 11)
[pixel shader todo(sm<4)]
@@ -202,7 +202,7 @@ float4 main() : sv_target
[test]
todo(msl) draw quad
if(sm<4) todo probe (0, 0) rgba(453021, 453021, 453021, 111111)
if(sm<4) probe (0, 0) rgba(453021, 453021, 453021, 111111)
if(sm>=4) probe (0, 0) rgba(12333, 12333, 12333, 111111)

View File

@@ -229,7 +229,7 @@ size (2d, 2, 2)
filter linear linear linear
address clamp clamp clamp
[pixel shader todo(sm<4)]
[pixel shader]
Texture2D tex;
sampler sam;
float a;
@@ -243,14 +243,14 @@ float4 main() : sv_target
[test]
uniform 0 float -2
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 4.0)
uniform 0 float 4
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
[pixel shader todo(sm<4)]
[pixel shader]
Texture2D tex;
sampler sam;
float a;
@@ -267,11 +267,11 @@ float4 main() : sv_target
[test]
uniform 0 float 2
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 4.0)
uniform 0 float 1
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (1.0, 0.0, 0.0, 4.0)
uniform 0 float 0
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (1.0, 1.0, 0.0, 4.0)

View File

@@ -18,7 +18,7 @@ void main(float4 pos : position, out float2 tex : texcoord, out float4 out_pos :
out_pos = pos;
}
[pixel shader todo(sm<4)]
[pixel shader]
sampler s;
Texture2D t;
uniform float bias;
@@ -32,16 +32,16 @@ float4 main(float2 coord : texcoord) : sv_target
[test]
uniform 0 float4 6.5 0.0 0.0 0.0
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (10.0, 0.0, 10.0, 0.0)
uniform 0 float4 7.5 0.0 0.0 0.0
todo(sm<4 | msl) draw quad
probe (0, 0) rgba (4.0, 0.0, 10.0, 0.0)
todo(msl) draw quad
todo(sm<4) probe (0, 0) rgba(4.0, 0.0, 10.0, 0.0)
uniform 0 float4 8.5 0.0 0.0 0.0
todo(sm<4 | msl) draw quad
probe (0, 0) rgba (0.0, 0.0, 10.0, 0.0)
todo(msl) draw quad
todo(sm<4) probe (0, 0) rgba(0.0, 0.0, 10.0, 0.0)
[require]
shader model >= 3.0

View File

@@ -7,7 +7,7 @@ size (2d, 2, 2)
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0
[pixel shader todo(sm<4)]
[pixel shader]
sampler s;
Texture2D t;
@@ -17,10 +17,10 @@ float4 main() : sv_target
}
[test]
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (0.25, 0, 0.25, 0)
[pixel shader todo(sm<4)]
[pixel shader]
SamplerState s;
Texture2D t;
@@ -30,7 +30,7 @@ float4 main() : sv_target
}
[test]
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (0.25, 0, 0.25, 0)
[pixel shader fail]

View File

@@ -136,7 +136,7 @@ float4 main(Texture2D tex2) : sv_target
}
[pixel shader todo(sm<4)]
[pixel shader]
Texture2D real_tex;
static Texture2D tex = real_tex;
sampler sam;
@@ -147,11 +147,11 @@ float4 main() : sv_target
}
[test]
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (1, 2, 3, 4)
[pixel shader todo(sm<4)]
[pixel shader]
Texture2D real_tex;
static Texture2D tex;
sampler sam;
@@ -163,7 +163,7 @@ float4 main() : sv_target
}
[test]
todo(sm<4 | msl) draw quad
todo(msl) draw quad
probe (0, 0) rgba (1, 2, 3, 4)