Blender V5.3
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 ()
Clear values and Load-store actions
void attachment_set_loadstore_op (GPUAttachmentType type, GPULoadStore ls) override
bool set_color_attachment_clear_color (uint slot, const double4 clear_color)
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 ()
Private METAL implementation functions
void apply_state ()
void mark_dirty ()
void mark_loadstore_dirty ()
void mark_cleared ()
void mark_do_clear ()
void update_attachments (bool update_viewport)
Adding and Removing attachments
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 ()
Fetch values and Frame-buffer status
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 ()
METAL API Resources and Validation
bool validate_render_pass ()
MTLRenderPassDescriptor * bake_render_pass_descriptor (bool load_contents)
Blitting
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_attachment_width ()
int get_attachment_height ()
void attachment_size_set (int w, int h)
Public Member Functions inherited from blender::gpu::FrameBuffer
void size_set (int width, int height)
int2 size_get () const
 Get the size of the framebuffer.
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 GPUAttachment & depth_attachment () const
gpu::Texture * depth_tex () const
gpu::Texture * color_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 double4 clear_col, float clear_depth, uint clear_stencil) override
void clear_multi (Span< double4 > clear_cols) override
void clear_attachment (GPUAttachmentType type, const double4 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 44 of file mtl_framebuffer.hh.

Constructor & Destructor Documentation

◆ MTLFrameBuffer()

◆ ~MTLFrameBuffer()

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

Member Function Documentation

◆ add_color_attachment()

◆ add_depth_attachment()

◆ add_stencil_attachment()

◆ apply_state()

◆ attachment_set_loadstore_op()

◆ attachment_size_set()

void blender::gpu::MTLFrameBuffer::attachment_size_set ( int w,
int h )

◆ bake_render_pass_descriptor()

◆ bind()

◆ blit()

◆ blit_to()

◆ check()

◆ clear()

◆ clear_attachment()

◆ clear_multi()

void blender::gpu::MTLFrameBuffer::clear_multi ( Span< double4 > clear_cols)
overridevirtual

◆ 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 1424 of file mtl_framebuffer.mm.

References blender::BLI_assert().

Referenced by check().

◆ get_attachment_height()

int blender::gpu::MTLFrameBuffer::get_attachment_height ( )

◆ get_attachment_limit()

◆ get_attachment_width()

int blender::gpu::MTLFrameBuffer::get_attachment_width ( )

◆ get_color_attachment()

◆ get_color_attachment_slot_from_texture()

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

Definition at line 1409 of file mtl_framebuffer.mm.

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

◆ get_depth_attachment()

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

◆ get_dirty()

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

◆ 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 237 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)

◆ has_color_attachment_with_texture()

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

Definition at line 1383 of file mtl_framebuffer.mm.

References blender::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 ( )

Definition at line 1403 of file mtl_framebuffer.mm.

References blender::BLI_assert().

Referenced by check(), clear(), ensure_render_target_size(), and update_attachments().

◆ mark_cleared()

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

Definition at line 594 of file mtl_framebuffer.mm.

◆ mark_dirty()

◆ mark_do_clear()

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

Definition at line 599 of file mtl_framebuffer.mm.

◆ mark_loadstore_dirty()

◆ read()

◆ 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 double4 clear_color )

◆ 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()

◆ update_attachments()

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

◆ validate_render_pass()

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

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