forked from microsoft/Xbox-ATG-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPixelShader.hlsl
38 lines (33 loc) · 1.04 KB
/
PixelShader.hlsl
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
34
35
36
37
38
//------------------------------------------------------------------------------------
// PixelShader.hlsl
//
// Simple shader to render a textured quad
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
struct Interpolants
{
float4 position : SV_Position;
float2 texcoord : TEXCOORD0;
};
struct Pixel
{
float4 color : SV_Target;
};
Texture2D txDiffuse : register(t0);
SamplerState samLinear : register(s0);
#define MainRS \
"RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT" \
" | DENY_DOMAIN_SHADER_ROOT_ACCESS" \
" | DENY_GEOMETRY_SHADER_ROOT_ACCESS" \
" | DENY_HULL_SHADER_ROOT_ACCESS)," \
"DescriptorTable (SRV(t0), visibility=SHADER_VISIBILITY_PIXEL),"\
"StaticSampler(s0, visibility=SHADER_VISIBILITY_PIXEL)"
[RootSignature(MainRS)]
Pixel main( Interpolants In )
{
Pixel Out;
Out.color = txDiffuse.Sample(samLinear, In.texcoord);
return Out;
}