Blender  V3.3
Macros | Typedefs | Functions
GPU_storage_buffer.h File Reference
#include "GPU_texture.h"
#include "GPU_vertex_buffer.h"

Go to the source code of this file.

Macros

#define GPU_storagebuf_create(size)    GPU_storagebuf_create_ex(size, NULL, GPU_USAGE_DYNAMIC, __func__);
 

Typedefs

typedef struct GPUStorageBuf GPUStorageBuf
 

Functions

GPUStorageBufGPU_storagebuf_create_ex (size_t size, const void *data, GPUUsageType usage, const char *name)
 
void GPU_storagebuf_free (GPUStorageBuf *ssbo)
 
void GPU_storagebuf_update (GPUStorageBuf *ssbo, const void *data)
 
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)
 
void GPU_storagebuf_copy_sub_from_vertbuf (GPUStorageBuf *ssbo, GPUVertBuf *src, uint dst_offset, uint src_offset, uint copy_size)
 Copy a part of a vertex buffer to a storage buffer. More...
 

Detailed Description

Storage buffers API. Used to handle many way bigger buffers than Uniform buffers update at once. Make sure that the data structure is compatible with what the implementation expect. (see "7.8 Shader Buffer Variables and Shader Storage Blocks" from the OpenGL spec for more info about std430 layout) Rule of thumb: Padding to 16bytes, don't use vec3.

Definition in file GPU_storage_buffer.h.

Macro Definition Documentation

◆ GPU_storagebuf_create

#define GPU_storagebuf_create (   size)     GPU_storagebuf_create_ex(size, NULL, GPU_USAGE_DYNAMIC, __func__);

Definition at line 33 of file GPU_storage_buffer.h.

Typedef Documentation

◆ GPUStorageBuf

typedef struct GPUStorageBuf GPUStorageBuf

Opaque type hiding blender::gpu::StorageBuf.

Definition at line 1 of file GPU_storage_buffer.h.

Function Documentation

◆ GPU_storagebuf_bind()

void GPU_storagebuf_bind ( GPUStorageBuf ssbo,
int  slot 
)

Definition at line 77 of file gpu_storage_buffer.cc.

References blender::gpu::unwrap().

Referenced by draw_update_uniforms().

◆ GPU_storagebuf_clear()

void GPU_storagebuf_clear ( GPUStorageBuf ssbo,
eGPUTextureFormat  internal_format,
eGPUDataFormat  data_format,
void data 
)

Definition at line 92 of file gpu_storage_buffer.cc.

References data, and blender::gpu::unwrap().

Referenced by GPU_storagebuf_clear_to_zero().

◆ GPU_storagebuf_clear_to_zero()

void GPU_storagebuf_clear_to_zero ( GPUStorageBuf ssbo)

Definition at line 100 of file gpu_storage_buffer.cc.

References data, GPU_DATA_UINT, GPU_R32UI, and GPU_storagebuf_clear().

◆ GPU_storagebuf_copy_sub_from_vertbuf()

void GPU_storagebuf_copy_sub_from_vertbuf ( GPUStorageBuf ssbo,
GPUVertBuf src,
uint  dst_offset,
uint  src_offset,
uint  copy_size 
)

Copy a part of a vertex buffer to a storage buffer.

Parameters
ssbodestination storage buffer
srcsource vertex buffer
dst_offsetwhere to start copying to (in bytes).
src_offsetwhere to start copying from (in bytes).
copy_sizebyte size of the segment to copy.

Definition at line 106 of file gpu_storage_buffer.cc.

References src, and blender::gpu::unwrap().

Referenced by blender::eevee::VelocityModule::step_swap().

◆ GPU_storagebuf_create_ex()

GPUStorageBuf* GPU_storagebuf_create_ex ( size_t  size,
const void data,
GPUUsageType  usage,
const char *  name 
)

◆ GPU_storagebuf_free()

void GPU_storagebuf_free ( GPUStorageBuf ssbo)

◆ GPU_storagebuf_unbind()

void GPU_storagebuf_unbind ( GPUStorageBuf ssbo)

Definition at line 82 of file gpu_storage_buffer.cc.

References blender::gpu::unwrap().

◆ GPU_storagebuf_unbind_all()

void GPU_storagebuf_unbind_all ( void  )

Definition at line 87 of file gpu_storage_buffer.cc.

Referenced by draw_shgroup(), and DRW_state_reset().

◆ GPU_storagebuf_update()

void GPU_storagebuf_update ( GPUStorageBuf ssbo,
const void data 
)