Added HLSL shader for descriptor indexing sample
This commit is contained in:
parent
a86bdc2c44
commit
ad447e10c4
7 changed files with 54 additions and 0 deletions
17
data/shaders/hlsl/descriptorindexing/descriptorindexing.frag
Normal file
17
data/shaders/hlsl/descriptorindexing/descriptorindexing.frag
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2021 Sascha Willems
|
||||
// Non-uniform access is enabled at compile time via SPV_EXT_descriptor_indexing (see compile.py)
|
||||
|
||||
Texture2D textures[] : register(t1);
|
||||
SamplerState samplerColorMap : register(s1);
|
||||
|
||||
struct VSOutput
|
||||
{
|
||||
float4 Pos : SV_POSITION;
|
||||
[[vk::location(0)]] int TextureIndex : TEXTUREINDEX0;
|
||||
[[vk::location(1)]] float2 UV : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 main(VSOutput input) : SV_TARGET
|
||||
{
|
||||
return textures[NonUniformResourceIndex(input.TextureIndex)].Sample(samplerColorMap, input.UV);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue