|
Blender V5.3
|
#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 |
Implementation of FrameBuffer object using Metal.
Definition at line 44 of file mtl_framebuffer.hh.
| blender::gpu::MTLFrameBuffer::MTLFrameBuffer | ( | MTLContext * | ctx, |
| const char * | name ) |
Create a conventional frame-buffer to attach texture to.
Definition at line 25 of file mtl_framebuffer.mm.
References blender::gpu::FrameBuffer::FrameBuffer(), GPU_FB_MAX_COLOR_ATTACHMENT, blender::bke::subdiv::init(), blender::gpu::FrameBuffer::scissor_reset(), blender::gpu::FrameBuffer::size_set(), and blender::gpu::FrameBuffer::viewport_reset().
Referenced by blit(), blit_to(), blender::gpu::MTLBackend::framebuffer_alloc(), and blender::gpu::MTLContext::MTLContext().
|
override |
Definition at line 58 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blender::gpu::MTLContext::get(), GPU_FB_MAX_COLOR_ATTACHMENT, blender::GPU_framebuffer_restore(), and remove_all_attachments().
| bool blender::gpu::MTLFrameBuffer::add_color_attachment | ( | gpu::MTLTexture * | texture, |
| uint | slot, | ||
| int | miplevel, | ||
| int | layer ) |
Definition at line 790 of file mtl_framebuffer.mm.
References attachment_size_set(), blender::BLI_assert(), get_attachment_limit(), blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_LOADACTION_LOAD, blender::GPU_STOREACTION_STORE, blender::gpu::GPU_TEXTURE_1D, blender::gpu::GPU_TEXTURE_1D_ARRAY, blender::gpu::GPU_TEXTURE_2D, blender::gpu::GPU_TEXTURE_2D_ARRAY, blender::gpu::GPU_TEXTURE_3D, blender::gpu::GPU_TEXTURE_BUFFER, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::GPU_TEXTURE_CUBE_ARRAY, layer, mark_dirty(), blender::max_ii(), MTL_LOG_ERROR, MTL_LOG_WARNING, blender::gpu::FrameBuffer::set_color_attachment_bit(), blender::gpu::FrameBuffer::size_set(), and texture().
Referenced by update_attachments().
| bool blender::gpu::MTLFrameBuffer::add_depth_attachment | ( | gpu::MTLTexture * | texture, |
| int | miplevel, | ||
| int | layer ) |
Definition at line 918 of file mtl_framebuffer.mm.
References attachment_size_set(), blender::BLI_assert(), BLI_assert_msg, blender::GPU_LOADACTION_LOAD, blender::GPU_STOREACTION_STORE, blender::gpu::GPU_TEXTURE_1D, blender::gpu::GPU_TEXTURE_1D_ARRAY, blender::gpu::GPU_TEXTURE_2D, blender::gpu::GPU_TEXTURE_2D_ARRAY, blender::gpu::GPU_TEXTURE_3D, blender::gpu::GPU_TEXTURE_BUFFER, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::GPU_TEXTURE_CUBE_ARRAY, layer, mark_dirty(), blender::max_ii(), MTL_LOG_ERROR, MTL_LOG_WARNING, blender::gpu::FrameBuffer::size_set(), and texture().
Referenced by update_attachments().
| bool blender::gpu::MTLFrameBuffer::add_stencil_attachment | ( | gpu::MTLTexture * | texture, |
| int | miplevel, | ||
| int | layer ) |
Definition at line 1038 of file mtl_framebuffer.mm.
References attachment_size_set(), blender::BLI_assert(), BLI_assert_msg, blender::GPU_LOADACTION_LOAD, blender::GPU_STOREACTION_STORE, blender::gpu::GPU_TEXTURE_1D, blender::gpu::GPU_TEXTURE_1D_ARRAY, blender::gpu::GPU_TEXTURE_2D, blender::gpu::GPU_TEXTURE_2D_ARRAY, blender::gpu::GPU_TEXTURE_3D, blender::gpu::GPU_TEXTURE_BUFFER, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::GPU_TEXTURE_CUBE_ARRAY, layer, mark_dirty(), blender::max_ii(), MTL_LOG_ERROR, MTL_LOG_WARNING, blender::gpu::FrameBuffer::size_set(), and texture().
Referenced by update_attachments().
| void blender::gpu::MTLFrameBuffer::apply_state | ( | ) |
Definition at line 745 of file mtl_framebuffer.mm.
References blender::gpu::Context::active_fb, blender::BLI_assert(), blender::gpu::FrameBuffer::dirty_state_, blender::gpu::MTLContext::get(), MTL_LOG_ERROR, MTL_LOG_WARNING, blender::gpu::FrameBuffer::multi_viewport_, blender::gpu::FrameBuffer::scissor_, blender::gpu::FrameBuffer::scissor_test_, blender::gpu::MTLContext::set_scissor(), blender::gpu::MTLContext::set_scissor_enabled(), blender::gpu::MTLContext::set_viewport(), blender::gpu::MTLContext::set_viewports(), and blender::gpu::FrameBuffer::viewport_.
Referenced by clear(), clear_attachment(), and clear_multi().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 1236 of file mtl_framebuffer.mm.
References blender::GPULoadStore::clear_value, blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_FB_DEPTH_ATTACHMENT, blender::GPU_FB_DEPTH_STENCIL_ATTACHMENT, blender::GPU_LOADACTION_CLEAR, blender::GPULoadStore::load_action, set_color_attachment_clear_color(), set_color_loadstore_op(), set_depth_attachment_clear_value(), set_depth_loadstore_op(), set_stencil_loadstore_op(), and blender::GPULoadStore::store_action.
| void blender::gpu::MTLFrameBuffer::attachment_size_set | ( | int | w, |
| int | h ) |
Definition at line 1944 of file mtl_framebuffer.mm.
References w().
Referenced by add_color_attachment(), add_depth_attachment(), add_stencil_attachment(), and ensure_render_target_size().
| MTLRenderPassDescriptor * blender::gpu::MTLFrameBuffer::bake_render_pass_descriptor | ( | bool | load_contents | ) |
Definition at line 1484 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blender::gpu::MTLAttachment::clear_value, blender::gpu::MTLAttachment::depth_plane, blender::gpu::MTLContext::get(), blender::gpu::MTLContext::get_inside_frame(), get_is_srgb(), blender::gpu::MTLTexture::get_metal_handle_base(), blender::gpu::MTLTexture::get_non_srgb_handle(), get_pending_clear(), GPU_FB_MAX_COLOR_ATTACHMENT, blender::GPU_LOADACTION_CLEAR, blender::GPU_LOADACTION_DONT_CARE, blender::GPU_LOADACTION_LOAD, blender::GPU_STOREACTION_DONT_CARE, blender::GPU_STOREACTION_STORE, blender::GPU_TEXTURE_USAGE_MEMORYLESS, blender::gpu::FrameBuffer::height_, blender::bke::subdiv::init(), blender::gpu::MTLTexture::is_format_srgb(), len(), blender::gpu::MTLAttachment::load_action, blender::gpu::MTLAttachment::mip, blender::gpu::mtl_load_action_from_gpu(), MTL_LOG_ERROR, blender::gpu::mtl_store_action_from_gpu(), blender::gpu::MTLAttachment::slice, blender::gpu::MTLAttachment::store_action, blender::gpu::MTLAttachment::texture, texture(), UNPACK4, UNUSED_VARS_NDEBUG, blender::gpu::Texture::usage_get(), blender::gpu::FrameBuffer::use_explicit_load_store_, blender::gpu::MTLAttachment::used, and blender::gpu::FrameBuffer::width_.
Referenced by blender::gpu::MTLCommandBufferManager::ensure_begin_render_command_encoder().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 109 of file mtl_framebuffer.mm.
References BLI_assert_msg, blender::gpu::FrameBuffer::dirty_state_, ensure_attachments_and_viewport(), blender::gpu::MTLContext::framebuffer_bind(), blender::gpu::MTLContext::get(), mark_dirty(), MTL_LOG_WARNING, reset_clear_state(), and blender::gpu::Shader::set_framebuffer_srgb_target().
| void blender::gpu::MTLFrameBuffer::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 ) |
Definition at line 1789 of file mtl_framebuffer.mm.
References blender::gpu::shader::metadata::assert, blender::BLI_assert(), blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::Texture::format_get(), blender::gpu::MTLContext::get(), get_color_attachment(), get_depth_attachment(), get_stencil_attachment(), blender::GPU_COLOR_BIT, blender::GPU_DEPTH_BIT, blender::GPU_STENCIL_BIT, blender::gpu::MTLContext::main_command_buffer, blender::gpu::MTLAttachment::mip, MTL_LOG_ERROR, MTL_LOG_WARNING, MTLFrameBuffer(), blender::gpu::MTLAttachment::slice, blender::gpu::MTLAttachment::texture, texture(), and blender::gpu::MTLAttachment::used.
Referenced by blit_to().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 528 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blit(), ensure_attachments_and_viewport(), blender::gpu::FrameBuffer::FrameBuffer(), get_color_attachment(), get_depth_attachment(), get_stencil_attachment(), blender::GPU_COLOR_BIT, blender::GPU_DEPTH_BIT, blender::GPU_STENCIL_BIT, blender::gpu::Texture::height_get(), MTLFrameBuffer(), blender::gpu::MTLAttachment::texture, blender::gpu::MTLAttachment::used, and blender::gpu::Texture::width_get().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 147 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blender::BLI_snprintf(), ensure_attachments_and_viewport(), get_attachment_count(), get_color_attachment(), get_depth_attachment(), get_stencil_attachment(), blender::GPU_TEXTURE_USAGE_ATTACHMENT, has_depth_attachment(), has_stencil_attachment(), blender::gpu::Texture::height_get(), MTL_LOG_ERROR, blender::gpu::FrameBuffer::name_, blender::gpu::MTLAttachment::texture, blender::gpu::MTLAttachment::used, and blender::gpu::Texture::width_get().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 305 of file mtl_framebuffer.mm.
References apply_state(), blender::BLI_assert(), blender::gpu::MTLContext::get(), blender::GPU_COLOR_BIT, blender::GPU_DEPTH_BIT, blender::GPU_STENCIL_BIT, has_depth_attachment(), has_stencil_attachment(), reset_clear_state(), set_color_attachment_clear_color(), set_depth_attachment_clear_value(), set_stencil_attachment_clear_value(), and update_attachments().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 385 of file mtl_framebuffer.mm.
References apply_state(), blender::BLI_assert(), blender::gpu::MTLContext::get(), blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_FB_DEPTH_ATTACHMENT, has_attachment_at_slot(), has_depth_attachment(), reset_clear_state(), set_color_attachment_clear_color(), and set_depth_attachment_clear_value().
Implements blender::gpu::FrameBuffer.
Definition at line 355 of file mtl_framebuffer.mm.
References apply_state(), get_attachment_limit(), has_attachment_at_slot(), reset_clear_state(), and set_color_attachment_clear_color().
| void blender::gpu::MTLFrameBuffer::ensure_attachments_and_viewport | ( | ) |
Definition at line 97 of file mtl_framebuffer.mm.
References blender::gpu::FrameBuffer::dirty_attachments_, blender::gpu::FrameBuffer::scissor_reset(), update_attachments(), and blender::gpu::FrameBuffer::viewport_reset().
| void blender::gpu::MTLFrameBuffer::ensure_render_target_size | ( | ) |
Definition at line 1218 of file mtl_framebuffer.mm.
References attachment_size_set(), has_depth_attachment(), and has_stencil_attachment().
Referenced by remove_all_attachments(), remove_color_attachment(), remove_depth_attachment(), and remove_stencil_attachment().
| uint blender::gpu::MTLFrameBuffer::get_attachment_count | ( | ) |
Definition at line 1424 of file mtl_framebuffer.mm.
References blender::BLI_assert().
Referenced by check().
| int blender::gpu::MTLFrameBuffer::get_attachment_height | ( | ) |
Definition at line 1954 of file mtl_framebuffer.mm.
Referenced by blender::gpu::MTLContext::ensure_render_pipeline_state().
|
inline |
Definition at line 202 of file mtl_framebuffer.hh.
References GPU_FB_MAX_COLOR_ATTACHMENT.
Referenced by add_color_attachment(), clear_multi(), get_color_attachment_slot_from_texture(), has_attachment_at_slot(), has_color_attachment_with_texture(), remove_color_attachment(), and set_color_attachment_clear_color().
| int blender::gpu::MTLFrameBuffer::get_attachment_width | ( | ) |
Definition at line 1950 of file mtl_framebuffer.mm.
Referenced by blender::gpu::MTLContext::ensure_render_pipeline_state().
| MTLAttachment blender::gpu::MTLFrameBuffer::get_color_attachment | ( | uint | slot | ) |
Definition at line 1430 of file mtl_framebuffer.mm.
References blender::BLI_assert(), GPU_FB_MAX_COLOR_ATTACHMENT, and blender::gpu::MTLAttachment::used.
Referenced by blender::gpu::MTLShader::bake_current_pipeline_state(), blit(), blit_to(), check(), read(), update_attachments(), and blender::gpu::MTLTexture::xr_blit.
| 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().
| MTLAttachment blender::gpu::MTLFrameBuffer::get_depth_attachment | ( | ) |
Definition at line 1441 of file mtl_framebuffer.mm.
References blender::BLI_assert().
Referenced by blender::gpu::MTLShader::bake_current_pipeline_state(), blit(), blit_to(), check(), read(), and update_attachments().
|
inline |
Definition at line 232 of file mtl_framebuffer.hh.
Referenced by blender::gpu::MTLBatch::bind(), blender::gpu::MTLContext::ensure_begin_render_pass(), and blender::gpu::MTLContext::ensure_render_pipeline_state().
| int blender::gpu::MTLFrameBuffer::get_height | ( | ) |
Definition at line 1939 of file mtl_framebuffer.mm.
References blender::gpu::FrameBuffer::height_.
Referenced by blender::gpu::MTLContext::ensure_render_pipeline_state().
|
inline |
Definition at line 247 of file mtl_framebuffer.hh.
Referenced by blender::gpu::MTLShader::bake_current_pipeline_state(), and bake_render_pass_descriptor().
|
inline |
Definition at line 237 of file mtl_framebuffer.hh.
Referenced by bake_render_pass_descriptor().
|
inline |
Definition at line 242 of file mtl_framebuffer.hh.
Referenced by blender::gpu::MTLShader::bake_current_pipeline_state().
| MTLAttachment blender::gpu::MTLFrameBuffer::get_stencil_attachment | ( | ) |
Definition at line 1447 of file mtl_framebuffer.mm.
References blender::BLI_assert().
Referenced by blender::gpu::MTLShader::bake_current_pipeline_state(), blit(), blit_to(), check(), and update_attachments().
| int blender::gpu::MTLFrameBuffer::get_width | ( | ) |
Definition at line 1935 of file mtl_framebuffer.mm.
References blender::gpu::FrameBuffer::width_.
Referenced by blender::gpu::MTLContext::ensure_render_pipeline_state().
| bool blender::gpu::MTLFrameBuffer::has_attachment_at_slot | ( | uint | slot | ) |
Definition at line 1373 of file mtl_framebuffer.mm.
References blender::BLI_assert(), and get_attachment_limit().
Referenced by clear_attachment(), clear_multi(), read(), remove_color_attachment(), and update_attachments().
| 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().
| bool blender::gpu::MTLFrameBuffer::has_depth_attachment | ( | ) |
Definition at line 1397 of file mtl_framebuffer.mm.
References blender::BLI_assert().
Referenced by check(), clear(), clear_attachment(), ensure_render_target_size(), read(), and update_attachments().
| 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().
| void blender::gpu::MTLFrameBuffer::mark_cleared | ( | ) |
Definition at line 594 of file mtl_framebuffer.mm.
| void blender::gpu::MTLFrameBuffer::mark_dirty | ( | ) |
Definition at line 583 of file mtl_framebuffer.mm.
Referenced by add_color_attachment(), add_depth_attachment(), add_stencil_attachment(), bind(), remove_all_attachments(), remove_color_attachment(), remove_depth_attachment(), and remove_stencil_attachment().
| void blender::gpu::MTLFrameBuffer::mark_do_clear | ( | ) |
Definition at line 599 of file mtl_framebuffer.mm.
| void blender::gpu::MTLFrameBuffer::mark_loadstore_dirty | ( | ) |
Definition at line 589 of file mtl_framebuffer.mm.
Referenced by set_color_attachment_clear_color(), set_color_loadstore_op(), set_depth_attachment_clear_value(), set_depth_loadstore_op(), set_stencil_attachment_clear_value(), and set_stencil_loadstore_op().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 451 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blender::gpu::Texture::format_, get_color_attachment(), get_depth_attachment(), blender::GPU_COLOR_BIT, blender::GPU_DEPTH_BIT, blender::GPU_STENCIL_BIT, has_attachment_at_slot(), has_depth_attachment(), MTL_LOG_ERROR, blender::gpu::MTLAttachment::texture, and blender::gpu::to_bytesize().
| void blender::gpu::MTLFrameBuffer::remove_all_attachments | ( | ) |
Definition at line 1199 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blender::gpu::FrameBuffer::dirty_attachments_, ensure_render_target_size(), GPU_FB_MAX_COLOR_ATTACHMENT, mark_dirty(), remove_color_attachment(), remove_depth_attachment(), and remove_stencil_attachment().
Referenced by update_attachments(), and ~MTLFrameBuffer().
| bool blender::gpu::MTLFrameBuffer::remove_color_attachment | ( | uint | slot | ) |
Definition at line 1158 of file mtl_framebuffer.mm.
References blender::BLI_assert(), ensure_render_target_size(), get_attachment_limit(), blender::GPU_FB_COLOR_ATTACHMENT0, has_attachment_at_slot(), mark_dirty(), and blender::gpu::FrameBuffer::set_color_attachment_bit().
Referenced by remove_all_attachments(), and update_attachments().
| bool blender::gpu::MTLFrameBuffer::remove_depth_attachment | ( | ) |
Definition at line 1175 of file mtl_framebuffer.mm.
References blender::BLI_assert(), ensure_render_target_size(), and mark_dirty().
Referenced by remove_all_attachments(), and update_attachments().
| bool blender::gpu::MTLFrameBuffer::remove_stencil_attachment | ( | ) |
Definition at line 1187 of file mtl_framebuffer.mm.
References blender::BLI_assert(), ensure_render_target_size(), and mark_dirty().
Referenced by remove_all_attachments(), and update_attachments().
| bool blender::gpu::MTLFrameBuffer::reset_clear_state | ( | ) |
Definition at line 1357 of file mtl_framebuffer.mm.
References blender::GPU_LOADACTION_LOAD, blender::GPU_STOREACTION_STORE, set_color_loadstore_op(), set_depth_loadstore_op(), and set_stencil_loadstore_op().
Referenced by bind(), clear(), clear_attachment(), and clear_multi().
| bool blender::gpu::MTLFrameBuffer::set_color_attachment_clear_color | ( | uint | slot, |
| const double4 | clear_color ) |
Definition at line 1260 of file mtl_framebuffer.mm.
References blender::assign_if_different(), blender::BLI_assert(), get_attachment_limit(), blender::GPU_LOADACTION_CLEAR, and mark_loadstore_dirty().
Referenced by attachment_set_loadstore_op(), clear(), clear_attachment(), clear_multi(), and update_attachments().
| bool blender::gpu::MTLFrameBuffer::set_color_loadstore_op | ( | uint | slot, |
| GPULoadOp | load_action, | ||
| GPUStoreOp | store_action ) |
Definition at line 1304 of file mtl_framebuffer.mm.
References blender::BLI_assert(), and mark_loadstore_dirty().
Referenced by attachment_set_loadstore_op(), reset_clear_state(), and update_attachments().
| bool blender::gpu::MTLFrameBuffer::set_depth_attachment_clear_value | ( | float | depth_clear | ) |
Definition at line 1276 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blender::GPU_LOADACTION_CLEAR, and mark_loadstore_dirty().
Referenced by attachment_set_loadstore_op(), clear(), clear_attachment(), and update_attachments().
| bool blender::gpu::MTLFrameBuffer::set_depth_loadstore_op | ( | GPULoadOp | load_action, |
| GPUStoreOp | store_action ) |
Definition at line 1323 of file mtl_framebuffer.mm.
References blender::BLI_assert(), and mark_loadstore_dirty().
Referenced by attachment_set_loadstore_op(), reset_clear_state(), and update_attachments().
| bool blender::gpu::MTLFrameBuffer::set_stencil_attachment_clear_value | ( | uint | stencil_clear | ) |
Definition at line 1290 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blender::GPU_LOADACTION_CLEAR, and mark_loadstore_dirty().
Referenced by clear(), and update_attachments().
| bool blender::gpu::MTLFrameBuffer::set_stencil_loadstore_op | ( | GPULoadOp | load_action, |
| GPUStoreOp | store_action ) |
Definition at line 1340 of file mtl_framebuffer.mm.
References blender::BLI_assert(), and mark_loadstore_dirty().
Referenced by attachment_set_loadstore_op(), reset_clear_state(), and update_attachments().
|
overrideprotectedvirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 425 of file mtl_framebuffer.mm.
References blender::gpu::FrameBuffer::attachments_, blender::gpu::MTLBackend::capabilities, blender::GPU_ATTACHMENT_IGNORE, blender::GPU_ATTACHMENT_READ, blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_texture_image_bind(), blender::Span< T >::index_range(), and blender::GPUAttachment::tex.
| void blender::gpu::MTLFrameBuffer::update_attachments | ( | bool | update_viewport | ) |
Definition at line 604 of file mtl_framebuffer.mm.
References add_color_attachment(), add_depth_attachment(), add_stencil_attachment(), blender::gpu::FrameBuffer::attachments_, blender::gpu::MTLAttachment::clear_value, blender::gpu::FrameBuffer::dirty_attachments_, get_color_attachment(), get_depth_attachment(), get_stencil_attachment(), blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_FB_COLOR_ATTACHMENT1, blender::GPU_FB_COLOR_ATTACHMENT2, blender::GPU_FB_COLOR_ATTACHMENT3, blender::GPU_FB_COLOR_ATTACHMENT4, blender::GPU_FB_COLOR_ATTACHMENT5, blender::GPU_FB_COLOR_ATTACHMENT6, blender::GPU_FB_COLOR_ATTACHMENT7, blender::GPU_FB_DEPTH_ATTACHMENT, blender::GPU_FB_DEPTH_STENCIL_ATTACHMENT, blender::GPU_FB_MAX_ATTACHMENT, blender::GPU_texture_format(), blender::GPU_texture_get_mipmap_size(), has_attachment_at_slot(), has_depth_attachment(), has_stencil_attachment(), blender::GPUAttachment::layer, blender::gpu::MTLAttachment::load_action, blender::GPUAttachment::mip, remove_all_attachments(), remove_color_attachment(), remove_depth_attachment(), remove_stencil_attachment(), set_color_attachment_clear_color(), set_color_loadstore_op(), set_depth_attachment_clear_value(), set_depth_loadstore_op(), set_stencil_attachment_clear_value(), set_stencil_loadstore_op(), blender::gpu::FrameBuffer::size_set(), blender::gpu::MTLAttachment::store_action, and blender::GPUAttachment::tex.
Referenced by clear(), ensure_attachments_and_viewport(), and validate_render_pass().
| bool blender::gpu::MTLFrameBuffer::validate_render_pass | ( | ) |
Definition at line 1458 of file mtl_framebuffer.mm.
References blender::BLI_assert(), blender::gpu::FrameBuffer::dirty_attachments_, and update_attachments().