texture_cache: Add getter to query if image view is rescaled

This commit is contained in:
ReinUsesLisp 2021-07-31 17:42:37 -03:00 committed by Fernando Sahmkow
parent 526e47f148
commit c7a1cbad44
5 changed files with 12 additions and 22 deletions

View file

@ -119,16 +119,6 @@ typename P::ImageView& TextureCache<P>::GetImageView(ImageViewId id) noexcept {
return slot_image_views[id];
}
template <class P>
const typename P::Image& TextureCache<P>::GetImage(ImageId id) const noexcept {
return slot_images[id];
}
template <class P>
typename P::Image& TextureCache<P>::GetImage(ImageId id) noexcept {
return slot_images[id];
}
template <class P>
void TextureCache<P>::MarkModification(ImageId id) noexcept {
MarkModification(slot_images[id]);
@ -634,6 +624,12 @@ bool TextureCache<P>::IsRescaling() const noexcept {
return is_rescaling;
}
template <class P>
bool TextureCache<P>::IsRescaling(const ImageViewBase& image_view) const noexcept {
const ImageBase& image = slot_images[image_view.image_id];
return True(image.flags & ImageFlagBits::Rescaled);
}
template <class P>
bool TextureCache<P>::IsRegionGpuModified(VAddr addr, size_t size) {
bool is_modified = false;

View file

@ -21,6 +21,7 @@
#include "video_core/texture_cache/descriptor_table.h"
#include "video_core/texture_cache/image_base.h"
#include "video_core/texture_cache/image_info.h"
#include "video_core/texture_cache/image_view_base.h"
#include "video_core/texture_cache/image_view_info.h"
#include "video_core/texture_cache/render_targets.h"
#include "video_core/texture_cache/slot_vector.h"
@ -100,12 +101,6 @@ public:
/// Return a reference to the given image view id
[[nodiscard]] ImageView& GetImageView(ImageViewId id) noexcept;
/// Return a constant reference to the given image id
[[nodiscard]] const Image& GetImage(ImageId id) const noexcept;
/// Return a reference to the given image id
[[nodiscard]] Image& GetImage(ImageId id) noexcept;
/// Mark an image as modified from the GPU
void MarkModification(ImageId id) noexcept;
@ -181,6 +176,8 @@ public:
[[nodiscard]] bool IsRescaling() const noexcept;
[[nodiscard]] bool IsRescaling(const ImageViewBase& image_view) const noexcept;
[[nodiscard]] bool BlackListImage(ImageId image_id);
std::mutex mutex;