diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-10-03 14:28:23 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-10-09 15:15:05 +0000 |
commit | 89ec1b3618f0f26a8f92049aabfc2df4d84c34c5 (patch) | |
tree | 1432a975da140b93d737d9dde865ed4c4864427b /src/gui/rhi/qrhigles2_p_p.h | |
parent | 4a3ee77f650868ba408827d9793e8b86a93400f0 (diff) |
rhi: Add support for buffer readbacks
This also marks the beginnings of significantly extending autotesting
of the resource and rendering functionality in QRhi.
Also involves fixing up the buffer operation lists like we did
for textures before. This is to ensure updates and reads on the
same batch execute in the correct order. So just have two lists:
one with buffer, one with texture operations.
Also simplify the struct layouts. No need for those inner structs
with many duplicate members. This reduces the size even, since using a
union was never an option here. Also switch to a VLA, the size is around
253 KB per batch.
The Null backend now keeps track of the QRhiBuffer data so it can return
valid results in readbacks.
Task-number: QTBUG-78984
Task-number: QTBUG-78986
Task-number: QTBUG-78971
Task-number: QTBUG-78883
Change-Id: I9694bd7fec523a4e71cf8a5c77c828123ebbb3bd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhigles2_p_p.h')
-rw-r--r-- | src/gui/rhi/qrhigles2_p_p.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhigles2_p_p.h b/src/gui/rhi/qrhigles2_p_p.h index 646836a699..a4a9c15ce7 100644 --- a/src/gui/rhi/qrhigles2_p_p.h +++ b/src/gui/rhi/qrhigles2_p_p.h @@ -312,8 +312,8 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer BindShaderResources, BindFramebuffer, Clear, - BufferData, BufferSubData, + GetBufferSubData, CopyTex, ReadPixels, SubImage, @@ -402,6 +402,13 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer const void *data; // must come from retainData() } bufferSubData; struct { + QRhiBufferReadbackResult *result; + GLenum target; + GLuint buffer; + int offset; + int size; + } getBufferSubData; + struct { GLenum srcFaceTarget; GLuint srcTexture; int srcLevel; @@ -744,7 +751,9 @@ public: rgba8Format(false), instancing(false), baseVertex(false), - compute(false) + compute(false), + textureCompareMode(false), + mapBuffer(false) { } int ctxMajor; int ctxMinor; @@ -775,6 +784,7 @@ public: uint baseVertex : 1; uint compute : 1; uint textureCompareMode : 1; + uint mapBuffer : 1; } caps; QGles2SwapChain *currentSwapChain = nullptr; QVector<GLint> supportedCompressedFormats; |