mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-04 01:29:26 +01:00
[dxvk] Add color space property to image description
This commit is contained in:
parent
ad11509e83
commit
ff41a5ab12
@ -1517,7 +1517,12 @@ namespace dxvk {
|
|||||||
// If everything matches already, no need to do anything. Only ensure
|
// If everything matches already, no need to do anything. Only ensure
|
||||||
// that the stable adress bit is respected if set for the first time.
|
// that the stable adress bit is respected if set for the first time.
|
||||||
if (isUsageAndFormatCompatible && isAccessAndLayoutCompatible) {
|
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);
|
image->assignStorageWithUsage(image->storage(), usageInfo);
|
||||||
m_common->memoryManager().lockResourceGpuAddress(image->storage());
|
m_common->memoryManager().lockResourceGpuAddress(image->storage());
|
||||||
}
|
}
|
||||||
|
@ -226,6 +226,9 @@ namespace dxvk {
|
|||||||
if (usageInfo.layout != VK_IMAGE_LAYOUT_UNDEFINED)
|
if (usageInfo.layout != VK_IMAGE_LAYOUT_UNDEFINED)
|
||||||
m_info.layout = usageInfo.layout;
|
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++) {
|
for (uint32_t i = 0; i < usageInfo.viewFormatCount; i++) {
|
||||||
if (!isViewCompatible(usageInfo.viewFormats[i]))
|
if (!isViewCompatible(usageInfo.viewFormats[i]))
|
||||||
m_viewFormats.push_back(usageInfo.viewFormats[i]);
|
m_viewFormats.push_back(usageInfo.viewFormats[i]);
|
||||||
|
@ -55,6 +55,10 @@ namespace dxvk {
|
|||||||
// Initial image layout
|
// Initial image layout
|
||||||
VkImageLayout initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
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
|
// Image is used by multiple contexts so it needs
|
||||||
// to be in its default layout after each submission
|
// to be in its default layout after each submission
|
||||||
VkBool32 shared = VK_FALSE;
|
VkBool32 shared = VK_FALSE;
|
||||||
@ -89,6 +93,8 @@ namespace dxvk {
|
|||||||
// New image layout. If undefined, the
|
// New image layout. If undefined, the
|
||||||
// default layout will not be changed.
|
// default layout will not be changed.
|
||||||
VkImageLayout layout = VK_IMAGE_LAYOUT_UNDEFINED;
|
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
|
// Number of new view formats to add
|
||||||
uint32_t viewFormatCount = 0u;
|
uint32_t viewFormatCount = 0u;
|
||||||
// View formats to add to the compatibility list
|
// View formats to add to the compatibility list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user