diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-03-03 14:24:11 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-03-05 19:40:41 +0100 |
commit | c3ae30085e4047ee7d5a945c36e2055c2de5197d (patch) | |
tree | 4a4e8c2b3ef2a3a9353965d4c49832765f785593 /src/gui/rhi/qrhimetal_p_p.h | |
parent | e1e0862990dbe00462f7faa02845a640a3d84155 (diff) |
rhi: Add support for arrays of combined image samplers
Introduces a new QRhiShaderResourceBinding function that takes an array
of texture-sampler pairs. The existing function is also available and is
equivalent to calling the array-based version with array size 1.
It is important to note that for Metal one needs MSL 2.0 for array of
textures, so qsb needs --msl 20 instead of --msl 12 for such shaders.
Comes with an autotest, and also updates all .qsb files for said test
with the latest shadertools.
Task-number: QTBUG-82624
Change-Id: Ibc1973aae826836f16d842c41d6c8403fd7ff876
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhimetal_p_p.h')
-rw-r--r-- | src/gui/rhi/qrhimetal_p_p.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/rhi/qrhimetal_p_p.h b/src/gui/rhi/qrhimetal_p_p.h index a5af5611a6..cb4b777d88 100644 --- a/src/gui/rhi/qrhimetal_p_p.h +++ b/src/gui/rhi/qrhimetal_p_p.h @@ -197,10 +197,13 @@ struct QMetalShaderResourceBindings : public QRhiShaderResourceBindings uint generation; }; struct BoundSampledTextureData { - quint64 texId; - uint texGeneration; - quint64 samplerId; - uint samplerGeneration; + int count; + struct { + quint64 texId; + uint texGeneration; + quint64 samplerId; + uint samplerGeneration; + } d[QRhiShaderResourceBinding::Data::MAX_TEX_SAMPLER_ARRAY_SIZE]; }; struct BoundStorageImageData { quint64 id; |