diff options
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 11 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.h | 4 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 4 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index a6e9eb60b..6e7f66ef0 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -942,10 +942,21 @@ bool Image::Scale(bool up_scale) { | |||
| 942 | dst_info.size.height = scaled_height; | 942 | dst_info.size.height = scaled_height; |
| 943 | upscaled_backup = MakeImage(dst_info, gl_internal_format); | 943 | upscaled_backup = MakeImage(dst_info, gl_internal_format); |
| 944 | } | 944 | } |
| 945 | auto& state_tracker = runtime->GetStateTracker(); | ||
| 946 | state_tracker.NotifyViewport0(); | ||
| 947 | state_tracker.NotifyScissor0(); | ||
| 945 | // TODO (ameerj): Investigate other GL states that affect blitting. | 948 | // TODO (ameerj): Investigate other GL states that affect blitting. |
| 946 | GLboolean scissor_test; | 949 | GLboolean scissor_test; |
| 947 | glGetBooleani_v(GL_SCISSOR_TEST, 0, &scissor_test); | 950 | glGetBooleani_v(GL_SCISSOR_TEST, 0, &scissor_test); |
| 948 | glDisablei(GL_SCISSOR_TEST, 0); | 951 | glDisablei(GL_SCISSOR_TEST, 0); |
| 952 | if (up_scale) { | ||
| 953 | glViewportIndexedf(0, 0.0f, 0.0f, static_cast<GLfloat>(scaled_width), | ||
| 954 | static_cast<GLfloat>(scaled_height)); | ||
| 955 | } else { | ||
| 956 | glViewportIndexedf(0, 0.0f, 0.0f, static_cast<GLfloat>(original_width), | ||
| 957 | static_cast<GLfloat>(original_height)); | ||
| 958 | } | ||
| 959 | |||
| 949 | 960 | ||
| 950 | const GLuint read_fbo = runtime->rescale_read_fbos[fbo_index].handle; | 961 | const GLuint read_fbo = runtime->rescale_read_fbos[fbo_index].handle; |
| 951 | const GLuint draw_fbo = runtime->rescale_draw_fbos[fbo_index].handle; | 962 | const GLuint draw_fbo = runtime->rescale_draw_fbos[fbo_index].handle; |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index eeb5133d5..8161e6b72 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h | |||
| @@ -116,6 +116,10 @@ public: | |||
| 116 | 116 | ||
| 117 | void TickFrame() {} | 117 | void TickFrame() {} |
| 118 | 118 | ||
| 119 | StateTracker& GetStateTracker() { | ||
| 120 | return state_tracker; | ||
| 121 | } | ||
| 122 | |||
| 119 | private: | 123 | private: |
| 120 | struct StagingBuffers { | 124 | struct StagingBuffers { |
| 121 | explicit StagingBuffers(GLenum storage_flags_, GLenum map_flags_); | 125 | explicit StagingBuffers(GLenum storage_flags_, GLenum map_flags_); |
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index f1254ef62..dd9553806 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -1810,8 +1810,8 @@ void TextureCache<P>::BindRenderTarget(ImageViewId* old_id, ImageViewId new_id) | |||
| 1810 | if (*old_id == new_id) { | 1810 | if (*old_id == new_id) { |
| 1811 | return; | 1811 | return; |
| 1812 | } | 1812 | } |
| 1813 | if (*old_id) { | 1813 | if (new_id) { |
| 1814 | const ImageViewBase& old_view = slot_image_views[*old_id]; | 1814 | const ImageViewBase& old_view = slot_image_views[new_id]; |
| 1815 | if (True(old_view.flags & ImageViewFlagBits::PreemtiveDownload)) { | 1815 | if (True(old_view.flags & ImageViewFlagBits::PreemtiveDownload)) { |
| 1816 | uncommitted_downloads.push_back(old_view.image_id); | 1816 | uncommitted_downloads.push_back(old_view.image_id); |
| 1817 | } | 1817 | } |