qt5base-lts/tests/auto/gui/rhi
Laszlo Agocs a5db072dc2 rhi: Add explicit subclass for RTs from swapchains
We want to enable gaining access to the underlying resource(s) by
inspecting a QRhiRenderTarget. This is not currently possible for
swapchains since there is nothing that references the actual
QRhiSwapChain. To clean this up, make an explicit, new
QRhiSwapChainRenderTarget subclass. Thus the logic already used in a
couple of places to examine the resources attached to a
QRhiTextureRenderTarget can now work with swapchain render targets too,
by branching based on the resourceType().

This eliminates the somewhat odd setup where a "RenderTarget" resource
is QRhiRenderTarget corresponding (but not exposing!) a swapchain,
whereas a "TextureRenderTarget" is a QRhiTextureRenderTarget which
is a subclass of QRhiRenderTarget. Now we correctly have an (abstract)
base and two subclasses, one for each type of render targets.

Besides, it allows us to clean up the oddly named
Q...ReferenceRenderTarget classes in the backends, which initially tried
to indicate that this "render target" merely references (or, in
practice, is) a swapchain. We can now have a nice and symmetrical
Q...SwapChainRenderTarget and Q...TextureRenderTarget naming scheme.

Change-Id: Ib07e9be99a316eec67b94de0860e08f5f4638959
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-04-05 19:40:17 +02:00
..
qrhi rhi: Add explicit subclass for RTs from swapchains 2022-04-05 19:40:17 +02:00
qshader CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test 2022-02-11 21:54:44 +01:00
CMakeLists.txt Re-enable tst_qrhi on Linux 2020-07-29 15:04:19 +02:00