Blender V5.0
blender::gpu::MTLFrameBuffer Class Reference

#include <mtl_framebuffer.hh>

Inherits blender::gpu::FrameBuffer.

Public Member Functions

uint get_attachment_limit ()
bool get_dirty ()
bool get_pending_clear ()
bool get_srgb_enabled ()
bool get_is_srgb ()
void default_size_set (int w, int h)
void attachment_set_loadstore_op (GPUAttachmentType type, GPULoadStore ls) override
bool set_color_attachment_clear_color (uint slot, const float clear_color[4])
bool set_depth_attachment_clear_value (float depth_clear)
bool set_stencil_attachment_clear_value (uint stencil_clear)
bool set_color_loadstore_op (uint slot, GPULoadOp load_action, GPUStoreOp store_action)
bool set_depth_loadstore_op (GPULoadOp load_action, GPUStoreOp store_action)
bool set_stencil_loadstore_op (GPULoadOp load_action, GPUStoreOp store_action)
bool reset_clear_state ()
void apply_state ()
void mark_dirty ()
void mark_loadstore_dirty ()
void mark_cleared ()
void mark_do_clear ()
void update_attachments (bool update_viewport)
bool add_color_attachment (gpu::MTLTexture *texture, uint slot, int miplevel, int layer)
bool add_depth_attachment (gpu::MTLTexture *texture, int miplevel, int layer)
bool add_stencil_attachment (gpu::MTLTexture *texture, int miplevel, int layer)
bool remove_color_attachment (uint slot)
bool remove_depth_attachment ()
bool remove_stencil_attachment ()
void remove_all_attachments ()
void ensure_render_target_size ()
bool has_attachment_at_slot (uint slot)
bool has_color_attachment_with_texture (gpu::MTLTexture *texture)
bool has_depth_attachment ()
bool has_stencil_attachment ()
int get_color_attachment_slot_from_texture (gpu::MTLTexture *texture)
uint get_attachment_count ()
MTLAttachment get_color_attachment (uint slot)
MTLAttachment get_depth_attachment ()
MTLAttachment get_stencil_attachment ()
bool validate_render_pass ()
MTLRenderPassDescriptor * bake_render_pass_descriptor (bool load_contents)
void blit (uint read_slot, uint src_x_offset, uint src_y_offset, MTLFrameBuffer *metal_fb_write, uint write_slot, uint dst_x_offset, uint dst_y_offset, uint width, uint height, GPUFrameBufferBits blit_buffers)
int get_width ()
int get_height ()
int get_default_width ()
int get_default_height ()
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 ()
const GPUAttachmentdepth_attachment () const
blender::gpu::Texturedepth_tex () const
blender::gpu::Texturecolor_tex (int slot) const
const char * name_get () const
void set_use_explicit_loadstore (bool use_explicit_loadstore)
bool get_use_explicit_loadstore () const
uint16_t get_color_attachments_bitset ()
 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)
uint get_bits_per_pixel ()

Creation & Deletion

 MTLFrameBuffer (MTLContext *ctx, const char *name)
 ~MTLFrameBuffer () override
void bind (bool enabled_srgb) override
bool check (char err_out[256]) override
void clear (GPUFrameBufferBits 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 (GPUFrameBufferBits planes, eGPUDataFormat format, const int area[4], int channel_len, int slot, void *r_data) override
void blit_to (GPUFrameBufferBits planes, int src_slot, FrameBuffer *dst, int dst_slot, int dst_offset_x, int dst_offset_y) override
void ensure_attachments_and_viewport ()
void subpass_transition_impl (const GPUAttachmentState, Span< GPUAttachmentState > color_attachment_states) override

Additional Inherited Members

Public Attributes inherited from blender::gpu::FrameBuffer
void ** py_ref = nullptr
Protected Member Functions inherited from blender::gpu::FrameBuffer
void set_color_attachment_bit (GPUAttachmentType type, bool value)
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
uint16_t color_attachments_bits_ = 0

Detailed Description

Implementation of FrameBuffer object using Metal.

Definition at line 47 of file mtl_framebuffer.hh.

Constructor & Destructor Documentation

◆ MTLFrameBuffer()

blender::gpu::MTLFrameBuffer::MTLFrameBuffer ( MTLContext * ctx,
const char * name )

◆ ~MTLFrameBuffer()

blender::gpu::MTLFrameBuffer::~MTLFrameBuffer ( )
override

Member Function Documentation

◆ add_color_attachment()

◆ add_depth_attachment()

◆ add_stencil_attachment()

◆ apply_state()

◆ attachment_set_loadstore_op()

◆ bake_render_pass_descriptor()

◆ bind()

◆ blit()

◆ blit_to()

◆ check()

◆ clear()

◆ clear_attachment()

◆ clear_multi()

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

◆ default_size_set()

void blender::gpu::MTLFrameBuffer::default_size_set ( int w,
int h )
inline

◆ ensure_attachments_and_viewport()

void blender::gpu::MTLFrameBuffer::ensure_attachments_and_viewport ( )

◆ ensure_render_target_size()

void blender::gpu::MTLFrameBuffer::ensure_render_target_size ( )

◆ get_attachment_count()

uint blender::gpu::MTLFrameBuffer::get_attachment_count ( )

Definition at line 1477 of file mtl_framebuffer.mm.

References BLI_assert.

Referenced by check().

◆ get_attachment_limit()

◆ get_color_attachment()

MTLAttachment blender::gpu::MTLFrameBuffer::get_color_attachment ( uint slot)

◆ get_color_attachment_slot_from_texture()

int blender::gpu::MTLFrameBuffer::get_color_attachment_slot_from_texture ( gpu::MTLTexture * texture)

Definition at line 1462 of file mtl_framebuffer.mm.

References BLI_assert, get_attachment_limit(), and texture().

◆ get_default_height()

int blender::gpu::MTLFrameBuffer::get_default_height ( )

◆ get_default_width()

int blender::gpu::MTLFrameBuffer::get_default_width ( )

◆ get_depth_attachment()

MTLAttachment blender::gpu::MTLFrameBuffer::get_depth_attachment ( )

◆ get_dirty()

bool blender::gpu::MTLFrameBuffer::get_dirty ( )
inline

Definition at line 235 of file mtl_framebuffer.hh.

Referenced by blender::gpu::MTLBatch::bind().

◆ get_height()

int blender::gpu::MTLFrameBuffer::get_height ( )

◆ get_is_srgb()

bool blender::gpu::MTLFrameBuffer::get_is_srgb ( )
inline

◆ get_pending_clear()

bool blender::gpu::MTLFrameBuffer::get_pending_clear ( )
inline

Definition at line 240 of file mtl_framebuffer.hh.

Referenced by bake_render_pass_descriptor().

◆ get_srgb_enabled()

bool blender::gpu::MTLFrameBuffer::get_srgb_enabled ( )
inline

◆ get_stencil_attachment()

MTLAttachment blender::gpu::MTLFrameBuffer::get_stencil_attachment ( )

◆ get_width()

int blender::gpu::MTLFrameBuffer::get_width ( )

◆ has_attachment_at_slot()

bool blender::gpu::MTLFrameBuffer::has_attachment_at_slot ( uint slot)

\ Fetch values and Frame-buffer status

Definition at line 1426 of file mtl_framebuffer.mm.

References BLI_assert, and get_attachment_limit().

Referenced by clear_attachment(), clear_multi(), read(), remove_color_attachment(), and update_attachments().

◆ has_color_attachment_with_texture()

bool blender::gpu::MTLFrameBuffer::has_color_attachment_with_texture ( gpu::MTLTexture * texture)

Definition at line 1436 of file mtl_framebuffer.mm.

References BLI_assert, get_attachment_limit(), and texture().

◆ has_depth_attachment()

bool blender::gpu::MTLFrameBuffer::has_depth_attachment ( )

◆ has_stencil_attachment()

bool blender::gpu::MTLFrameBuffer::has_stencil_attachment ( )

◆ mark_cleared()

void blender::gpu::MTLFrameBuffer::mark_cleared ( )

Definition at line 640 of file mtl_framebuffer.mm.

◆ mark_dirty()

void blender::gpu::MTLFrameBuffer::mark_dirty ( )

◆ mark_do_clear()

void blender::gpu::MTLFrameBuffer::mark_do_clear ( )

Definition at line 645 of file mtl_framebuffer.mm.

◆ mark_loadstore_dirty()

◆ read()

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

◆ remove_all_attachments()

◆ remove_color_attachment()

◆ remove_depth_attachment()

bool blender::gpu::MTLFrameBuffer::remove_depth_attachment ( )

◆ remove_stencil_attachment()

bool blender::gpu::MTLFrameBuffer::remove_stencil_attachment ( )

◆ reset_clear_state()

bool blender::gpu::MTLFrameBuffer::reset_clear_state ( )

◆ set_color_attachment_clear_color()

bool blender::gpu::MTLFrameBuffer::set_color_attachment_clear_color ( uint slot,
const float clear_color[4] )

◆ set_color_loadstore_op()

bool blender::gpu::MTLFrameBuffer::set_color_loadstore_op ( uint slot,
GPULoadOp load_action,
GPUStoreOp store_action )

◆ set_depth_attachment_clear_value()

bool blender::gpu::MTLFrameBuffer::set_depth_attachment_clear_value ( float depth_clear)

◆ set_depth_loadstore_op()

bool blender::gpu::MTLFrameBuffer::set_depth_loadstore_op ( GPULoadOp load_action,
GPUStoreOp store_action )

◆ set_stencil_attachment_clear_value()

bool blender::gpu::MTLFrameBuffer::set_stencil_attachment_clear_value ( uint stencil_clear)

◆ set_stencil_loadstore_op()

bool blender::gpu::MTLFrameBuffer::set_stencil_loadstore_op ( GPULoadOp load_action,
GPUStoreOp store_action )

◆ subpass_transition_impl()

void blender::gpu::MTLFrameBuffer::subpass_transition_impl ( const GPUAttachmentState ,
Span< GPUAttachmentState > color_attachment_states )
overrideprotectedvirtual

◆ update_attachments()

void blender::gpu::MTLFrameBuffer::update_attachments ( bool update_viewport)

◆ validate_render_pass()

bool blender::gpu::MTLFrameBuffer::validate_render_pass ( )

\ METAL API Resources and Validation

Definition at line 1511 of file mtl_framebuffer.mm.

References BLI_assert, blender::gpu::FrameBuffer::dirty_attachments_, and update_attachments().


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