mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-05 06:22:45 +01:00
Merge pull request #543 from Subv/uniforms
GLRenderer: Write the shader stage configuration UBO data *before* copying it to the GPU.
This commit is contained in:
commit
ee318d4015
1 changed files with 4 additions and 3 deletions
|
@ -214,13 +214,14 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) {
|
||||||
continue;
|
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
|
// 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,
|
||||||
sizeof(GLShader::MaxwellUniformData));
|
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_ptr += sizeof(GLShader::MaxwellUniformData);
|
||||||
buffer_offset += sizeof(GLShader::MaxwellUniformData);
|
buffer_offset += sizeof(GLShader::MaxwellUniformData);
|
||||||
|
|
Loading…
Reference in a new issue