19#include <Metal/Metal.h>
50 uint colour_attachment_count_;
54 bool use_multilayered_rendering_ =
false;
65 bool is_loadstore_dirty_;
78 bool has_pending_clear_;
91 MTL_FB_CONFIG_CLEAR = 0,
92 MTL_FB_CONFIG_LOAD = 1,
93 MTL_FB_CONFIG_CUSTOM = 2,
95 MTL_FB_CONFIG_MAX = (MTL_FB_CONFIG_CUSTOM + 1),
98 MTLRenderPassDescriptor *framebuffer_descriptor_[MTL_FB_CONFIG_MAX];
99 MTLRenderPassColorAttachmentDescriptor
102 bool descriptor_dirty_[MTL_FB_CONFIG_MAX];
116 int attachment_width_ = 0;
117 int attachment_height_ = 0;
127 void bind(
bool enabled_srgb)
override;
129 bool check(
char err_out[256])
override;
134 uint clear_stencil)
override;
145 void *r_data)
override;
152 int dst_offset_y)
override;
234 return is_dirty_ || is_loadstore_dirty_;
239 return has_pending_clear_;
244 return enabled_srgb_;
256 MEM_CXX_CLASS_ALLOC_FUNCS(
"MTLFrameBuffer");
Read Blender memory allocation and freeing.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
FrameBuffer(const char *name)
bool remove_stencil_attachment()
MTLAttachment get_color_attachment(uint slot)
bool remove_color_attachment(uint slot)
void attachment_size_set(int w, int h)
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)
bool set_stencil_loadstore_op(GPULoadOp load_action, GPUStoreOp store_action)
bool set_depth_loadstore_op(GPULoadOp load_action, GPUStoreOp store_action)
void remove_all_attachments()
int get_attachment_height()
int get_color_attachment_slot_from_texture(gpu::MTLTexture *texture)
bool remove_depth_attachment()
bool check(char err_out[256]) override
void read(GPUFrameBufferBits planes, eGPUDataFormat format, const int area[4], int channel_len, int slot, void *r_data) override
bool add_color_attachment(gpu::MTLTexture *texture, uint slot, int miplevel, int layer)
void clear_multi(Span< double4 > clear_cols) override
void clear(GPUFrameBufferBits buffers, const double4 clear_col, float clear_depth, uint clear_stencil) override
MTLFrameBuffer(MTLContext *ctx, const char *name)
bool set_depth_attachment_clear_value(float depth_clear)
void update_attachments(bool update_viewport)
void ensure_render_target_size()
MTLAttachment get_stencil_attachment()
void ensure_attachments_and_viewport()
MTLRenderPassDescriptor * bake_render_pass_descriptor(bool load_contents)
bool has_color_attachment_with_texture(gpu::MTLTexture *texture)
MTLAttachment get_depth_attachment()
bool set_color_loadstore_op(uint slot, GPULoadOp load_action, GPUStoreOp store_action)
int get_attachment_width()
uint get_attachment_limit()
void blit_to(GPUFrameBufferBits planes, int src_slot, FrameBuffer *dst, int dst_slot, int dst_offset_x, int dst_offset_y) override
bool add_depth_attachment(gpu::MTLTexture *texture, int miplevel, int layer)
void attachment_set_loadstore_op(GPUAttachmentType type, GPULoadStore ls) override
bool validate_render_pass()
bool set_stencil_attachment_clear_value(uint stencil_clear)
bool add_stencil_attachment(gpu::MTLTexture *texture, int miplevel, int layer)
bool has_stencil_attachment()
bool has_attachment_at_slot(uint slot)
void clear_attachment(GPUAttachmentType type, const double4 clear_value) override
void mark_loadstore_dirty()
bool set_color_attachment_clear_color(uint slot, const double4 clear_color)
void bind(bool enabled_srgb) override
void subpass_transition_impl(const GPUAttachmentState, Span< GPUAttachmentState > color_attachment_states) override
uint get_attachment_count()
bool has_depth_attachment()
#define GPU_FB_MAX_COLOR_ATTACHMENT
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
@ GPU_LOADACTION_DONT_CARE
@ GPU_STOREACTION_DONT_CARE
VecBase< double, 4 > double4
gpu::MTLTexture * texture
uint render_target_array_length