summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-09-23 15:40:06 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-09-25 09:24:25 +0200
commit60871b4fdf1ec977498ec4baa1d33c0972ac434f (patch)
tree0ade7fd3236119cf8e9698f1958a5665339e2704 /tests/manual
parent342a8f29ea542ff8b65453888a7cc9644dbe66cc (diff)
rhi: vulkan: Fix mipmap generation for cubemaps
Change-Id: Ia1aab06214be802aaabc97ffefa28947e11148e3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/rhi/cubemap/cubemap.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/manual/rhi/cubemap/cubemap.cpp b/tests/manual/rhi/cubemap/cubemap.cpp
index 6004c39ea9..7949d2ecfc 100644
--- a/tests/manual/rhi/cubemap/cubemap.cpp
+++ b/tests/manual/rhi/cubemap/cubemap.cpp
@@ -73,7 +73,8 @@ void Window::customInit()
d.releasePool << d.ubuf;
const QSize cubeMapSize(512, 512);
- d.tex = m_r->newTexture(QRhiTexture::RGBA8, cubeMapSize, 1, QRhiTexture::CubeMap);
+ d.tex = m_r->newTexture(QRhiTexture::RGBA8, cubeMapSize, 1, QRhiTexture::CubeMap
+ | QRhiTexture::MipMapped | QRhiTexture::UsedWithGenerateMips); // exercise mipmap generation as well
d.releasePool << d.tex;
d.tex->create();
@@ -93,6 +94,8 @@ void Window::customInit()
});
d.initialUpdates->uploadTexture(d.tex, desc);
+ d.initialUpdates->generateMips(d.tex);
+
d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
QRhiSampler::Repeat, QRhiSampler::Repeat);
d.releasePool << d.sampler;