@@ -73,6 +73,26 @@ def DXSA_TessellatorOutputPrimitiveTypeAttr :
7373 let assemblyFormat = "$value";
7474}
7575
76+ def DXSA_OutputPrimitiveTopology_PointList : I32EnumAttrCase<"pointlist", 1>;
77+ def DXSA_OutputPrimitiveTopology_LineStrip : I32EnumAttrCase<"linestrip", 3>;
78+ def DXSA_OutputPrimitiveTopology_TriangleStrip : I32EnumAttrCase<"trianglestrip", 5>;
79+
80+ def DXSA_OutputPrimitiveTopology : I32EnumAttr<
81+ "OutputPrimitiveTopology", "shader output primitive topology", [
82+ DXSA_OutputPrimitiveTopology_PointList,
83+ DXSA_OutputPrimitiveTopology_LineStrip,
84+ DXSA_OutputPrimitiveTopology_TriangleStrip
85+ ]> {
86+ let cppNamespace = "::mlir::dxsa";
87+ let genSpecializedAttr = 0;
88+ }
89+
90+ def DXSA_OutputPrimitiveTopologyAttr :
91+ EnumAttr<DXSADialect, DXSA_OutputPrimitiveTopology,
92+ "output_primitive_topology"> {
93+ let assemblyFormat = "$value";
94+ }
95+
7696//===----------------------------------------------------------------------===//
7797// DXSA op definitions
7898//===----------------------------------------------------------------------===//
@@ -235,4 +255,20 @@ def DXSA_DclTessellatorOutputPrimitive
235255 let assemblyFormat = "$type attr-dict";
236256}
237257
258+ def DXSA_DclOutputTopology : DXSA_Op<"dcl_output_topology"> {
259+ let summary = "declare what primitive topology the shader generates as output";
260+ let description = [{
261+ The `dxsa.dcl_output_topology` operation declares the primitive topology
262+ that the shader generates as output.
263+
264+ Example:
265+
266+ ```mlir
267+ dxsa.dcl_output_topology trianglestrip
268+ ```
269+ }];
270+ let arguments = (ins DXSA_OutputPrimitiveTopologyAttr:$topology);
271+ let assemblyFormat = "$topology attr-dict";
272+ }
273+
238274#endif // DXSA_OPS
0 commit comments