mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 10:04:39 +00:00
renderer_vulkan: Emulate B5G6R5 with swizzle
This commit is contained in:
parent
5eccb1734d
commit
dc1f740860
@ -248,6 +248,15 @@ constexpr CompMapping RemapSwizzle(const DataFormat format, const CompMapping sw
|
||||
result.a = swizzle.r;
|
||||
return result;
|
||||
}
|
||||
case DataFormat::Format5_6_5: {
|
||||
// Remap to a more supported component order.
|
||||
CompMapping result;
|
||||
result.r = swizzle.b;
|
||||
result.g = swizzle.g;
|
||||
result.b = swizzle.r;
|
||||
result.a = swizzle.a;
|
||||
return result;
|
||||
}
|
||||
default:
|
||||
return swizzle;
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ std::span<const SurfaceFormatInfo> SurfaceFormats() {
|
||||
vk::Format::eR32G32B32A32Sfloat),
|
||||
// 5_6_5
|
||||
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format5_6_5, AmdGpu::NumberFormat::Unorm,
|
||||
vk::Format::eB5G6R5UnormPack16),
|
||||
vk::Format::eR5G6B5UnormPack16),
|
||||
// 1_5_5_5
|
||||
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format1_5_5_5, AmdGpu::NumberFormat::Unorm,
|
||||
vk::Format::eA1R5G5B5UnormPack16),
|
||||
|
@ -70,7 +70,6 @@ std::unordered_map<vk::Format, vk::FormatProperties3> GetFormatProperties(
|
||||
vk::Format::eB8G8R8A8Unorm,
|
||||
vk::Format::eB8G8R8A8Srgb,
|
||||
vk::Format::eD24UnormS8Uint,
|
||||
vk::Format::eR5G6B5UnormPack16,
|
||||
};
|
||||
for (const auto& format : misc_formats) {
|
||||
if (!format_properties.contains(format)) {
|
||||
@ -676,11 +675,6 @@ vk::Format Instance::GetSupportedFormat(const vk::Format format,
|
||||
return vk::Format::eR8Unorm;
|
||||
}
|
||||
break;
|
||||
case vk::Format::eB5G6R5UnormPack16:
|
||||
if (IsFormatSupported(vk::Format::eR5G6B5UnormPack16, flags)) {
|
||||
return vk::Format::eR5G6B5UnormPack16;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -626,7 +626,7 @@ void TextureCache::RefreshImage(Image& image, Vulkan::Scheduler* custom_schedule
|
||||
image_copy.push_back({
|
||||
.bufferOffset = mip.offset,
|
||||
.bufferRowLength = mip_pitch,
|
||||
.bufferImageHeight = mip_height,
|
||||
.bufferImageHeight = mip_height ? std::max(mip_height, 8U) : mip_height,
|
||||
.imageSubresource{
|
||||
.aspectMask = image.aspect_mask & ~vk::ImageAspectFlagBits::eStencil,
|
||||
.mipLevel = m,
|
||||
|
Loading…
Reference in New Issue
Block a user