vs_output.hlsl 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // RUN: %dxc /T vs_6_0 /E BezierVS /DDX12 /Od /Zi %s | FileCheck %s
  2. // CHECK-DAG: call void @llvm.dbg.value(metadata float %{{.+}}, i64 0, metadata !{{[0-9]+}}, metadata !{{[0-9]+}}), !dbg !{{[0-9]+}} ; var:"output" !DIExpression(DW_OP_bit_piece, 0, 32)
  3. // CHECK-DAG: call void @llvm.dbg.value(metadata float %{{.+}}, i64 0, metadata !{{[0-9]+}}, metadata !{{[0-9]+}}), !dbg !{{[0-9]+}} ; var:"output" !DIExpression(DW_OP_bit_piece, 32, 32)
  4. // CHECK-DAG: call void @llvm.dbg.value(metadata float %{{.+}}, i64 0, metadata !{{[0-9]+}}, metadata !{{[0-9]+}}), !dbg !{{[0-9]+}} ; var:"output" !DIExpression(DW_OP_bit_piece, 64, 32)
  5. //--------------------------------------------------------------------------------------
  6. // SimpleBezier.hlsl
  7. //
  8. // Shader demonstrating DirectX 11 tesselation of a bezier surface
  9. //
  10. // Advanced Technology Group (ATG)
  11. // Copyright (C) Microsoft Corporation. All rights reserved.
  12. //--------------------------------------------------------------------------------------
  13. #ifdef DX12
  14. #define RS \
  15. [RootSignature(" \
  16. RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT), \
  17. DescriptorTable(CBV(b0, numDescriptors = 1), visibility=SHADER_VISIBILITY_ALL) \
  18. ")]
  19. #else
  20. #define RS
  21. #endif
  22. //--------------------------------------------------------------------------------------
  23. // Constant Buffers
  24. //--------------------------------------------------------------------------------------
  25. cbuffer cbPerFrame : register( b0 )
  26. {
  27. matrix g_mViewProjection;
  28. float3 g_cameraWorldPos;
  29. float g_tessellationFactor;
  30. };
  31. //--------------------------------------------------------------------------------------
  32. // Vertex shader section
  33. //--------------------------------------------------------------------------------------
  34. struct VS_CONTROL_POINT_INPUT
  35. {
  36. float3 pos : POSITION;
  37. };
  38. struct VS_CONTROL_POINT_OUTPUT
  39. {
  40. float3 pos : POSITION;
  41. };
  42. //--------------------------------------------------------------------------------------
  43. // This simple vertex shader passes the control points straight through to the
  44. // hull shader. In a more complex scene, you might transform the control points
  45. // or perform skinning at this step.
  46. // The input to the vertex shader comes from the vertex buffer.
  47. // The output from the vertex shader will go into the hull shader.
  48. //--------------------------------------------------------------------------------------
  49. RS
  50. VS_CONTROL_POINT_OUTPUT BezierVS( VS_CONTROL_POINT_INPUT Input )
  51. {
  52. VS_CONTROL_POINT_OUTPUT output;
  53. output.pos = Input.pos;
  54. return output;
  55. }