From 3ef7a760ff5ae61e4297ec2f271408ac453ca93d Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 20 Apr 2020 13:00:39 +0200 Subject: rhi: Take mip size into account for render target size Also extend autotesting, both for rendering into a given mip level and for rendering into a given cubemap face. Change-Id: Ida94b71150477ceb50a3b5616d8b7be13174558b Reviewed-by: Andy Nichols --- src/gui/rhi/qrhid3d11.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui/rhi/qrhid3d11.cpp') diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index 0665304a19..c3c40b4cc4 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -470,6 +470,8 @@ bool QRhiD3D11::isFeatureSupported(QRhi::Feature feature) const return true; case QRhi::TexelFetch: return true; + case QRhi::RenderToNonBaseMipLevel: + return true; default: Q_UNREACHABLE(); return false; @@ -3243,7 +3245,7 @@ bool QD3D11TextureRenderTarget::build() } ownsRtv[attIndex] = true; if (attIndex == 0) { - d.pixelSize = texD->pixelSize(); + d.pixelSize = rhiD->q->sizeForMipLevel(colorAtt.level(), texD->pixelSize()); d.sampleCount = int(texD->sampleDesc.Count); } } else if (rb) { -- cgit v1.2.3