summaryrefslogtreecommitdiff
path: root/contrib/SDL-3.2.8/src/render/direct3d11/D3D11_VertexShader.hlsl
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/SDL-3.2.8/src/render/direct3d11/D3D11_VertexShader.hlsl')
-rw-r--r--contrib/SDL-3.2.8/src/render/direct3d11/D3D11_VertexShader.hlsl38
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/render/direct3d11/D3D11_VertexShader.hlsl b/contrib/SDL-3.2.8/src/render/direct3d11/D3D11_VertexShader.hlsl
new file mode 100644
index 0000000..63e5172
--- /dev/null
+++ b/contrib/SDL-3.2.8/src/render/direct3d11/D3D11_VertexShader.hlsl
@@ -0,0 +1,38 @@
1#pragma pack_matrix( row_major )
2
3cbuffer VertexShaderConstants : register(b0)
4{
5 matrix model;
6 matrix projectionAndView;
7};
8
9struct VertexShaderInput
10{
11 float3 pos : POSITION;
12 float2 tex : TEXCOORD0;
13 float4 color : COLOR0;
14};
15
16struct VertexShaderOutput
17{
18 float4 pos : SV_POSITION;
19 float2 tex : TEXCOORD0;
20 float4 color : COLOR0;
21};
22
23VertexShaderOutput main(VertexShaderInput input)
24{
25 VertexShaderOutput output;
26 float4 pos = float4(input.pos, 1.0f);
27
28 // Transform the vertex position into projected space.
29 pos = mul(pos, model);
30 pos = mul(pos, projectionAndView);
31 output.pos = pos;
32
33 // Pass through texture coordinates and color values without transformation
34 output.tex = input.tex;
35 output.color = input.color;
36
37 return output;
38}