BasicHLSL11_VS.hlsl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // RUN: %dxc -E main -T vs_6_0 %s | FileCheck %s
  2. // Skip input
  3. // CHECK: POSITION
  4. // CHECK: xyz
  5. // CHECK: NORMAL
  6. // CHECK: xyz
  7. // CHECK: TEXCOORD
  8. // CHECK: xy
  9. // Make sure used match output mask.
  10. // CHECK: NORMAL
  11. // CHECK: xyz
  12. // CHECK: xyz
  13. // CHECK: TEXCOORD
  14. // CHECK: xy
  15. // CHECK: xy
  16. // CHECK: SV_Position
  17. // CHECK: xyzw
  18. // CHECK: xyzw
  19. // CHECK: OutputPositionPresent=1
  20. // CHECK: dx.op.createHandle(i32 57, i8 2, i32 0, i32 5, i1 false)
  21. //--------------------------------------------------------------------------------------
  22. // File: BasicHLSL11_VS.hlsl
  23. //
  24. // The vertex shader file for the BasicHLSL11 sample.
  25. //
  26. // Copyright (c) Microsoft Corporation. All rights reserved.
  27. //--------------------------------------------------------------------------------------
  28. //--------------------------------------------------------------------------------------
  29. // Globals
  30. //--------------------------------------------------------------------------------------
  31. cbuffer cbPerObject : register( b5 )
  32. {
  33. matrix g_mWorldViewProjection : packoffset( c0 );
  34. column_major matrix g_mWorld : packoffset( c4 );
  35. };
  36. //--------------------------------------------------------------------------------------
  37. // Input / Output structures
  38. //--------------------------------------------------------------------------------------
  39. struct VS_INPUT
  40. {
  41. float3 vPosition : POSITION;
  42. float3 vNormal : NORMAL;
  43. float2 vTexcoord : TEXCOORD0;
  44. };
  45. struct VS_OUTPUT
  46. {
  47. float3 vNormal : NORMAL;
  48. float2 vTexcoord : TEXCOORD0;
  49. float4 vPosition : SV_POSITION;
  50. };
  51. //--------------------------------------------------------------------------------------
  52. // Vertex Shader
  53. //--------------------------------------------------------------------------------------
  54. VS_OUTPUT main( VS_INPUT Input )
  55. {
  56. VS_OUTPUT Output;
  57. Output.vPosition = mul( float4( Input.vPosition, 1.0 ), g_mWorldViewProjection );
  58. Output.vNormal = mul( Input.vNormal, (float3x3)g_mWorld );
  59. Output.vTexcoord = Input.vTexcoord;
  60. return Output;
  61. }