|
Blender V4.3
|
#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 |
Implementation of FrameBuffer object using OpenGL.
Definition at line 24 of file gl_framebuffer.hh.
| 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.
| 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 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_.
| blender::gpu::GLFrameBuffer::~GLFrameBuffer | ( | ) |
Definition at line 58 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 | ( | ) |
Definition at line 330 of file gl_framebuffer.cc.
References blender::gpu::FrameBuffer::dirty_state_, GPU_MAX_VIEWPORTS, blender::gpu::FrameBuffer::multi_viewport_, 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 299 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, ARRAY_SIZE, blender::gpu::FrameBuffer::attachment_set(), BLI_assert, clear_attachment(), GPULoadStore::clear_value, blender::gpu::GLContext::framebuffer_fetch_support, GPU_ATTACHMENT_NONE, GPU_DATA_FLOAT, GPU_LOADACTION_CLEAR, GPULoadStore::load_action, tex, and blender::gpu::GLContext::texture_barrier_support.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 368 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::GLStateManager::active_fb, BLI_assert_msg, blender::gpu::FrameBuffer::dirty_attachments_, blender::gpu::FrameBuffer::dirty_state_, blender::gpu::GLContext::framebuffer_fetch_support, blender::gpu::GLContext::get(), GPU_ATTACHMENT_NONE, GPU_FB_MAX_ATTACHMENT, blender::gpu::FrameBuffer::scissor_reset(), blender::gpu::Shader::set_framebuffer_srgb_target(), blender::gpu::GLContext::texture_barrier_support, and blender::gpu::FrameBuffer::viewport_reset().
|
overridevirtual |
Copy src at the give offset inside dst.
Implements blender::gpu::FrameBuffer.
Definition at line 574 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_, blender::gpu::Context::state_manager, blender::gpu::to_gl(), w(), and blender::gpu::FrameBuffer::width_.
|
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_.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 423 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::StateManager::apply_state(), BLI_assert, buffers, 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(), blender::gpu::Context::state_manager, and blender::gpu::to_gl().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 464 of file gl_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::StateManager::apply_state(), BLI_assert, BLI_assert_msg, blender::gpu::GLContext::get(), GPU_color_mask(), GPU_DATA_FLOAT, GPU_DATA_INT, GPU_DATA_UINT, GPU_DATA_UINT_24_8, GPU_depth_mask(), GPU_depth_mask_get(), GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPU_write_mask(), GPU_write_mask_get(), and blender::gpu::Context::state_manager.
Referenced by attachment_set_loadstore_op(), and clear_multi().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 519 of file gl_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, clear_attachment(), GPU_DATA_FLOAT, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_MAX_ATTACHMENT, and tex.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 532 of file gl_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, BLI_assert_msg, blender::gpu::channel_len_to_gl(), GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPU_STENCIL_BIT, tex, blender::gpu::to_gl(), and UNPACK4.
|
overrideprotectedvirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 229 of file gl_framebuffer.cc.
References ARRAY_SIZE, blender::gpu::FrameBuffer::attachment_set(), blender::gpu::FrameBuffer::attachments_, GPUSamplerState::default_sampler(), blender::gpu::FrameBuffer::dirty_attachments_, blender::gpu::GLContext::framebuffer_fetch_support, GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_READ, GPU_ATTACHMENT_WRITE, GPU_depth_mask(), GPU_FB_COLOR_ATTACHMENT0, GPU_FB_MAX_COLOR_ATTACHMENT, GPU_texture_bind_ex(), blender::Span< T >::index_range(), GPUAttachment::tex, tex, blender::gpu::GLContext::texture_barrier_support, blender::gpu::to_gl(), and blender::gpu::unwrap().
|
friend |
Definition at line 26 of file gl_framebuffer.hh.