diff options
author | bunnei <bunneidev@gmail.com> | 2018-06-06 05:34:37 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-06-07 00:09:05 +0200 |
commit | 4112aa68a673db4a8b73bc53270fdfa7f68532bf (patch) | |
tree | 8b40b7928a58138b883236942d777651b5a9fe4c /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | gl_shader_decompiler: Refactor uniform handling to allow different decodings. (diff) | |
download | yuzu-4112aa68a673db4a8b73bc53270fdfa7f68532bf.tar yuzu-4112aa68a673db4a8b73bc53270fdfa7f68532bf.tar.gz yuzu-4112aa68a673db4a8b73bc53270fdfa7f68532bf.tar.bz2 yuzu-4112aa68a673db4a8b73bc53270fdfa7f68532bf.tar.lz yuzu-4112aa68a673db4a8b73bc53270fdfa7f68532bf.tar.xz yuzu-4112aa68a673db4a8b73bc53270fdfa7f68532bf.tar.zst yuzu-4112aa68a673db4a8b73bc53270fdfa7f68532bf.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 0a33868b7..30be38dd4 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -654,7 +654,16 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr buffer_draw_state.bindpoint = current_bindpoint + bindpoint; boost::optional<VAddr> addr = gpu.memory_manager->GpuToCpuAddress(buffer.address); - std::vector<u8> data(used_buffer.GetSize() * sizeof(float)); + + std::vector<u8> data; + if (used_buffer.IsIndirect()) { + // Buffer is accessed indirectly, so upload the entire thing + data.resize(buffer.size * sizeof(float)); + } else { + // Buffer is accessed directly, upload just what we use + data.resize(used_buffer.GetSize() * sizeof(float)); + } + Memory::ReadBlock(*addr, data.data(), data.size()); glBindBuffer(GL_SHADER_STORAGE_BUFFER, buffer_draw_state.ssbo); |