dx11test
annotate shader.hlsl @ 3:aa1497adac80
fixed line endings
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 21 Jun 2013 09:37:24 +0300 |
parents | 647ba0689512 |
children |
rev | line source |
---|---|
nuclear@3 | 1 cbuffer RenderState : register(b0) { |
nuclear@3 | 2 matrix modelview_matrix : packoffset(c0); |
nuclear@3 | 3 matrix projection_matrix : packoffset(c4); |
nuclear@3 | 4 }; |
nuclear@3 | 5 |
nuclear@3 | 6 struct VSInput { |
nuclear@3 | 7 float4 pos : POSITION; |
nuclear@3 | 8 float4 color : COLOR; |
nuclear@3 | 9 }; |
nuclear@3 | 10 |
nuclear@3 | 11 struct VSOutput { |
nuclear@3 | 12 float4 pos : SV_POSITION; |
nuclear@3 | 13 float4 color : COLOR0; |
nuclear@3 | 14 }; |
nuclear@3 | 15 |
nuclear@3 | 16 VSOutput vertex_main(VSInput input) |
nuclear@3 | 17 { |
nuclear@3 | 18 VSOutput res; |
nuclear@3 | 19 |
nuclear@3 | 20 float4 vpos = mul(input.pos, modelview_matrix); |
nuclear@3 | 21 |
nuclear@3 | 22 res.pos = mul(vpos, projection_matrix); |
nuclear@3 | 23 res.color = input.color; |
nuclear@3 | 24 return res; |
nuclear@3 | 25 } |
nuclear@3 | 26 |
nuclear@3 | 27 |
nuclear@3 | 28 float4 pixel_main(VSOutput input) : SV_TARGET |
nuclear@3 | 29 { |
nuclear@3 | 30 return input.color; |
nuclear@0 | 31 } |