multiStreamGS.hlsl 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // RUN: %dxc -E main -T gs_5_0 %s | FileCheck %s
  2. // CHECK:; Output signature:
  3. // CHECK:;
  4. // CHECK:; Name Index Mask Register SysValue Format Used
  5. // CHECK:; -------------------- ----- ------ -------- -------- ------- ------
  6. // CHECK:; m0:SV_Position 0 xyzw 0 POS float xyzw
  7. // CHECK:; m0:AAA 0 xy 1 NONE float xy
  8. // CHECK:; m1:PPP 0 xyzw 0 NONE float xyzw
  9. // CHECK:; m1:PPP 1 xyzw 1 NONE float xyzw
  10. // CHECK:; m1:PPP 2 xyzw 2 NONE float xyzw
  11. // CHECK:; m1:XXX 0 xyz 3 NONE uint xyz
  12. // CHECK:; m1:YYY 0 xyz 4 NONE uint xyz
  13. // CHECK:; m2:SV_Position 0 xyzw 0 POS float xyzw
  14. // CHECK:; m2:AAA 0 xy 1 NONE float xy
  15. // CHECK: OutputStreamMask=7
  16. // CHECK: emitStream(i32 97, i8 0)
  17. // CHECK: cutStream(i32 98, i8 0)
  18. // CHECK: emitStream(i32 97, i8 1)
  19. // CHECK: cutStream(i32 98, i8 1)
  20. // CHECK: emitStream(i32 97, i8 1)
  21. // CHECK: cutStream(i32 98, i8 1)
  22. // CHECK: emitStream(i32 97, i8 2)
  23. // CHECK: cutStream(i32 98, i8 2)
  24. struct MyStruct
  25. {
  26. float4 pos : SV_Position;
  27. float2 a : AAA;
  28. };
  29. struct MyStruct2
  30. {
  31. uint3 X : XXX;
  32. float4 p[3] : PPP;
  33. uint3 Y : YYY;
  34. };
  35. int g1;
  36. [maxvertexcount(12)]
  37. void main(point float4 array[1] : COORD, inout PointStream<MyStruct> OutputStream0,
  38. inout PointStream<MyStruct2> OutputStream1,
  39. inout PointStream<MyStruct> OutputStream2)
  40. {
  41. float4 r = array[0];
  42. MyStruct a = (MyStruct)0;
  43. MyStruct2 b = (MyStruct2)0;
  44. a.pos = array[r.x];
  45. a.a = r.xy;
  46. b.X = r.xyz;
  47. b.Y = a.pos.xyz;
  48. b.p[2] = a.pos * 44;
  49. if (g1) {
  50. OutputStream0.Append(a);
  51. OutputStream0.RestartStrip();
  52. } else {
  53. b.X.x = r.w;
  54. OutputStream1.Append(b);
  55. OutputStream1.RestartStrip();
  56. }
  57. OutputStream1.Append(b);
  58. OutputStream1.RestartStrip();
  59. OutputStream2.Append(a);
  60. OutputStream2.RestartStrip();
  61. }