85#define GPU_FRAMEBUFFER_FREE_SAFE(fb) \
87 if (fb != nullptr) { \
88 GPU_framebuffer_free(fb); \
141#define NULL_ATTACHMENT_COLOR {0.0, 0.0, 0.0, 0.0}
142#define NULL_LOAD_STORE \
143 {GPU_LOADACTION_DONT_CARE, GPU_STOREACTION_DONT_CARE, NULL_ATTACHMENT_COLOR}
174 uint load_store_actions_len);
175#define GPU_framebuffer_bind_ex(_fb, ...) \
177 GPULoadStore actions[] = __VA_ARGS__; \
178 GPU_framebuffer_bind_loadstore(_fb, actions, (sizeof(actions) / sizeof(GPULoadStore))); \
204 uint attachment_len);
206#define GPU_framebuffer_subpass_transition(_fb, ...) \
208 GPUAttachmentState actions[] = __VA_ARGS__; \
209 GPU_framebuffer_subpass_transition_array( \
210 _fb, actions, (sizeof(actions) / sizeof(GPUAttachmentState))); \
238#define GPU_framebuffer_ensure_config(_fb, ...) \
240 if (*(_fb) == nullptr) { \
241 *(_fb) = GPU_framebuffer_create(#_fb); \
243 GPUAttachment config[] = __VA_ARGS__; \
244 GPU_framebuffer_config_array(*(_fb), config, (sizeof(config) / sizeof(GPUAttachment))); \
258#define GPU_ATTACHMENT_NONE \
265#define GPU_ATTACHMENT_LEAVE \
272#define GPU_ATTACHMENT_TEXTURE(_texture) \
279#define GPU_ATTACHMENT_TEXTURE_MIP(_texture, _mip) \
286#define GPU_ATTACHMENT_TEXTURE_LAYER(_texture, _layer) \
293#define GPU_ATTACHMENT_TEXTURE_LAYER_MIP(_texture, _layer, _mip) \
303#define GPU_ATTACHMENT_TEXTURE_CUBEFACE(_texture, _face) \
310#define GPU_ATTACHMENT_TEXTURE_CUBEFACE_MIP(_texture, _face, _mip) \
448 const float clear_col[4],
450 unsigned int clear_stencil);
480 const float clear_col[4],
499 const float clear_col[4],
549#ifndef GPU_NO_USE_PY_REFERENCES
614 int x,
int y,
int width,
int height,
int channels,
eGPUDataFormat data_format,
void *r_data);
653 bool with_depth_buffer,
#define ENUM_OPERATORS(_type, _max)
blender::gpu::FrameBuffer * GPU_framebuffer_create(const char *name)
void GPU_framebuffer_subpass_transition_array(blender::gpu::FrameBuffer *fb, const GPUAttachmentState *attachment_states, uint attachment_len)
blender::gpu::Texture * GPU_offscreen_color_texture(const GPUOffScreen *offscreen)
void GPU_framebuffer_default_size(blender::gpu::FrameBuffer *fb, int width, int height)
void GPU_framebuffer_texture_detach(blender::gpu::FrameBuffer *fb, blender::gpu::Texture *texture)
void GPU_offscreen_draw_to_screen(GPUOffScreen *offscreen, int x, int y)
void GPU_framebuffer_viewport_reset(blender::gpu::FrameBuffer *fb)
void GPU_framebuffer_clear_stencil(blender::gpu::FrameBuffer *fb, uint clear_stencil)
int GPU_offscreen_width(const GPUOffScreen *offscreen)
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
void GPU_framebuffer_restore()
void GPU_backbuffer_bind(GPUBackBuffer back_buffer_type)
void GPU_framebuffer_bind_loadstore(blender::gpu::FrameBuffer *fb, const GPULoadStore *load_store_actions, uint load_store_actions_len)
void GPU_framebuffer_clear_depth_stencil(blender::gpu::FrameBuffer *fb, float clear_depth, uint clear_stencil)
blender::gpu::FrameBuffer * GPU_framebuffer_back_get()
void GPU_framebuffer_read_color(blender::gpu::FrameBuffer *fb, int x, int y, int width, int height, int channels, int slot, eGPUDataFormat data_format, void *r_data)
blender::gpu::TextureFormat GPU_offscreen_format(const GPUOffScreen *offscreen)
void GPU_framebuffer_multi_clear(blender::gpu::FrameBuffer *fb, const float(*clear_colors)[4])
static constexpr int GPU_MAX_VIEWPORTS
void ** GPU_framebuffer_py_reference_get(blender::gpu::FrameBuffer *fb)
void GPU_framebuffer_py_reference_set(blender::gpu::FrameBuffer *fb, void **py_ref)
void GPU_frontbuffer_read_color(int x, int y, int width, int height, int channels, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_free(blender::gpu::FrameBuffer *fb)
uint GPU_framebuffer_stack_level_get()
void GPU_framebuffer_texture_layer_attach(blender::gpu::FrameBuffer *fb, blender::gpu::Texture *texture, int slot, int layer, int mip)
void GPU_framebuffer_texture_attach(blender::gpu::FrameBuffer *fb, blender::gpu::Texture *texture, int slot, int mip)
void GPU_framebuffer_viewport_set(blender::gpu::FrameBuffer *fb, int x, int y, int width, int height)
int GPU_offscreen_height(const GPUOffScreen *offscreen)
blender::gpu::FrameBuffer * GPU_framebuffer_pop()
GPUOffScreen * GPU_offscreen_create(int width, int height, bool with_depth_buffer, blender::gpu::TextureFormat format, eGPUTextureUsage usage, bool clear, char err_out[256])
void GPU_clear_color(float red, float green, float blue, float alpha)
bool GPU_framebuffer_check_valid(blender::gpu::FrameBuffer *fb, char err_out[256])
void GPU_framebuffer_blit(blender::gpu::FrameBuffer *fb_read, int read_slot, blender::gpu::FrameBuffer *fb_write, int write_slot, GPUFrameBufferBits blit_buffers)
void GPU_offscreen_read_color_region(GPUOffScreen *offscreen, eGPUDataFormat data_format, int x, int y, int w, int h, void *r_data)
void GPU_offscreen_free(GPUOffScreen *offscreen)
void GPU_offscreen_viewport_data_get(GPUOffScreen *offscreen, blender::gpu::FrameBuffer **r_fb, blender::gpu::Texture **r_color, blender::gpu::Texture **r_depth)
const char * GPU_framebuffer_get_name(blender::gpu::FrameBuffer *fb)
void GPU_framebuffer_bind_no_srgb(blender::gpu::FrameBuffer *fb)
void GPU_framebuffer_clear_depth(blender::gpu::FrameBuffer *fb, float clear_depth)
void GPU_framebuffer_clear_color_depth_stencil(blender::gpu::FrameBuffer *fb, const float clear_col[4], float clear_depth, uint clear_stencil)
void GPU_clear_depth(float depth)
bool GPU_framebuffer_bound(blender::gpu::FrameBuffer *fb)
void GPU_framebuffer_clear_color(blender::gpu::FrameBuffer *fb, const float clear_col[4])
void GPU_framebuffer_read_depth(blender::gpu::FrameBuffer *fb, int x, int y, int width, int height, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_push(blender::gpu::FrameBuffer *fb)
void GPU_framebuffer_config_array(blender::gpu::FrameBuffer *fb, const GPUAttachment *config, int config_len)
void GPU_offscreen_read_color(GPUOffScreen *offscreen, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_multi_viewports_set(blender::gpu::FrameBuffer *gpu_fb, const int viewport_rects[GPU_MAX_VIEWPORTS][4])
void GPU_framebuffer_texture_cubeface_attach(blender::gpu::FrameBuffer *fb, blender::gpu::Texture *texture, int slot, int face, int mip)
void GPU_framebuffer_clear_color_depth(blender::gpu::FrameBuffer *fb, const float clear_col[4], float clear_depth)
void GPU_framebuffer_clear(blender::gpu::FrameBuffer *fb, GPUFrameBufferBits buffers, const float clear_col[4], float clear_depth, unsigned int clear_stencil)
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
void GPU_offscreen_unbind(GPUOffScreen *offscreen, bool restore)
void GPU_framebuffer_viewport_get(blender::gpu::FrameBuffer *fb, int r_viewport[4])
blender::gpu::FrameBuffer * GPU_framebuffer_active_get()
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)
blender::gpu::Texture * tex