diff options
Diffstat (limited to 'examples/hellogpumipmap/shader.hlsl')
-rw-r--r-- | examples/hellogpumipmap/shader.hlsl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/hellogpumipmap/shader.hlsl b/examples/hellogpumipmap/shader.hlsl new file mode 100644 index 0000000..be69b39 --- /dev/null +++ b/examples/hellogpumipmap/shader.hlsl @@ -0,0 +1,36 @@ +cbuffer ConstantBuffer : register(b0) +{ + float4x4 modelview; + float4x4 projection; +}; + +struct VSInput +{ + float4 position : POSITION; + float2 coord : TEXCOORD0; +}; + +struct PSInput +{ + float4 position : SV_POSITION; + float2 coord : TEXCOORD0; +}; + +Texture2D tex : register(t0); +SamplerState samp : register(s0); + +PSInput VS_Texture(VSInput input) +{ + PSInput result; + + float4x4 mvp = mul(projection, modelview); + 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); +} |