1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 11:52:12 +01:00

[d3d9] Fix view formats for conversion formats

This commit is contained in:
Joshua Ashton 2020-02-24 06:38:26 +00:00
parent 1e426cdb08
commit b67f4974be
2 changed files with 7 additions and 4 deletions

View File

@ -193,8 +193,8 @@ namespace dxvk {
Rc<DxvkImage> D3D9CommonTexture::CreatePrimaryImage(D3DRESOURCETYPE ResourceType, bool TryOffscreenRT) const {
DxvkImageCreateInfo imageInfo;
imageInfo.type = GetImageTypeFromResourceType(ResourceType);
imageInfo.format = m_mapping.ConversionFormatInfo.VulkanFormat != VK_FORMAT_UNDEFINED
? m_mapping.ConversionFormatInfo.VulkanFormat
imageInfo.format = m_mapping.ConversionFormatInfo.FormatColor != VK_FORMAT_UNDEFINED
? m_mapping.ConversionFormatInfo.FormatColor
: m_mapping.FormatColor;
imageInfo.flags = 0;
imageInfo.sampleCount = VK_SAMPLE_COUNT_1_BIT;
@ -427,7 +427,9 @@ namespace dxvk {
VkImageUsageFlags UsageFlags,
bool Srgb) {
DxvkImageViewCreateInfo viewInfo;
viewInfo.format = PickSRGB(m_mapping.FormatColor, m_mapping.FormatSrgb, Srgb);
viewInfo.format = m_mapping.ConversionFormatInfo.FormatColor != VK_FORMAT_UNDEFINED
? PickSRGB(m_mapping.ConversionFormatInfo.FormatColor, m_mapping.ConversionFormatInfo.FormatSrgb, Srgb)
: PickSRGB(m_mapping.FormatColor, m_mapping.FormatSrgb, Srgb);
viewInfo.aspect = imageFormatInfo(viewInfo.format)->aspectMask;
viewInfo.swizzle = m_mapping.Swizzle;
viewInfo.usage = UsageFlags;

View File

@ -137,7 +137,8 @@ namespace dxvk {
struct D3D9_CONVERSION_FORMAT_INFO {
D3D9ConversionFormat FormatType = D3D9ConversionFormat_None;
VkExtent2D MacroPixelSize = { 1u, 1u };
VkFormat VulkanFormat = VK_FORMAT_UNDEFINED;
VkFormat FormatColor = VK_FORMAT_UNDEFINED;
VkFormat FormatSrgb = VK_FORMAT_UNDEFINED;
};
/**