Added GpuBuffer::WritePolicy 81/290281/10
authorAdam Bialogonski <adam.b@samsung.com>
Thu, 20 Apr 2023 10:31:36 +0000 (11:31 +0100)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 12 May 2023 13:34:47 +0000 (14:34 +0100)
commitb042388ebaef225c58c75e350d101ddda6f5f970
tree9bac72ad510068af3aa31c4d1e9e41ca3d9fd1da
parent4106102c29a3e8706434ed404ae0068f425e06f7
Added GpuBuffer::WritePolicy

The write policy tells the GpuBuffer what to do with the Graphics::Buffer object
during updating buffer content. It's possible to:

- RETAIN the content
- DISCARD the content

Both options have performance implications. Retaining the content may cause blocking the access to the buffer by the GPU driver in case the buffer is currently in use by the GPU. Frequent buffer updates may cause a massive performance hit. This policy allows writing a partial updates into the buffer.

Discarding the content means orphaning an underlying memory and allocating new buffer storage so it can be accessed immediately while GPU may be finishing work with the old content. The downside of it is no partial updates are possible. Area of buffer which isn't updated stays undefined. This policy is made for frequent updates (every frame).

Change-Id: Ic0e80d7b23208a455129c16fb3e23a4020791b50
automated-tests/src/dali-internal/CMakeLists.txt
automated-tests/src/dali-internal/utc-Dali-Internal-GpuBuffer.cpp [new file with mode: 0644]
dali/internal/render/renderers/gpu-buffer.cpp
dali/internal/render/renderers/gpu-buffer.h
dali/internal/render/renderers/render-geometry.cpp
dali/internal/render/renderers/render-vertex-buffer.cpp