summaryrefslogtreecommitdiffstats
path: root/tests/manual/rhi/shared/examplefw.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-05-19 19:30:53 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2021-05-31 17:16:57 +0200
commit51c22a1f51e2f91289c938be7754f957c9bfa47e (patch)
tree58eea1c4aeb83f4ee2ede516f321624ab5558181 /tests/manual/rhi/shared/examplefw.h
parent5eab5d62530f351307a01ca57af964e5c506079c (diff)
rhi: Add support for 3D textures
Supported on OpenGL (and ES) 3.0+ and everywhere else. Can also be a render target, targeting a single slice at a time. Can be mipmapped, cannot be multisample. Reading back a given slice from a 3D texture is left as a future exercise, for now it is documented to be not supported. Upload is going to be limited to one slice in one upload entry, just like we specify one face or one miplevel for cubemap and mipmapped textures. This also involves some welcome hardening of how texture subresources are described internally: as we no longer can count on a layer index between 0..5 (as is the case with cubemaps), simply arrays with MAX_LAYER==6 are no longer sufficient. Switch to sufficiently dynamic data structures where applicable. On Vulkan rendering to a slice needs Vulkan 1.1 (and 1.1 enabled on the VkInstance). Task-number: QTBUG-89703 Change-Id: Ide6c20124ec9201d94ffc339dd479cd1ece777b0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests/manual/rhi/shared/examplefw.h')
-rw-r--r--tests/manual/rhi/shared/examplefw.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/manual/rhi/shared/examplefw.h b/tests/manual/rhi/shared/examplefw.h
index cbd52509c4..9efbd37d77 100644
--- a/tests/manual/rhi/shared/examplefw.h
+++ b/tests/manual/rhi/shared/examplefw.h
@@ -538,6 +538,12 @@ int main(int argc, char **argv)
qDebug("Enabling Vulkan validation layer (if available)");
inst.setLayers({ "VK_LAYER_KHRONOS_validation" });
}
+ const QVersionNumber supportedVersion = inst.supportedApiVersion();
+ qDebug() << "Supported Vulkan API version:" << supportedVersion;
+ if (supportedVersion >= QVersionNumber(1, 1)) {
+ qDebug("Requesting Vulkan API 1.1 on the VkInstance");
+ inst.setApiVersion(QVersionNumber(1, 1));
+ }
inst.setExtensions(QRhiVulkanInitParams::preferredInstanceExtensions());
if (!inst.create()) {
qWarning("Failed to create Vulkan instance, switching to OpenGL");