blob: 04bbaccf0c44dd9b46a7c2f5ea6a669d6f6ddedb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// vk-sampler-getdimension.slang
//TEST:SIMPLE(filecheck=CHECK):-target spirv -entry main -stage fragment -emit-spirv-directly
// Input to the fragment shader.
struct PSin
{
float3 position : POSITION;
};
// Output of the fragment shader
struct PSout
{
float4 color : SV_Target;
};
[[vk::binding(1)]] Sampler3D g_Volume;
// Fragment Shader
[shader("pixel")]
PSout main(PSin stage, bool isFrontFacing : SV_IsFrontFace)
{
// CHECK: %image{{.*}} = OpImage
// CHECK: OpImageQuerySizeLod %{{.*}} %image{{.*}} %uint_1
PSout output;
// Find normal at position
uint3 dim;
uint levels;
g_Volume.GetDimensions(1, dim.x, dim.y, dim.z, levels);
output.color = g_Volume.Sample(float3(dim));
return output;
}
|