diff options
| author | Yong He <yonghe@outlook.com> | 2023-11-16 14:32:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-16 14:32:33 -0800 |
| commit | 4c78efd0c34442866f20e9d00bbb6908115c9a01 (patch) | |
| tree | 03ca8584847f0937a926f6b27386dcd982ed7780 /tests/cross-compile | |
| parent | 12f7237e4060388494c549623f4a640327b7ca08 (diff) | |
Unify stdlib `Texture` types into one generic type. (#3327)
* Unify Texture types in stdlib into 1 generic type.
* Fixes.
* Fix.
* Fixes.
* Fix reflection.
* Fix binding reflection.
* Add gather intrinsics.
* Fix gather intrinsics.
* Fix texture type toText.
* Fix intrinsic.
* fix cuda intrinsic.
* Fix project files.
* cleanup.
* Fix.
* Fix.
* Fix sampler feedback test.
* Fix getDimension intrinsics.
* Fix spirv sample image intrinsics.
* Fix test.
* Fix GLSL intrinsic.
* Cleanup.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/cross-compile')
| -rw-r--r-- | tests/cross-compile/glsl-samplecmplevelzero.slang | 4 | ||||
| -rw-r--r-- | tests/cross-compile/glsl-texturegather.slang | 11 | ||||
| -rw-r--r-- | tests/cross-compile/image-load.slang | 8 | ||||
| -rw-r--r-- | tests/cross-compile/vk-texture-indexing.slang | 5 |
4 files changed, 18 insertions, 10 deletions
diff --git a/tests/cross-compile/glsl-samplecmplevelzero.slang b/tests/cross-compile/glsl-samplecmplevelzero.slang index 4bfd557cc..cd2ee54bd 100644 --- a/tests/cross-compile/glsl-samplecmplevelzero.slang +++ b/tests/cross-compile/glsl-samplecmplevelzero.slang @@ -1,7 +1,7 @@ //TEST:CROSS_COMPILE(filecheck=CHECK): -profile ps_5_0 -entry main -target glsl -// CHECK: float _S3 = (textureLod(sampler2DShadow(shadowMap_0,sampler_0), vec3((_S2), (0.0)), 0)); -// CHECK: float _S4 = (textureLodOffset(sampler2DShadow(shadowMap_0,sampler_0), vec3((_S2), (0.0)), 0, (ivec2(1, 1)))); +// CHECK: float _S3 = (textureLod(sampler2DShadow(shadowMap_0,sampler_0), (_S2), 0)); +// CHECK: float _S4 = (textureLodOffset(sampler2DShadow(shadowMap_0,sampler_0), (_S2), 0, (ivec2(1, 1)))); Texture2D shadowMap; SamplerComparisonState sampler; diff --git a/tests/cross-compile/glsl-texturegather.slang b/tests/cross-compile/glsl-texturegather.slang index 125cf6df1..1647faaac 100644 --- a/tests/cross-compile/glsl-texturegather.slang +++ b/tests/cross-compile/glsl-texturegather.slang @@ -1,9 +1,10 @@ -//TEST:CROSS_COMPILE(filecheck=CHECK): -profile ps_5_0 -entry main -target glsl +//TEST:SIMPLE(filecheck=CHECK): -stage fragment -entry main -target spirv -emit-spirv-directly +//TEST:SIMPLE(filecheck=CHECK): -stage fragment -entry main -target spirv -// CHECK: textureGather(sampler2DShadow(t_0,sc_0), (loc_0), (3.0)) -// CHECK: textureGatherOffset(sampler2DShadow(t_0,sc_0), (loc_0), (3.0), (off_0)) -// CHECK: textureGatherOffsets(sampler2DShadow(t_0,sc_0), (loc_0), (3.0), ivec2[]((off_0), (off_0), (off_0), (off_0))) -// CHECK: textureGatherOffsets(sampler2DShadow(t_0,sc_0), (loc_0), (3.0), ivec2[]((ivec2(6, 6)), (ivec2(7, 7)), (ivec2(8, 8)), (ivec2(9, 9)))) +// CHECK: OpImageDrefGather +// CHECK: OpImageDrefGather +// CHECK: OpImageDrefGather +// CHECK: OpImageDrefGather Texture2D t; SamplerState s; diff --git a/tests/cross-compile/image-load.slang b/tests/cross-compile/image-load.slang index dc80288e6..fa1430c38 100644 --- a/tests/cross-compile/image-load.slang +++ b/tests/cross-compile/image-load.slang @@ -4,7 +4,8 @@ // gets properly converted to a call to `imageLoad` // and not just `texelFetch` as it would for a `Texture*`. -//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage compute +//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry main -stage compute -emit-spirv-directly +//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry main -stage compute struct Params { @@ -15,5 +16,8 @@ ParameterBlock<Params> gParams; void main(uint3 tid : SV_DispatchThreadID) { - float f = gParams.tex.Load(int3(int2(tid.xy), int(tid.z))); + // CHECK: OpImageRead + // CHECK: OpImageWrite + float f = gParams.tex.Load(int3(int2(tid.xy), int(tid.z))); + gParams.tex[tid] = f + 1.0; } diff --git a/tests/cross-compile/vk-texture-indexing.slang b/tests/cross-compile/vk-texture-indexing.slang index 9a086d5bd..ace0befd5 100644 --- a/tests/cross-compile/vk-texture-indexing.slang +++ b/tests/cross-compile/vk-texture-indexing.slang @@ -1,6 +1,7 @@ // vk-texture-indexing.slang -//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage fragment +//TEST:SIMPLE(filecheck=CHECK):-target spirv -entry main -stage fragment +//TEST_DISABLED:SIMPLE(filecheck=CHECK):-target spirv -entry main -stage fragment -emit-spirv-directly struct Params { @@ -19,6 +20,8 @@ float4 main( uint3 uv : UV) : SV_Target { + // CHECK: OpDecorate %{{.*}} NonUniform + // CHECK: OpImageFetch float v = fetchData(uv.xy, uv.z); return v; } |
