|
|
@@ -207,6 +207,22 @@ private:
|
|
|
if (stage != ShaderStage::Vertex)
|
|
|
return;
|
|
|
|
|
|
+ DeclareVertexRedeclarations();
|
|
|
+ }
|
|
|
+
|
|
|
+ void DeclareGeometry() {
|
|
|
+ if (stage != ShaderStage::Geometry)
|
|
|
+ return;
|
|
|
+
|
|
|
+ const auto topology = GetTopologyName(header.common3.output_topology);
|
|
|
+ const auto max_vertices = std::to_string(header.common4.max_output_vertices);
|
|
|
+ code.AddLine("layout (" + topology + ", max_vertices = " + max_vertices + ") out;");
|
|
|
+ code.AddNewLine();
|
|
|
+
|
|
|
+ DeclareVertexRedeclarations();
|
|
|
+ }
|
|
|
+
|
|
|
+ void DeclareVertexRedeclarations() {
|
|
|
bool clip_distances_declared = false;
|
|
|
|
|
|
code.AddLine("out gl_PerVertex {");
|
|
|
@@ -229,16 +245,6 @@ private:
|
|
|
code.AddNewLine();
|
|
|
}
|
|
|
|
|
|
- void DeclareGeometry() {
|
|
|
- if (stage != ShaderStage::Geometry)
|
|
|
- return;
|
|
|
-
|
|
|
- const auto topology = GetTopologyName(header.common3.output_topology);
|
|
|
- const auto max_vertices = std::to_string(header.common4.max_output_vertices);
|
|
|
- code.AddLine("layout (" + topology + ", max_vertices = " + max_vertices + ") out;");
|
|
|
- code.AddNewLine();
|
|
|
- }
|
|
|
-
|
|
|
void DeclareRegisters() {
|
|
|
const auto& registers = ir.GetRegisters();
|
|
|
for (const u32 gpr : registers) {
|