Blender
V3.3
|
#include <gpu_framebuffer_private.hh>
Public Member Functions | |
virtual void | bind (bool enabled_srgb)=0 |
virtual bool | check (char err_out[256])=0 |
virtual void | clear (eGPUFrameBufferBits buffers, const float clear_col[4], float clear_depth, uint clear_stencil)=0 |
virtual void | clear_multi (const float(*clear_col)[4])=0 |
virtual void | clear_attachment (GPUAttachmentType type, eGPUDataFormat data_format, const void *clear_value)=0 |
virtual void | attachment_set_loadstore_op (GPUAttachmentType type, eGPULoadOp load_action, eGPUStoreOp store_action)=0 |
virtual void | read (eGPUFrameBufferBits planes, eGPUDataFormat format, const int area[4], int channel_len, int slot, void *r_data)=0 |
virtual void | blit_to (eGPUFrameBufferBits planes, int src_slot, FrameBuffer *dst, int dst_slot, int dst_offset_x, int dst_offset_y)=0 |
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 () const |
void | viewport_reset () |
void | scissor_reset () |
GPUTexture * | depth_tex () const |
GPUTexture * | color_tex (int slot) const |
Constructor / Destructor | |
FrameBuffer (const char *name) | |
virtual | ~FrameBuffer () |
Attachments Management | |
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 *userData, int level), void *userData) |
uint | get_bits_per_pixel () |
Public Attributes | |
void ** | py_ref = nullptr |
void ** | ref = nullptr |
Protected Attributes | |
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 |
Definition at line 72 of file gpu_framebuffer_private.hh.
blender::gpu::FrameBuffer::FrameBuffer | ( | const char * | name | ) |
Definition at line 30 of file gpu_framebuffer.cc.
References attachments_, BLI_strncpy(), dirty_attachments_, dirty_state_, and name_.
|
virtual |
Definition at line 49 of file gpu_framebuffer.cc.
References attachments_, and py_ref.
void blender::gpu::FrameBuffer::attachment_remove | ( | GPUAttachmentType | type | ) |
Definition at line 121 of file gpu_framebuffer.cc.
References attachments_, dirty_attachments_, and type.
Referenced by blender::gpu::Texture::detach_from(), and blender::gpu::Texture::~Texture().
void blender::gpu::FrameBuffer::attachment_set | ( | GPUAttachmentType | type, |
const GPUAttachment & | new_attachment | ||
) |
Definition at line 70 of file gpu_framebuffer.cc.
References attachments_, BLI_assert, dirty_attachments_, ELEM, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPU_FB_MAX_ATTACHMENT, GPU_FB_MAX_COLOR_ATTACHMENT, GPU_texture_array(), GPU_texture_cube(), GPU_texture_depth(), GPU_texture_stencil(), GPUAttachment::layer, GPUAttachment::mip, GPUAttachment::tex, and type.
|
pure virtual |
Implemented in blender::gpu::GLFrameBuffer, and blender::gpu::MTLFrameBuffer.
Referenced by load_store_config_array(), and recursive_downsample().
Implemented in blender::gpu::GLFrameBuffer, and blender::gpu::MTLFrameBuffer.
Referenced by GPU_backbuffer_bind(), GPU_framebuffer_blit(), GPU_framebuffer_restore(), and recursive_downsample().
|
pure virtual |
Implemented in blender::gpu::GLFrameBuffer, and blender::gpu::MTLFrameBuffer.
Referenced by GPU_framebuffer_blit(), and GPU_offscreen_draw_to_screen().
|
pure virtual |
Implemented in blender::gpu::GLFrameBuffer, and blender::gpu::MTLFrameBuffer.
|
pure virtual |
Implemented in blender::gpu::GLFrameBuffer, and blender::gpu::MTLFrameBuffer.
Referenced by GPU_clear_color(), and GPU_clear_depth().
|
pure virtual |
Implemented in blender::gpu::GLFrameBuffer, and blender::gpu::MTLFrameBuffer.
Implemented in blender::gpu::GLFrameBuffer, and blender::gpu::MTLFrameBuffer.
|
inline |
Definition at line 209 of file gpu_framebuffer_private.hh.
References attachments_, GPU_FB_COLOR_ATTACHMENT0, and GPUAttachment::tex.
Referenced by GPU_framebuffer_blit().
|
inline |
Definition at line 201 of file gpu_framebuffer_private.hh.
References attachments_, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, tex, and GPUAttachment::tex.
Referenced by GPU_framebuffer_blit().
unsigned int blender::gpu::FrameBuffer::get_bits_per_pixel | ( | ) |
Definition at line 151 of file gpu_framebuffer.cc.
References attachments_, tex, blender::gpu::to_bytesize(), and blender::gpu::to_component_len().
Referenced by blender::gpu::MTLFrameBuffer::bake_render_pass_descriptor().
void blender::gpu::FrameBuffer::load_store_config_array | ( | const GPULoadStore * | load_store_actions, |
uint | actions_len | ||
) |
Definition at line 127 of file gpu_framebuffer.cc.
References attachment_set_loadstore_op(), attachments_, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPULoadStore::load_action, GPULoadStore::store_action, tex, and type.
|
pure virtual |
Implemented in blender::gpu::GLFrameBuffer, and blender::gpu::MTLFrameBuffer.
Referenced by GPU_frontbuffer_read_pixels().
void blender::gpu::FrameBuffer::recursive_downsample | ( | int | max_lvl, |
void(*)(void *userData, int level) | callback, | ||
void * | userData | ||
) |
Definition at line 164 of file gpu_framebuffer.cc.
References attachment_set_loadstore_op(), attachments_, bind(), callback, dirty_attachments_, blender::math::floor(), GPU_FB_DEPTH_ATTACHMENT, GPU_LOADACTION_DONT_CARE, GPU_mip_render_workaround(), GPU_STOREACTION_STORE, height_, max_ii(), min_ii(), tex, type, and width_.
|
inline |
Definition at line 179 of file gpu_framebuffer_private.hh.
References copy_v4_v4_int(), and scissor_.
Referenced by GPU_scissor_get(), and blender::gpu::MTLFrameBuffer::update_attachments().
|
inline |
Definition at line 195 of file gpu_framebuffer_private.hh.
References height_, scissor_set(), and width_.
Referenced by blender::gpu::MTLFrameBuffer::add_color_attachment(), blender::gpu::MTLFrameBuffer::add_depth_attachment(), blender::gpu::MTLFrameBuffer::add_stencil_attachment(), blender::gpu::GLFrameBuffer::bind(), blender::gpu::MTLFrameBuffer::ensure_render_target_size(), blender::gpu::MTLFrameBuffer::MTLFrameBuffer(), and blender::gpu::MTLFrameBuffer::update_attachments().
|
inline |
Definition at line 160 of file gpu_framebuffer_private.hh.
References copy_v4_v4_int(), dirty_state_, equals_v4v4_int(), and scissor_.
Referenced by GPU_scissor(), scissor_reset(), and blender::gpu::MTLFrameBuffer::update_attachments().
|
inline |
Definition at line 184 of file gpu_framebuffer_private.hh.
References scissor_test_.
Definition at line 168 of file gpu_framebuffer_private.hh.
References dirty_state_, and scissor_test_.
Referenced by GPU_scissor_test().
|
inline |
Definition at line 145 of file gpu_framebuffer_private.hh.
References dirty_state_, height, height_, width, and width_.
Referenced by blender::gpu::GLContext::activate(), blender::gpu::MTLFrameBuffer::add_color_attachment(), blender::gpu::MTLFrameBuffer::add_depth_attachment(), blender::gpu::MTLFrameBuffer::add_stencil_attachment(), blender::gpu::MTLFrameBuffer::ensure_render_target_size(), and blender::gpu::MTLFrameBuffer::MTLFrameBuffer().
|
inline |
Definition at line 174 of file gpu_framebuffer_private.hh.
References copy_v4_v4_int(), and viewport_.
Referenced by GPU_viewport_size_get_f(), GPU_viewport_size_get_i(), and blender::gpu::MTLFrameBuffer::update_attachments().
|
inline |
Definition at line 189 of file gpu_framebuffer_private.hh.
References height_, viewport_set(), and width_.
Referenced by blender::gpu::MTLFrameBuffer::add_color_attachment(), blender::gpu::MTLFrameBuffer::add_depth_attachment(), blender::gpu::MTLFrameBuffer::add_stencil_attachment(), blender::gpu::MTLFrameBuffer::apply_state(), blender::gpu::GLFrameBuffer::bind(), blender::gpu::MTLFrameBuffer::ensure_render_target_size(), blender::gpu::MTLFrameBuffer::MTLFrameBuffer(), and blender::gpu::MTLFrameBuffer::update_attachments().
|
inline |
Definition at line 152 of file gpu_framebuffer_private.hh.
References copy_v4_v4_int(), dirty_state_, equals_v4v4_int(), and viewport_.
Referenced by GPU_viewport(), blender::gpu::MTLFrameBuffer::update_attachments(), and viewport_reset().
|
protected |
Set of texture attachments to render to. DEPTH and DEPTH_STENCIL are mutually exclusive.
Definition at line 75 of file gpu_framebuffer_private.hh.
Referenced by attachment_remove(), attachment_set(), blender::gpu::GLFrameBuffer::clear_multi(), color_tex(), depth_tex(), FrameBuffer(), get_bits_per_pixel(), load_store_config_array(), blender::gpu::GLFrameBuffer::read(), recursive_downsample(), blender::gpu::MTLFrameBuffer::update_attachments(), and ~FrameBuffer().
|
protected |
Is true if internal representation need to be updated.
Definition at line 77 of file gpu_framebuffer_private.hh.
Referenced by attachment_remove(), attachment_set(), blender::gpu::GLFrameBuffer::bind(), blender::gpu::GLFrameBuffer::blit_to(), FrameBuffer(), blender::gpu::GLFrameBuffer::GLFrameBuffer(), recursive_downsample(), blender::gpu::MTLFrameBuffer::remove_all_attachments(), and blender::gpu::MTLFrameBuffer::update_attachments().
|
protected |
Definition at line 86 of file gpu_framebuffer_private.hh.
Referenced by blender::gpu::MTLFrameBuffer::apply_state(), blender::gpu::GLFrameBuffer::apply_state(), blender::gpu::MTLFrameBuffer::bind(), blender::gpu::GLFrameBuffer::bind(), FrameBuffer(), scissor_set(), scissor_test_set(), size_set(), and viewport_set().
|
protected |
Definition at line 79 of file gpu_framebuffer_private.hh.
Referenced by blender::gpu::MTLFrameBuffer::add_color_attachment(), blender::gpu::MTLFrameBuffer::add_depth_attachment(), blender::gpu::MTLFrameBuffer::add_stencil_attachment(), blender::gpu::MTLFrameBuffer::get_height(), blender::gpu::GLFrameBuffer::GLFrameBuffer(), recursive_downsample(), scissor_reset(), size_set(), blender::gpu::MTLFrameBuffer::update_attachments(), and viewport_reset().
|
protected |
Debug name.
Definition at line 81 of file gpu_framebuffer_private.hh.
Referenced by blender::gpu::MTLFrameBuffer::check(), blender::gpu::GLFrameBuffer::check(), FrameBuffer(), and blender::gpu::GLFrameBuffer::GLFrameBuffer().
void** blender::gpu::FrameBuffer::py_ref = nullptr |
Reference of a pointer that needs to be cleaned when deallocating the frame-buffer. Points to BPyGPUFrameBuffer.fb
Definition at line 94 of file gpu_framebuffer_private.hh.
Referenced by ~FrameBuffer().
void** blender::gpu::FrameBuffer::ref = nullptr |
Definition at line 100 of file gpu_framebuffer_private.hh.
|
protected |
Definition at line 84 of file gpu_framebuffer_private.hh.
Referenced by blender::gpu::MTLFrameBuffer::apply_state(), blender::gpu::GLFrameBuffer::apply_state(), blender::gpu::GLFrameBuffer::GLFrameBuffer(), scissor_get(), and scissor_set().
|
protected |
Definition at line 85 of file gpu_framebuffer_private.hh.
Referenced by blender::gpu::MTLFrameBuffer::apply_state(), blender::gpu::GLFrameBuffer::apply_state(), scissor_test_get(), and scissor_test_set().
|
protected |
Frame-buffer state.
Definition at line 83 of file gpu_framebuffer_private.hh.
Referenced by blender::gpu::MTLFrameBuffer::apply_state(), blender::gpu::GLFrameBuffer::apply_state(), blender::gpu::GLFrameBuffer::GLFrameBuffer(), viewport_get(), and viewport_set().
|
protected |
Size of attachment textures.
Definition at line 79 of file gpu_framebuffer_private.hh.
Referenced by blender::gpu::MTLFrameBuffer::add_color_attachment(), blender::gpu::MTLFrameBuffer::add_depth_attachment(), blender::gpu::MTLFrameBuffer::add_stencil_attachment(), blender::gpu::MTLFrameBuffer::get_width(), blender::gpu::GLFrameBuffer::GLFrameBuffer(), recursive_downsample(), scissor_reset(), size_set(), blender::gpu::MTLFrameBuffer::update_attachments(), and viewport_reset().