diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-10-19 14:11:20 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-10-29 15:57:13 +0200 |
commit | e7a1fbfc471503cd5252a4acba7277639e5b65c2 (patch) | |
tree | 324a5af076db2840eeb3c5bee0b3875b03056893 /src/gui/rhi/qrhigles2_p_p.h | |
parent | e7371fa1592cf490eab6cb82bc06ed67c7d154e3 (diff) |
rhi: Add texture array support
Arrays of textures have always been supported, but we will encounter
cases when we need to work with texture array objects as well.
Note that currently it is not possible to expose only a slice of the
array to the shader, because there is no dedicated API in the SRB,
and thus the same SRV/UAV (or equivalent) is used always, capturing
all elements in the array. Therefore in the shader the last component
of P in texture() is in range 0..array_size-1.
Change-Id: I5a032ed016aeefbbcd743d5bfb9fbc49ba00a1fa
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhigles2_p_p.h')
-rw-r--r-- | src/gui/rhi/qrhigles2_p_p.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhigles2_p_p.h b/src/gui/rhi/qrhigles2_p_p.h index 4d18e9c60f..48f79e3c1d 100644 --- a/src/gui/rhi/qrhigles2_p_p.h +++ b/src/gui/rhi/qrhigles2_p_p.h @@ -139,7 +139,7 @@ inline bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b) struct QGles2Texture : public QRhiTexture { QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth, - int sampleCount, Flags flags); + int arraySize, int sampleCount, Flags flags); ~QGles2Texture(); void destroy() override; bool create() override; @@ -521,6 +521,7 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer GLenum target; GLuint texture; int dstLevel; + int dstLayer; } blitFromRb; struct { GLenum target; @@ -752,6 +753,7 @@ public: QRhiTexture *createTexture(QRhiTexture::Format format, const QSize &pixelSize, int depth, + int arraySize, int sampleCount, QRhiTexture::Flags flags) override; QRhiSampler *createSampler(QRhiSampler::Filter magFilter, @@ -910,6 +912,7 @@ public: maxTextureSize(2048), maxDrawBuffers(4), maxSamples(16), + maxTextureArraySize(0), maxThreadGroupsPerDimension(0), maxThreadsPerThreadGroup(0), maxThreadGroupsX(0), @@ -951,6 +954,7 @@ public: int maxTextureSize; int maxDrawBuffers; int maxSamples; + int maxTextureArraySize; int maxThreadGroupsPerDimension; int maxThreadsPerThreadGroup; int maxThreadGroupsX; |