85#define GPU_FRAMEBUFFER_FREE_SAFE(fb) \
87 if (fb != nullptr) { \
88 GPU_framebuffer_free(fb); \
141#define NULL_ATTACHMENT_COLOR \
145#define NULL_LOAD_STORE \
147 GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_DONT_CARE, NULL_ATTACHMENT_COLOR \
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))); \
261#define GPU_ATTACHMENT_NONE \
266#define GPU_ATTACHMENT_LEAVE \
271#define GPU_ATTACHMENT_TEXTURE(_texture) \
276#define GPU_ATTACHMENT_TEXTURE_MIP(_texture, _mip) \
278 _texture, -1, _mip, \
281#define GPU_ATTACHMENT_TEXTURE_LAYER(_texture, _layer) \
283 _texture, _layer, 0, \
286#define GPU_ATTACHMENT_TEXTURE_LAYER_MIP(_texture, _layer, _mip) \
288 _texture, _layer, _mip, \
294#define GPU_ATTACHMENT_TEXTURE_CUBEFACE(_texture, _face) \
296 _texture, _face, 0, \
299#define GPU_ATTACHMENT_TEXTURE_CUBEFACE_MIP(_texture, _face, _mip) \
301 _texture, _face, _mip, \
324 GPUFrameBuffer *
fb, GPUTexture *
texture,
int slot,
int layer,
int mip);
336 GPUFrameBuffer *
fb, GPUTexture *
texture,
int slot,
int face,
int mip);
431 const float clear_col[4],
433 unsigned int clear_stencil);
463 const float clear_col[4],
482 const float clear_col[4],
532#ifndef GPU_NO_USE_PY_REFERENCES
597 int x,
int y,
int width,
int height,
int channels,
eGPUDataFormat data_format,
void *r_data);
609 GPUFrameBuffer *fb_write,
624 void (*per_level_callback)(
void *user_data,
int level),
650 bool with_depth_buffer,
720 GPUFrameBuffer **r_fb,
721 GPUTexture **r_color,
722 GPUTexture **r_depth);
#define ENUM_OPERATORS(_type, _max)
void GPU_framebuffer_multi_viewports_set(GPUFrameBuffer *gpu_fb, const int viewport_rects[GPU_MAX_VIEWPORTS][4])
void GPU_framebuffer_read_color(GPUFrameBuffer *fb, int x, int y, int width, int height, int channels, int slot, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_viewport_get(GPUFrameBuffer *fb, int r_viewport[4])
void GPU_offscreen_draw_to_screen(GPUOffScreen *offscreen, int x, int y)
const char * GPU_framebuffer_get_name(GPUFrameBuffer *fb)
void GPU_framebuffer_bind_no_srgb(GPUFrameBuffer *fb)
GPUFrameBuffer * GPU_framebuffer_create(const char *name)
GPUFrameBuffer * GPU_framebuffer_active_get()
int GPU_offscreen_width(const GPUOffScreen *offscreen)
bool GPU_framebuffer_check_valid(GPUFrameBuffer *fb, char err_out[256])
void GPU_framebuffer_viewport_set(GPUFrameBuffer *fb, int x, int y, int width, int height)
void GPU_framebuffer_viewport_reset(GPUFrameBuffer *fb)
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
void GPU_offscreen_viewport_data_get(GPUOffScreen *offscreen, GPUFrameBuffer **r_fb, GPUTexture **r_color, GPUTexture **r_depth)
void GPU_framebuffer_texture_cubeface_attach(GPUFrameBuffer *fb, GPUTexture *texture, int slot, int face, int mip)
void GPU_framebuffer_clear_color_depth_stencil(GPUFrameBuffer *fb, const float clear_col[4], float clear_depth, uint clear_stencil)
void GPU_framebuffer_restore()
void GPU_framebuffer_clear_stencil(GPUFrameBuffer *fb, uint clear_stencil)
void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *texture)
void GPU_framebuffer_clear_depth_stencil(GPUFrameBuffer *fb, float clear_depth, uint clear_stencil)
static constexpr int GPU_MAX_VIEWPORTS
void GPU_frontbuffer_read_color(int x, int y, int width, int height, int channels, eGPUDataFormat data_format, void *r_data)
void ** GPU_framebuffer_py_reference_get(GPUFrameBuffer *fb)
void GPU_framebuffer_read_depth(GPUFrameBuffer *fb, int x, int y, int width, int height, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_clear_color_depth(GPUFrameBuffer *fb, const float clear_col[4], float clear_depth)
uint GPU_framebuffer_stack_level_get()
void GPU_framebuffer_subpass_transition_array(GPUFrameBuffer *fb, const GPUAttachmentState *attachment_states, uint attachment_len)
void GPU_framebuffer_bind_loadstore(GPUFrameBuffer *fb, const GPULoadStore *load_store_actions, uint load_store_actions_len)
int GPU_offscreen_height(const GPUOffScreen *offscreen)
GPUOffScreen * GPU_offscreen_create(int width, int height, bool with_depth_buffer, eGPUTextureFormat format, eGPUTextureUsage usage, bool clear, char err_out[256])
void GPU_framebuffer_py_reference_set(GPUFrameBuffer *fb, void **py_ref)
void GPU_framebuffer_free(GPUFrameBuffer *fb)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void GPU_framebuffer_multi_clear(GPUFrameBuffer *fb, const float(*clear_colors)[4])
GPUTexture * GPU_offscreen_color_texture(const GPUOffScreen *offscreen)
void GPU_clear_color(float red, float green, float blue, float alpha)
void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_len)
void GPU_offscreen_read_color_region(GPUOffScreen *offscreen, eGPUDataFormat data_format, int x, int y, int w, int h, void *r_data)
void GPU_framebuffer_texture_layer_attach(GPUFrameBuffer *fb, GPUTexture *texture, int slot, int layer, int mip)
void GPU_offscreen_free(GPUOffScreen *offscreen)
void GPU_backbuffer_bind(eGPUBackBuffer back_buffer_type)
eGPUTextureFormat GPU_offscreen_format(const GPUOffScreen *offscreen)
void GPU_framebuffer_push(GPUFrameBuffer *fb)
void GPU_clear_depth(float depth)
void GPU_framebuffer_default_size(GPUFrameBuffer *fb, int width, int height)
void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *fb, int max_level, void(*per_level_callback)(void *user_data, int level), void *user_data)
void GPU_framebuffer_clear_color(GPUFrameBuffer *fb, const float clear_col[4])
void GPU_offscreen_read_color(GPUOffScreen *offscreen, eGPUDataFormat data_format, void *r_data)
GPUFrameBuffer * GPU_framebuffer_pop()
void GPU_framebuffer_clear(GPUFrameBuffer *fb, eGPUFrameBufferBits buffers, const float clear_col[4], float clear_depth, unsigned int clear_stencil)
void GPU_framebuffer_clear_depth(GPUFrameBuffer *fb, float clear_depth)
bool GPU_framebuffer_bound(GPUFrameBuffer *fb)
GPUFrameBuffer * GPU_framebuffer_back_get()
void GPU_offscreen_unbind(GPUOffScreen *offscreen, bool restore)
void GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *texture, int slot, int mip)
void GPU_framebuffer_blit(GPUFrameBuffer *fb_read, int read_slot, GPUFrameBuffer *fb_write, int write_slot, eGPUFrameBufferBits blit_buffers)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
BLI_INLINE float fb(float length, float L)
static void clear(Message &msg)