summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-11-21 18:21:42 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-11-23 01:28:49 +0100
commit36d9b409fc8793b617c4ce5525d8dc297cb4d579 (patch)
tree33e3f8cd5a039acdacbf16c80436cbd8ff3461f6
parentgl_rasterizer: Add missing cbuf counter reset on compute (diff)
downloadyuzu-36d9b409fc8793b617c4ce5525d8dc297cb4d579.tar
yuzu-36d9b409fc8793b617c4ce5525d8dc297cb4d579.tar.gz
yuzu-36d9b409fc8793b617c4ce5525d8dc297cb4d579.tar.bz2
yuzu-36d9b409fc8793b617c4ce5525d8dc297cb4d579.tar.lz
yuzu-36d9b409fc8793b617c4ce5525d8dc297cb4d579.tar.xz
yuzu-36d9b409fc8793b617c4ce5525d8dc297cb4d579.tar.zst
yuzu-36d9b409fc8793b617c4ce5525d8dc297cb4d579.zip
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp12
2 files changed, 6 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index f2494e0e2..de7b7ce93 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -857,13 +857,13 @@ bool RasterizerOpenGL::AccelerateDisplay(const Tegra::FramebufferConfig& config,
void RasterizerOpenGL::SetupDrawConstBuffers(std::size_t stage_index, const Shader& shader) {
MICROPROFILE_SCOPE(OpenGL_UBO);
- const u32 base_binding = device.GetBaseBindings(stage_index).uniform_buffer;
const auto& stages = system.GPU().Maxwell3D().state.shader_stages;
const auto& shader_stage = stages[stage_index];
+ u32 binding = device.GetBaseBindings(stage_index).uniform_buffer;
for (const auto& entry : shader->GetShaderEntries().const_buffers) {
const auto& buffer = shader_stage.const_buffers[entry.GetIndex()];
- SetupConstBuffer(base_binding + entry.GetIndex(), buffer, entry);
+ SetupConstBuffer(binding++, buffer, entry);
}
}
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 5ad285c25..040370c83 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -619,10 +619,9 @@ private:
}
void DeclareConstantBuffers() {
- for (const auto& entry : ir.GetConstantBuffers()) {
- const auto [index, size] = entry;
- const u32 binding = device.GetBaseBindings(stage).uniform_buffer + index;
- code.AddLine("layout (std140, binding = {}) uniform {} {{", binding,
+ u32 binding = device.GetBaseBindings(stage).uniform_buffer;
+ for (const auto& [index, cbuf] : ir.GetConstantBuffers()) {
+ code.AddLine("layout (std140, binding = {}) uniform {} {{", binding++,
GetConstBufferBlock(index));
code.AddLine(" uvec4 {}[{}];", GetConstBuffer(index), MAX_CONSTBUFFER_ELEMENTS);
code.AddLine("}};");
@@ -632,10 +631,7 @@ private:
void DeclareGlobalMemory() {
u32 binding = device.GetBaseBindings(stage).shader_storage_buffer;
-
- for (const auto& gmem : ir.GetGlobalMemory()) {
- const auto& [base, usage] = gmem;
-
+ for (const auto& [base, usage] : ir.GetGlobalMemory()) {
// Since we don't know how the shader will use the shader, hint the driver to disable as
// much optimizations as possible
std::string qualifier = "coherent volatile";