mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-08 23:40:02 +00:00
glsl_decompiler: Fixup geometry shaders
This commit is contained in:
parent
ea78c78253
commit
dbed6c6485
2 changed files with 17 additions and 15 deletions
|
@ -84,11 +84,7 @@ ProgramResult GenerateGeometryShader(const ShaderSetup& setup) {
|
||||||
out += "#extension GL_ARB_separate_shader_objects : enable\n";
|
out += "#extension GL_ARB_separate_shader_objects : enable\n";
|
||||||
out += GetCommonDeclarations();
|
out += GetCommonDeclarations();
|
||||||
|
|
||||||
out += R"(out gl_PerVertex {
|
out += R"(layout (location = 0) in vec4 gs_position[];
|
||||||
vec4 gl_Position;
|
|
||||||
};
|
|
||||||
|
|
||||||
layout (location = 0) in vec4 gs_position[];
|
|
||||||
layout (location = 0) out vec4 position;
|
layout (location = 0) out vec4 position;
|
||||||
|
|
||||||
layout (std140) uniform gs_config {
|
layout (std140) uniform gs_config {
|
||||||
|
|
|
@ -207,6 +207,22 @@ private:
|
||||||
if (stage != ShaderStage::Vertex)
|
if (stage != ShaderStage::Vertex)
|
||||||
return;
|
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;
|
bool clip_distances_declared = false;
|
||||||
|
|
||||||
code.AddLine("out gl_PerVertex {");
|
code.AddLine("out gl_PerVertex {");
|
||||||
|
@ -229,16 +245,6 @@ private:
|
||||||
code.AddNewLine();
|
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() {
|
void DeclareRegisters() {
|
||||||
const auto& registers = ir.GetRegisters();
|
const auto& registers = ir.GetRegisters();
|
||||||
for (const u32 gpr : registers) {
|
for (const u32 gpr : registers) {
|
||||||
|
|
Loading…
Reference in a new issue