summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp17
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h1
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) {
299 BaseBindings base_bindings; 299 BaseBindings base_bindings;
300 std::array<bool, Maxwell::NumClipDistances> clip_distances{}; 300 std::array<bool, Maxwell::NumClipDistances> clip_distances{};
301 301
302 // Prepare UBO bindings 302 // Prepare packed bindings
303 bind_ubo_pushbuffer.Setup(base_bindings.cbuf); 303 bind_ubo_pushbuffer.Setup(base_bindings.cbuf);
304 bind_ssbo_pushbuffer.Setup(base_bindings.gmem);
304 305
305 for (std::size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) { 306 for (std::size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) {
306 const auto& shader_config = gpu.regs.shader_config[index]; 307 const auto& shader_config = gpu.regs.shader_config[index];
@@ -370,6 +371,7 @@ void RasterizerOpenGL::SetupShaders(GLenum primitive_mode) {
370 } 371 }
371 372
372 bind_ubo_pushbuffer.Bind(); 373 bind_ubo_pushbuffer.Bind();
374 bind_ssbo_pushbuffer.Bind();
373 375
374 SyncClipEnabled(clip_distances); 376 SyncClipEnabled(clip_distances);
375 377
@@ -947,15 +949,12 @@ void RasterizerOpenGL::SetupConstBuffers(Tegra::Engines::Maxwell3D::Regs::Shader
947void RasterizerOpenGL::SetupGlobalRegions(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage, 949void RasterizerOpenGL::SetupGlobalRegions(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage,
948 const Shader& shader, GLenum primitive_mode, 950 const Shader& shader, GLenum primitive_mode,
949 BaseBindings base_bindings) { 951 BaseBindings base_bindings) {
950 // TODO(Rodrigo): Use ARB_multi_bind here
951 const auto& entries = shader->GetShaderEntries().global_memory_entries; 952 const auto& entries = shader->GetShaderEntries().global_memory_entries;
952 953 for (std::size_t bindpoint = 0; bindpoint < entries.size(); ++bindpoint) {
953 for (u32 bindpoint = 0; bindpoint < static_cast<u32>(entries.size()); ++bindpoint) { 954 const auto& entry{entries[bindpoint]};
954 const auto& entry = entries[bindpoint]; 955 const auto& region{global_cache.GetGlobalRegion(entry, stage)};
955 const u32 current_bindpoint = base_bindings.gmem + bindpoint; 956 bind_ssbo_pushbuffer.Push(region->GetBufferHandle(), 0,
956 const auto& region = global_cache.GetGlobalRegion(entry, stage); 957 static_cast<GLsizeiptr>(region->GetSizeInBytes()));
957
958 glBindBufferBase(GL_SHADER_STORAGE_BUFFER, current_bindpoint, region->GetBufferHandle());
959 } 958 }
960} 959}
961 960
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:
231 GLint uniform_buffer_alignment; 231 GLint uniform_buffer_alignment;
232 232
233 BindBuffersRangePushBuffer bind_ubo_pushbuffer{GL_UNIFORM_BUFFER}; 233 BindBuffersRangePushBuffer bind_ubo_pushbuffer{GL_UNIFORM_BUFFER};
234 BindBuffersRangePushBuffer bind_ssbo_pushbuffer{GL_SHADER_STORAGE_BUFFER};
234 235
235 std::size_t CalculateVertexArraysSize() const; 236 std::size_t CalculateVertexArraysSize() const;
236 237