diff options
| author | 2018-07-12 22:57:57 -0400 | |
|---|---|---|
| committer | 2018-07-12 22:57:57 -0400 | |
| commit | 8aeff9cf8e84c27ab83cea8df1a94ce8082efc78 (patch) | |
| tree | e79cdf86838e120908b50fd25ad4f48a98bc29e9 /src/video_core/renderer_opengl | |
| parent | gl_shader_gen: Implement dual vertex shader mode. (diff) | |
| download | yuzu-8aeff9cf8e84c27ab83cea8df1a94ce8082efc78.tar.gz yuzu-8aeff9cf8e84c27ab83cea8df1a94ce8082efc78.tar.xz yuzu-8aeff9cf8e84c27ab83cea8df1a94ce8082efc78.zip | |
gl_rasterizer: Fix check for if a shader stage is enabled.
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 02ffd9bde..4072a12b4 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -216,15 +216,13 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) { | |||
| 216 | auto& shader_config = gpu.regs.shader_config[index]; | 216 | auto& shader_config = gpu.regs.shader_config[index]; |
| 217 | const Maxwell::ShaderProgram program{static_cast<Maxwell::ShaderProgram>(index)}; | 217 | const Maxwell::ShaderProgram program{static_cast<Maxwell::ShaderProgram>(index)}; |
| 218 | 218 | ||
| 219 | const size_t stage{index == 0 ? 0 : index - 1}; // Stage indices are 0 - 5 | ||
| 220 | |||
| 221 | const bool is_enabled = gpu.IsShaderStageEnabled(static_cast<Maxwell::ShaderStage>(stage)); | ||
| 222 | |||
| 223 | // Skip stages that are not enabled | 219 | // Skip stages that are not enabled |
| 224 | if (!is_enabled) { | 220 | if (!gpu.regs.IsShaderConfigEnabled(index)) { |
| 225 | continue; | 221 | continue; |
| 226 | } | 222 | } |
| 227 | 223 | ||
| 224 | const size_t stage{index == 0 ? 0 : index - 1}; // Stage indices are 0 - 5 | ||
| 225 | |||
| 228 | GLShader::MaxwellUniformData ubo{}; | 226 | GLShader::MaxwellUniformData ubo{}; |
| 229 | ubo.SetFromRegs(gpu.state.shader_stages[stage]); | 227 | ubo.SetFromRegs(gpu.state.shader_stages[stage]); |
| 230 | std::memcpy(buffer_ptr, &ubo, sizeof(ubo)); | 228 | std::memcpy(buffer_ptr, &ubo, sizeof(ubo)); |
| @@ -628,9 +626,6 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr | |||
| 628 | auto& gpu = Core::System::GetInstance().GPU(); | 626 | auto& gpu = Core::System::GetInstance().GPU(); |
| 629 | auto& maxwell3d = gpu.Get3DEngine(); | 627 | auto& maxwell3d = gpu.Get3DEngine(); |
| 630 | 628 | ||
| 631 | ASSERT_MSG(maxwell3d.IsShaderStageEnabled(stage), | ||
| 632 | "Attempted to upload constbuffer of disabled shader stage"); | ||
| 633 | |||
| 634 | // Reset all buffer draw state for this stage. | 629 | // Reset all buffer draw state for this stage. |
| 635 | for (auto& buffer : state.draw.const_buffers[static_cast<size_t>(stage)]) { | 630 | for (auto& buffer : state.draw.const_buffers[static_cast<size_t>(stage)]) { |
| 636 | buffer.bindpoint = 0; | 631 | buffer.bindpoint = 0; |
| @@ -697,9 +692,6 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, | |||
| 697 | auto& gpu = Core::System::GetInstance().GPU(); | 692 | auto& gpu = Core::System::GetInstance().GPU(); |
| 698 | auto& maxwell3d = gpu.Get3DEngine(); | 693 | auto& maxwell3d = gpu.Get3DEngine(); |
| 699 | 694 | ||
| 700 | ASSERT_MSG(maxwell3d.IsShaderStageEnabled(stage), | ||
| 701 | "Attempted to upload textures of disabled shader stage"); | ||
| 702 | |||
| 703 | ASSERT_MSG(current_unit + entries.size() <= std::size(state.texture_units), | 695 | ASSERT_MSG(current_unit + entries.size() <= std::size(state.texture_units), |
| 704 | "Exceeded the number of active textures."); | 696 | "Exceeded the number of active textures."); |
| 705 | 697 | ||