summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-10-23 04:59:30 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-11-16 22:11:32 +0100
commit93c9eb196f4444495f50220c3e6b89d2f0b582db (patch)
tree13b68c943f40391976a9675566582f6943f6cb59 /src
parentgl_texture_cache: Simplify scaling procedures (diff)
downloadyuzu-93c9eb196f4444495f50220c3e6b89d2f0b582db.tar
yuzu-93c9eb196f4444495f50220c3e6b89d2f0b582db.tar.gz
yuzu-93c9eb196f4444495f50220c3e6b89d2f0b582db.tar.bz2
yuzu-93c9eb196f4444495f50220c3e6b89d2f0b582db.tar.lz
yuzu-93c9eb196f4444495f50220c3e6b89d2f0b582db.tar.xz
yuzu-93c9eb196f4444495f50220c3e6b89d2f0b582db.tar.zst
yuzu-93c9eb196f4444495f50220c3e6b89d2f0b582db.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index bb24a0656..4df8a684a 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -184,6 +184,9 @@ void RasterizerOpenGL::Clear() {
SyncRasterizeEnable();
SyncStencilTestState();
+ std::scoped_lock lock{texture_cache.mutex};
+ texture_cache.UpdateRenderTargets(true);
+ state_tracker.BindFramebuffer(texture_cache.GetFramebuffer()->Handle());
if (regs.clear_flags.scissor) {
SyncScissorTest();
} else {
@@ -192,10 +195,6 @@ void RasterizerOpenGL::Clear() {
}
UNIMPLEMENTED_IF(regs.clear_flags.viewport);
- std::scoped_lock lock{texture_cache.mutex};
- texture_cache.UpdateRenderTargets(true);
- state_tracker.BindFramebuffer(texture_cache.GetFramebuffer()->Handle());
-
if (use_color) {
glClearBufferfv(GL_COLOR, regs.clear_buffers.RT, regs.clear_color);
}
@@ -925,12 +924,9 @@ void RasterizerOpenGL::SyncScissorTest() {
const auto& regs = maxwell3d.regs;
const auto& resolution = Settings::values.resolution_info;
- const auto scale_up = [resolution](u32 value) -> u32 {
- if (value == 0) {
- return 0U;
- }
- const u32 converted_value = (value * resolution.up_scale) >> resolution.down_shift;
- return std::max<u32>(converted_value, 1U);
+ const bool is_rescaling{texture_cache.IsRescaling()};
+ const auto scale_up = [resolution, is_rescaling](u32 value) {
+ return is_rescaling ? resolution.ScaleUp(value) : value;
};
for (std::size_t index = 0; index < Maxwell::NumViewports; ++index) {
if (!force && !flags[Dirty::Scissor0 + index]) {