summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-01-28 00:27:53 +0100
committerGitHub <noreply@github.com>2021-01-28 00:27:53 +0100
commit45b13c303731b9971ebce8eca9f63bbc2c6f22b9 (patch)
tree0ef519ae519b90ac88d470087966dcffb9a482dc
parentvulkan_device: Blacklist Intel from float16 math (#5798) (diff)
parentgl_shader_decompiler: Fix constant buffer size calculation (diff)
downloadyuzu-45b13c303731b9971ebce8eca9f63bbc2c6f22b9.tar
yuzu-45b13c303731b9971ebce8eca9f63bbc2c6f22b9.tar.gz
yuzu-45b13c303731b9971ebce8eca9f63bbc2c6f22b9.tar.bz2
yuzu-45b13c303731b9971ebce8eca9f63bbc2c6f22b9.tar.lz
yuzu-45b13c303731b9971ebce8eca9f63bbc2c6f22b9.tar.xz
yuzu-45b13c303731b9971ebce8eca9f63bbc2c6f22b9.tar.zst
yuzu-45b13c303731b9971ebce8eca9f63bbc2c6f22b9.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 2e1fa252d..c35b71b6b 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -14,6 +14,7 @@
#include "common/alignment.h"
#include "common/assert.h"
#include "common/common_types.h"
+#include "common/div_ceil.h"
#include "common/logging/log.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/engines/shader_type.h"
@@ -877,7 +878,7 @@ private:
u32 binding = device.GetBaseBindings(stage).uniform_buffer;
for (const auto& [index, info] : ir.GetConstantBuffers()) {
- const u32 num_elements = Common::AlignUp(info.GetSize(), 4) / 4;
+ const u32 num_elements = Common::DivCeil(info.GetSize(), 4 * sizeof(u32));
const u32 size = info.IsIndirect() ? MAX_CONSTBUFFER_ELEMENTS : num_elements;
code.AddLine("layout (std140, binding = {}) uniform {} {{", binding++,
GetConstBufferBlock(index));