yum-mirror/slang

Making it easier to work with shaders

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

Yong HeSupport combined texture sampler when targeting HLSL. (#3963)5dd27a26d

master
1.0 KiB25 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target hlsl -entry fragMain -profile ps_6_0
2//TEST:SIMPLE(filecheck=DXIL): -target dxil -entry fragMain -profile ps_6_0
3
4// Check that we can correctly cross compile combined texture samplers to HLSL.
5
6// DXIL: define void @fragMain()
7
8// CHECK-DAG: Texture2D<float4 > sampler_texture{{.*}} : register(t0);
9// CHECK-DAG: SamplerState sampler_sampler{{.*}} : register(s0);
10Sampler2D sampler;
11
12// CHECK-DAG: Texture2D<float4 > followingTexture{{.*}} : register(t1);
13Texture2D followingTexture;
14
15// CHECK-DAG: SamplerState followingSamplerState{{.*}} : register(s1);
16SamplerState followingSamplerState;
17
18// CHECK-DAG: Texture2D<float4 > explicitBindingSampler_texture{{.*}} : register(t4);
19// CHECK-DAG: SamplerState explicitBindingSampler_sampler{{.*}} : register(s3);
20Sampler2D explicitBindingSampler : register(t4): register(s3);
21
22float4 fragMain() : SV_Target
23{
24    return sampler.Sample(float2(0, 0)) + explicitBindingSampler.Sample(float2(0, 0)) + followingTexture.Sample(followingSamplerState, float2(0,0));
25}