summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-06-15 06:30:59 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:38 +0200
commitc5dfa0b6308fa0f79b3323204b6c61d38d43ff87 (patch)
treefcf15e07d23730ebb508023194defea6d5e033da /src/shader_recompiler/backend/glsl
parentglsl: Conditionally use fine/coarse derivatives based on device support (diff)
downloadyuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.tar
yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.tar.gz
yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.tar.bz2
yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.tar.lz
yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.tar.xz
yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.tar.zst
yuzu-c5dfa0b6308fa0f79b3323204b6c61d38d43ff87.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl.cpp9
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_special.cpp17
2 files changed, 12 insertions, 14 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cpp
index 9f8cf659f..ff869923f 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp
@@ -216,15 +216,6 @@ std::string EmitGLSL(const Profile& profile, const RuntimeInfo& runtime_info, IR
fmt::format("shared uint smem[{}];", Common::AlignUp(program.shared_memory_size, 4));
}
ctx.header += "void main(){\n";
- if (program.stage == Stage::VertexA || program.stage == Stage::VertexB) {
- ctx.header += "gl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);";
- // TODO: Properly resolve attribute issues
- for (size_t index = 0; index < program.info.stores_generics.size() / 2; ++index) {
- if (!program.info.stores_generics[index]) {
- ctx.header += fmt::format("out_attr{}=vec4(0,0,0,1);", index);
- }
- }
- }
DefineVariables(ctx, ctx.header);
if (ctx.uses_cc_carry) {
ctx.header += "uint carry;";
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 @@
#include "shader_recompiler/backend/glsl/emit_context.h"
#include "shader_recompiler/backend/glsl/emit_glsl_instructions.h"
+#include "shader_recompiler/frontend/ir/program.h"
#include "shader_recompiler/frontend/ir/value.h"
namespace Shader::Backend::GLSL {
@@ -42,13 +43,19 @@ void EmitPhiMove(EmitContext& ctx, const IR::Value& phi_value, const IR::Value&
ctx.Add("{}={};", phi_reg, val_reg);
}
-void EmitPrologue(EmitContext&) {
- // TODO
+void EmitPrologue(EmitContext& ctx) {
+ if (ctx.stage == Stage::VertexA || ctx.stage == Stage::VertexB) {
+ ctx.Add("gl_Position=vec4(0.0f, 0.0f, 0.0f, 1.0f);");
+ // TODO: Properly resolve attribute issues
+ for (size_t index = 0; index < ctx.info.stores_generics.size() / 2; ++index) {
+ if (!ctx.info.stores_generics[index]) {
+ ctx.Add("out_attr{}=vec4(0,0,0,1);", index);
+ }
+ }
+ }
}
-void EmitEpilogue(EmitContext&) {
- // TODO
-}
+void EmitEpilogue(EmitContext&) {}
void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) {
ctx.Add("EmitStreamVertex(int({}));", ctx.var_alloc.Consume(stream));