diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-04-26 06:55:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-26 06:55:43 +0200 |
commit | 7e38dd580f72323985d9331b43bad5ace38e56eb (patch) | |
tree | 11032b9ea3fa1e198f68afc3186e119be390ce56 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Merge pull request #3791 from Kewlan/hotkey-config-plus (diff) | |
parent | vk_rasterizer: Add lazy default buffer maker and use it for empty buffers (diff) | |
download | yuzu-7e38dd580f72323985d9331b43bad5ace38e56eb.tar yuzu-7e38dd580f72323985d9331b43bad5ace38e56eb.tar.gz yuzu-7e38dd580f72323985d9331b43bad5ace38e56eb.tar.bz2 yuzu-7e38dd580f72323985d9331b43bad5ace38e56eb.tar.lz yuzu-7e38dd580f72323985d9331b43bad5ace38e56eb.tar.xz yuzu-7e38dd580f72323985d9331b43bad5ace38e56eb.tar.zst yuzu-7e38dd580f72323985d9331b43bad5ace38e56eb.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 4c16c89d2..6fe155bcc 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -186,8 +186,12 @@ void RasterizerOpenGL::SetupVertexBuffer() { const GPUVAddr start = vertex_array.StartAddress(); const GPUVAddr end = regs.vertex_array_limit[index].LimitAddress(); - ASSERT(end > start); - const u64 size = end - start + 1; + ASSERT(end >= start); + const u64 size = end - start; + if (size == 0) { + glBindVertexBuffer(static_cast<GLuint>(index), 0, 0, vertex_array.stride); + continue; + } const auto [vertex_buffer, vertex_buffer_offset] = buffer_cache.UploadMemory(start, size); glBindVertexBuffer(static_cast<GLuint>(index), vertex_buffer, vertex_buffer_offset, vertex_array.stride); @@ -311,8 +315,8 @@ std::size_t RasterizerOpenGL::CalculateVertexArraysSize() const { const GPUVAddr start = regs.vertex_array[index].StartAddress(); const GPUVAddr end = regs.vertex_array_limit[index].LimitAddress(); - ASSERT(end > start); - size += end - start + 1; + size += end - start; + ASSERT(end >= start); } return size; |