yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Darren WihandiAdd SampleCmpLevel intrinsics (#6004)2249d6ffb

master
894 B16 linesraw
1//TEST:CROSS_COMPILE(filecheck=CHECK): -profile ps_5_0 -entry main -target glsl
2
3// CHECK: float {{.*}} = (textureLod(sampler2DShadow(shadowMap_0,sampler_0), ({{.*}}), (0.0)));
4// CHECK: float {{.*}} = (textureLodOffset(sampler2DShadow(shadowMap_0,sampler_0), ({{.*}}), (0.0), (ivec2(1, 1))));
5// CHECK: float {{.*}} = (textureLod(sampler2DShadow(shadowMap_0,sampler_0), ({{.*}}), (1.5)));
6// CHECK: float {{.*}} = (textureLodOffset(sampler2DShadow(shadowMap_0,sampler_0), ({{.*}}), (1.5), (ivec2(2, 2))));
7
8Texture2D shadowMap;
9SamplerComparisonState sampler;
10float4 main(float4 p : SV_POSITION)
11{
12    return shadowMap.SampleCmpLevelZero(sampler, float2(0.0), 0.0)
13         + shadowMap.SampleCmpLevelZero(sampler, float2(0.0), 0.0, int2(1,1))
14         + shadowMap.SampleCmpLevel(sampler, float2(0.0), 0.0, 1.5)
15         + shadowMap.SampleCmpLevel(sampler, float2(0.0), 0.0, 1.5, int2(2,2));
16}