diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-03-16 10:42:12 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-18 22:59:20 +0300 |
commit | 7ee816e32f3655d4ca8abb555f885d8de9ba0520 (patch) | |
tree | 50190c369e80c20fadc1bc55d56f160188a1ff90 /source/blender/gpu/GPU_storage_buffer.h | |
parent | 5bd38f3be8542f09ece0d936b04dba3f8854cb51 (diff) |
GPU: StorageBuf: Add method to clear the buffer in place.
This is a faster way to clear a buffer instead of reuploading new data.
It is equivalent to `memset` and runs directly on the GPU.
This is better to clear huge buffers and to avoid the sync cost of data upload.
Diffstat (limited to 'source/blender/gpu/GPU_storage_buffer.h')
-rw-r--r-- | source/blender/gpu/GPU_storage_buffer.h | 7 |
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 930b6a1012b..1478d490e23 100644 --- a/source/blender/gpu/GPU_storage_buffer.h +++ b/source/blender/gpu/GPU_storage_buffer.h @@ -13,6 +13,7 @@ #pragma once +#include "GPU_texture.h" #include "GPU_vertex_buffer.h" #ifdef __cplusplus @@ -40,6 +41,12 @@ void GPU_storagebuf_bind(GPUStorageBuf *ssbo, int slot); void GPU_storagebuf_unbind(GPUStorageBuf *ssbo); void GPU_storagebuf_unbind_all(void); +void GPU_storagebuf_clear(GPUStorageBuf *ssbo, + eGPUTextureFormat internal_format, + eGPUDataFormat data_format, + void *data); +void GPU_storagebuf_clear_to_zero(GPUStorageBuf *ssbo); + #ifdef __cplusplus } #endif |