BasicHLSL11_VS2.hlsl 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // RUN: %dxc -E main -T vs_6_0 -Zpr %s | FileCheck %s
  2. // CHECK: OutputPositionPresent=1
  3. // CHECK: row_major
  4. // CHECK: column_major
  5. //--------------------------------------------------------------------------------------
  6. // File: BasicHLSL11_VS.hlsl
  7. //
  8. // The vertex shader file for the BasicHLSL11 sample.
  9. //
  10. // Copyright (c) Microsoft Corporation. All rights reserved.
  11. //--------------------------------------------------------------------------------------
  12. //--------------------------------------------------------------------------------------
  13. // Globals
  14. //--------------------------------------------------------------------------------------
  15. cbuffer cbPerObject : register( b0 )
  16. {
  17. matrix g_mWorldViewProjection : packoffset( c0 );
  18. column_major matrix g_mWorld : packoffset( c4 );
  19. };
  20. //--------------------------------------------------------------------------------------
  21. // Input / Output structures
  22. //--------------------------------------------------------------------------------------
  23. struct VS_INPUT
  24. {
  25. float3 vPosition : POSITION;
  26. float3 vNormal : NORMAL;
  27. float2 vTexcoord : TEXCOORD0;
  28. };
  29. struct VS_OUTPUT
  30. {
  31. float3 vNormal : NORMAL;
  32. float2 vTexcoord : TEXCOORD0;
  33. float4 vPosition : SV_POSITION;
  34. };
  35. //--------------------------------------------------------------------------------------
  36. // Vertex Shader
  37. //--------------------------------------------------------------------------------------
  38. VS_OUTPUT main( VS_INPUT Input )
  39. {
  40. VS_OUTPUT Output;
  41. Output.vPosition = mul( float4( Input.vPosition, 1.0 ), g_mWorldViewProjection );
  42. Output.vNormal = mul( Input.vNormal, (float3x3)g_mWorld );
  43. Output.vTexcoord = Input.vTexcoord;
  44. return Output;
  45. }