mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d: Set VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT only for typeless formats.
This commit is contained in:
parent
26edc3c545
commit
dc081f6f9e
@ -116,8 +116,9 @@ static HRESULT vkd3d_create_image(struct d3d12_resource *resource, struct d3d12_
|
||||
|
||||
image_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
||||
image_info.pNext = NULL;
|
||||
/* FIXME: Use mutable formats only for typeless formats. */
|
||||
image_info.flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||
image_info.flags = 0;
|
||||
if (dxgi_format_is_typeless(desc->Format))
|
||||
image_info.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||
if (desc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D && desc->Width == desc->Height)
|
||||
image_info.flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
|
||||
|
||||
|
@ -86,6 +86,38 @@ VkFormat vkd3d_get_vk_format(DXGI_FORMAT format)
|
||||
return vkd3d_format->vk_format;
|
||||
}
|
||||
|
||||
bool dxgi_format_is_typeless(DXGI_FORMAT dxgi_format)
|
||||
{
|
||||
switch (dxgi_format)
|
||||
{
|
||||
case DXGI_FORMAT_R32G32B32A32_TYPELESS:
|
||||
case DXGI_FORMAT_R32G32B32_TYPELESS:
|
||||
case DXGI_FORMAT_R16G16B16A16_TYPELESS:
|
||||
case DXGI_FORMAT_R32G32_TYPELESS:
|
||||
case DXGI_FORMAT_R32G8X24_TYPELESS:
|
||||
case DXGI_FORMAT_R10G10B10A2_TYPELESS:
|
||||
case DXGI_FORMAT_R8G8B8A8_TYPELESS:
|
||||
case DXGI_FORMAT_R16G16_TYPELESS:
|
||||
case DXGI_FORMAT_R32_TYPELESS:
|
||||
case DXGI_FORMAT_R24G8_TYPELESS:
|
||||
case DXGI_FORMAT_R8G8_TYPELESS:
|
||||
case DXGI_FORMAT_R16_TYPELESS:
|
||||
case DXGI_FORMAT_R8_TYPELESS:
|
||||
case DXGI_FORMAT_BC1_TYPELESS:
|
||||
case DXGI_FORMAT_BC2_TYPELESS:
|
||||
case DXGI_FORMAT_BC3_TYPELESS:
|
||||
case DXGI_FORMAT_BC4_TYPELESS:
|
||||
case DXGI_FORMAT_BC5_TYPELESS:
|
||||
case DXGI_FORMAT_B8G8R8A8_TYPELESS:
|
||||
case DXGI_FORMAT_B8G8R8X8_TYPELESS:
|
||||
case DXGI_FORMAT_BC6H_TYPELESS:
|
||||
case DXGI_FORMAT_BC7_TYPELESS:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool is_valid_feature_level(D3D_FEATURE_LEVEL feature_level)
|
||||
{
|
||||
static const D3D_FEATURE_LEVEL valid_feature_levels[] =
|
||||
|
@ -545,6 +545,8 @@ static inline bool vkd3d_format_is_compressed(const struct vkd3d_format *format)
|
||||
|
||||
const struct vkd3d_format *vkd3d_get_format(DXGI_FORMAT dxgi_format) DECLSPEC_HIDDEN;
|
||||
|
||||
bool dxgi_format_is_typeless(DXGI_FORMAT dxgi_format) DECLSPEC_HIDDEN;
|
||||
|
||||
enum VkCompareOp vk_compare_op_from_d3d12(D3D12_COMPARISON_FUNC op) DECLSPEC_HIDDEN;
|
||||
|
||||
bool is_valid_feature_level(D3D_FEATURE_LEVEL feature_level) DECLSPEC_HIDDEN;
|
||||
|
Loading…
Reference in New Issue
Block a user