From 2189e0f2fc2aadf84ed53a7ae6210e2bbe04b45e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sun, 11 Oct 2020 22:02:43 +0200 Subject: 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 --- tests/manual/rhi/noninstanced/noninstanced.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/manual/rhi') diff --git a/tests/manual/rhi/noninstanced/noninstanced.cpp b/tests/manual/rhi/noninstanced/noninstanced.cpp index 31ea6e24a2..e014e302e0 100644 --- a/tests/manual/rhi/noninstanced/noninstanced.cpp +++ b/tests/manual/rhi/noninstanced/noninstanced.cpp @@ -149,7 +149,7 @@ void Window::customRender() } for (int i = 0; i < INSTANCE_COUNT; ++i) { - char *p = d.ubuf[i]->beginFullDynamicUniformBufferUpdateForCurrentFrame(); + char *p = d.ubuf[i]->beginFullDynamicBufferUpdateForCurrentFrame(); QMatrix4x4 mvp = m_proj; mvp.rotate(d.rot, 0, 1, 0); mvp.scale(0.05f); @@ -171,7 +171,7 @@ void Window::customRender() memcpy(p + 84, &d.instData[i].g, 4); memcpy(p + 88, &d.instData[i].b, 4); - d.ubuf[i]->endFullDynamicUniformBufferUpdateForCurrentFrame(); + d.ubuf[i]->endFullDynamicBufferUpdateForCurrentFrame(); } cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u, QRhiCommandBuffer::DoNotTrackResourcesForCompute); -- cgit v1.2.3