diff options
author | bunnei <bunneidev@gmail.com> | 2018-06-07 17:21:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 17:21:36 +0200 |
commit | ee318d4015f1d19fc80d0bfc3d3aba29c3df342e (patch) | |
tree | 122cf63b67d76f6b77924b2c721e6714c27d1579 /src/video_core/renderer_opengl | |
parent | Merge pull request #522 from mailwl/mm-u (diff) | |
parent | GLRenderer: Write the shader stage configuration UBO data *before* copying it to the GPU. (diff) | |
download | yuzu-ee318d4015f1d19fc80d0bfc3d3aba29c3df342e.tar yuzu-ee318d4015f1d19fc80d0bfc3d3aba29c3df342e.tar.gz yuzu-ee318d4015f1d19fc80d0bfc3d3aba29c3df342e.tar.bz2 yuzu-ee318d4015f1d19fc80d0bfc3d3aba29c3df342e.tar.lz yuzu-ee318d4015f1d19fc80d0bfc3d3aba29c3df342e.tar.xz yuzu-ee318d4015f1d19fc80d0bfc3d3aba29c3df342e.tar.zst yuzu-ee318d4015f1d19fc80d0bfc3d3aba29c3df342e.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-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 2e90ebcf4..0bd235218 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -214,13 +214,14 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) { continue; } + GLShader::MaxwellUniformData ubo{}; + ubo.SetFromRegs(gpu.state.shader_stages[stage]); + std::memcpy(buffer_ptr, &ubo, sizeof(ubo)); + // Upload uniform data as one UBO per stage const GLintptr ubo_offset = buffer_offset; copy_buffer(uniform_buffers[stage].handle, ubo_offset, sizeof(GLShader::MaxwellUniformData)); - GLShader::MaxwellUniformData* ub_ptr = - reinterpret_cast<GLShader::MaxwellUniformData*>(buffer_ptr); - ub_ptr->SetFromRegs(gpu.state.shader_stages[stage]); buffer_ptr += sizeof(GLShader::MaxwellUniformData); buffer_offset += sizeof(GLShader::MaxwellUniformData); |