summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorFengChen <vonchenplus@gmail.com>2022-09-01 16:05:11 +0200
committerFengChen <vonchenplus@gmail.com>2022-09-20 05:55:43 +0200
commit9a95c7fa14bdfc14aacea92896c8ae8533918fe8 (patch)
tree3beb2289136a59134195d35e37d4b56b294a3081 /src/video_core/renderer_opengl
parentMerge pull request #8841 from zhaobot/tx-update-20220901035349 (diff)
downloadyuzu-9a95c7fa14bdfc14aacea92896c8ae8533918fe8.tar
yuzu-9a95c7fa14bdfc14aacea92896c8ae8533918fe8.tar.gz
yuzu-9a95c7fa14bdfc14aacea92896c8ae8533918fe8.tar.bz2
yuzu-9a95c7fa14bdfc14aacea92896c8ae8533918fe8.tar.lz
yuzu-9a95c7fa14bdfc14aacea92896c8ae8533918fe8.tar.xz
yuzu-9a95c7fa14bdfc14aacea92896c8ae8533918fe8.tar.zst
yuzu-9a95c7fa14bdfc14aacea92896c8ae8533918fe8.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_graphics_pipeline.cpp11
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp2
3 files changed, 22 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
index 67eae369d..c297f7121 100644
--- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
+++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
@@ -502,6 +502,17 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
float_image_scaling_mask, down_factor, 0.0f);
}
}
+ if (info.uses_render_area) {
+ const auto render_area_width(static_cast<GLfloat>(regs.render_area.width));
+ const auto render_area_height(static_cast<GLfloat>(regs.render_area.height));
+ if (use_assembly) {
+ glProgramLocalParameter4fARB(AssemblyStage(stage), 1, render_area_width,
+ render_area_height, 0.0f, 0.0f);
+ } else {
+ glProgramUniform4f(source_programs[stage].handle, 1, render_area_width,
+ render_area_height, 0.0f, 0.0f);
+ }
+ }
}};
if constexpr (Spec::enabled_stages[0]) {
prepare_stage(0);
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index a0d048b0b..f018333af 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -622,6 +622,16 @@ void RasterizerOpenGL::SyncViewport() {
}
flags[Dirty::Viewport0 + index] = false;
+ if (!regs.viewport_transform_enabled) {
+ const auto x = static_cast<GLfloat>(regs.render_area.x);
+ const auto y = static_cast<GLfloat>(regs.render_area.y);
+ const auto width = static_cast<GLfloat>(regs.render_area.width);
+ const auto height = static_cast<GLfloat>(regs.render_area.height);
+ glViewportIndexedf(static_cast<GLuint>(index), x, y, width != 0.0f ? width : 1.0f,
+ height != 0.0f ? height : 1.0f);
+ continue;
+ }
+
const auto& src = regs.viewport_transform[index];
GLfloat x = conv(src.translate_x - src.scale_x);
GLfloat y = conv(src.translate_y - src.scale_y);
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index 1ad56d9e7..7e76f679f 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -49,7 +49,7 @@ using VideoCommon::LoadPipelines;
using VideoCommon::SerializePipeline;
using Context = ShaderContext::Context;
-constexpr u32 CACHE_VERSION = 5;
+constexpr u32 CACHE_VERSION = 7;
template <typename Container>
auto MakeSpan(Container& container) {