diff options
| author | Darren Wihandi <65404740+fairywreath@users.noreply.github.com> | 2025-01-09 23:49:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-09 20:49:59 -0800 |
| commit | 2b76466c4bc8a47bd4ac69994bafdbb2924272c2 (patch) | |
| tree | c000028f7ae01e8f275dc18ea6431934bc8d6152 /tests/hlsl-intrinsic/texture | |
| parent | 55ff4686e5685c414d82f16b9c1a4a331bd4f853 (diff) | |
Add CalculateLevelOfDetail* overloads for comparison samplers (#6018)
* add CalculateLevelOfDetail* intrinsics for comparison samplers
* fix dx12 test
* fix metallib test
* fix merge conflict
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/hlsl-intrinsic/texture')
| -rw-r--r-- | tests/hlsl-intrinsic/texture/texture-calculate-level-of-detail.slang | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/hlsl-intrinsic/texture/texture-calculate-level-of-detail.slang b/tests/hlsl-intrinsic/texture/texture-calculate-level-of-detail.slang new file mode 100644 index 000000000..0b623c1f6 --- /dev/null +++ b/tests/hlsl-intrinsic/texture/texture-calculate-level-of-detail.slang @@ -0,0 +1,27 @@ +//TEST:SIMPLE(filecheck=CHECK_HLSL): -stage fragment -entry fragmentMain -target hlsl +//TEST:SIMPLE(filecheck=CHECK_SPIRV): -stage fragment -entry fragmentMain -target spirv + +Texture2D t; +SamplerState s; +SamplerComparisonState sc; + +float fragmentMain() +{ + float result = 0.0; + + // CHECK_SPIRV: OpCapability ImageQuery + + // CHECK_HLSL: CalculateLevelOfDetail + // CHECK_HLSL: CalculateLevelOfDetailUnclamped + // CHECK_SPIRV: OpImageQueryLod + // CHECK_SPIRV: OpImageQueryLod + result += t.CalculateLevelOfDetail(s, float2(0,0)) + t.CalculateLevelOfDetailUnclamped(s, float2(0,0)); + + // CHECK_HLSL: CalculateLevelOfDetail + // CHECK_HLSL: CalculateLevelOfDetailUnclamped + // CHECK_SPIRV: OpImageQueryLod + // CHECK_SPIRV: OpImageQueryLod + result += t.CalculateLevelOfDetail(sc, float2(0,0)) + t.CalculateLevelOfDetailUnclamped(sc, float2(0,0)); + + return result; +} |
