summaryrefslogtreecommitdiffstats
path: root/tests/manual/rhi/multiview/multiview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change license for tests filesLucie GĂ©rard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* rhi: gl: metal: Enable depth-stencil correctly with multiviewLaszlo Agocs2023-06-281-1/+1
| | | | | | | | | | | | | | | After fixing the data type for D24S8, we can now implement attaching depth and stencil (with the same texture). For Metal we need to set a stencil flag correctly. This allows using D24S8 in the manual test, which is likely the format that is going to be commonly used when setting up multiview with Qt Quick. Fixes: QTBUG-114904 Change-Id: Ife425c6cb3e09bfe40092c841b78f7a93bb6a4cd Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Enable depth texture for multiviewLaszlo Agocs2023-06-281-1/+1
| | | | | | | | | | | | | | | Cannot just do like with other APIs and expose a view of multiple array layers. The only option is to use the multiview-specific API and specify layers 0..view_count-1 in the depth texture. This allows having depth in a multiview render pass with OpenGL. Note that this does not cover stencil. D24S8 does not work, so we may need to explore having a dedicated, separate stencil texture. Task-number: QTBUG-114896 Change-Id: I06ede1d77fef199148d595a55d144c96dc3cbc9d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Use a depth/stencil texture in the multiview manual testLaszlo Agocs2023-06-281-4/+17
| | | | | | | | ...and expand the docs a bit. Task-number: QTBUG-114896 Change-Id: I969c3aa2fa72a242e275e4b6dd996df20d1cd2ab Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: multiview: Exercise instancing in the testLaszlo Agocs2023-06-271-9/+31
| | | | | | | | | Just to make sure instanced drawing does not regress. Relevant particularly with Metal. Fixes: QTBUG-114885 Change-Id: Ib39066d32985bf25ca02d5aa54d9cf654772be9a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add an option to exercise MSAA in the multiview testLaszlo Agocs2023-06-261-3/+36
| | | | | | Task-number: QTBUG-114790 Change-Id: Id9378abb13e56062bf1db6c7360595b7a2f1afc6 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: multiview test: Fix leftover resourceUpdate callLaszlo Agocs2023-06-261-2/+0
| | | | | | | This should not be there because 'u' is passed to beginPass(). Change-Id: I95ba8ed400baa06948b4d4c6bbf7ca2d07a5480f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: d3d12: Implement multiview supportLaszlo Agocs2023-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This relies on qsb being able to invoke dxc instead of fxc when the request HLSL (shader model) version is 6.1. (6.1 is required for SV_ViewID) This currently works only when conditioning offline with qsb (or via CMake), because qsb can easily invoke dxc instead of fxc. When shipping HLSL inside the .qsb package (so when -c is not specified or running the external tool fails), this won't work since the D3D12 backend still uses D3DCompile(), not IDxcCompiler. Support for that will be investigated separately. We also need to bump to ID3D12Device2 and ID3D12GraphicsCommandList1. With Windows 10 version 1703 being quite old now, this should not be a problem at run time. There are however issues at build time, namely that MinGW and MinGW/LLVM and similar seems to have ancient Windows SDK headers according to the CI test runs. None of the MSVC configurations have this in the CI, they have reasonable versions of d3d12.h and similar. Therefore, one important aspect of this change is that the D3D12 backend of QRhi will only be available from now on when the SDK headers are new enough (meaning ID3D12Device2 is declared, which is a several years old type now). Otherwise, QRhi::create() will simply fail when asking for D3D12 with a helpful warning message about the Qt build being crippled. Implementation-wise, there are surprises in store as well: The way the PSO is created needs to be revamped to follow the extensible approach that uses a pipeline state stream description. Both the graphics and compute pipeline creation is changed to use CreatePipelineState() and the associated machinery. This is only really essential for graphics pipelines since we know have to include data for view instancing (multiview). For compute the result is the same as before. Additionally, the view count must now be baked into the QRhiGraphicsPipeline. This means that applications must call setMultiViewCount() with the same value (typically 2) *both* on the render target's color attachment and on the pipeline. Backends that do not care about the pipeline's view count (GL, Vulkan) will of course ignore it, but if it's not set correctly D3D12 will fail. The manual test is updated accordingly. Fixes: QTBUG-114772 Change-Id: I93db7313377e711c2faeb956815899b12132d23b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Introduce multiview starting with OpenGL (ES)Laszlo Agocs2023-06-221-0/+239
Fixes: QTBUG-114770 Change-Id: Ibb1ced7f19d15a5116c60e95fd3e6b86ace63155 Reviewed-by: Andy Nichols <andy.nichols@qt.io>