diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 33 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 5 |
2 files changed, 24 insertions, 14 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 26ab857c9..c8031b695 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -192,19 +192,8 @@ void TextureCache<P>::SynchronizeComputeDescriptors() { | |||
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | template <class P> | 194 | template <class P> |
| 195 | void TextureCache<P>::UpdateRenderTargets(bool is_clear) { | 195 | bool TextureCache<P>::RescaleRenderTargets(bool is_clear) { |
| 196 | using namespace VideoCommon::Dirty; | ||
| 197 | auto& flags = maxwell3d.dirty.flags; | 196 | auto& flags = maxwell3d.dirty.flags; |
| 198 | if (!flags[Dirty::RenderTargets]) { | ||
| 199 | for (size_t index = 0; index < NUM_RT; ++index) { | ||
| 200 | ImageViewId& color_buffer_id = render_targets.color_buffer_ids[index]; | ||
| 201 | PrepareImageView(color_buffer_id, true, is_clear && IsFullClear(color_buffer_id)); | ||
| 202 | } | ||
| 203 | const ImageViewId depth_buffer_id = render_targets.depth_buffer_id; | ||
| 204 | PrepareImageView(depth_buffer_id, true, is_clear && IsFullClear(depth_buffer_id)); | ||
| 205 | return; | ||
| 206 | } | ||
| 207 | |||
| 208 | u32 scale_rating = 0; | 197 | u32 scale_rating = 0; |
| 209 | bool rescaled = false; | 198 | bool rescaled = false; |
| 210 | std::array<ImageId, NUM_RT> tmp_color_images{}; | 199 | std::array<ImageId, NUM_RT> tmp_color_images{}; |
| @@ -281,8 +270,6 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) { | |||
| 281 | scale_rating = 1; | 270 | scale_rating = 1; |
| 282 | } | 271 | } |
| 283 | } while (has_deleted_images); | 272 | } while (has_deleted_images); |
| 284 | // Rescale End | ||
| 285 | |||
| 286 | const auto set_rating = [this, scale_rating](ImageId image_id) { | 273 | const auto set_rating = [this, scale_rating](ImageId image_id) { |
| 287 | if (image_id != CORRUPT_ID) { | 274 | if (image_id != CORRUPT_ID) { |
| 288 | Image& image = slot_images[image_id]; | 275 | Image& image = slot_images[image_id]; |
| @@ -297,6 +284,24 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) { | |||
| 297 | } | 284 | } |
| 298 | set_rating(tmp_depth_image); | 285 | set_rating(tmp_depth_image); |
| 299 | 286 | ||
| 287 | return rescaled; | ||
| 288 | } | ||
| 289 | |||
| 290 | template <class P> | ||
| 291 | void TextureCache<P>::UpdateRenderTargets(bool is_clear) { | ||
| 292 | using namespace VideoCommon::Dirty; | ||
| 293 | auto& flags = maxwell3d.dirty.flags; | ||
| 294 | if (!flags[Dirty::RenderTargets]) { | ||
| 295 | for (size_t index = 0; index < NUM_RT; ++index) { | ||
| 296 | ImageViewId& color_buffer_id = render_targets.color_buffer_ids[index]; | ||
| 297 | PrepareImageView(color_buffer_id, true, is_clear && IsFullClear(color_buffer_id)); | ||
| 298 | } | ||
| 299 | const ImageViewId depth_buffer_id = render_targets.depth_buffer_id; | ||
| 300 | PrepareImageView(depth_buffer_id, true, is_clear && IsFullClear(depth_buffer_id)); | ||
| 301 | return; | ||
| 302 | } | ||
| 303 | |||
| 304 | const bool rescaled = RescaleRenderTargets(is_clear); | ||
| 300 | if (is_rescaling != rescaled) { | 305 | if (is_rescaling != rescaled) { |
| 301 | flags[Dirty::RescaleViewports] = true; | 306 | flags[Dirty::RescaleViewports] = true; |
| 302 | flags[Dirty::RescaleScissors] = true; | 307 | flags[Dirty::RescaleScissors] = true; |
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index eea589269..643ad811c 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h | |||
| @@ -119,6 +119,11 @@ public: | |||
| 119 | /// Refresh the state for compute image view and sampler descriptors | 119 | /// Refresh the state for compute image view and sampler descriptors |
| 120 | void SynchronizeComputeDescriptors(); | 120 | void SynchronizeComputeDescriptors(); |
| 121 | 121 | ||
| 122 | /// Updates the Render Targets if they can be rescaled | ||
| 123 | /// @param is_clear True when the render targets are being used for clears | ||
| 124 | /// @retval True if the Render Targets have been rescaled. | ||
| 125 | bool RescaleRenderTargets(bool is_clear); | ||
| 126 | |||
| 122 | /// Update bound render targets and upload memory if necessary | 127 | /// Update bound render targets and upload memory if necessary |
| 123 | /// @param is_clear True when the render targets are being used for clears | 128 | /// @param is_clear True when the render targets are being used for clears |
| 124 | void UpdateRenderTargets(bool is_clear); | 129 | void UpdateRenderTargets(bool is_clear); |