diff options
| author | 2021-06-15 00:30:59 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:38 -0400 | |
| commit | c5dfa0b6308fa0f79b3323204b6c61d38d43ff87 (patch) | |
| tree | fcf15e07d23730ebb508023194defea6d5e033da /src/shader_recompiler/backend/glsl/emit_glsl_special.cpp | |
| parent | glsl: Conditionally use fine/coarse derivatives based on device support (diff) | |
| download | yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.tar.gz yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.tar.xz yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.zip | |
glsl: Move gl_Position/generic attribute initialization to EmitProlgue
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_special.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_special.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_special.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_special.cpp index 2155b8802..cfef58d79 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_special.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_special.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include "shader_recompiler/backend/glsl/emit_context.h" | 7 | #include "shader_recompiler/backend/glsl/emit_context.h" |
| 8 | #include "shader_recompiler/backend/glsl/emit_glsl_instructions.h" | 8 | #include "shader_recompiler/backend/glsl/emit_glsl_instructions.h" |
| 9 | #include "shader_recompiler/frontend/ir/program.h" | ||
| 9 | #include "shader_recompiler/frontend/ir/value.h" | 10 | #include "shader_recompiler/frontend/ir/value.h" |
| 10 | 11 | ||
| 11 | namespace Shader::Backend::GLSL { | 12 | namespace Shader::Backend::GLSL { |
| @@ -42,13 +43,19 @@ void EmitPhiMove(EmitContext& ctx, const IR::Value& phi_value, const IR::Value& | |||
| 42 | ctx.Add("{}={};", phi_reg, val_reg); | 43 | ctx.Add("{}={};", phi_reg, val_reg); |
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | void EmitPrologue(EmitContext&) { | 46 | void EmitPrologue(EmitContext& ctx) { |
| 46 | // TODO | 47 | if (ctx.stage == Stage::VertexA || ctx.stage == Stage::VertexB) { |
| 48 | ctx.Add("gl_Position=vec4(0.0f, 0.0f, 0.0f, 1.0f);"); | ||
| 49 | // TODO: Properly resolve attribute issues | ||
| 50 | for (size_t index = 0; index < ctx.info.stores_generics.size() / 2; ++index) { | ||
| 51 | if (!ctx.info.stores_generics[index]) { | ||
| 52 | ctx.Add("out_attr{}=vec4(0,0,0,1);", index); | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
| 47 | } | 56 | } |
| 48 | 57 | ||
| 49 | void EmitEpilogue(EmitContext&) { | 58 | void EmitEpilogue(EmitContext&) {} |
| 50 | // TODO | ||
| 51 | } | ||
| 52 | 59 | ||
| 53 | void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) { | 60 | void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) { |
| 54 | ctx.Add("EmitStreamVertex(int({}));", ctx.var_alloc.Consume(stream)); | 61 | ctx.Add("EmitStreamVertex(int({}));", ctx.var_alloc.Consume(stream)); |