HLSL: Manually configure descriptor set and binding number for resources
This commit is contained in:
45
Test/hlsl.multiDescriptorSet.frag
Normal file
45
Test/hlsl.multiDescriptorSet.frag
Normal file
@@ -0,0 +1,45 @@
|
||||
Texture2D txDiffuseA : register( t0 );
|
||||
Texture2D txDiffuseB : register( t1 );
|
||||
|
||||
SamplerState samLinearA : register( s0 );
|
||||
SamplerState samLinearB : register( s1 );
|
||||
|
||||
cbuffer cbNeverChanges : register( b0 )
|
||||
{
|
||||
matrix View;
|
||||
};
|
||||
|
||||
cbuffer cbChangeOnResize : register( b1 )
|
||||
{
|
||||
matrix Projection;
|
||||
};
|
||||
|
||||
cbuffer cbChangesEveryFrame : register( b2 )
|
||||
{
|
||||
matrix World;
|
||||
float4 vMeshColor;
|
||||
};
|
||||
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float4 Pos : POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 Pos : SV_POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
float4 main( PS_INPUT input) : SV_Target
|
||||
{
|
||||
PS_INPUT output = (PS_INPUT)0;
|
||||
output.Pos = mul( input.Pos, World );
|
||||
output.Pos = mul( output.Pos, View );
|
||||
output.Pos = mul( output.Pos, Projection );
|
||||
output.Tex = input.Tex;
|
||||
return txDiffuseA.Sample( samLinearA, output.Tex ) * vMeshColor;
|
||||
}
|
||||
Reference in New Issue
Block a user