mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Pass image format list to the driver
Allows drivers to enable DCC in some situations.
This commit is contained in:
parent
c1334e7601
commit
9b78738d2c
@ -8,10 +8,24 @@ namespace dxvk {
|
|||||||
DxvkMemoryAllocator& memAlloc,
|
DxvkMemoryAllocator& memAlloc,
|
||||||
VkMemoryPropertyFlags memFlags)
|
VkMemoryPropertyFlags memFlags)
|
||||||
: m_vkd(vkd), m_info(createInfo), m_memFlags(memFlags) {
|
: m_vkd(vkd), m_info(createInfo), m_memFlags(memFlags) {
|
||||||
|
|
||||||
|
// Copy the compatible view formats to a persistent array
|
||||||
|
m_viewFormats.resize(createInfo.viewFormatCount);
|
||||||
|
for (uint32_t i = 0; i < createInfo.viewFormatCount; i++)
|
||||||
|
m_viewFormats[i] = createInfo.viewFormats[i];
|
||||||
|
m_info.viewFormats = m_viewFormats.data();
|
||||||
|
|
||||||
|
// If defined, we should provide a format list, which
|
||||||
|
// allows some drivers to enable image compression
|
||||||
|
VkImageFormatListCreateInfoKHR formatList;
|
||||||
|
formatList.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR;
|
||||||
|
formatList.pNext = nullptr;
|
||||||
|
formatList.viewFormatCount = createInfo.viewFormatCount;
|
||||||
|
formatList.pViewFormats = createInfo.viewFormats;
|
||||||
|
|
||||||
VkImageCreateInfo info;
|
VkImageCreateInfo info;
|
||||||
info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
||||||
info.pNext = nullptr;
|
info.pNext = &formatList;
|
||||||
info.flags = createInfo.flags;
|
info.flags = createInfo.flags;
|
||||||
info.imageType = createInfo.type;
|
info.imageType = createInfo.type;
|
||||||
info.format = createInfo.format;
|
info.format = createInfo.format;
|
||||||
|
@ -50,6 +50,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
/// Common image layout
|
/// Common image layout
|
||||||
VkImageLayout layout;
|
VkImageLayout layout;
|
||||||
|
|
||||||
|
// Image view formats that can
|
||||||
|
// be used with this image
|
||||||
|
uint32_t viewFormatCount = 0;
|
||||||
|
const VkFormat* viewFormats = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -240,6 +245,8 @@ namespace dxvk {
|
|||||||
VkMemoryPropertyFlags m_memFlags;
|
VkMemoryPropertyFlags m_memFlags;
|
||||||
DxvkMemory m_memory;
|
DxvkMemory m_memory;
|
||||||
VkImage m_image = VK_NULL_HANDLE;
|
VkImage m_image = VK_NULL_HANDLE;
|
||||||
|
|
||||||
|
std::vector<VkFormat> m_viewFormats;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user