diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-04-05 08:50:26 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-04-06 00:18:43 +0200 |
commit | b631c09e72a761a4aa3dc8183ec1661e95619939 (patch) | |
tree | e1cdfede4065dbe81791d0cb04f36bd08e7ad0a2 /src | |
parent | gl_rasterizer: Use ARB_multi_bind to update UBOs across stages (diff) | |
download | yuzu-b631c09e72a761a4aa3dc8183ec1661e95619939.tar yuzu-b631c09e72a761a4aa3dc8183ec1661e95619939.tar.gz yuzu-b631c09e72a761a4aa3dc8183ec1661e95619939.tar.bz2 yuzu-b631c09e72a761a4aa3dc8183ec1661e95619939.tar.lz yuzu-b631c09e72a761a4aa3dc8183ec1661e95619939.tar.xz yuzu-b631c09e72a761a4aa3dc8183ec1661e95619939.tar.zst yuzu-b631c09e72a761a4aa3dc8183ec1661e95619939.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 17 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 1 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 148692943..d250d5cbb 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -299,8 +299,9 @@ void RasterizerOpenGL::SetupShaders(GLenum primitive_mode) { BaseBindings base_bindings; std::array<bool, Maxwell::NumClipDistances> clip_distances{}; - // Prepare UBO bindings + // Prepare packed bindings bind_ubo_pushbuffer.Setup(base_bindings.cbuf); + bind_ssbo_pushbuffer.Setup(base_bindings.gmem); for (std::size_t index = 0; index < Maxwell::MaxShaderProgram; ++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_ssbo_pushbuffer.Bind(); SyncClipEnabled(clip_distances); @@ -947,15 +949,12 @@ void RasterizerOpenGL::SetupConstBuffers(Tegra::Engines::Maxwell3D::Regs::Shader void RasterizerOpenGL::SetupGlobalRegions(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage, const Shader& shader, GLenum primitive_mode, BaseBindings base_bindings) { - // TODO(Rodrigo): Use ARB_multi_bind here const auto& entries = shader->GetShaderEntries().global_memory_entries; - - for (u32 bindpoint = 0; bindpoint < static_cast<u32>(entries.size()); ++bindpoint) { - const auto& entry = entries[bindpoint]; - const u32 current_bindpoint = base_bindings.gmem + bindpoint; - const auto& region = global_cache.GetGlobalRegion(entry, stage); - - glBindBufferBase(GL_SHADER_STORAGE_BUFFER, current_bindpoint, region->GetBufferHandle()); + for (std::size_t bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { + const auto& entry{entries[bindpoint]}; + const auto& region{global_cache.GetGlobalRegion(entry, stage)}; + bind_ssbo_pushbuffer.Push(region->GetBufferHandle(), 0, + static_cast<GLsizeiptr>(region->GetSizeInBytes())); } } diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 72a399e3d..e4c64ae71 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -231,6 +231,7 @@ private: GLint uniform_buffer_alignment; BindBuffersRangePushBuffer bind_ubo_pushbuffer{GL_UNIFORM_BUFFER}; + BindBuffersRangePushBuffer bind_ssbo_pushbuffer{GL_SHADER_STORAGE_BUFFER}; std::size_t CalculateVertexArraysSize() const; |