From fd7b2535a2d713d0b1aade84d1e8d89a150cc3f6 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Tue, 2 Aug 2022 01:20:30 +0200 Subject: [PATCH] early-access version 2883 --- README.md | 2 +- src/video_core/renderer_opengl/gl_texture_cache.cpp | 5 +++-- src/video_core/renderer_opengl/gl_texture_cache.h | 5 ++--- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 11 ++++++++++- src/video_core/renderer_vulkan/vk_texture_cache.h | 2 +- src/video_core/texture_cache/texture_cache.h | 8 ++++---- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fbb6047a8..1027651cd 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2882. +This is the source code for early-access 2883. ## Legal Notice diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 8c0fffc67..59c328cbc 100755 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -737,7 +737,8 @@ Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_, } } -Image::Image(const VideoCommon::NullImageParams& params) : VideoCommon::ImageBase{params} {} +Image::Image(TextureCacheRuntime&, const VideoCommon::NullImageParams& params) + : VideoCommon::ImageBase{params} {} Image::~Image() = default; @@ -1078,7 +1079,7 @@ bool Image::ScaleDown(bool ignore) { } ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewInfo& info, - ImageId image_id_, Image& image, const SlotVector&) + ImageId image_id_, Image& image) : VideoCommon::ImageViewBase{info, image.info, image_id_}, views{runtime.null_image_views} { const Device& device = runtime.device; if (True(image.flags & ImageFlagBits::Converted)) { diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 113528e9b..55db2d5a0 100755 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -189,7 +189,7 @@ class Image : public VideoCommon::ImageBase { public: explicit Image(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, GPUVAddr gpu_addr, VAddr cpu_addr); - explicit Image(const VideoCommon::NullImageParams&); + explicit Image(TextureCacheRuntime&, const VideoCommon::NullImageParams&); ~Image(); @@ -244,8 +244,7 @@ class ImageView : public VideoCommon::ImageViewBase { friend Image; public: - explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageViewInfo&, ImageId, Image&, - const SlotVector&); + explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageViewInfo&, ImageId, Image&); explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo&, const VideoCommon::ImageViewInfo&, GPUVAddr); explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 152c79e8a..71de9a91c 100755 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1287,7 +1287,16 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu } } -Image::Image(const VideoCommon::NullImageParams& params) : VideoCommon::ImageBase{params} {} +Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::NullImageParams& params) + : VideoCommon::ImageBase(params), scheduler{&runtime_.scheduler}, runtime{&runtime_}, + original_image{MakeImage(runtime_.device, info)}, + commit(runtime_.memory_allocator.Commit(original_image, MemoryUsage::DeviceLocal)), + aspect_mask{ImageAspectMask(info.format)} { + if (runtime->device.HasDebuggingToolAttached()) { + original_image.SetObjectNameEXT("NullImage"); + } + current_image = *original_image; +} Image::~Image() = default; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 0b7ac0df1..320a053f3 100755 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -110,7 +110,7 @@ class Image : public VideoCommon::ImageBase { public: explicit Image(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, GPUVAddr gpu_addr, VAddr cpu_addr); - explicit Image(const VideoCommon::NullImageParams&); + explicit Image(TextureCacheRuntime&, const VideoCommon::NullImageParams&); ~Image(); diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index c85869dd0..9d4b7c411 100755 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -41,8 +41,9 @@ TextureCache

::TextureCache(Runtime& runtime_, VideoCore::RasterizerInterface& // Make sure the first index is reserved for the null resources // This way the null resource becomes a compile time constant - void(slot_images.insert(NullImageParams{})); - void(slot_image_views.insert(runtime, NullImageViewParams{})); + void(slot_images.insert(runtime, NullImageParams{})); + void(slot_image_views.insert(runtime, ImageViewInfo{}, NULL_IMAGE_ID, + slot_images[NULL_IMAGE_ID])); void(slot_samplers.insert(runtime, sampler_descriptor)); if constexpr (HAS_DEVICE_MEMORY_INFO) { @@ -1443,8 +1444,7 @@ ImageViewId TextureCache

::FindOrEmplaceImageView(ImageId image_id, const Imag if (const ImageViewId image_view_id = image.FindView(info); image_view_id) { return image_view_id; } - const ImageViewId image_view_id = - slot_image_views.insert(runtime, info, image_id, image, slot_images); + const ImageViewId image_view_id = slot_image_views.insert(runtime, info, image_id, image); image.InsertView(info, image_view_id); return image_view_id; }