Description
Qt Quick 3D custom materials rely on arrays of textures (note: not texture arrays (i.e. sampler2DArray and such)):
layout(binding = 10) uniform sampler2D lightProbe; layout(binding = 11) uniform sampler2D lightProbe2; layout(binding = 8) uniform sampler2D shadowMaps[8]; layout(binding = 9) uniform samplerCube shadowCubes[8]; layout(binding = 4) uniform sampler2D uEnvironmentTexture; layout(binding = 6) uniform sampler2D depthTexture; layout(binding = 7) uniform sampler2D aoTexture; layout(binding = 5) uniform sampler2D uBakedShadowTexture; layout(std140, binding = 0) uniform cbMain { ... }
layout(binding = 8) uniform sampler2D shadowMaps[8];
and
layout(binding = 9) uniform samplerCube shadowCubes[8];
are not something we support currently.
In uniform blocks, there is support for arrays of struct, float, vec2, vec3 and vec4, but for combined image samplers the dimension is effectively ignored and only [0] will be set. There is also no way to provide a list of (texture, sampler) pairs in the QRhiShaderResourceBindings API.
Note: with Metal it turns out that MSL 1.2 is not sufficient: "Shader baking failed: MSL 2.0 or greater is required for arrays of textures."
Attachments
Issue Links
- is required for
-
QTBUG-82245 Quick3D custom materials with RHI (excl. blits/multipass)
- Closed
For Gerrit Dashboard: QTBUG-82624 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
292676,3 | rhi: Include an arrayDims vector in InOutVariable too | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
292677,3 | Add playground tests for texture arrays and arrays of textures | dev | qt/qtshadertools | Status: MERGED | +2 | 0 |
292678,2 | rhi: Include an arrayDims vector in InOutVariable too | dev | qt/qtbase | Status: MERGED | -2 | 0 |
292679,4 | Expose the array dimensions for InOutVariable, when applicable | dev | qt/qtshadertools | Status: MERGED | +2 | 0 |
292728,2 | hlsl: Adjust texture and sampler registers for arrays | dev | qt/qtshadertools | Status: MERGED | +2 | 0 |
292735,2 | rhi: Use versioning in QShaderDescription serialization as well | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
292760,9 | rhi: Add support for arrays of combined image samplers | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |