Blender V4.3
blender::gpu::GLFrameBuffer Class Reference

#include <gl_framebuffer.hh>

Inherits blender::gpu::FrameBuffer.

Public Member Functions

Binding
void bind (bool enabled_srgb) override
 
Operations.
void clear (eGPUFrameBufferBits buffers, const float clear_col[4], float clear_depth, uint clear_stencil) override
 
void clear_multi (const float(*clear_cols)[4]) override
 
void clear_attachment (GPUAttachmentType type, eGPUDataFormat data_format, const void *clear_value) override
 
void read (eGPUFrameBufferBits planes, eGPUDataFormat format, const int area[4], int channel_len, int slot, void *r_data) override
 
void blit_to (eGPUFrameBufferBits planes, int src_slot, FrameBuffer *dst, int dst_slot, int dst_offset_x, int dst_offset_y) override
 
- Public Member Functions inherited from blender::gpu::FrameBuffer
void size_set (int width, int height)
 
void default_size_set (int width, int height)
 
void viewport_set (const int viewport[4])
 
void viewport_multi_set (const int viewports[GPU_MAX_VIEWPORTS][4])
 
void scissor_set (const int scissor[4])
 
void scissor_test_set (bool test)
 
void viewport_get (int r_viewport[4]) const
 
void scissor_get (int r_scissor[4]) const
 
bool scissor_test_get () const
 
void viewport_reset ()
 
void scissor_reset ()
 
GPUTexture * depth_tex () const
 
GPUTexture * color_tex (int slot) const
 
const char *const name_get () const
 
void set_use_explicit_loadstore (bool use_explicit_loadstore)
 
bool get_use_explicit_loadstore () const
 
 FrameBuffer (const char *name)
 
virtual ~FrameBuffer ()
 
void subpass_transition (const GPUAttachmentState depth_attachment_state, Span< GPUAttachmentState > color_attachment_states)
 
void load_store_config_array (const GPULoadStore *load_store_actions, uint actions_len)
 
void attachment_set (GPUAttachmentType type, const GPUAttachment &new_attachment)
 
void attachment_remove (GPUAttachmentType type)
 
void recursive_downsample (int max_lvl, void(*callback)(void *user_data, int level), void *user_data)
 
uint get_bits_per_pixel ()
 

Friends

class GLTexture
 

Creation & Deletion

 GLFrameBuffer (const char *name)
 
 GLFrameBuffer (const char *name, GLContext *ctx, GLenum target, GLuint fbo, int w, int h)
 
 ~GLFrameBuffer ()
 

Config

bool check (char err_out[256]) override
 
void attachment_set_loadstore_op (GPUAttachmentType type, GPULoadStore ls) override
 
void apply_state ()
 
void subpass_transition_impl (const GPUAttachmentState depth_attachment_state, Span< GPUAttachmentState > color_attachment_states) override
 

Additional Inherited Members

- Public Attributes inherited from blender::gpu::FrameBuffer
void ** py_ref = nullptr
 
- Protected Attributes inherited from blender::gpu::FrameBuffer
GPUAttachment attachments_ [GPU_FB_MAX_ATTACHMENT]
 
bool dirty_attachments_ = true
 
int width_ = 0
 
int height_ = 0
 
char name_ [DEBUG_NAME_LEN]
 
int viewport_ [GPU_MAX_VIEWPORTS][4] = {{0}}
 
int scissor_ [4] = {0}
 
bool multi_viewport_ = false
 
bool scissor_test_ = false
 
bool dirty_state_ = true
 
bool use_explicit_load_store_ = false
 

Detailed Description

Implementation of FrameBuffer object using OpenGL.

Definition at line 24 of file gl_framebuffer.hh.

Constructor & Destructor Documentation

◆ GLFrameBuffer() [1/2]

blender::gpu::GLFrameBuffer::GLFrameBuffer ( const char * name)

Create a conventional frame-buffer to attach texture to.

Definition at line 26 of file gl_framebuffer.cc.

◆ GLFrameBuffer() [2/2]

blender::gpu::GLFrameBuffer::GLFrameBuffer ( const char * name,
GLContext * ctx,
GLenum target,
GLuint fbo,
int w,
int h )

Special frame-buffer encapsulating internal window frame-buffer. (i.e.: #GL_FRONT_LEFT, #GL_BACK_RIGHT, ...)

Parameters
ctxContext the handle is from.
targetThe internal GL name (i.e: #GL_BACK_LEFT).
fboThe (optional) already created object for some implementation. Default is 0.
wBuffer width.
hBuffer height.

Definition at line 33 of file gl_framebuffer.cc.

References blender::gpu::FrameBuffer::dirty_attachments_, blender::gpu::FrameBuffer::height_, blender::gpu::FrameBuffer::name_, blender::gpu::debug::object_label(), blender::gpu::FrameBuffer::scissor_, blender::gpu::Context::state_manager, blender::gpu::FrameBuffer::viewport_, w(), and blender::gpu::FrameBuffer::width_.

◆ ~GLFrameBuffer()

Member Function Documentation

◆ apply_state()

◆ attachment_set_loadstore_op()

◆ bind()

◆ blit_to()

void blender::gpu::GLFrameBuffer::blit_to ( eGPUFrameBufferBits planes,
int src_slot,
FrameBuffer * dst,
int dst_slot,
int dst_offset_x,
int dst_offset_y )
overridevirtual

◆ check()

bool blender::gpu::GLFrameBuffer::check ( char err_out[256])
overridevirtual

This is a rather slow operation. Don't check in normal cases.

Implements blender::gpu::FrameBuffer.

Definition at line 98 of file gl_framebuffer.cc.

References bind(), BLI_snprintf(), FORMAT_STATUS, and blender::gpu::FrameBuffer::name_.

◆ clear()

◆ clear_attachment()

◆ clear_multi()

void blender::gpu::GLFrameBuffer::clear_multi ( const float(*) clear_cols[4])
overridevirtual

◆ read()

void blender::gpu::GLFrameBuffer::read ( eGPUFrameBufferBits planes,
eGPUDataFormat format,
const int area[4],
int channel_len,
int slot,
void * r_data )
overridevirtual

◆ subpass_transition_impl()

Friends And Related Symbol Documentation

◆ GLTexture

friend class GLTexture
friend

Definition at line 26 of file gl_framebuffer.hh.


The documentation for this class was generated from the following files: