diff --git a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp index 12093c3c44..02853b078a 100644 --- a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp @@ -186,8 +186,7 @@ void ComputePipeline::Configure() { for (u32 index = 0; index < desc.count; ++index) { ImageView& image_view{texture_cache.GetImageView((views_it++)->id)}; textures[texture_binding] = image_view.Handle(desc.type); - if (True(texture_cache.GetImage(image_view.image_id).flags & - VideoCommon::ImageFlagBits::Rescaled)) { + if (texture_cache.IsRescaling(image_view)) { scaling_mask |= 1u << texture_binding; } ++texture_binding; diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp index 01aa2897a2..c3d549a6e1 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp @@ -472,8 +472,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { for (u32 index = 0; index < desc.count; ++index) { ImageView& image_view{texture_cache.GetImageView((views_it++)->id)}; textures[texture_binding] = image_view.Handle(desc.type); - if (True(texture_cache.GetImage(image_view.image_id).flags & - VideoCommon::ImageFlagBits::Rescaled)) { + if (texture_cache.IsRescaling(image_view)) { scaling_mask |= 1u << stage_texture_binding; } ++texture_binding; diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index bf18b34d1a..bce4220c63 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h @@ -168,10 +168,9 @@ inline void PushImageDescriptors(TextureCache& texture_cache, const VideoCommon::ImageViewId image_view_id{(views++)->id}; const VkSampler sampler{*(samplers++)}; ImageView& image_view{texture_cache.GetImageView(image_view_id)}; - const Image& image{texture_cache.GetImage(image_view.image_id)}; const VkImageView vk_image_view{image_view.Handle(desc.type)}; update_descriptor_queue.AddSampledImage(vk_image_view, sampler); - rescaling.PushTexture(True(image.flags & VideoCommon::ImageFlagBits::Rescaled)); + rescaling.PushTexture(texture_cache.IsRescaling(image_view)); } } for (const auto& desc : info.image_descriptors) { diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 4dbded6355..0e70c4db24 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -119,16 +119,6 @@ typename P::ImageView& TextureCache
::GetImageView(ImageViewId id) noexcept {
return slot_image_views[id];
}
-template ::GetImage(ImageId id) const noexcept {
- return slot_images[id];
-}
-
-template ::GetImage(ImageId id) noexcept {
- return slot_images[id];
-}
-
template ::MarkModification(ImageId id) noexcept {
MarkModification(slot_images[id]);
@@ -634,6 +624,12 @@ bool TextureCache ::IsRescaling() const noexcept {
return is_rescaling;
}
+template ::IsRescaling(const ImageViewBase& image_view) const noexcept {
+ const ImageBase& image = slot_images[image_view.image_id];
+ return True(image.flags & ImageFlagBits::Rescaled);
+}
+
template ::IsRegionGpuModified(VAddr addr, size_t size) {
bool is_modified = false;
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h
index b6cc096820..8b417b611a 100644
--- a/src/video_core/texture_cache/texture_cache_base.h
+++ b/src/video_core/texture_cache/texture_cache_base.h
@@ -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;