yuzu-emu
/
yuzu
Archived
1
0
Fork 0

video_core: Only apply AF to 2D (array) image types

This commit is contained in:
Wollnashorn 2023-06-17 14:20:44 +02:00
parent c309a1c69b
commit 3e47ebe2e9
1 changed files with 7 additions and 2 deletions

View File

@ -46,6 +46,12 @@ ImageViewBase::ImageViewBase(const ImageInfo& info, const ImageViewInfo& view_in
ImageViewBase::ImageViewBase(const NullImageViewParams&) : image_id{NULL_IMAGE_ID} {}
bool ImageViewBase::SupportsAnisotropy() const noexcept {
const bool has_mips = range.extent.levels > 1;
const bool is_2d = type == ImageViewType::e2D || type == ImageViewType::e2DArray;
if (!has_mips || !is_2d) {
return false;
}
switch (format) {
case PixelFormat::R8_UNORM:
case PixelFormat::R8_SNORM:
@ -87,9 +93,8 @@ bool ImageViewBase::SupportsAnisotropy() const noexcept {
case PixelFormat::D32_FLOAT_S8_UINT:
return false;
default:
break;
return true;
}
return range.extent.levels > 1;
}
} // namespace VideoCommon