summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Bogado <rodolfoosvaldobogado@gmail.com>2018-11-25 16:18:29 +0100
committerRodolfo Bogado <rodolfoosvaldobogado@gmail.com>2018-11-25 16:18:29 +0100
commit415e8383ba33e08ca3a95ae30c03be7de63de3e6 (patch)
tree71400a9b69e48581aac30285c59da0cb2f12fcdf
parentAdd support for viewport_transfom_enable register (diff)
downloadyuzu-415e8383ba33e08ca3a95ae30c03be7de63de3e6.tar
yuzu-415e8383ba33e08ca3a95ae30c03be7de63de3e6.tar.gz
yuzu-415e8383ba33e08ca3a95ae30c03be7de63de3e6.tar.bz2
yuzu-415e8383ba33e08ca3a95ae30c03be7de63de3e6.tar.lz
yuzu-415e8383ba33e08ca3a95ae30c03be7de63de3e6.tar.xz
yuzu-415e8383ba33e08ca3a95ae30c03be7de63de3e6.tar.zst
yuzu-415e8383ba33e08ca3a95ae30c03be7de63de3e6.zip
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index fea106ba1..99004c9ad 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -969,7 +969,11 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, Shader& shader,
void RasterizerOpenGL::SyncViewport(OpenGLState& current_state) {
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
- for (std::size_t i = 0; i < Tegra::Engines::Maxwell3D::Regs::NumViewports; i++) {
+ const bool geometry_shaders_enabled =
+ regs.IsShaderConfigEnabled(static_cast<size_t>(Maxwell::ShaderProgram::Geometry));
+ const std::size_t viewport_count =
+ geometry_shaders_enabled ? Tegra::Engines::Maxwell3D::Regs::NumViewports : 1;
+ for (std::size_t i = 0; i < viewport_count; i++) {
auto& viewport = current_state.viewports[i];
const auto& src = regs.viewports[i];
if (regs.viewport_transform_enabled) {
@@ -1157,7 +1161,11 @@ void RasterizerOpenGL::SyncLogicOpState() {
void RasterizerOpenGL::SyncScissorTest(OpenGLState& current_state) {
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
- for (std::size_t i = 0; i < Tegra::Engines::Maxwell3D::Regs::NumViewports; i++) {
+ const bool geometry_shaders_enabled =
+ regs.IsShaderConfigEnabled(static_cast<size_t>(Maxwell::ShaderProgram::Geometry));
+ const std::size_t viewport_count =
+ geometry_shaders_enabled ? Tegra::Engines::Maxwell3D::Regs::NumViewports : 1;
+ for (std::size_t i = 0; i < viewport_count; i++) {
const auto& src = regs.scissor_test[i];
auto& dst = current_state.viewports[i].scissor;
dst.enabled = (src.enable != 0);