diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-07-26 16:34:40 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-26 09:34:40 -0700 |
| commit | 7b48b24baac066c3c54aaad3f36fb5979fc18ed1 (patch) | |
| tree | 057572f4513e4241904e18812821d37b3b723c72 /tests/cross-compile | |
| parent | c61775e634a6a52772de60e68ba6d50751d8b790 (diff) | |
Add glsl intrinsics for CalculateLevelOfDetail (#3023)
Translates to textureQueryLod().x (with the Unclameped variant being returned in the .y component)
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/cross-compile')
| -rw-r--r-- | tests/cross-compile/glsl-calculatelevelofdetail.slang | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/cross-compile/glsl-calculatelevelofdetail.slang b/tests/cross-compile/glsl-calculatelevelofdetail.slang new file mode 100644 index 000000000..eb8c44a8b --- /dev/null +++ b/tests/cross-compile/glsl-calculatelevelofdetail.slang @@ -0,0 +1,11 @@ +//TEST:CROSS_COMPILE(filecheck=CHECK): -profile ps_5_0 -entry main -target glsl + +// CHECK: textureQueryLod(sampler2D(t_0,s_0), ({{.*}})).x +// CHECK: textureQueryLod(sampler2D(t_0,s_0), ({{.*}})).y + +Texture2D t; +SamplerState s; +float main() +{ + return t.CalculateLevelOfDetail(s, float2(0,0)) + t.CalculateLevelOfDetailUnclamped(s, float2(0,0)); +} |
