diff options
Diffstat (limited to 'src/quick/scenegraph/adaptations/d3d12/shaders/texture.hlsl')
-rw-r--r-- | src/quick/scenegraph/adaptations/d3d12/shaders/texture.hlsl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/quick/scenegraph/adaptations/d3d12/shaders/texture.hlsl b/src/quick/scenegraph/adaptations/d3d12/shaders/texture.hlsl new file mode 100644 index 0000000000..1ae6579e8d --- /dev/null +++ b/src/quick/scenegraph/adaptations/d3d12/shaders/texture.hlsl @@ -0,0 +1,33 @@ +struct VSInput +{ + float4 position : POSITION; + float2 coord : TEXCOORD0; +}; + +cbuffer ConstantBuffer : register(b0) +{ + float4x4 mvp; + float opacity; +}; + +struct PSInput +{ + float4 position : SV_POSITION; + float2 coord : TEXCOORD0; +}; + +Texture2D tex : register(t0); +SamplerState samp : register(s0); + +PSInput VS_Texture(VSInput input) +{ + PSInput result; + result.position = mul(mvp, input.position); + result.coord = input.coord; + return result; +} + +float4 PS_Texture(PSInput input) : SV_TARGET +{ + return tex.Sample(samp, input.coord) * opacity; +} |