mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
demos: Do not force sRGB formats for Vulkan swapchains.
Fixes the following validation error: IMAGE(ERROR): object: 0x0 type: 0 location: 3302 msgCode: 180357110: vkCreateImageView() format VK_FORMAT_B8G8R8A8_UNORM differs from image 6 format VK_FORMAT_B8G8R8A8_SRGB. Formats MUST be IDENTICAL unless VK_IMAGE_CREATE_MUTABLE_FORMAT BIT was set on image creation. The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be identical to the format used to create image' Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
dd461ca6b8
commit
fd36cefbe2
@ -304,17 +304,6 @@ static inline void demo_set_idle_func(struct demo *demo,
|
|||||||
demo->idle_func = idle_func;
|
demo->idle_func = idle_func;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline DXGI_FORMAT demo_get_srgb_format(DXGI_FORMAT format)
|
|
||||||
{
|
|
||||||
switch (format)
|
|
||||||
{
|
|
||||||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
|
||||||
return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
|
|
||||||
default:
|
|
||||||
return DXGI_FORMAT_UNKNOWN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct demo_swapchain *demo_swapchain_create(ID3D12CommandQueue *command_queue,
|
static inline struct demo_swapchain *demo_swapchain_create(ID3D12CommandQueue *command_queue,
|
||||||
struct demo_window *window, const struct demo_swapchain_desc *desc)
|
struct demo_window *window, const struct demo_swapchain_desc *desc)
|
||||||
{
|
{
|
||||||
@ -338,7 +327,7 @@ static inline struct demo_swapchain *demo_swapchain_create(ID3D12CommandQueue *c
|
|||||||
VkImage *vk_images;
|
VkImage *vk_images;
|
||||||
VkFormat format;
|
VkFormat format;
|
||||||
|
|
||||||
if ((format = vkd3d_get_vk_format(demo_get_srgb_format(desc->format))) == VK_FORMAT_UNDEFINED)
|
if ((format = vkd3d_get_vk_format(desc->format)) == VK_FORMAT_UNDEFINED)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (FAILED(ID3D12CommandQueue_GetDevice(command_queue, &IID_ID3D12Device, (void **)&d3d12_device)))
|
if (FAILED(ID3D12CommandQueue_GetDevice(command_queue, &IID_ID3D12Device, (void **)&d3d12_device)))
|
||||||
|
Loading…
Reference in New Issue
Block a user