diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-11-25 16:17:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-25 16:17:00 +0100 |
commit | 2993d3bb4955c222cfba3a4b210c89010aee3198 (patch) | |
tree | e369c7e2c943bf614cbfd72b0f62d32a85d4cd21 /src/video_core | |
parent | Merge pull request #11889 from t895/ini-lib (diff) | |
parent | vk_texture_cache: add workaround for nullDescriptor on Mali (diff) | |
download | yuzu-2993d3bb4955c222cfba3a4b210c89010aee3198.tar yuzu-2993d3bb4955c222cfba3a4b210c89010aee3198.tar.gz yuzu-2993d3bb4955c222cfba3a4b210c89010aee3198.tar.bz2 yuzu-2993d3bb4955c222cfba3a4b210c89010aee3198.tar.lz yuzu-2993d3bb4955c222cfba3a4b210c89010aee3198.tar.xz yuzu-2993d3bb4955c222cfba3a4b210c89010aee3198.tar.zst yuzu-2993d3bb4955c222cfba3a4b210c89010aee3198.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 18 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.h | 1 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index de34f6d49..5dbec2e62 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1785,8 +1785,22 @@ ImageView::ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, : VideoCommon::ImageViewBase{info, view_info, gpu_addr_}, buffer_size{VideoCommon::CalculateGuestSizeInBytes(info)} {} -ImageView::ImageView(TextureCacheRuntime&, const VideoCommon::NullImageViewParams& params) - : VideoCommon::ImageViewBase{params} {} +ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::NullImageViewParams& params) + : VideoCommon::ImageViewBase{params}, device{&runtime.device} { + if (device->HasNullDescriptor()) { + return; + } + + // Handle fallback for devices without nullDescriptor + ImageInfo info{}; + info.format = PixelFormat::A8B8G8R8_UNORM; + + null_image = MakeImage(*device, runtime.memory_allocator, info, {}); + image_handle = *null_image; + for (u32 i = 0; i < Shader::NUM_TEXTURE_TYPES; i++) { + image_views[i] = MakeView(VK_FORMAT_A8B8G8R8_UNORM_PACK32, VK_IMAGE_ASPECT_COLOR_BIT); + } +} ImageView::~ImageView() = default; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 7a0807709..edf5d7635 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -267,6 +267,7 @@ private: vk::ImageView depth_view; vk::ImageView stencil_view; vk::ImageView color_view; + vk::Image null_image; VkImage image_handle = VK_NULL_HANDLE; VkImageView render_target = VK_NULL_HANDLE; VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT; |