summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhigles2_p_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-10-11 22:02:43 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-10-12 07:55:37 +0200
commit2189e0f2fc2aadf84ed53a7ae6210e2bbe04b45e (patch)
tree5cdc23693256752f6b7ad624efa1d270fd7bd247 /src/gui/rhi/qrhigles2_p_p.h
parente7c456d3395826a427b863c0cfc8c60aa4ab7d6c (diff)
rhi: Make the new direct buffer update available for non-uniform buffers
The original restriction to UniformBuffer was due to the GL backend where there is no GL buffer object for QRhiBuffers with usage UniformBuffer. However, we can still implement this for cases when there is a true GL buffer object underneath. With other backends it should all work as-is already. This becomes useful when one has buffers with usage Vertex that need full updates every frame. (f.ex. instance data) Unfortunately this involves renaming the function. But while at it, add an autotest case as well. Change-Id: Iff59e4509a8bae06654cc92fe8428bd79eb012fb 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.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhigles2_p_p.h b/src/gui/rhi/qrhigles2_p_p.h
index b7577ce51b..6ce3786445 100644
--- a/src/gui/rhi/qrhigles2_p_p.h
+++ b/src/gui/rhi/qrhigles2_p_p.h
@@ -65,11 +65,13 @@ struct QGles2Buffer : public QRhiBuffer
void destroy() override;
bool create() override;
QRhiBuffer::NativeBuffer nativeBuffer() override;
- char *beginFullDynamicUniformBufferUpdateForCurrentFrame() override;
+ char *beginFullDynamicBufferUpdateForCurrentFrame() override;
+ void endFullDynamicBufferUpdateForCurrentFrame() override;
+ int nonZeroSize = 0;
GLuint buffer = 0;
GLenum targetForDataOps;
- char *ubuf = nullptr;
+ char *data = nullptr;
enum Access {
AccessNone,
AccessVertex,