90#define GPU_FRAMEBUFFER_FREE_SAFE(fb) \
92 if (fb != nullptr) { \
93 GPU_framebuffer_free(fb); \
146#define NULL_ATTACHMENT_COLOR {0.0, 0.0, 0.0, 0.0}
147#define NULL_LOAD_STORE \
148 {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_DONT_CARE, NULL_ATTACHMENT_COLOR}
178 const GPULoadStore *load_store_actions,
179 uint load_store_actions_len);
180#define GPU_framebuffer_bind_ex(_fb, ...) \
182 GPULoadStore actions[] = __VA_ARGS__; \
183 GPU_framebuffer_bind_loadstore(_fb, actions, (sizeof(actions) / sizeof(GPULoadStore))); \
209 uint attachment_len);
211#define GPU_framebuffer_subpass_transition(_fb, ...) \
213 GPUAttachmentState actions[] = __VA_ARGS__; \
214 GPU_framebuffer_subpass_transition_array( \
215 _fb, actions, (sizeof(actions) / sizeof(GPUAttachmentState))); \
243#define GPU_framebuffer_ensure_config(_fb, ...) \
245 if (*(_fb) == nullptr) { \
246 *(_fb) = GPU_framebuffer_create(#_fb); \
248 GPUAttachment config[] = __VA_ARGS__; \
249 GPU_framebuffer_config_array(*(_fb), config, (sizeof(config) / sizeof(GPUAttachment))); \
259 const GPUAttachment *config,
263#define GPU_ATTACHMENT_NONE \
269#define GPU_ATTACHMENT_LEAVE \
275#define GPU_ATTACHMENT_TEXTURE(_texture) \
281#define GPU_ATTACHMENT_TEXTURE_MIP(_texture, _mip) \
284 _texture, -1, _mip, \
287#define GPU_ATTACHMENT_TEXTURE_LAYER(_texture, _layer) \
290 _texture, _layer, 0, \
293#define GPU_ATTACHMENT_TEXTURE_LAYER_MIP(_texture, _layer, _mip) \
296 _texture, _layer, _mip, \
302#define GPU_ATTACHMENT_TEXTURE_CUBEFACE(_texture, _face) \
305 _texture, _face, 0, \
308#define GPU_ATTACHMENT_TEXTURE_CUBEFACE_MIP(_texture, _face, _mip) \
311 _texture, _face, _mip, \
337 gpu::FrameBuffer *
fb, gpu::Texture *
texture,
int slot,
int layer,
int mip);
349 gpu::FrameBuffer *
fb, gpu::Texture *
texture,
int slot,
int face,
int mip);
451 unsigned int clear_stencil);
550#ifndef GPU_NO_USE_PY_REFERENCES
616 int x,
int y,
int width,
int height,
int channels,
eGPUDataFormat data_format,
void *r_data);
628 gpu::FrameBuffer *fb_write,
655 bool with_depth_buffer,
692 GPUOffScreen *offscreen,
eGPUDataFormat data_format,
int x,
int y,
int w,
int h,
void *r_data);
725 gpu::FrameBuffer **r_fb,
726 gpu::Texture **r_color,
727 gpu::Texture **r_depth);
#define ENUM_OPERATORS(_enum_type)
static void clear(T &value)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
void GPU_framebuffer_bind(gpu::FrameBuffer *fb)
gpu::FrameBuffer * GPU_framebuffer_active_get()
void GPU_framebuffer_read_color(gpu::FrameBuffer *fb, int x, int y, int width, int height, int channels, int slot, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_texture_layer_attach(gpu::FrameBuffer *fb, gpu::Texture *texture, int slot, int layer, int mip)
void GPU_offscreen_free(GPUOffScreen *offscreen)
void GPU_framebuffer_clear(gpu::FrameBuffer *fb, GPUFrameBufferBits buffers, const double4 clear_col, float clear_depth, unsigned int clear_stencil)
void GPU_framebuffer_restore()
void GPU_framebuffer_py_reference_set(gpu::FrameBuffer *fb, void **py_ref)
const char * GPU_framebuffer_get_name(gpu::FrameBuffer *fb)
void GPU_clear_color(float red, float green, float blue, float alpha)
bool GPU_framebuffer_check_valid(gpu::FrameBuffer *fb, char err_out[256])
void GPU_framebuffer_free(gpu::FrameBuffer *fb)
void GPU_framebuffer_viewport_set(gpu::FrameBuffer *fb, int x, int y, int width, int height)
BLI_INLINE float fb(float length, float L)
int2 GPU_framebuffer_extent_get(gpu::FrameBuffer *fb)
Get the extent of the framebuffer.
void GPU_framebuffer_clear_depth_stencil(gpu::FrameBuffer *fb, float clear_depth, uint clear_stencil)
void GPU_clear_depth(float depth)
void GPU_framebuffer_push(gpu::FrameBuffer *fb)
void GPU_framebuffer_clear_color(gpu::FrameBuffer *fb, const double4 clear_col)
int GPU_offscreen_width(const GPUOffScreen *offscreen)
gpu::FrameBuffer * GPU_framebuffer_pop()
void GPU_offscreen_read_color_region(GPUOffScreen *offscreen, eGPUDataFormat data_format, int x, int y, int w, int h, void *r_data)
int GPU_offscreen_height(const GPUOffScreen *offscreen)
void GPU_offscreen_unbind(GPUOffScreen *offscreen, bool restore)
void GPU_offscreen_viewport_data_get(GPUOffScreen *offscreen, gpu::FrameBuffer **r_fb, gpu::Texture **r_color, gpu::Texture **r_depth)
gpu::FrameBuffer * GPU_framebuffer_back_get()
void GPU_offscreen_draw_to_screen(GPUOffScreen *offscreen, int x, int y)
void GPU_framebuffer_viewport_reset(gpu::FrameBuffer *fb)
static constexpr int GPU_MAX_VIEWPORTS
void ** GPU_framebuffer_py_reference_get(gpu::FrameBuffer *fb)
void GPU_framebuffer_config_array(gpu::FrameBuffer *fb, const GPUAttachment *config, int config_len)
void GPU_backbuffer_bind(GPUBackBuffer back_buffer_type)
void GPU_framebuffer_multi_viewports_set(gpu::FrameBuffer *gpu_fb, const int viewport_rects[GPU_MAX_VIEWPORTS][4])
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
void GPU_framebuffer_bind_no_srgb(gpu::FrameBuffer *fb)
void GPU_frontbuffer_read_color(int x, int y, int width, int height, int channels, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_blit(gpu::FrameBuffer *fb_read, int read_slot, gpu::FrameBuffer *fb_write, int write_slot, GPUFrameBufferBits blit_buffers)
gpu::FrameBuffer * GPU_framebuffer_create(const char *name)
void GPU_framebuffer_clear_depth(gpu::FrameBuffer *fb, float clear_depth)
void GPU_framebuffer_multi_clear(gpu::FrameBuffer *fb, Span< double4 > clear_colors)
void GPU_framebuffer_bind_loadstore(gpu::FrameBuffer *fb, const GPULoadStore *load_store_actions, uint load_store_actions_len)
uint GPU_framebuffer_stack_level_get()
void GPU_framebuffer_default_size(gpu::FrameBuffer *fb, int width, int height)
void GPU_framebuffer_texture_cubeface_attach(gpu::FrameBuffer *fb, gpu::Texture *texture, int slot, int face, int mip)
void GPU_framebuffer_texture_attach(gpu::FrameBuffer *fb, gpu::Texture *texture, int slot, int mip)
gpu::Texture * GPU_offscreen_color_texture(const GPUOffScreen *offscreen)
gpu::TextureFormat GPU_offscreen_format(const GPUOffScreen *offscreen)
void GPU_framebuffer_viewport_get(gpu::FrameBuffer *fb, int r_viewport[4])
GPUOffScreen * GPU_offscreen_create(int width, int height, bool with_depth_buffer, gpu::TextureFormat format, eGPUTextureUsage usage, bool clear, char err_out[256])
void GPU_framebuffer_subpass_transition_array(gpu::FrameBuffer *fb, const GPUAttachmentState *attachment_states, uint attachment_len)
void GPU_framebuffer_read_depth(gpu::FrameBuffer *fb, int x, int y, int width, int height, eGPUDataFormat data_format, void *r_data)
bool GPU_framebuffer_bound(gpu::FrameBuffer *fb)
void GPU_framebuffer_clear_color_depth(gpu::FrameBuffer *fb, const double4 clear_col, float clear_depth)
void GPU_framebuffer_clear_stencil(gpu::FrameBuffer *fb, uint clear_stencil)
VecBase< double, 4 > double4
void GPU_framebuffer_clear_color_depth_stencil(gpu::FrameBuffer *fb, const double4 clear_col, float clear_depth, uint clear_stencil)
void GPU_framebuffer_texture_detach(gpu::FrameBuffer *fb, gpu::Texture *texture)
void GPU_offscreen_read_color(GPUOffScreen *offscreen, eGPUDataFormat data_format, void *r_data)