diff options
author | Subv <subv2112@gmail.com> | 2018-04-15 18:18:09 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2018-04-15 18:18:09 +0200 |
commit | e128e90350a95bbeeebb3987c3513537e5e4289c (patch) | |
tree | f1487899eaee35fe95e136deb853222871ef585c /src/video_core | |
parent | GPU: Use the buffer hints from the shader decompiler to upload only the necessary const buffers for each shader stage. (diff) | |
download | yuzu-e128e90350a95bbeeebb3987c3513537e5e4289c.tar yuzu-e128e90350a95bbeeebb3987c3513537e5e4289c.tar.gz yuzu-e128e90350a95bbeeebb3987c3513537e5e4289c.tar.bz2 yuzu-e128e90350a95bbeeebb3987c3513537e5e4289c.tar.lz yuzu-e128e90350a95bbeeebb3987c3513537e5e4289c.tar.xz yuzu-e128e90350a95bbeeebb3987c3513537e5e4289c.tar.zst yuzu-e128e90350a95bbeeebb3987c3513537e5e4289c.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 8709f9fc2..a778dfc64 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -571,10 +571,11 @@ void RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, buffer_draw_state.bindpoint = bindpoint; VAddr addr = gpu.memory_manager->PhysicalToVirtualAddress(buffer.address); - const u8* data = Memory::GetPointer(addr); + std::vector<u8> data(used_buffer.GetSize() * sizeof(float)); + Memory::ReadBlock(addr, data.data(), data.size()); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, buffer_draw_state.ssbo); - glBufferData(GL_SHADER_STORAGE_BUFFER, used_buffer.GetSize() * sizeof(float), data, - GL_DYNAMIC_DRAW); + glBufferData(GL_SHADER_STORAGE_BUFFER, data.size(), data.data(), GL_DYNAMIC_DRAW); glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0); } |