diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-04-09 06:45:39 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:26 +0200 |
commit | 7cb2ab358517d95ebcd35c94c72b9e91762906c3 (patch) | |
tree | 3f75959e255026665a4dde406cb8c4cc34fb45a0 /src/video_core/renderer_vulkan/vk_texture_cache.h | |
parent | shader: Fix Windows build issues (diff) | |
download | yuzu-7cb2ab358517d95ebcd35c94c72b9e91762906c3.tar yuzu-7cb2ab358517d95ebcd35c94c72b9e91762906c3.tar.gz yuzu-7cb2ab358517d95ebcd35c94c72b9e91762906c3.tar.bz2 yuzu-7cb2ab358517d95ebcd35c94c72b9e91762906c3.tar.lz yuzu-7cb2ab358517d95ebcd35c94c72b9e91762906c3.tar.xz yuzu-7cb2ab358517d95ebcd35c94c72b9e91762906c3.tar.zst yuzu-7cb2ab358517d95ebcd35c94c72b9e91762906c3.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_texture_cache.h')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 498e76a1c..0b73d55f8 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -7,6 +7,7 @@ #include <compare> #include <span> +#include "shader_recompiler/shader_info.h" #include "video_core/renderer_vulkan/vk_staging_buffer_pool.h" #include "video_core/texture_cache/texture_cache.h" #include "video_core/vulkan_common/vulkan_memory_allocator.h" @@ -133,8 +134,11 @@ public: [[nodiscard]] VkImageView StencilView(); - [[nodiscard]] VkImageView Handle(VideoCommon::ImageViewType query_type) const noexcept { - return *image_views[static_cast<size_t>(query_type)]; + [[nodiscard]] VkImageView StorageView(Shader::TextureType texture_type, + Shader::ImageFormat image_format); + + [[nodiscard]] VkImageView Handle(Shader::TextureType texture_type) const noexcept { + return *image_views[static_cast<size_t>(texture_type)]; } [[nodiscard]] VkImage ImageHandle() const noexcept { @@ -145,10 +149,6 @@ public: return render_target; } - [[nodiscard]] PixelFormat ImageFormat() const noexcept { - return image_format; - } - [[nodiscard]] VkSampleCountFlagBits Samples() const noexcept { return samples; } @@ -162,15 +162,20 @@ public: } private: - [[nodiscard]] vk::ImageView MakeDepthStencilView(VkImageAspectFlags aspect_mask); + struct StorageViews { + std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> signeds; + std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> unsigneds; + }; + + [[nodiscard]] vk::ImageView MakeView(VkFormat vk_format, VkImageAspectFlags aspect_mask); const Device* device = nullptr; - std::array<vk::ImageView, VideoCommon::NUM_IMAGE_VIEW_TYPES> image_views; + std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> image_views; + std::unique_ptr<StorageViews> storage_views; vk::ImageView depth_view; vk::ImageView stencil_view; VkImage image_handle = VK_NULL_HANDLE; VkImageView render_target = VK_NULL_HANDLE; - PixelFormat image_format = PixelFormat::Invalid; VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT; GPUVAddr gpu_addr = 0; u32 buffer_size = 0; |