فهرست منبع

texture_cache: Add image getters

ReinUsesLisp 5 سال پیش
والد
کامیت
74efa57c1b
2فایلهای تغییر یافته به همراه16 افزوده شده و 0 حذف شده
  1. 10 0
      src/video_core/texture_cache/texture_cache.h
  2. 6 0
      src/video_core/texture_cache/texture_cache_base.h

+ 10 - 0
src/video_core/texture_cache/texture_cache.h

@@ -119,6 +119,16 @@ typename P::ImageView& TextureCache<P>::GetImageView(ImageViewId id) noexcept {
     return slot_image_views[id];
     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>
 template <class P>
 void TextureCache<P>::MarkModification(ImageId id) noexcept {
 void TextureCache<P>::MarkModification(ImageId id) noexcept {
     MarkModification(slot_images[id]);
     MarkModification(slot_images[id]);

+ 6 - 0
src/video_core/texture_cache/texture_cache_base.h

@@ -95,6 +95,12 @@ public:
     /// Return a reference to the given image view id
     /// Return a reference to the given image view id
     [[nodiscard]] ImageView& GetImageView(ImageViewId id) noexcept;
     [[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
     /// Mark an image as modified from the GPU
     void MarkModification(ImageId id) noexcept;
     void MarkModification(ImageId id) noexcept;