summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-27 06:06:23 +0200
committerGitHub <noreply@github.com>2018-06-27 06:06:23 +0200
commit84cadf9918bcc71c77621d4c22dcf3edf98f9763 (patch)
tree0cb7a0cc54d7042565ccc08386962060ce7f5aca
parentMerge pull request #593 from bunnei/fix-swizzle (diff)
parentgl_rasterizer: Workaround for when exceeding max UBO size. (diff)
downloadyuzu-84cadf9918bcc71c77621d4c22dcf3edf98f9763.tar
yuzu-84cadf9918bcc71c77621d4c22dcf3edf98f9763.tar.gz
yuzu-84cadf9918bcc71c77621d4c22dcf3edf98f9763.tar.bz2
yuzu-84cadf9918bcc71c77621d4c22dcf3edf98f9763.tar.lz
yuzu-84cadf9918bcc71c77621d4c22dcf3edf98f9763.tar.xz
yuzu-84cadf9918bcc71c77621d4c22dcf3edf98f9763.tar.zst
yuzu-84cadf9918bcc71c77621d4c22dcf3edf98f9763.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp6
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index aadf7e233..3fbf8e1f9 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -613,6 +613,12 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
if (used_buffer.IsIndirect()) {
// Buffer is accessed indirectly, so upload the entire thing
size = buffer.size * sizeof(float);
+
+ if (size > MaxConstbufferSize) {
+ NGLOG_ERROR(HW_GPU, "indirect constbuffer size {} exceeds maximum {}", size,
+ MaxConstbufferSize);
+ size = MaxConstbufferSize;
+ }
} else {
// Buffer is accessed directly, upload just what we use
size = used_buffer.GetSize() * sizeof(float);
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 2ab066681..4762983c9 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -55,7 +55,7 @@ public:
};
/// Maximum supported size that a constbuffer can have in bytes.
- static constexpr size_t MaxConstbufferSize = 0x1000;
+ static constexpr size_t MaxConstbufferSize = 0x10000;
static_assert(MaxConstbufferSize % sizeof(GLvec4) == 0,
"The maximum size of a constbuffer must be a multiple of the size of GLvec4");