diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-19 02:04:09 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:32 +0200 |
commit | 8b7d5912d61d56f65fb7e3a03bba544a4c40bfa6 (patch) | |
tree | ede1d0e1d3c828b50f4af190f64adf73a30a62e7 /src/shader_recompiler/backend/glasm/emit_context.cpp | |
parent | glasm: Implement textureGather instructions (diff) | |
download | yuzu-8b7d5912d61d56f65fb7e3a03bba544a4c40bfa6.tar yuzu-8b7d5912d61d56f65fb7e3a03bba544a4c40bfa6.tar.gz yuzu-8b7d5912d61d56f65fb7e3a03bba544a4c40bfa6.tar.bz2 yuzu-8b7d5912d61d56f65fb7e3a03bba544a4c40bfa6.tar.lz yuzu-8b7d5912d61d56f65fb7e3a03bba544a4c40bfa6.tar.xz yuzu-8b7d5912d61d56f65fb7e3a03bba544a4c40bfa6.tar.zst yuzu-8b7d5912d61d56f65fb7e3a03bba544a4c40bfa6.zip |
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_context.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_context.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp index 4903e9d8e..d1fe84a5f 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.cpp +++ b/src/shader_recompiler/backend/glasm/emit_context.cpp @@ -4,6 +4,7 @@ #include <string_view> +#include "shader_recompiler/backend/bindings.h" #include "shader_recompiler/backend/glasm/emit_context.h" #include "shader_recompiler/frontend/ir/program.h" @@ -22,7 +23,7 @@ std::string_view InterpDecorator(Interpolation interp) { } } // Anonymous namespace -EmitContext::EmitContext(IR::Program& program) { +EmitContext::EmitContext(IR::Program& program, Bindings& bindings) : info{program.info} { // FIXME: Temporary partial implementation u32 cbuf_index{}; for (const auto& desc : program.info.constant_buffer_descriptors) { @@ -79,6 +80,13 @@ EmitContext::EmitContext(IR::Program& program) { Add("OUTPUT out_attr{}[]={{result.attrib[{}..{}]}};", index, index, index); } } + const size_t num_textures{program.info.texture_descriptors.size()}; + texture_bindings.resize(num_textures); + for (size_t index = 0; index < num_textures; ++index) { + const auto& desc{program.info.texture_descriptors[index]}; + texture_bindings[index] = bindings.texture; + bindings.texture += desc.count; + } } } // namespace Shader::Backend::GLASM |