1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-03 16:29:15 +01:00

[dxvk] Add color space property to image description

This commit is contained in:
Philip Rebohle 2025-01-13 00:01:03 +01:00 committed by Philip Rebohle
parent ad11509e83
commit ff41a5ab12
3 changed files with 15 additions and 1 deletions

View File

@ -1517,7 +1517,12 @@ namespace dxvk {
// If everything matches already, no need to do anything. Only ensure
// that the stable adress bit is respected if set for the first time.
if (isUsageAndFormatCompatible && isAccessAndLayoutCompatible) {
if (usageInfo.stableGpuAddress && image->canRelocate()) {
bool needsUpdate = (usageInfo.stableGpuAddress && image->canRelocate());
if (usageInfo.colorSpace != VK_COLOR_SPACE_MAX_ENUM_KHR)
needsUpdate |= (usageInfo.colorSpace != image->info().colorSpace);
if (needsUpdate) {
image->assignStorageWithUsage(image->storage(), usageInfo);
m_common->memoryManager().lockResourceGpuAddress(image->storage());
}

View File

@ -226,6 +226,9 @@ namespace dxvk {
if (usageInfo.layout != VK_IMAGE_LAYOUT_UNDEFINED)
m_info.layout = usageInfo.layout;
if (usageInfo.colorSpace != VK_COLOR_SPACE_MAX_ENUM_KHR)
m_info.colorSpace = usageInfo.colorSpace;
for (uint32_t i = 0; i < usageInfo.viewFormatCount; i++) {
if (!isViewCompatible(usageInfo.viewFormats[i]))
m_viewFormats.push_back(usageInfo.viewFormats[i]);

View File

@ -55,6 +55,10 @@ namespace dxvk {
// Initial image layout
VkImageLayout initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
// Color space to interpret image data with. This
// is only meaningful for swap chain back buffers.
VkColorSpaceKHR colorSpace = VK_COLOR_SPACE_MAX_ENUM_KHR;
// Image is used by multiple contexts so it needs
// to be in its default layout after each submission
VkBool32 shared = VK_FALSE;
@ -89,6 +93,8 @@ namespace dxvk {
// New image layout. If undefined, the
// default layout will not be changed.
VkImageLayout layout = VK_IMAGE_LAYOUT_UNDEFINED;
// Color space to interpret the image in
VkColorSpaceKHR colorSpace = VK_COLOR_SPACE_MAX_ENUM_KHR;
// Number of new view formats to add
uint32_t viewFormatCount = 0u;
// View formats to add to the compatibility list