1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 01:54:16 +01:00

[d3d9] Support unsupported formats in LockRect

This commit is contained in:
Georg Lehmann 2021-08-22 22:33:40 +02:00 committed by Joshie
parent 82d40f5bba
commit ed70f9a07c
2 changed files with 6 additions and 2 deletions

View File

@ -4102,7 +4102,11 @@ namespace dxvk {
const Rc<DxvkBuffer> mappedBuffer = pResource->GetBuffer(Subresource);
auto formatInfo = imageFormatInfo(pResource->GetFormatMapping().FormatColor);
auto& formatMapping = pResource->GetFormatMapping();
const DxvkFormatInfo* formatInfo = formatMapping.IsValid()
? imageFormatInfo(formatMapping.FormatColor) : UnsupportedFormatInfo(pResource->Desc()->Format);
auto subresource = pResource->GetSubresourceFromIndex(
formatInfo->aspectMask, Subresource);

View File

@ -165,7 +165,7 @@ namespace dxvk {
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY };
D3D9_CONVERSION_FORMAT_INFO ConversionFormatInfo = { };
bool IsValid() { return FormatColor != VK_FORMAT_UNDEFINED; }
bool IsValid() const { return FormatColor != VK_FORMAT_UNDEFINED; }
};
D3D9_VK_FORMAT_MAPPING ConvertFormatUnfixed(D3D9Format Format);