summaryrefslogtreecommitdiff
path: root/tests/hlsl-intrinsic/texture
diff options
context:
space:
mode:
authorDarren Wihandi <65404740+fairywreath@users.noreply.github.com>2025-01-08 22:50:57 -0500
committerGitHub <noreply@github.com>2025-01-08 19:50:57 -0800
commit2249d6ffb19e4db8580c76ccb04ab4ca3ddc8394 (patch)
treea5d975e79c60fe735a5d9f5948a5534e3a37ec5b /tests/hlsl-intrinsic/texture
parent63b8d9e1d0b0bba66f13013aa6b80bd9fab4036b (diff)
Add SampleCmpLevel intrinsics (#6004)
* add SampleCmpLevel intrinsics * update tests * fix typo * fix broken glsl test * refactor SampleCmpLevelZero * fix metallib test * fix broken test on dx12 --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/hlsl-intrinsic/texture')
-rw-r--r--tests/hlsl-intrinsic/texture/texture-intrinsics.slang27
1 files changed, 23 insertions, 4 deletions
diff --git a/tests/hlsl-intrinsic/texture/texture-intrinsics.slang b/tests/hlsl-intrinsic/texture/texture-intrinsics.slang
index 0543c71b2..e13389ccb 100644
--- a/tests/hlsl-intrinsic/texture/texture-intrinsics.slang
+++ b/tests/hlsl-intrinsic/texture/texture-intrinsics.slang
@@ -105,6 +105,25 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
#endif
/*
+ float Object.SampleCmpLevel().
+ These require SM 6.7 for dx12 but functional compute tests currently do not run with the cs_6_7,
+ hence only enable these for vk.
+ */
+#if defined(VK)
+ float level = 1.0;
+ val += t1D.SampleCmpLevel(shadowSampler, u, 0, level);
+ val += t2D.SampleCmpLevel(shadowSampler, float2(u, u), 0, level);
+ val += t1DArray.SampleCmpLevel(shadowSampler, float2(u, u), 0, level);
+ val += tCube.SampleCmpLevel(shadowSampler, normalize(float3(u, 1 - u, u)), 0, level);
+ val += t2DArray.SampleCmpLevel(shadowSampler, normalize(float3(u, 1 - u, u)), 0, level);
+ val += tCubeArray.SampleCmpLevel(shadowSampler, normalize(float4(u, 1-u, u, u)), 0, level);
+
+ // Offset variant
+ val += t1D.SampleCmpLevel(shadowSampler, u, 0, level, 0);
+ val += t2D.SampleCmpLevel(shadowSampler, float2(u, u), 0, level, int2(0, 0));
+#endif
+
+ /*
void Object.GetDimensions()
*/
t1D.GetDimensions(width);
@@ -353,7 +372,7 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
// DX12CS6: 377
// DX12CS6: 377
// DX12CS6: 377
-// VK: 351
-// VK: 351
-// VK: 351
-// VK: 351 \ No newline at end of file
+// VK: 359
+// VK: 359
+// VK: 359
+// VK: 359