diff --git a/src/xrt/auxiliary/d3d/d3d_dxgi_formats.h b/src/xrt/auxiliary/d3d/d3d_dxgi_formats.h index 2d87b27d9..dd4498fb3 100644 --- a/src/xrt/auxiliary/d3d/d3d_dxgi_formats.h +++ b/src/xrt/auxiliary/d3d/d3d_dxgi_formats.h @@ -35,6 +35,7 @@ d3d_vk_format_to_dxgi(int64_t format) case VK_FORMAT_R16G16B16A16_UNORM: return DXGI_FORMAT_R16G16B16A16_UNORM; case VK_FORMAT_R8G8B8A8_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; case VK_FORMAT_R8G8B8A8_UNORM: return DXGI_FORMAT_R8G8B8A8_UNORM; // Should not be used, colour precision. + case VK_FORMAT_R32_SFLOAT: return DXGI_FORMAT_R32_FLOAT; case VK_FORMAT_X8_D24_UNORM_PACK32: /// @todo DXGI_FORMAT_D24_UNORM_S8_UINT ? return (DXGI_FORMAT)0; @@ -73,6 +74,9 @@ d3d_dxgi_format_to_typeless_dxgi(DXGI_FORMAT format) case DXGI_FORMAT_R8G8B8A8_UNORM: // return DXGI_FORMAT_R8G8B8A8_TYPELESS; + case DXGI_FORMAT_R32_FLOAT: // + return DXGI_FORMAT_R32_TYPELESS; + default: return format; } } @@ -88,6 +92,7 @@ d3d_dxgi_format_to_vk(DXGI_FORMAT format) case DXGI_FORMAT_R16G16B16A16_FLOAT: return VK_FORMAT_R16G16B16A16_SFLOAT; case DXGI_FORMAT_R16G16B16A16_UNORM: return VK_FORMAT_R16G16B16A16_UNORM; case DXGI_FORMAT_R16G16B16A16_SNORM: return VK_FORMAT_R16G16B16A16_SNORM; + case DXGI_FORMAT_R32_FLOAT: return VK_FORMAT_R32_SFLOAT; case DXGI_FORMAT_D16_UNORM: return VK_FORMAT_D16_UNORM; case DXGI_FORMAT_D32_FLOAT: return VK_FORMAT_D32_SFLOAT; case DXGI_FORMAT_D24_UNORM_S8_UINT: return VK_FORMAT_D24_UNORM_S8_UINT; diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index b36d07256..31c039f29 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -1163,6 +1163,7 @@ vk_cb_get_buffer_external_handle_type(struct vk_bundle *vk); THING_COLOR(R8G8B8_UNORM) /* OGL VK - Uncommon. Bad color precision. */ \ THING_COLOR(B8G8R8_UNORM) /* VK - Uncommon. Bad color precision. */ \ THING_COLOR(R5G6B5_UNORM_PACK16) /* OLG VK - Bad color precision. */ \ + THING_COLOR(R32_SFLOAT) /* OGL VK */ \ /* depth formats */ \ THING_D(D32_SFLOAT) /* OGL VK */ \ THING_D(D16_UNORM) /* OGL VK */ \ diff --git a/tests/aux_d3d_dxgi_formats.hpp b/tests/aux_d3d_dxgi_formats.hpp index e632690be..591174d89 100644 --- a/tests/aux_d3d_dxgi_formats.hpp +++ b/tests/aux_d3d_dxgi_formats.hpp @@ -14,9 +14,9 @@ static constexpr std::initializer_list colorFormats = { - DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_R16G16B16A16_FLOAT, - DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_UNORM, - DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_R16G16B16A16_FLOAT, + DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R32_FLOAT }; static constexpr std::initializer_list depthStencilFormats = { @@ -26,10 +26,11 @@ static constexpr std::initializer_list depthStencilFormats = { DXGI_FORMAT_D32_FLOAT, }; static constexpr std::initializer_list formats = { - DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_R16G16B16A16_FLOAT, - DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_UNORM, - DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_D16_UNORM, - DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_D32_FLOAT_S8X24_UINT, DXGI_FORMAT_D32_FLOAT, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_R16G16B16A16_FLOAT, + DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R32_FLOAT, + DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_D32_FLOAT_S8X24_UINT, + DXGI_FORMAT_D32_FLOAT, }; static inline bool