diff options
author | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-11-27 04:55:49 +0100 |
---|---|---|
committer | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-11-27 05:25:29 +0100 |
commit | db1d32485e732fc0b7eb7fb17c1642e07397a97c (patch) | |
tree | 3b7b6bfe49d27e6ada7d218e725869ba6ba44031 /src/shader_recompiler | |
parent | Merge pull request #11535 from GPUCode/upload_cmdbuf (diff) | |
download | yuzu-db1d32485e732fc0b7eb7fb17c1642e07397a97c.tar yuzu-db1d32485e732fc0b7eb7fb17c1642e07397a97c.tar.gz yuzu-db1d32485e732fc0b7eb7fb17c1642e07397a97c.tar.bz2 yuzu-db1d32485e732fc0b7eb7fb17c1642e07397a97c.tar.lz yuzu-db1d32485e732fc0b7eb7fb17c1642e07397a97c.tar.xz yuzu-db1d32485e732fc0b7eb7fb17c1642e07397a97c.tar.zst yuzu-db1d32485e732fc0b7eb7fb17c1642e07397a97c.zip |
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r-- | src/shader_recompiler/backend/glsl/glsl_emit_context.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index 9ff4028c2..2f27ef5f9 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include "common/div_ceil.h" #include "shader_recompiler/backend/bindings.h" #include "shader_recompiler/backend/glsl/glsl_emit_context.h" #include "shader_recompiler/frontend/ir/program.h" @@ -431,9 +432,11 @@ void EmitContext::DefineConstantBuffers(Bindings& bindings) { } for (const auto& desc : info.constant_buffer_descriptors) { const auto cbuf_type{profile.has_gl_cbuf_ftou_bug ? "uvec4" : "vec4"}; + const u32 cbuf_used_size{Common::DivCeil(info.constant_buffer_used_sizes[desc.index], 16U)}; + const u32 cbuf_binding_size{info.uses_global_memory ? 0x1000U : cbuf_used_size}; header += fmt::format("layout(std140,binding={}) uniform {}_cbuf_{}{{{} {}_cbuf{}[{}];}};", bindings.uniform_buffer, stage_name, desc.index, cbuf_type, - stage_name, desc.index, 4 * 1024); + stage_name, desc.index, cbuf_binding_size); bindings.uniform_buffer += desc.count; } } |