diff options
author | Wollnashorn <Wollnashorn@users.noreply.github.com> | 2023-06-15 18:19:32 +0200 |
---|---|---|
committer | Wollnashorn <Wollnashorn@users.noreply.github.com> | 2023-06-15 18:19:32 +0200 |
commit | 42c944b250d8d5c8147b24b3a453cba29968d46c (patch) | |
tree | 6d156e8247219bf373edd848bd3a89bbd32eb546 /src/video_core/texture_cache | |
parent | video_core: Apply AF only to samplers with normal LOD range [0, 1+x] (diff) | |
download | yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.gz yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.bz2 yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.lz yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.xz yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.tar.zst yuzu-42c944b250d8d5c8147b24b3a453cba29968d46c.zip |
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r-- | src/video_core/texture_cache/image_view_base.cpp | 39 | ||||
-rw-r--r-- | src/video_core/texture_cache/image_view_base.h | 2 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/image_view_base.cpp b/src/video_core/texture_cache/image_view_base.cpp index d134b6738..26fa6d63e 100644 --- a/src/video_core/texture_cache/image_view_base.cpp +++ b/src/video_core/texture_cache/image_view_base.cpp @@ -45,4 +45,43 @@ ImageViewBase::ImageViewBase(const ImageInfo& info, const ImageViewInfo& view_in ImageViewBase::ImageViewBase(const NullImageViewParams&) : image_id{NULL_IMAGE_ID} {} +bool ImageViewBase::SupportsAnisotropy() const noexcept { + using namespace VideoCommon; + switch (format) { + case PixelFormat::R8_UNORM: + case PixelFormat::R8_SNORM: + case PixelFormat::R8_SINT: + case PixelFormat::R8_UINT: + case PixelFormat::BC4_UNORM: + case PixelFormat::BC4_SNORM: + case PixelFormat::BC5_UNORM: + case PixelFormat::BC5_SNORM: + case PixelFormat::R32G32_FLOAT: + case PixelFormat::R32G32_SINT: + case PixelFormat::R32_FLOAT: + case PixelFormat::R16_FLOAT: + case PixelFormat::R16_UNORM: + case PixelFormat::R16_SNORM: + case PixelFormat::R16_UINT: + case PixelFormat::R16_SINT: + case PixelFormat::R16G16_UNORM: + case PixelFormat::R16G16_FLOAT: + case PixelFormat::R16G16_UINT: + case PixelFormat::R16G16_SINT: + case PixelFormat::R16G16_SNORM: + case PixelFormat::R8G8_UNORM: + case PixelFormat::R8G8_SNORM: + case PixelFormat::R8G8_SINT: + case PixelFormat::R8G8_UINT: + case PixelFormat::R32G32_UINT: + case PixelFormat::R32_UINT: + case PixelFormat::R32_SINT: + case PixelFormat::G4R4_UNORM: + return false; + default: + break; + } + return range.extent.levels > 1; +} + } // namespace VideoCommon diff --git a/src/video_core/texture_cache/image_view_base.h b/src/video_core/texture_cache/image_view_base.h index a25ae1d4a..87549ffff 100644 --- a/src/video_core/texture_cache/image_view_base.h +++ b/src/video_core/texture_cache/image_view_base.h @@ -33,6 +33,8 @@ struct ImageViewBase { return type == ImageViewType::Buffer; } + [[nodiscard]] bool SupportsAnisotropy() const noexcept; + ImageId image_id{}; GPUVAddr gpu_addr = 0; PixelFormat format{}; |