nonDominatingSetMeshOutputCounts.hlsl 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // RUN: %dxc -E main -T ms_6_5 %s | FileCheck %s
  2. // CHECK: Non-Dominating SetMeshOutputCounts call.
  3. #define MAX_VERT 32
  4. #define MAX_PRIM 16
  5. #define NUM_THREADS 32
  6. struct MeshPerVertex {
  7. float4 position : SV_Position;
  8. float color[4] : COLOR;
  9. };
  10. struct MeshPerPrimitive {
  11. float normal : NORMAL;
  12. float malnor : MALNOR;
  13. int layer[4] : LAYER;
  14. };
  15. struct MeshPayload {
  16. float normal;
  17. float malnor;
  18. int layer[4];
  19. };
  20. [numthreads(NUM_THREADS, 1, 1)]
  21. [outputtopology("triangle")]
  22. void main(
  23. out indices uint3 primIndices[MAX_PRIM],
  24. out vertices MeshPerVertex verts[MAX_VERT],
  25. out primitives MeshPerPrimitive prims[MAX_PRIM],
  26. in payload MeshPayload mpl,
  27. in uint tig : SV_GroupIndex,
  28. in uint vid : SV_ViewID
  29. )
  30. {
  31. MeshPerVertex ov;
  32. if (vid % 2) {
  33. SetMeshOutputCounts(MAX_VERT, MAX_PRIM);
  34. ov.position = float4(4.0,5.0,6.0,7.0);
  35. ov.color[0] = 4.0;
  36. ov.color[1] = 5.0;
  37. ov.color[2] = 6.0;
  38. ov.color[3] = 7.0;
  39. } else {
  40. ov.position = float4(14.0,15.0,16.0,17.0);
  41. ov.color[0] = 14.0;
  42. ov.color[1] = 15.0;
  43. ov.color[2] = 16.0;
  44. ov.color[3] = 17.0;
  45. }
  46. if (tig % 3) {
  47. primIndices[tig / 3] = uint3(tig, tig + 1, tig + 2);
  48. MeshPerPrimitive op;
  49. op.normal = mpl.normal;
  50. op.malnor = mpl.malnor;
  51. op.layer[0] = mpl.layer[0];
  52. op.layer[1] = mpl.layer[1];
  53. op.layer[2] = mpl.layer[2];
  54. op.layer[3] = mpl.layer[3];
  55. prims[tig / 3] = op;
  56. }
  57. verts[tig] = ov;
  58. }