19#include <Metal/Metal.h>
53 uint colour_attachment_count_;
57 bool use_multilayered_rendering_ =
false;
68 bool is_loadstore_dirty_;
81 bool has_pending_clear_;
94 MTL_FB_CONFIG_CLEAR = 0,
95 MTL_FB_CONFIG_LOAD = 1,
96 MTL_FB_CONFIG_CUSTOM = 2,
98 MTL_FB_CONFIG_MAX = (MTL_FB_CONFIG_CUSTOM + 1),
101 MTLRenderPassDescriptor *framebuffer_descriptor_[MTL_FB_CONFIG_MAX];
102 MTLRenderPassColorAttachmentDescriptor
105 bool descriptor_dirty_[MTL_FB_CONFIG_MAX];
118 int default_width_ = 0;
119 int default_height_ = 0;
129 void bind(
bool enabled_srgb)
override;
131 bool check(
char err_out[256])
override;
134 const float clear_col[4],
136 uint clear_stencil)
override;
137 void clear_multi(
const float (*clear_cols)[4])
override;
140 const void *clear_value)
override;
149 void *r_data)
override;
156 int dst_offset_y)
override;
237 return is_dirty_ || is_loadstore_dirty_;
242 return has_pending_clear_;
247 return enabled_srgb_;
265 MEM_CXX_CLASS_ALLOC_FUNCS(
"MTLFrameBuffer");
@ GPU_LOADACTION_DONT_CARE
@ GPU_STOREACTION_DONT_CARE
Read Guarded memory(de)allocation.
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 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_color_attachment_slot_from_texture(gpu::MTLTexture *texture)
void default_size_set(int w, int h)
bool remove_depth_attachment()
bool check(char err_out[256]) override
bool add_color_attachment(gpu::MTLTexture *texture, uint slot, int miplevel, int layer)
bool set_color_attachment_clear_color(uint slot, const float clear_color[4])
MTLFrameBuffer(MTLContext *ctx, const char *name)
bool set_depth_attachment_clear_value(float depth_clear)
void update_attachments(bool update_viewport)
~MTLFrameBuffer() override
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)
void clear_multi(const float(*clear_cols)[4]) override
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()
void clear(GPUFrameBufferBits buffers, const float clear_col[4], float clear_depth, uint clear_stencil) override
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, eGPUDataFormat data_format, const void *clear_value) override
void mark_loadstore_dirty()
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::MTLTexture * texture
union blender::gpu::MTLAttachment::@142227134026063347366002067303226104245171177125 clear_value
uint render_target_array_length