diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-16 22:23:10 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-16 22:23:10 +0100 |
commit | f09cd52980724068a37fb99b1edd50e99d4d8703 (patch) | |
tree | 49c1c69b277803704fd275dd0b45917be9b84290 /src/video_core/renderer_vulkan | |
parent | vk_texture_cache: Fix typo in commentary (diff) | |
download | yuzu-f09cd52980724068a37fb99b1edd50e99d4d8703.tar yuzu-f09cd52980724068a37fb99b1edd50e99d4d8703.tar.gz yuzu-f09cd52980724068a37fb99b1edd50e99d4d8703.tar.bz2 yuzu-f09cd52980724068a37fb99b1edd50e99d4d8703.tar.lz yuzu-f09cd52980724068a37fb99b1edd50e99d4d8703.tar.xz yuzu-f09cd52980724068a37fb99b1edd50e99d4d8703.tar.zst yuzu-f09cd52980724068a37fb99b1edd50e99d4d8703.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 17 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.h | 13 |
2 files changed, 8 insertions, 22 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 24defeee9..51b0d38a6 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -242,10 +242,8 @@ View CachedSurface::CreateView(const ViewParams& params) { } View CachedSurface::CreateViewInner(const ViewParams& params, bool is_proxy) { - auto view = std::make_shared<CachedSurfaceView>(device, *this, params, is_proxy); - views[params] = view; // TODO(Rodrigo): Add name decorations - return view; + return views[params] = std::make_shared<CachedSurfaceView>(device, *this, params, is_proxy); } void CachedSurface::UploadBuffer(const std::vector<u8>& staging_buffer) { @@ -320,11 +318,8 @@ CachedSurfaceView::CachedSurfaceView(const VKDevice& device, CachedSurface& surf image{surface.GetImageHandle()}, buffer_view{surface.GetBufferViewHandle()}, aspect_mask{surface.GetAspectMask()}, device{device}, surface{surface}, base_layer{params.base_layer}, num_layers{params.num_layers}, base_level{params.base_level}, - num_levels{params.num_levels} { - if (image) { - image_view_type = GetImageViewType(params.target); - } -} + num_levels{params.num_levels}, image_view_type{image ? GetImageViewType(params.target) + : vk::ImageViewType{}} {} CachedSurfaceView::~CachedSurfaceView() = default; @@ -388,11 +383,6 @@ vk::ImageView CachedSurfaceView::GetHandle(SwizzleSource x_source, SwizzleSource return last_image_view = *image_view; } -bool CachedSurfaceView::IsOverlapping(const View& rhs) const { - // TODO(Rodrigo): Also test for layer and mip level overlaps. - return &surface == &rhs->surface; -} - VKTextureCache::VKTextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer, const VKDevice& device, VKResourceManager& resource_manager, VKMemoryManager& memory_manager, VKScheduler& scheduler, @@ -479,6 +469,7 @@ void VKTextureCache::ImageBlit(View& src_view, View& dst_view, void VKTextureCache::BufferCopy(Surface& src_surface, Surface& dst_surface) { // Currently unimplemented. PBO copies should be dropped and we should use a render pass to // convert from color to depth and viceversa. + LOG_WARNING(Render_Vulkan, "Unimplemented"); } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 4bc330c9f..d3edbe80c 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -5,15 +5,10 @@ #pragma once #include <memory> -#include <tuple> #include <unordered_map> -#include <boost/functional/hash.hpp> -#include <boost/icl/interval_map.hpp> - #include "common/assert.h" #include "common/common_types.h" -#include "common/hash.h" #include "common/logging/log.h" #include "common/math_util.h" #include "video_core/gpu.h" @@ -22,11 +17,9 @@ #include "video_core/renderer_vulkan/vk_image.h" #include "video_core/renderer_vulkan/vk_memory_manager.h" #include "video_core/renderer_vulkan/vk_scheduler.h" -#include "video_core/surface.h" #include "video_core/texture_cache/surface_base.h" #include "video_core/texture_cache/texture_cache.h" #include "video_core/textures/decoders.h" -#include "video_core/textures/texture.h" namespace Core { class System; @@ -141,7 +134,9 @@ public: Tegra::Texture::SwizzleSource z_source, Tegra::Texture::SwizzleSource w_source); - bool IsOverlapping(const View& rhs) const; + bool IsSameSurface(const CachedSurfaceView& rhs) const { + return &surface == &rhs.surface; + } vk::ImageView GetHandle() { return GetHandle(Tegra::Texture::SwizzleSource::R, Tegra::Texture::SwizzleSource::G, @@ -207,7 +202,7 @@ private: const u32 num_layers; const u32 base_level; const u32 num_levels; - vk::ImageViewType image_view_type{}; + const vk::ImageViewType image_view_type; vk::ImageView last_image_view; u32 last_swizzle{}; |