summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add readme with info about the new qt/qtshadertools repoHEADmasterLaszlo Agocs2020-01-101-0/+4
| | | | | Change-Id: Ibc060a7cef1ae86901e47996e5713dba670a682e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add license textLaszlo Agocs2020-01-071-0/+674
| | | | | Change-Id: I23fd379f92ea387a591e5c51fd320502b4a2ccb9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Heavily limit platforms where it can be builtLaszlo Agocs2020-01-071-0/+2
| | | | | | | | This can be lifted later, one by one, once compilation and operation is verified on the platforms in question. Change-Id: I02dc9a33352b86ffcb3247d87fdd43eadf2139cf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make it Qt 6 CI compatibleLaszlo Agocs2020-01-072-1/+5
| | | | | Change-Id: Ifa90dcebb9ac938d080336f331332749e47a8b02 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make it clear that -1 indicates "unused" in the native binding mapLaszlo Agocs2020-01-061-3/+10
| | | | | | | | Handling this correctly is up to the Metal backend of QRhi. Task-number: QTBUG-80668 Change-Id: I4086a8d89a995545e882b4ad4d05b6c14459c1df Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Drop binding qualifiers from samplers in GLSLLaszlo Agocs2019-12-111-13/+8
| | | | | | | | | | | | | | | | | | Enabling GL_ARB_shading_language_420pack (for core-compatible shaders) is not quite ok when the OpenGL implementation (e.g. the one on macOS) does not support this extension. The QRhi OpenGL backend does not rely on bindings for samplers in the first place (and uniform blocks are converted to plain uniforms). So there is no purpose for the binding points in the GLSL code. This fixes operating on macOS with the 4.1 core profile context. (2.1 worked in any case, as this flag and the concept of layout qualifiers are not relevant for <= 120 shaders) Change-Id: Iaec2130aac5fef7c3d8656718bd9ccf418299580 Fixes: QTBUG-80690 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Prepare to be turned into a proper Qt moduleLaszlo Agocs2019-12-1015-201/+119
| | | | | | | License is GPLv3 + commercial. Change-Id: Id6a848bc9fa4ef1fc700f56df9461747a325dc50 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Use the magic fallback name when structName is emptyLaszlo Agocs2019-12-102-0/+49
| | | | | | | | | | | | | This will enable Qt Quick 3D to function correctly with the GL backend of QRhi. What's special with Quick3D is that the shaders rely on uniform blocks without instance names (so that member accesses do not need to be qualified, allowing the bulk of the shader code to stay compatible with the direct OpenGL rendering path where plain uniforms are used) Fixes: QTBUG-80585 Change-Id: Id7c9c30d392c593bad29299eaa92bea016a5bbdb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Get rid of QFlags warnings for assigning 0Laszlo Agocs2019-12-034-6/+6
| | | | | | Fixes: QTBUG-80492 Change-Id: I5b6492e34603cc3732c34eb24a6d43b17b67be74 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* qsb: Print the Qt version alongside the app nameLaszlo Agocs2019-11-261-1/+4
| | | | | | | | | | | | | | | | | | | Serialization and deserialization of .qsb files is implemented in QShader in QtGui. There is backwards, but not forward compatibility in the serialization format: QShader in 5.15 is guaranteed to be able to deserialize shaders from 5.14, but 5.14 is not compatible with serialized data from 5.15. Therefore, verifying what Qt version qsb is using at run time (qVersion()) can be useful to help avoiding confusion when one has multiple builds of shadertools against multiple qtbase versions. Additionally, enable -v and --version. These will show the build time Qt version (QT_VERSION_STR). Task-number: QTBUG-80320 Change-Id: Id1ac92a022a5f066f1f4998456e21a89048ef47f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Extend autotest for reflectionLaszlo Agocs2019-11-143-0/+315
| | | | | | | | | | | | | | | | | Let's verify that reflecting a shader with an array of struct in a uniform block leads to the expected QShaderDescription. This is particularly useful against regressions, while also being a real life use case (lights in Quick 3D for instance). Also check the native resource binding map (generated for Metal SL only at the moment). Finally, have something for combined image samplers, the most common case with sampler2D. Change-Id: I9bea94ef9834e071384df423675623bcebe0cd44 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Switch to the C API of SPIRV-CrossLaszlo Agocs2019-11-146-288/+537
| | | | | | | | | | | | | | | | | Also moves the remap (e.g. stripping of symbols) support to its own file. (useful to prevent header clashes between glslang and SPIRV-Cross) The C API of SPIRV-Cross is expected to be more stable than the C++ one (the latter comes with no guarantees). It is worth noting that full behavioral compatibility when it comes to the generated shader code is not part of the compatibility promise, but being able to build on a stable C API is already a good step forward. Task-number: QTBUG-78591 Change-Id: I9a91bb60a2f29bf91670f00659824636f6b6fc2a Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Update SPIRV-CrossLaszlo Agocs2019-11-1113-493/+1916
| | | | | | Task-number: QTBUG-78591 Change-Id: I03d2b49408267d18aaa54fe163663325ee7672d0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* qsb: Print the serialization format version in dump modeLaszlo Agocs2019-10-301-1/+5
| | | | | Change-Id: Ifa8e28f367b7f4ff1031f1624c51c5cd5521257f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Generate native resource binding map for MSLLaszlo Agocs2019-10-234-16/+54
| | | | | | Task-number: QTBUG-79368 Change-Id: I74f6bdab13e5ee0f7c97e78e776f59e191af2fdb Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Update SPIRV-CrossLaszlo Agocs2019-10-2322-2027/+10145
| | | | | Change-Id: I15dbf83057b5aa435b87b80e219b113987735cad Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Disable unused arg warning in release buildsLaszlo Agocs2019-10-232-1/+27
| | | | | Change-Id: Ib68abb9658ae2bb2374071ce3f11e04cffae05c0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Update glslangLaszlo Agocs2019-10-2162-10320/+12351
| | | | | Change-Id: I9ba7a26872a4fe01ff2d6e640705c903b4397c83 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Include _p.h, not _p_p.h in the QShaderBaker headerLaszlo Agocs2019-08-141-1/+1
| | | | | | | | | | This is still wrong from public - private API viewpoint, of course. For now let's just pretend that QShader is going to become public at some point. Change-Id: I0ed021509245119ad111d275b9af40ed514c042d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make the _qt_order input location configurableLaszlo Agocs2019-08-127-6/+36
| | | | | Change-Id: Id746ed3b6eefa7d4de3bff663c61c57a35052d1a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Enable fake gl_PointCoord for HLSL outputLaszlo Agocs2019-08-121-0/+1
| | | | | | | Faking (0.5, 0.5) is better than failing with an obscure error message. Change-Id: I3d9105d5e8dc2564d11436b27d3d222767774b5d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Query and store the local sizeLaszlo Agocs2019-06-261-0/+4
| | | | | | | | | Storing the local size becomes interesting for the Metal backend of QRhi because there the Metal API needs the local size as well when doing a dispatch. Change-Id: I5cdf46d45c69bd24cd5c53aab53ca0c2b0d87b37 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Set point_size_compat for HLSLLaszlo Agocs2019-06-131-0/+1
| | | | | | | | Shaders setting gl_PointSize should still translate without errors. With D3D the value is ignored and points will be of size 1. Change-Id: Ieb7fb7b1062a04e30d7318beaa519ae961c44a86 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add an extract option to qsbLaszlo Agocs2019-06-121-6/+77
| | | | | | | Occasionally one will need to access one single generated shader variant. Change-Id: Ied0a7862e900fc8476f1dc12bbc5615e9442e918 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add support for storage images and blocksLaszlo Agocs2019-06-113-16/+107
| | | | | | | Not used in graphics but are essential for compute. Change-Id: I4d3a0dfd926ee02b824494ee438f3a69fc96c0d4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Follow QRhiShader API cleanupLaszlo Agocs2019-06-1110-272/+272
| | | | | Change-Id: I4ebde6e68fe8c8fe0105981f9bea6f01aba96c60 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Disable uniform buffers for glsl output altogetherLaszlo Agocs2019-05-141-0/+3
| | | | | | | | | Regardless of the GLSL version. This allows the QRhi GL backend to have a single code path when it comes to uniforms, and it does not need to worry about uniform buffers for GLSL >=140 and >=300es. Change-Id: If4bbfc12d57b5b1fc6382dec5a65130c357f5c2e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Update SPIRV-CrossLaszlo Agocs2019-05-1426-634/+2315
| | | | | | | | This also pulls in the addition of the emit_uniform_buffer_as_plain_uniforms flag for the GLSL generator, which is something we want to use. Change-Id: Iffc6c40265c72930665587d26d8c4b9638698a01 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add support for -D in qsb and preamble in QShaderBakerLaszlo Agocs2019-05-068-5/+154
| | | | | | | | | | Allow inserting a user provided string. glslang takes care of heavy lifting. For qsb this means compile time #define statements can now be generated by passing -DSOMETHING and -DSOMETHING=123 on the command line. Change-Id: Iddf276c3fa91e21780530aa2f54719325f404ba6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Import the Qt Shader Tools moduleLaszlo Agocs2019-04-09199-0/+153356
| | | | | | | ...from https://git.qt.io/laagocs/qtshadertools/ Change-Id: I3aa655da81978e13016f8150634e278448015709 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Initial empty repositoryKari Oikarinen2019-04-040-0/+0