nuklear_d3d11.hlsl 631 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. cbuffer buffer0 : register(b0)
  3. {
  4. float4x4 ProjectionMatrix;
  5. };
  6. sampler sampler0 : register(s0);
  7. Texture2D<float4> texture0 : register(t0);
  8. struct VS_INPUT
  9. {
  10. float2 pos : POSITION;
  11. float4 col : COLOR0;
  12. float2 uv : TEXCOORD0;
  13. };
  14. struct PS_INPUT
  15. {
  16. float4 pos : SV_POSITION;
  17. float4 col : COLOR0;
  18. float2 uv : TEXCOORD0;
  19. };
  20. PS_INPUT vs(VS_INPUT input)
  21. {
  22. PS_INPUT output;
  23. output.pos = mul(ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));
  24. output.col = input.col;
  25. output.uv = input.uv;
  26. return output;
  27. }
  28. float4 ps(PS_INPUT input) : SV_Target
  29. {
  30. return input.col * texture0.Sample(sampler0, input.uv);
  31. }