summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/rhi/qrhid3d11.cpp6
-rw-r--r--src/gui/rhi/qrhivulkan.cpp14
2 files changed, 17 insertions, 3 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index 8336d43ff6..05ee415502 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -1707,7 +1707,8 @@ void QRhiD3D11::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resource
if (srcTexD) {
cmd.args.resolveSubRes.src = srcTexD->tex;
if (srcTexD->dxgiFormat != dstTexD->dxgiFormat) {
- qWarning("Resolve source and destination formats do not match");
+ qWarning("Resolve source (%d) and destination (%d) formats do not match",
+ int(srcTexD->dxgiFormat), int(dstTexD->dxgiFormat));
continue;
}
if (srcTexD->sampleDesc.Count <= 1) {
@@ -1721,7 +1722,8 @@ void QRhiD3D11::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resource
} else {
cmd.args.resolveSubRes.src = srcRbD->tex;
if (srcRbD->dxgiFormat != dstTexD->dxgiFormat) {
- qWarning("Resolve source and destination formats do not match");
+ qWarning("Resolve source (%d) and destination (%d) formats do not match",
+ int(srcRbD->dxgiFormat), int(dstTexD->dxgiFormat));
continue;
}
if (srcRbD->m_pixelSize != dstTexD->m_pixelSize) {
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
index 16de7e0aea..b46b0b819c 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -1219,12 +1219,24 @@ bool QRhiVulkan::createOffscreenRenderPass(QVkRenderPassDescriptor *rpD,
for (auto it = firstColorAttachment; it != lastColorAttachment; ++it) {
if (it->resolveTexture()) {
QVkTexture *rtexD = QRHI_RES(QVkTexture, it->resolveTexture());
+ const VkFormat dstFormat = rtexD->vkformat;
if (rtexD->samples > VK_SAMPLE_COUNT_1_BIT)
qWarning("Resolving into a multisample texture is not supported");
+ QVkTexture *texD = QRHI_RES(QVkTexture, it->texture());
+ QVkRenderBuffer *rbD = QRHI_RES(QVkRenderBuffer, it->renderBuffer());
+ const VkFormat srcFormat = texD ? texD->vkformat : rbD->vkformat;
+ if (srcFormat != dstFormat) {
+ // This is a validation error. But some implementations survive,
+ // actually. Warn about it however, because it's an error with
+ // some other backends (like D3D) as well.
+ qWarning("Multisample resolve between different formats (%d and %d) is not supported.",
+ int(srcFormat), int(dstFormat));
+ }
+
VkAttachmentDescription attDesc;
memset(&attDesc, 0, sizeof(attDesc));
- attDesc.format = rtexD->vkformat;
+ attDesc.format = dstFormat;
attDesc.samples = VK_SAMPLE_COUNT_1_BIT;
attDesc.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; // ignored
attDesc.storeOp = VK_ATTACHMENT_STORE_OP_STORE;