From 60871b4fdf1ec977498ec4baa1d33c0972ac434f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 23 Sep 2020 15:40:06 +0200 Subject: rhi: vulkan: Fix mipmap generation for cubemaps Change-Id: Ia1aab06214be802aaabc97ffefa28947e11148e3 Reviewed-by: Andy Nichols --- tests/manual/rhi/cubemap/cubemap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/manual/rhi/cubemap/cubemap.cpp') 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; -- cgit v1.2.3