diff options
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 6 |
4 files changed, 12 insertions, 3 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 5c0ae8009..ed22a2090 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -238,6 +238,8 @@ void Maxwell3D::ProcessCBBind(Regs::ShaderStage stage) { | |||
| 238 | 238 | ||
| 239 | auto& buffer = shader.const_buffers[bind_data.index]; | 239 | auto& buffer = shader.const_buffers[bind_data.index]; |
| 240 | 240 | ||
| 241 | ASSERT(bind_data.index < Regs::MaxConstBuffers); | ||
| 242 | |||
| 241 | buffer.enabled = bind_data.valid.Value() != 0; | 243 | buffer.enabled = bind_data.valid.Value() != 0; |
| 242 | buffer.index = bind_data.index; | 244 | buffer.index = bind_data.index; |
| 243 | buffer.address = regs.const_buffer.BufferAddress(); | 245 | buffer.address = regs.const_buffer.BufferAddress(); |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 4d0ff96a5..0506ac8fe 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -44,7 +44,7 @@ public: | |||
| 44 | static constexpr size_t MaxShaderProgram = 6; | 44 | static constexpr size_t MaxShaderProgram = 6; |
| 45 | static constexpr size_t MaxShaderStage = 5; | 45 | static constexpr size_t MaxShaderStage = 5; |
| 46 | // Maximum number of const buffers per shader stage. | 46 | // Maximum number of const buffers per shader stage. |
| 47 | static constexpr size_t MaxConstBuffers = 16; | 47 | static constexpr size_t MaxConstBuffers = 18; |
| 48 | 48 | ||
| 49 | enum class QueryMode : u32 { | 49 | enum class QueryMode : u32 { |
| 50 | Write = 0, | 50 | Write = 0, |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index b87b87e03..bf6b5c3a0 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -659,7 +659,10 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr | |||
| 659 | auto& buffer_draw_state = | 659 | auto& buffer_draw_state = |
| 660 | state.draw.const_buffers[static_cast<size_t>(stage)][used_buffer.GetIndex()]; | 660 | state.draw.const_buffers[static_cast<size_t>(stage)][used_buffer.GetIndex()]; |
| 661 | 661 | ||
| 662 | ASSERT_MSG(buffer.enabled, "Attempted to upload disabled constbuffer"); | 662 | if (!buffer.enabled) { |
| 663 | continue; | ||
| 664 | } | ||
| 665 | |||
| 663 | buffer_draw_state.enabled = true; | 666 | buffer_draw_state.enabled = true; |
| 664 | buffer_draw_state.bindpoint = current_bindpoint + bindpoint; | 667 | buffer_draw_state.bindpoint = current_bindpoint + bindpoint; |
| 665 | 668 | ||
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index 24b1d956b..5c7b636e4 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h | |||
| @@ -7,6 +7,10 @@ | |||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <glad/glad.h> | 8 | #include <glad/glad.h> |
| 9 | 9 | ||
| 10 | #include "video_core/engines/maxwell_3d.h" | ||
| 11 | |||
| 12 | using Regs = Tegra::Engines::Maxwell3D::Regs; | ||
| 13 | |||
| 10 | namespace TextureUnits { | 14 | namespace TextureUnits { |
| 11 | 15 | ||
| 12 | struct TextureUnit { | 16 | struct TextureUnit { |
| @@ -120,7 +124,7 @@ public: | |||
| 120 | GLuint bindpoint; | 124 | GLuint bindpoint; |
| 121 | GLuint ssbo; | 125 | GLuint ssbo; |
| 122 | }; | 126 | }; |
| 123 | std::array<std::array<ConstBufferConfig, 16>, 5> const_buffers{}; | 127 | std::array<std::array<ConstBufferConfig, Regs::MaxConstBuffers>, 5> const_buffers; |
| 124 | } draw; | 128 | } draw; |
| 125 | 129 | ||
| 126 | struct { | 130 | struct { |