Browse Source

Fixed errors again

pull/3737/head
Forrest Mark X 2 weeks ago
committed by crueter
parent
commit
1f28f0e705
  1. 54
      src/video_core/renderer_vulkan/vk_texture_cache.cpp

54
src/video_core/renderer_vulkan/vk_texture_cache.cpp

@ -933,6 +933,33 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const
0, nullptr, nullptr, write_barriers); 0, nullptr, nullptr, write_barriers);
}); });
} }
[[nodiscard]] bool ByteWidthSupported(u32 bpp, const Device& device) {
switch (bpp) {
case 1:
return device.IsStorageBuffer8BitAccessSupported();
case 2:
return device.IsStorageBuffer16BitAccessSupported();
case 4:
case 8:
case 16:
return true;
default:
return false;
}
}
[[nodiscard]] boost::container::small_vector<VkFormat, 8> BuildViewFormats(
const ImageInfo& info, std::span<const VkFormat> base_view_formats) {
boost::container::small_vector<VkFormat, 8> formats(base_view_formats.begin(),
base_view_formats.end());
if (Settings::values.gpu_unswizzle_enabled.GetValue()) {
if (const auto block_view_format = BlockTexelViewFormat(info.format)) {
formats.push_back(*block_view_format);
}
}
return formats;
}
} // Anonymous namespace } // Anonymous namespace
TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& scheduler_, TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& scheduler_,
@ -986,21 +1013,6 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched
} }
} }
[[nodiscard]] bool ByteWidthSupported(u32 bpp, const Device& device) {
switch (bpp) {
case 1:
return device.IsStorageBuffer8BitAccessSupported();
case 2:
return device.IsStorageBuffer16BitAccessSupported();
case 4:
case 8:
case 16:
return true;
default:
return false;
}
}
bool TextureCacheRuntime::IsUnswizzleStorageFormatSupported(PixelFormat format) const { bool TextureCacheRuntime::IsUnswizzleStorageFormatSupported(PixelFormat format) const {
const u32 bytes_per_block = VideoCore::Surface::BytesPerBlock(format); const u32 bytes_per_block = VideoCore::Surface::BytesPerBlock(format);
if (!ByteWidthSupported(bytes_per_block, device)) { if (!ByteWidthSupported(bytes_per_block, device)) {
@ -1880,18 +1892,6 @@ void TextureCacheRuntime::ReleaseSparseUnswizzleBuffer(Image& image) {
}); });
} }
[[nodiscard]] boost::container::small_vector<VkFormat, 8> BuildViewFormats(
const ImageInfo& info, std::span<const VkFormat> base_view_formats) {
boost::container::small_vector<VkFormat, 8> formats(base_view_formats.begin(),
base_view_formats.end());
if (Settings::values.gpu_unswizzle_enabled.GetValue()) {
if (const auto block_view_format = BlockTexelViewFormat(info.format)) {
formats.push_back(*block_view_format);
}
}
return formats;
}
Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu_addr_, Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu_addr_,
VAddr cpu_addr_) VAddr cpu_addr_)
: VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), scheduler{&runtime_.scheduler}, : VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), scheduler{&runtime_.scheduler},

Loading…
Cancel
Save