From 7b48b24baac066c3c54aaad3f36fb5979fc18ed1 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Wed, 26 Jul 2023 16:34:40 +0000 Subject: 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 --- tests/cross-compile/glsl-calculatelevelofdetail.slang | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/cross-compile/glsl-calculatelevelofdetail.slang (limited to 'tests') 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)); +} -- cgit v1.2.3