diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-10-11 22:02:43 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-10-12 07:55:37 +0200 |
commit | 2189e0f2fc2aadf84ed53a7ae6210e2bbe04b45e (patch) | |
tree | 5cdc23693256752f6b7ad624efa1d270fd7bd247 /src/gui/rhi/qrhivulkan.cpp | |
parent | e7c456d3395826a427b863c0cfc8c60aa4ab7d6c (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/qrhivulkan.cpp')
-rw-r--r-- | src/gui/rhi/qrhivulkan.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index 05b7afae75..fc539c03a9 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -5370,14 +5370,14 @@ QRhiBuffer::NativeBuffer QVkBuffer::nativeBuffer() return { { &buffers[0] }, 1 }; } -char *QVkBuffer::beginFullDynamicUniformBufferUpdateForCurrentFrame() +char *QVkBuffer::beginFullDynamicBufferUpdateForCurrentFrame() { // Shortcut the entire buffer update mechanism and allow the client to do // the host writes directly to the buffer. This will lead to unexpected // results when combined with QRhiResourceUpdateBatch-based updates for the - // buffer, but provides a fast path for uniform buffers that have all their + // buffer, but provides a fast path for dynamic buffers that have all their // content changed in every frame. - Q_ASSERT(m_type == Dynamic && m_usage.testFlag(UniformBuffer)); + Q_ASSERT(m_type == Dynamic); QRHI_RES_RHI(QRhiVulkan); Q_ASSERT(rhiD->inFrame); const int slot = rhiD->currentFrameSlot; @@ -5391,7 +5391,7 @@ char *QVkBuffer::beginFullDynamicUniformBufferUpdateForCurrentFrame() return static_cast<char *>(p); } -void QVkBuffer::endFullDynamicUniformBufferUpdateForCurrentFrame() +void QVkBuffer::endFullDynamicBufferUpdateForCurrentFrame() { QRHI_RES_RHI(QRhiVulkan); const int slot = rhiD->currentFrameSlot; |