|
Blender
V2.93
|
#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 | viewport_set (const int viewport[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 (void) const |
| void | viewport_reset (void) |
| void | scissor_reset (void) |
| GPUTexture * | depth_tex (void) const |
| GPUTexture * | color_tex (int slot) const |
| FrameBuffer (const char *name) | |
| virtual | ~FrameBuffer () |
| void | attachment_set (GPUAttachmentType type, const GPUAttachment &new_attachment) |
| void | attachment_remove (GPUAttachmentType type) |
| void | recursive_downsample (int max_lvl, void(*callback)(void *userData, int level), void *userData) |
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 | apply_state (void) |
Additional Inherited Members | |
Protected Attributes inherited from blender::gpu::FrameBuffer | |
| GPUAttachment | attachments_ [GPU_FB_MAX_ATTACHMENT] |
| bool | dirty_attachments_ |
| int | width_ |
| int | height_ |
| char | name_ [DEBUG_NAME_LEN] |
| int | viewport_ [4] = {0} |
| int | scissor_ [4] = {0} |
| bool | scissor_test_ = false |
| bool | dirty_state_ = true |
Implementation of FrameBuffer object using OpenGL.
Definition at line 41 of file gl_framebuffer.hh.
| blender::gpu::GLFrameBuffer::GLFrameBuffer | ( | const char * | name | ) |
Create a conventional frame-buffer to attach texture to.
Definition at line 41 of file gl_framebuffer.cc.
| 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, ...)
| ctx | Context the handle is from. |
| target | The internal GL name (i.e: #GL_BACK_LEFT). |
| fbo | The (optional) already created object for some implementation. Default is 0. |
| w | Buffer width. |
| h | Buffer height. |
Definition at line 48 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_.
| blender::gpu::GLFrameBuffer::~GLFrameBuffer | ( | ) |
Definition at line 73 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::Context::back_left, BLI_assert, blender::gpu::GLContext::fbo_free(), blender::gpu::Context::get(), and GPU_framebuffer_restore().
| void blender::gpu::GLFrameBuffer::apply_state | ( | void | ) |
Definition at line 239 of file gl_framebuffer.cc.
References blender::gpu::FrameBuffer::dirty_state_, glDisable, glEnable, blender::gpu::FrameBuffer::scissor_, blender::gpu::FrameBuffer::scissor_test_, UNPACK4, and blender::gpu::FrameBuffer::viewport_.
Referenced by blender::gpu::GLStateManager::apply_state().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 264 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::GLStateManager::active_fb, BLI_assert, blender::gpu::FrameBuffer::dirty_attachments_, blender::gpu::FrameBuffer::dirty_state_, blender::gpu::GLContext::get(), glDisable, glEnable, GPU_shader_set_framebuffer_srgb_target(), blender::gpu::FrameBuffer::scissor_reset(), and blender::gpu::FrameBuffer::viewport_reset().
|
overridevirtual |
Copy src at the give offset inside dst.
Implements blender::gpu::FrameBuffer.
Definition at line 457 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::StateManager::apply_state(), ARRAY_SIZE, bind(), BLI_assert, blender::gpu::FrameBuffer::dirty_attachments_, GPU_COLOR_BIT, blender::gpu::FrameBuffer::height_, mask(), blender::gpu::Context::state_manager, blender::gpu::to_gl(), w(), blender::gpu::FrameBuffer::width_, x, and y.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 114 of file gl_framebuffer.cc.
References bind(), BLI_snprintf(), err, FORMAT_STATUS, and blender::gpu::FrameBuffer::name_.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 313 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::StateManager::apply_state(), BLI_assert, blender::gpu::GLContext::get(), GPU_COLOR_BIT, GPU_color_mask(), GPU_DEPTH_BIT, GPU_depth_mask(), GPU_STENCIL_ALWAYS, GPU_STENCIL_BIT, GPU_stencil_mask_get(), GPU_stencil_test(), GPU_stencil_test_get(), GPU_stencil_write_mask_set(), GPU_write_mask(), GPU_write_mask_get(), mask(), blender::gpu::Context::state_manager, and blender::gpu::to_gl().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 354 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::StateManager::apply_state(), BLI_assert, blender::gpu::GLContext::get(), GPU_color_mask(), GPU_DATA_FLOAT, GPU_DATA_INT, GPU_DATA_UINT, GPU_DATA_UINT_24_8, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPU_write_mask(), GPU_write_mask_get(), blender::gpu::Context::state_manager, and type.
Referenced by clear_multi().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 406 of file gl_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, clear_attachment(), GPU_DATA_FLOAT, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_MAX_ATTACHMENT, tex, and type.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 419 of file gl_framebuffer.cc.
References blender::compositor::area(), blender::gpu::channel_len_to_gl(), GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_STENCIL_BIT, blender::gpu::to_gl(), type, and UNPACK4.
|
friend |
Definition at line 43 of file gl_framebuffer.hh.