diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-05-25 11:57:57 +0200 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-05-25 14:21:03 +0200 |
commit | 0ffef9cb8da7682b42f595c683d7ef9cb22dabd7 (patch) | |
tree | 3bf51b51cc03cc246ed73d52a3a17a4f1c62bec5 /src/gui/rhi/qrhivulkan.cpp | |
parent | ecca816ea1d2b98a500cc621ff1bd5e34771f7af (diff) |
RHI: Introduce QRhiTexture::RG8
Change-Id: I58f35b2629bd6464f08cba66e852215472fcbe2a
Fixes: QTBUG-84384
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhivulkan.cpp')
-rw-r--r-- | src/gui/rhi/qrhivulkan.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index 1591829cac..164d596d74 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -791,6 +791,8 @@ static inline VkFormat toVkTextureFormat(QRhiTexture::Format format, QRhiTexture return srgb ? VK_FORMAT_B8G8R8A8_SRGB : VK_FORMAT_B8G8R8A8_UNORM; case QRhiTexture::R8: return srgb ? VK_FORMAT_R8_SRGB : VK_FORMAT_R8_UNORM; + case QRhiTexture::RG8: + return srgb ? VK_FORMAT_R8G8_SRGB : VK_FORMAT_R8G8_UNORM; case QRhiTexture::R16: return VK_FORMAT_R16_UNORM; case QRhiTexture::RED_OR_ALPHA8: @@ -884,10 +886,16 @@ static inline QRhiTexture::Format colorTextureFormatFromVkFormat(VkFormat format return QRhiTexture::BGRA8; case VK_FORMAT_R8_UNORM: return QRhiTexture::R8; + case VK_FORMAT_R8G8_UNORM: + return QRhiTexture::RG8; case VK_FORMAT_R8_SRGB: if (flags) (*flags) |= QRhiTexture::sRGB; return QRhiTexture::R8; + case VK_FORMAT_R8G8_SRGB: + if (flags) + (*flags) |= QRhiTexture::sRGB; + return QRhiTexture::RG8; case VK_FORMAT_R16_UNORM: return QRhiTexture::R16; default: // this cannot assert, must warn and return unknown |