Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-08-30 22:52:09 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-08-30 23:26:11 +0300
commitfe195f51d1a842087ba411488ec5a8b8979583ee (patch)
tree5fa00805fa337b351fc105c58047f0acf39daac0 /source/blender/gpu/GPU_storage_buffer.h
parent25237d2625078c6d14d744f288776299efd3c7c8 (diff)
GPUStorageBuf: Add `read()` function to readback buffer data to host
This is not expected to be fast. This is only for inspecting the content of the buffer for debugging or validation purpose.
Diffstat (limited to 'source/blender/gpu/GPU_storage_buffer.h')
-rw-r--r--source/blender/gpu/GPU_storage_buffer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_storage_buffer.h b/source/blender/gpu/GPU_storage_buffer.h
index ca6a848786b..8837a7c7647 100644
--- a/source/blender/gpu/GPU_storage_buffer.h
+++ b/source/blender/gpu/GPU_storage_buffer.h
@@ -48,6 +48,13 @@ void GPU_storagebuf_clear(GPUStorageBuf *ssbo,
void GPU_storagebuf_clear_to_zero(GPUStorageBuf *ssbo);
/**
+ * Read back content of the buffer to CPU for inspection.
+ * Slow! Only use for inspection / debugging.
+ * NOTE: Not synchronized. Use appropriate barrier before reading.
+ */
+void GPU_storagebuf_read(GPUStorageBuf *ssbo, void *data);
+
+/**
* \brief Copy a part of a vertex buffer to a storage buffer.
*
* \param ssbo: destination storage buffer