summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi
Commit message (Collapse)AuthorAgeFilesLines
* rhi: Manage buffer data without QBALaszlo Agocs2020-09-309-63/+119
| | | | | | | | Use a simple and straightforward container that only does what we need here. Change-Id: I1a81b53a58bc91d533e3d7df5471a1362046825d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: vk: Do not copy the entire BufferOp struct for host writesLaszlo Agocs2020-09-292-7/+11
| | | | | | | | Take only the three things we need. Otherwise we waste time on copying data that is not even relevant to buffer updates at all. Change-Id: I5ed6ae647e23c6f1d0f5f1d973bead2e008f06cc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Skip nice but not essential uniform checks in releaseLaszlo Agocs2020-09-291-0/+2
| | | | | Change-Id: Ic258f128d691a221670d930d2bfe90cda74a4c75 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Drop QBitArray usageLaszlo Agocs2020-09-292-8/+13
| | | | | Change-Id: I4ae92e6c8c91111a4593c51ee05443b3bc806c35 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Improve layout compatibility test performanceLaszlo Agocs2020-09-298-9/+36
| | | | | | | | | Also bump the non-heap buffer size in the binding list to 16, in order to accommodate complex Quick3D materials with many associated texture maps. Change-Id: Id190e5f8304f5941cffc41a2605fce45dfeb72f0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Pre-sort uniform metadata based on offsetLaszlo Agocs2020-09-291-7/+11
| | | | | | | | | Because we will iterate through this list and issue a memcpy for each entry. Better to keep it sorted based on offset to be more cache friendly. Change-Id: Ie9dcb259e9a543937cbdcdea85aec9eb92dba1b1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Switch command lists to QVLALaszlo Agocs2020-09-253-3/+3
| | | | | Change-Id: Ic163533eee973f0ee2f3e2efe25390caa57dd659 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* rhi: gl: get rid of a wrapper QByteArray where a raw ptr sufficesLaszlo Agocs2020-09-251-3/+2
| | | | | | | | This is a visible performance increase actually, given this is on a quite hot chode path. Change-Id: I165bfa0d4e490f80078551efb4bf2fe8e72d3596 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* rhi: Skip comparing to this in isCompatible testsLaszlo Agocs2020-09-252-0/+9
| | | | | Change-Id: Ie1855f992315f6e02986016a254127cec0ac94c8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* rhi: gl: d3d: Do not use QByteArray where there is no pointLaszlo Agocs2020-09-254-14/+17
| | | | | | | | | The real benefit in practice is getting rid of profilers going wild about QByteArray::begin() and similar. The actual perf. gain is fairly small. Change-Id: I25e4c762f303b41f0aaf914bc62751f3265d3cf8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* rhi: Drop the zeroing out of resource binding structsv6.0.0-alpha1Laszlo Agocs2020-09-252-10/+2
| | | | | | | | | | This has a non-insignificant cost (since the size is at least 260 bytes) in renderers that construct a lot of these objects per frame. After changing the qHash implementation to be lighter we no longer rely on qHashBits, so zeroing it is not essential anymore. Remove it. Change-Id: If1fbd8dfd46fb3f0e9ea5a3c4794d24b8aeac1ba Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: vulkan: Fix mipmap generation for cubemapsLaszlo Agocs2020-09-254-80/+81
| | | | | Change-Id: Ia1aab06214be802aaabc97ffefa28947e11148e3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Enable seamless cubemap filteringLaszlo Agocs2020-09-231-0/+10
| | | | | | | | ...when available. This is mandatory in order to match results with other APIs where this is always on. Change-Id: I3b8ef2cb806a7297c83e60a3eb1fa71b50780dbe Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Reuse the data in buffer ops in res.update batchesLaszlo Agocs2020-09-236-25/+60
| | | | | | | | Because having profilers bombarded with mallocs (due to creating deep copy QByteArrays) is not nice. Change-Id: I848f41f3465d6dc2a58a193cc863495aacf13d79 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Reuse buffer/texture op entries in res.update batchesLaszlo Agocs2020-09-237-36/+125
| | | | | | | | More of an enabler for reusing the data in the individual entries since not clearing the QVLA does not give us much on its own. Change-Id: Ief9761f75382c3373cc2bc7b866eb59fdd8b3277 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Report an "optimal capacity" from res.update batchesLaszlo Agocs2020-09-233-2/+30
| | | | | Change-Id: If47eddf3fe7d365c80b0a15712ef155a6898d904 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Do not just pick the first free res.upd. batch all the timeLaszlo Agocs2020-09-232-1/+13
| | | | | | | | | Rather, utilize all the available ones in the pool, picking the next available batch after the one we picked previously (with wrapping over as necessary). Change-Id: I5f26e127a406c2dd07d155712429c72ad4f0f0f1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: d3d: Fix dynamic offsets with multiple buffersLaszlo Agocs2020-09-233-15/+37
| | | | | | Fixes: QTBUG-86821 Change-Id: I57f86bf0f7e95b92f5b2c5fee587112ecf0fc8e6 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Support signed integer attributes on QRHIInho Lee2020-09-217-19/+71
| | | | | | | Previous UIntAttributes feature is renamed as IntAttributes. Change-Id: I4b4a87a0eebf37291da832605f7bee8fb2d4e62b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: Expose compute threadgroup limits in ResourceLimitsLaszlo Agocs2020-09-188-1/+123
| | | | | | | | | | As OpenGL ES and Vulkan ruin the day with the spec mandated minimum value for max threads per threadgroup being only 128, clients need a way to decide if their compute shader (local_size_*) is suitable for use at run time. Change-Id: I72b4fc97032406340623add82ea4d9544ebe9fdc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Enhance compute dispatch docsLaszlo Agocs2020-09-171-0/+12
| | | | | | | | These docs are not part of the generated docs due to QRhi being private, but nonetheless keep it useful. Change-Id: Ic46aaa4cd329535c37fffcd514ba354dff4bfb5c Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* rhi: Improve srb hash perf somewhatLaszlo Agocs2020-09-171-4/+27
| | | | | | | | | Do not qHashBits on the whole data that is at least 260 bytes, a big part of it often unused. Just hash binding/stage/type and the first resource pointer. Change-Id: If9b3dc9acf36edf225302b1216d91e87b652b8ef Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* rhi: gl: Eliminate duplicate glUniform callsLaszlo Agocs2020-09-142-9/+25
| | | | | | | | | | | | | | | | This can happen when there is a uniform block in the Vulkan shader with an instance name, both in the vertex and fragment shader. The members are mapped to members of a struct uniform in GLSL since we do not use uniform buffers there. Now if there is, for example, "ubuf.opacity" both in the vertex and fragment shader reflection info, then it's still just one single uniform in the GL program, using one location. Registering it twice in our 'uniforms' list is harmless, but wasteful, since it means the uniform value will be set twice upon each setShaderResources(). Change-Id: Ib646eaec333522560d631b3b81800ef610f09319 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QRhi: support matrix array types of the uniform in GLES2 backendInho Lee2020-09-141-10/+19
| | | | | | Task-number: QTBUG-83173 Change-Id: Ieda8948820a9470e3b0bc420ec7b1af09395d568 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: gl: Fix shader cache with unstable vertex input locationsLaszlo Agocs2020-09-112-38/+74
| | | | | | Task-number: QTBUG-86531 Change-Id: I9bcd314e06662e3c6cc4204b24689d61ee6cb298 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Sanity check the srb in debug buildsLaszlo Agocs2020-09-036-2/+91
| | | | | | | | | | | Instead of cryptic assertions and crashes depending on the backend, show some useful warnings (in debug builds only) when one tries to create an srb with a list where there are duplicated bindings. (a mistake that happens relatively often during the development of frameworks, such as Quick 3D, on top) Change-Id: If1b50a2e8165b001878ad566e048f146e636514f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Correctly report WideLines for OpenGLLaszlo Agocs2020-08-302-2/+3
| | | | | | | | In core profile contexts a line width other than 1 may not work as expected since it is deprecated in the core profile. Change-Id: I3fc33cf90c65156aa87d04f08518c9ddcfb62625 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: vulkan: Enable features on the deviceLaszlo Agocs2020-08-301-2/+17
| | | | | | | | | | | The silly fine-grained enabling of features on the VkDevice seems to be ignored in practice by the implementations, but wideLines becomes relevant because the validation layers warns if a line width is set on the pipeline without enabling the feature on the device. So to play nice, enable the features we care about. Change-Id: I0c64a0d10a8279fe43d899118b0d6f0e4f875d41 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Also try GLSL 140 and 130Laszlo Agocs2020-08-301-9/+13
| | | | | Change-Id: I21e3ca92d62f20f3ec608bef54c68f9bd09a207f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: d3d: Allow compiling source shaders with debug at run timeLaszlo Agocs2020-08-283-6/+56
| | | | | | | | | | Relevant for Qt Quick 3D. As in many cases Quick3D will rely on runtime generated shader code, the translated HLSL will be compiled via D3DCompile() at run time. To make such shaders debuggable, the necessary flag (D3DCOMPILE_DEBUG) should be requestable somehow. Change-Id: I4d5c3b57bf58df8d46556eebb5cf6fb75e9d0afe Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Fix documentation warnings for Qt GUITopi Reinio2020-08-281-0/+4
| | | | | | | | | | | | * Drop deprecation warnings for now-dropped items * Use the 'qt6' define and a new \nothing doc macro to conditionally document items on Qt 6 * Add a custom module header for docs that pulls in also Vulkan headers * Add \internal command for internal classes/functions * Move QtGUI-related code snippets from widgets to gui docs Change-Id: Ieb386b96631a49568d09059906d307c45c01d93a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Change QByteArray to handle large arraysLars Knoll2020-08-271-2/+2
| | | | | | | | | | Use qsizetype throughout. Change-Id: I787af7fcfa17e1be87decb64c41c609cc24be117 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QSet to qsizetypeUlf Hermann2020-08-251-1/+1
| | | | | Change-Id: I70ad8fb6908ce3837a723e9a095bee5c166739e4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* rhi: d3d11: Enable setting xxxColor as an alpha src/dst blend factorLaszlo Agocs2020-08-191-11/+17
| | | | | | | Fixes: QTBUG-86111 Pick-to: 5.15 Change-Id: Iabcf1708ea65e9f05f39caf9df9b45c25ac5dbb8 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: sanityCheckGraphicsPipeline handle no vertex attributesPaul Lemire2020-08-181-7/+1
| | | | | | | | | It is a valid use case to have a vertex shader with no vertex attributes. Using gl_VertexID or gl_InstanceID is enough to generate vertex data out of thin air. Change-Id: If7689914624a84723923fd2d7aef355bda592e24 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: QRhiGles2 use proper texture target for multisampled texturesPaul Lemire2020-08-172-3/+18
| | | | | Change-Id: I6e92a66f2758599626e7bdfbb2e149bb69192479 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Disentangle QIODevice dependenciesLars Knoll2020-08-151-0/+1
| | | | | | | | | | | | | | | | | Move the QIODevice::OpenMode enum into a base class, so that we can remove the full QIODevice (and thus QObject) dependency from qdatastream.h and qtextstream.h. This is required so that we can include QDataStream in qmetatype.h without getting circular dependencies. As a nice side effect, QDataStream and QTextStream can now inherit QIODeviceBase and provide the OpenMode enum directly in their class scope. Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Another round of using noexcept instead of pre-C++11 definesAllan Sandfeld Jensen2020-08-136-87/+87
| | | | | | | A few new files were added with old-school defines. Change-Id: Ieb2c71e094e55102f3f39fb9551823f36863f5f4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove old CBOR-based format from QShaderLaszlo Agocs2020-08-114-218/+19
| | | | | | | | | We only support version 4 and 5 in Qt 6.0. 1 and 2 are already gone (due to being based on binary JSON), now we remove 3 as well. Task-number: QTBUG-81346 Change-Id: I3627dcc0587f1e36f11e93edf7172889e911d64e Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: QRhiGles2 fix leak BlitFromRenderbufferPaul Lemire2020-08-071-0/+1
| | | | | | | Leaked FBO otherwise lead to massive runtime memory consumption increases. Change-Id: Ic8ffad4917c11294e6c83cdae0b36114d661b251 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove deprecated binary json featureEdward Welbourne2020-07-313-34/+1
| | | | | | | | | Deprecated in 5.15 in favor of CBOR. Fixes: QTBUG-81239 Change-Id: I711d4bd7dd1247f58e77ac9fa53304cbe5028918 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* rhi: QRhiGLes2::gatherUniforms fix gathering in structPaul Lemire2020-07-311-1/+2
| | | | | | | | In the case we don't have an array of structs, structPrefix needs to be suffixed with a dot to get the proper uniform names. Change-Id: I50ed54c2f7c3cc4556ed1854419bc4fe3a2989f7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Revert "Add missing override" for 3rdparty vk_mem_alloc.hAlexander Volkov2020-07-291-0/+3
| | | | | | | | | This partially reverts 9bad3508fccb058261d47e023400868147f2d733. Disable -Wsuggest-override for gcc when including the header instead. Change-Id: Id2507ce731da62bbd64aa6477b181735ba62adc1 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: Allow null resources in srbLaszlo Agocs2020-07-133-64/+135
| | | | | | | | | | In this case the srb represents the layout only, and can still be used to create a pipeline. For setShaderResources() one will then need to use another, layout compatible, srb that references valid resources. Change-Id: I3ea5b63df3be8847540ca4c0c40fbd29dbed8fb7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-078-24/+24
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use qsizetype in QListLars Knoll2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: add support for D24 / D24S8 formatsJean-Michaël Celerier2020-07-026-13/+71
| | | | | Change-Id: I7ba14d30fa57bcb92cd764aed6c85cde853935b4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Switch to qvla where it makes sense in rhiLaszlo Agocs2020-06-308-39/+43
| | | | | | | | | For all of these we know in advance that the vast majority of usages will not exceed a certain number of elements. Also, none of these are copied or moved ever. Change-Id: I48aedf143e221dc178d661e23454d1e4fb7a271b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use QList instead of QVector in guiJarek Kobus2020-06-2911-66/+62
| | | | | | | | Applied to headers only. Source file to be changed separately. Task-number: QTBUG-84469 Change-Id: Ic08a899321eaffc46b8461aaee3dbaa4d2c727a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>