Browse Source
Merge pull request #546 from Subv/flush_ubo_buffer
Rasterizer: Flush the written region when writing shader uniform data before copying it to the uniform buffers.
pull/15/merge
bunnei
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
0 deletions
-
src/video_core/renderer_opengl/gl_rasterizer.cpp
|
|
@ -218,6 +218,9 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) { |
|
|
ubo.SetFromRegs(gpu.state.shader_stages[stage]); |
|
|
ubo.SetFromRegs(gpu.state.shader_stages[stage]); |
|
|
std::memcpy(buffer_ptr, &ubo, sizeof(ubo)); |
|
|
std::memcpy(buffer_ptr, &ubo, sizeof(ubo)); |
|
|
|
|
|
|
|
|
|
|
|
// Flush the buffer so that the GPU can see the data we just wrote.
|
|
|
|
|
|
glFlushMappedBufferRange(GL_ARRAY_BUFFER, buffer_offset, sizeof(ubo)); |
|
|
|
|
|
|
|
|
// Upload uniform data as one UBO per stage
|
|
|
// Upload uniform data as one UBO per stage
|
|
|
const GLintptr ubo_offset = buffer_offset; |
|
|
const GLintptr ubo_offset = buffer_offset; |
|
|
copy_buffer(uniform_buffers[stage].handle, ubo_offset, |
|
|
copy_buffer(uniform_buffers[stage].handle, ubo_offset, |
|
|
|