writer/hlsl: Swizzle depth texture intrinsics

HLSL usually implicitly casts a vector down to a scalar, but this breaks when passing the vector to RWByteAddressBuffer.Store (for DXC only).

Fixed: tint:827
Change-Id: I67d0bc6e9185de3d434a7aaeb575d83850111ec5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55760
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-06-24 08:46:06 +00:00
committed by Tint LUCI CQ
parent 9cae45e6ca
commit c8434889d8
17 changed files with 144 additions and 117 deletions

View File

@@ -9,6 +9,6 @@ struct tint_symbol_1 {
[numthreads(1, 1, 1)]
void main(tint_symbol_1 tint_symbol) {
const uint3 GlobalInvocationId = tint_symbol.GlobalInvocationId;
result.Store((4u * ((GlobalInvocationId.y * width) + GlobalInvocationId.x)), asuint(tex.Load(int3(int(GlobalInvocationId.x), int(GlobalInvocationId.y), 0), 0)));
result.Store((4u * ((GlobalInvocationId.y * width) + GlobalInvocationId.x)), asuint(tex.Load(int3(int(GlobalInvocationId.x), int(GlobalInvocationId.y), 0), 0).x));
return;
}

View File

@@ -1,7 +1,7 @@
Texture2D arg_0 : register(t0, space1);
void textureLoad_19cf87() {
float res = arg_0.Load(int3(0, 0, 0), 1);
float res = arg_0.Load(int3(0, 0, 0), 1).x;
}
struct tint_symbol {

View File

@@ -1,7 +1,7 @@
Texture2DArray arg_0 : register(t0, space1);
void textureLoad_9b2667() {
float res = arg_0.Load(int4(0, 0, 1, 0), 1);
float res = arg_0.Load(int4(0, 0, 1, 0), 1).x;
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@ Texture2D arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSample_38bbb9() {
float res = arg_0.Sample(arg_1, float2(0.0f, 0.0f));
float res = arg_0.Sample(arg_1, float2(0.0f, 0.0f)).x;
}
void fragment_main() {

View File

@@ -2,7 +2,7 @@ Texture2D arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSample_667d76() {
float res = arg_0.Sample(arg_1, float2(0.0f, 0.0f), int2(0, 0));
float res = arg_0.Sample(arg_1, float2(0.0f, 0.0f), int2(0, 0)).x;
}
void fragment_main() {

View File

@@ -2,7 +2,7 @@ Texture2DArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSample_7e9ffd() {
float res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, float(1)));
float res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, float(1))).x;
}
void fragment_main() {

View File

@@ -2,7 +2,7 @@ Texture2DArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSample_8522e7() {
float res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, float(1)), int2(0, 0));
float res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, float(1)), int2(0, 0)).x;
}
void fragment_main() {

View File

@@ -2,7 +2,7 @@ TextureCubeArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSample_c2f4e8() {
float res = arg_0.Sample(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)));
float res = arg_0.Sample(arg_1, float4(0.0f, 0.0f, 0.0f, float(1))).x;
}
void fragment_main() {

View File

@@ -2,7 +2,7 @@ TextureCube arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSample_ea7030() {
float res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f));
float res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f)).x;
}
void fragment_main() {

View File

@@ -2,7 +2,7 @@ Texture2D arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSampleLevel_02be59() {
float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1);
float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1).x;
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@ TextureCube arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSampleLevel_1b0291() {
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1);
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1).x;
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@ Texture2DArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSampleLevel_1bf73e() {
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1);
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1).x;
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@ Texture2D arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSampleLevel_47daa4() {
float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1, int2(0, 0));
float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1, int2(0, 0)).x;
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@ TextureCubeArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSampleLevel_ae5e39() {
float res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), 1);
float res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), 1).x;
}
struct tint_symbol {

View File

@@ -2,7 +2,7 @@ Texture2DArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
void textureSampleLevel_ba93b3() {
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1, int2(0, 0));
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1, int2(0, 0)).x;
}
struct tint_symbol {