mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-24 12:26:26 -05:00
gl_rasterizer: Use ARB_multi_bind to update SSBOs
This commit is contained in:
parent
2d1f054c61
commit
b631c09e72
2 changed files with 9 additions and 9 deletions
|
@ -299,8 +299,9 @@ void RasterizerOpenGL::SetupShaders(GLenum primitive_mode) {
|
||||||
BaseBindings base_bindings;
|
BaseBindings base_bindings;
|
||||||
std::array<bool, Maxwell::NumClipDistances> clip_distances{};
|
std::array<bool, Maxwell::NumClipDistances> clip_distances{};
|
||||||
|
|
||||||
// Prepare UBO bindings
|
// Prepare packed bindings
|
||||||
bind_ubo_pushbuffer.Setup(base_bindings.cbuf);
|
bind_ubo_pushbuffer.Setup(base_bindings.cbuf);
|
||||||
|
bind_ssbo_pushbuffer.Setup(base_bindings.gmem);
|
||||||
|
|
||||||
for (std::size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) {
|
for (std::size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) {
|
||||||
const auto& shader_config = gpu.regs.shader_config[index];
|
const auto& shader_config = gpu.regs.shader_config[index];
|
||||||
|
@ -370,6 +371,7 @@ void RasterizerOpenGL::SetupShaders(GLenum primitive_mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bind_ubo_pushbuffer.Bind();
|
bind_ubo_pushbuffer.Bind();
|
||||||
|
bind_ssbo_pushbuffer.Bind();
|
||||||
|
|
||||||
SyncClipEnabled(clip_distances);
|
SyncClipEnabled(clip_distances);
|
||||||
|
|
||||||
|
@ -947,15 +949,12 @@ void RasterizerOpenGL::SetupConstBuffers(Tegra::Engines::Maxwell3D::Regs::Shader
|
||||||
void RasterizerOpenGL::SetupGlobalRegions(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage,
|
void RasterizerOpenGL::SetupGlobalRegions(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage,
|
||||||
const Shader& shader, GLenum primitive_mode,
|
const Shader& shader, GLenum primitive_mode,
|
||||||
BaseBindings base_bindings) {
|
BaseBindings base_bindings) {
|
||||||
// TODO(Rodrigo): Use ARB_multi_bind here
|
|
||||||
const auto& entries = shader->GetShaderEntries().global_memory_entries;
|
const auto& entries = shader->GetShaderEntries().global_memory_entries;
|
||||||
|
for (std::size_t bindpoint = 0; bindpoint < entries.size(); ++bindpoint) {
|
||||||
for (u32 bindpoint = 0; bindpoint < static_cast<u32>(entries.size()); ++bindpoint) {
|
const auto& entry{entries[bindpoint]};
|
||||||
const auto& entry = entries[bindpoint];
|
const auto& region{global_cache.GetGlobalRegion(entry, stage)};
|
||||||
const u32 current_bindpoint = base_bindings.gmem + bindpoint;
|
bind_ssbo_pushbuffer.Push(region->GetBufferHandle(), 0,
|
||||||
const auto& region = global_cache.GetGlobalRegion(entry, stage);
|
static_cast<GLsizeiptr>(region->GetSizeInBytes()));
|
||||||
|
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, current_bindpoint, region->GetBufferHandle());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,6 +231,7 @@ private:
|
||||||
GLint uniform_buffer_alignment;
|
GLint uniform_buffer_alignment;
|
||||||
|
|
||||||
BindBuffersRangePushBuffer bind_ubo_pushbuffer{GL_UNIFORM_BUFFER};
|
BindBuffersRangePushBuffer bind_ubo_pushbuffer{GL_UNIFORM_BUFFER};
|
||||||
|
BindBuffersRangePushBuffer bind_ssbo_pushbuffer{GL_SHADER_STORAGE_BUFFER};
|
||||||
|
|
||||||
std::size_t CalculateVertexArraysSize() const;
|
std::size_t CalculateVertexArraysSize() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue