From ee21e4ecd372d6a191244dffbc5ac5c7b80150c1 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 28 May 2020 17:06:22 -0300 Subject: glsl: Squash constant buffers into a single SSBO when we hit the limit Avoids compilation errors at the cost of shader build times and runtime performance when a game hits the limit of uniform buffers we can use. --- src/video_core/renderer_opengl/gl_device.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/video_core/renderer_opengl/gl_device.h') diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index 683ed9002..98cca0254 100644 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h @@ -24,6 +24,10 @@ public: explicit Device(); explicit Device(std::nullptr_t); + u32 GetMaxUniformBuffers(Tegra::Engines::ShaderType shader_type) const noexcept { + return max_uniform_buffers[static_cast(shader_type)]; + } + const BaseBindings& GetBaseBindings(std::size_t stage_index) const noexcept { return base_bindings[stage_index]; } @@ -92,7 +96,8 @@ private: static bool TestVariableAoffi(); static bool TestPreciseBug(); - std::array base_bindings; + std::array max_uniform_buffers{}; + std::array base_bindings{}; std::size_t uniform_buffer_alignment{}; std::size_t shader_storage_alignment{}; u32 max_vertex_attributes{}; -- cgit v1.2.3