summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-07-12 10:22:01 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:40 +0200
commitbf2956d77ab0ad06c4b5505cc9906e51e5878274 (patch)
tree3aae336c0dc3fe65351d5e6e312a214351e2e2fc /src/shader_recompiler/backend
parentglsl: Clamp shared mem size to GL_MAX_COMPUTE_SHARED_MEMORY_SIZE (diff)
downloadyuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.gz
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.bz2
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.lz
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.xz
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.zst
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.zip
Diffstat (limited to 'src/shader_recompiler/backend')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm.cpp7
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl.cpp9
2 files changed, 12 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
index 64787b353..a5e8c9b6e 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
@@ -2,7 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include <ranges>
+#include <algorithm>
#include <string>
#include <tuple>
@@ -196,7 +196,10 @@ void PrecolorInst(IR::Inst& phi) {
void Precolor(const IR::Program& program) {
for (IR::Block* const block : program.blocks) {
- for (IR::Inst& phi : block->Instructions() | std::views::take_while(IR::IsPhi)) {
+ for (IR::Inst& phi : block->Instructions()) {
+ if (!IR::IsPhi(phi)) {
+ break;
+ }
PrecolorInst(phi);
}
}
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cpp
index c5e819a0a..8a430d573 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp
@@ -2,8 +2,10 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include <ranges>
+#include <algorithm>
#include <string>
+#include <tuple>
+#include <type_traits>
#include "common/div_ceil.h"
#include "common/settings.h"
@@ -120,7 +122,10 @@ void PrecolorInst(IR::Inst& phi) {
void Precolor(const IR::Program& program) {
for (IR::Block* const block : program.blocks) {
- for (IR::Inst& phi : block->Instructions() | std::views::take_while(IR::IsPhi)) {
+ for (IR::Inst& phi : block->Instructions()) {
+ if (!IR::IsPhi(phi)) {
+ break;
+ }
PrecolorInst(phi);
}
}