mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 01:53:37 +00:00
winevulkan: Enable VK_EXT_hdr_metadata.
This works fine with the new struct conversions, and is needed for HDR with native Vulkan games such as Doom Eternal and games using HDR with DXVK and VKD3D-Proton.
This commit is contained in:
parent
aa70bdb5d6
commit
90416a48af
|
@ -5431,6 +5431,18 @@ VkResult WINAPI vkSetEvent(VkDevice device, VkEvent event)
|
|||
return params.result;
|
||||
}
|
||||
|
||||
void WINAPI vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, const VkHdrMetadataEXT *pMetadata)
|
||||
{
|
||||
struct vkSetHdrMetadataEXT_params params;
|
||||
NTSTATUS status;
|
||||
params.device = device;
|
||||
params.swapchainCount = swapchainCount;
|
||||
params.pSwapchains = pSwapchains;
|
||||
params.pMetadata = pMetadata;
|
||||
status = UNIX_CALL(vkSetHdrMetadataEXT, ¶ms);
|
||||
assert(!status);
|
||||
}
|
||||
|
||||
VkResult WINAPI vkSetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data)
|
||||
{
|
||||
struct vkSetPrivateData_params params;
|
||||
|
@ -6100,6 +6112,7 @@ static const struct vulkan_func vk_device_dispatch_table[] =
|
|||
{"vkSetDebugUtilsObjectTagEXT", vkSetDebugUtilsObjectTagEXT},
|
||||
{"vkSetDeviceMemoryPriorityEXT", vkSetDeviceMemoryPriorityEXT},
|
||||
{"vkSetEvent", vkSetEvent},
|
||||
{"vkSetHdrMetadataEXT", vkSetHdrMetadataEXT},
|
||||
{"vkSetPrivateData", vkSetPrivateData},
|
||||
{"vkSetPrivateDataEXT", vkSetPrivateDataEXT},
|
||||
{"vkSignalSemaphore", vkSignalSemaphore},
|
||||
|
|
|
@ -526,6 +526,7 @@ enum unix_call
|
|||
unix_vkSetDebugUtilsObjectTagEXT,
|
||||
unix_vkSetDeviceMemoryPriorityEXT,
|
||||
unix_vkSetEvent,
|
||||
unix_vkSetHdrMetadataEXT,
|
||||
unix_vkSetPrivateData,
|
||||
unix_vkSetPrivateDataEXT,
|
||||
unix_vkSignalSemaphore,
|
||||
|
@ -4511,6 +4512,14 @@ struct vkSetEvent_params
|
|||
VkResult result;
|
||||
};
|
||||
|
||||
struct vkSetHdrMetadataEXT_params
|
||||
{
|
||||
VkDevice device;
|
||||
uint32_t swapchainCount;
|
||||
const VkSwapchainKHR *pSwapchains;
|
||||
const VkHdrMetadataEXT *pMetadata;
|
||||
};
|
||||
|
||||
struct vkSetPrivateData_params
|
||||
{
|
||||
VkDevice device;
|
||||
|
|
|
@ -97,7 +97,6 @@ UNSUPPORTED_EXTENSIONS = [
|
|||
# Device extensions
|
||||
"VK_AMD_display_native_hdr",
|
||||
"VK_EXT_full_screen_exclusive",
|
||||
"VK_EXT_hdr_metadata", # Needs WSI work.
|
||||
"VK_GOOGLE_display_timing",
|
||||
"VK_KHR_external_fence_win32",
|
||||
"VK_KHR_external_semaphore_win32",
|
||||
|
|
|
@ -6033,6 +6033,20 @@ typedef struct VkDebugUtilsObjectTagInfoEXT32
|
|||
PTR32 pTag;
|
||||
} VkDebugUtilsObjectTagInfoEXT32;
|
||||
|
||||
typedef struct VkHdrMetadataEXT32
|
||||
{
|
||||
VkStructureType sType;
|
||||
PTR32 pNext;
|
||||
VkXYColorEXT displayPrimaryRed;
|
||||
VkXYColorEXT displayPrimaryGreen;
|
||||
VkXYColorEXT displayPrimaryBlue;
|
||||
VkXYColorEXT whitePoint;
|
||||
float maxLuminance;
|
||||
float minLuminance;
|
||||
float maxContentLightLevel;
|
||||
float maxFrameAverageLightLevel;
|
||||
} VkHdrMetadataEXT32;
|
||||
|
||||
typedef struct VkSemaphoreSignalInfo32
|
||||
{
|
||||
VkStructureType sType;
|
||||
|
@ -25208,6 +25222,40 @@ static inline void convert_VkDebugUtilsObjectTagInfoEXT_win32_to_host(const VkDe
|
|||
FIXME("Unexpected pNext\n");
|
||||
}
|
||||
|
||||
static inline void convert_VkHdrMetadataEXT_win32_to_host(const VkHdrMetadataEXT32 *in, VkHdrMetadataEXT *out)
|
||||
{
|
||||
if (!in) return;
|
||||
|
||||
out->sType = in->sType;
|
||||
out->pNext = NULL;
|
||||
out->displayPrimaryRed = in->displayPrimaryRed;
|
||||
out->displayPrimaryGreen = in->displayPrimaryGreen;
|
||||
out->displayPrimaryBlue = in->displayPrimaryBlue;
|
||||
out->whitePoint = in->whitePoint;
|
||||
out->maxLuminance = in->maxLuminance;
|
||||
out->minLuminance = in->minLuminance;
|
||||
out->maxContentLightLevel = in->maxContentLightLevel;
|
||||
out->maxFrameAverageLightLevel = in->maxFrameAverageLightLevel;
|
||||
if (in->pNext)
|
||||
FIXME("Unexpected pNext\n");
|
||||
}
|
||||
|
||||
static inline const VkHdrMetadataEXT *convert_VkHdrMetadataEXT_array_win32_to_host(struct conversion_context *ctx, const VkHdrMetadataEXT32 *in, uint32_t count)
|
||||
{
|
||||
VkHdrMetadataEXT *out;
|
||||
unsigned int i;
|
||||
|
||||
if (!in || !count) return NULL;
|
||||
|
||||
out = conversion_context_alloc(ctx, count * sizeof(*out));
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
convert_VkHdrMetadataEXT_win32_to_host(&in[i], &out[i]);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
static inline void convert_VkSemaphoreSignalInfo_win32_to_host(const VkSemaphoreSignalInfo32 *in, VkSemaphoreSignalInfo *out)
|
||||
{
|
||||
if (!in) return;
|
||||
|
@ -39446,6 +39494,39 @@ static NTSTATUS thunk32_vkSetEvent(void *args)
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
static NTSTATUS thunk64_vkSetHdrMetadataEXT(void *args)
|
||||
{
|
||||
struct vkSetHdrMetadataEXT_params *params = args;
|
||||
|
||||
TRACE("%p, %u, %p, %p\n", params->device, params->swapchainCount, params->pSwapchains, params->pMetadata);
|
||||
|
||||
wine_device_from_handle(params->device)->funcs.p_vkSetHdrMetadataEXT(wine_device_from_handle(params->device)->device, params->swapchainCount, params->pSwapchains, params->pMetadata);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* _WIN64 */
|
||||
|
||||
static NTSTATUS thunk32_vkSetHdrMetadataEXT(void *args)
|
||||
{
|
||||
struct
|
||||
{
|
||||
PTR32 device;
|
||||
uint32_t swapchainCount;
|
||||
PTR32 pSwapchains;
|
||||
PTR32 pMetadata;
|
||||
} *params = args;
|
||||
const VkHdrMetadataEXT *pMetadata_host;
|
||||
struct conversion_context ctx;
|
||||
|
||||
TRACE("%#x, %u, %#x, %#x\n", params->device, params->swapchainCount, params->pSwapchains, params->pMetadata);
|
||||
|
||||
init_conversion_context(&ctx);
|
||||
pMetadata_host = convert_VkHdrMetadataEXT_array_win32_to_host(&ctx, (const VkHdrMetadataEXT32 *)UlongToPtr(params->pMetadata), params->swapchainCount);
|
||||
wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetHdrMetadataEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->swapchainCount, (const VkSwapchainKHR *)UlongToPtr(params->pSwapchains), pMetadata_host);
|
||||
free_conversion_context(&ctx);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
static NTSTATUS thunk64_vkSetPrivateData(void *args)
|
||||
{
|
||||
|
@ -40027,6 +40108,7 @@ static const char * const vk_device_extensions[] =
|
|||
"VK_EXT_global_priority",
|
||||
"VK_EXT_global_priority_query",
|
||||
"VK_EXT_graphics_pipeline_library",
|
||||
"VK_EXT_hdr_metadata",
|
||||
"VK_EXT_host_query_reset",
|
||||
"VK_EXT_image_2d_view_of_3d",
|
||||
"VK_EXT_image_compression_control",
|
||||
|
@ -40783,6 +40865,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
thunk64_vkSetDebugUtilsObjectTagEXT,
|
||||
thunk64_vkSetDeviceMemoryPriorityEXT,
|
||||
thunk64_vkSetEvent,
|
||||
thunk64_vkSetHdrMetadataEXT,
|
||||
thunk64_vkSetPrivateData,
|
||||
thunk64_vkSetPrivateDataEXT,
|
||||
thunk64_vkSignalSemaphore,
|
||||
|
@ -41324,6 +41407,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
thunk32_vkSetDebugUtilsObjectTagEXT,
|
||||
thunk32_vkSetDeviceMemoryPriorityEXT,
|
||||
thunk32_vkSetEvent,
|
||||
thunk32_vkSetHdrMetadataEXT,
|
||||
thunk32_vkSetPrivateData,
|
||||
thunk32_vkSetPrivateDataEXT,
|
||||
thunk32_vkSignalSemaphore,
|
||||
|
|
|
@ -507,6 +507,7 @@ struct vulkan_device_funcs
|
|||
VkResult (*p_vkSetDebugUtilsObjectTagEXT)(VkDevice, const VkDebugUtilsObjectTagInfoEXT *);
|
||||
void (*p_vkSetDeviceMemoryPriorityEXT)(VkDevice, VkDeviceMemory, float);
|
||||
VkResult (*p_vkSetEvent)(VkDevice, VkEvent);
|
||||
void (*p_vkSetHdrMetadataEXT)(VkDevice, uint32_t, const VkSwapchainKHR *, const VkHdrMetadataEXT *);
|
||||
VkResult (*p_vkSetPrivateData)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t);
|
||||
VkResult (*p_vkSetPrivateDataEXT)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t);
|
||||
VkResult (*p_vkSignalSemaphore)(VkDevice, const VkSemaphoreSignalInfo *);
|
||||
|
@ -1032,6 +1033,7 @@ struct vulkan_instance_funcs
|
|||
USE_VK_FUNC(vkSetDebugUtilsObjectTagEXT) \
|
||||
USE_VK_FUNC(vkSetDeviceMemoryPriorityEXT) \
|
||||
USE_VK_FUNC(vkSetEvent) \
|
||||
USE_VK_FUNC(vkSetHdrMetadataEXT) \
|
||||
USE_VK_FUNC(vkSetPrivateData) \
|
||||
USE_VK_FUNC(vkSetPrivateDataEXT) \
|
||||
USE_VK_FUNC(vkSignalSemaphore) \
|
||||
|
|
|
@ -186,6 +186,8 @@
|
|||
#define VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME "VK_EXT_depth_clip_enable"
|
||||
#define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 4
|
||||
#define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace"
|
||||
#define VK_EXT_HDR_METADATA_SPEC_VERSION 2
|
||||
#define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata"
|
||||
#define VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION 1
|
||||
#define VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME "VK_KHR_imageless_framebuffer"
|
||||
#define VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION 1
|
||||
|
@ -3879,6 +3881,7 @@ typedef enum VkStructureType
|
|||
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = 1000101001,
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000,
|
||||
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001,
|
||||
VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000,
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES = 1000108000,
|
||||
VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO = 1000108001,
|
||||
VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO = 1000108002,
|
||||
|
@ -10553,6 +10556,12 @@ typedef struct VkWriteDescriptorSetInlineUniformBlock
|
|||
} VkWriteDescriptorSetInlineUniformBlock;
|
||||
typedef VkWriteDescriptorSetInlineUniformBlock VkWriteDescriptorSetInlineUniformBlockEXT;
|
||||
|
||||
typedef struct VkXYColorEXT
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
} VkXYColorEXT;
|
||||
|
||||
typedef struct VkAccelerationStructureGeometryAabbsDataKHR
|
||||
{
|
||||
VkStructureType sType;
|
||||
|
@ -10941,6 +10950,20 @@ typedef struct VkGeometryNV
|
|||
VkGeometryFlagsKHR flags;
|
||||
} VkGeometryNV;
|
||||
|
||||
typedef struct VkHdrMetadataEXT
|
||||
{
|
||||
VkStructureType sType;
|
||||
const void *pNext;
|
||||
VkXYColorEXT displayPrimaryRed;
|
||||
VkXYColorEXT displayPrimaryGreen;
|
||||
VkXYColorEXT displayPrimaryBlue;
|
||||
VkXYColorEXT whitePoint;
|
||||
float maxLuminance;
|
||||
float minLuminance;
|
||||
float maxContentLightLevel;
|
||||
float maxFrameAverageLightLevel;
|
||||
} VkHdrMetadataEXT;
|
||||
|
||||
typedef struct VkImageBlit
|
||||
{
|
||||
VkImageSubresourceLayers srcSubresource;
|
||||
|
@ -12079,6 +12102,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectNameEXT)(VkDevice, const V
|
|||
typedef VkResult (VKAPI_PTR *PFN_vkSetDebugUtilsObjectTagEXT)(VkDevice, const VkDebugUtilsObjectTagInfoEXT *);
|
||||
typedef void (VKAPI_PTR *PFN_vkSetDeviceMemoryPriorityEXT)(VkDevice, VkDeviceMemory, float);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetEvent)(VkDevice, VkEvent);
|
||||
typedef void (VKAPI_PTR *PFN_vkSetHdrMetadataEXT)(VkDevice, uint32_t, const VkSwapchainKHR *, const VkHdrMetadataEXT *);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateData)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateDataEXT)(VkDevice, VkObjectType, uint64_t, VkPrivateDataSlot, uint64_t);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSignalSemaphore)(VkDevice, const VkSemaphoreSignalInfo *);
|
||||
|
@ -12613,6 +12637,7 @@ VkResult VKAPI_CALL vkSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugU
|
|||
VkResult VKAPI_CALL vkSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo);
|
||||
void VKAPI_CALL vkSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority);
|
||||
VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event);
|
||||
void VKAPI_CALL vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, const VkHdrMetadataEXT *pMetadata);
|
||||
VkResult VKAPI_CALL vkSetPrivateData(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data);
|
||||
VkResult VKAPI_CALL vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data);
|
||||
VkResult VKAPI_CALL vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo *pSignalInfo);
|
||||
|
|
Loading…
Reference in a new issue