|
Blender V5.3
|
#include <vk_framebuffer.hh>
Inherits blender::gpu::FrameBuffer.
Public Member Functions | |
| void | bind (bool enabled_srgb) override |
| bool | check (char err_out[256]) override |
| uint32_t | viewport_size () const |
| void | vk_viewports_append (Vector< VkViewport, GPU_MAX_VIEWPORTS > &r_viewports) const |
| void | vk_render_areas_append (Vector< VkRect2D, GPU_MAX_VIEWPORTS > &r_render_areas) const |
| void | render_area_update (VkRect2D &render_area) const |
| VkFormat | depth_attachment_format_get () const |
| VkFormat | stencil_attachment_format_get () const |
| Span< VkFormat > | color_attachment_formats_get () const |
| Get color attachment formats in used by the framebuffer. | |
| void | rendering_reset () |
| void | rendering_ensure (VKContext &context) |
| void | rendering_ensure_dynamic_rendering (VKContext &context, const VKExtensions &extensions) |
| void | rendering_end (VKContext &context) |
| bool | is_rendering () const |
Creation & Deletion | |
| VKFrameBuffer (const char *name) | |
| virtual | ~VKFrameBuffer () |
Load/Store operations | |
| void | attachment_set_loadstore_op (GPUAttachmentType type, GPULoadStore) override |
Read back | |
| void | read (GPUFrameBufferBits planes, eGPUDataFormat format, const int area[4], int channel_len, int slot, void *r_data) override |
Blit operations | |
| void | blit_to (GPUFrameBufferBits planes, int src_slot, FrameBuffer *dst, int dst_slot, int dst_offset_x, int dst_offset_y) override |
Update attachments | |
| void | update_size () |
| void | update_srgb () |
| int | color_attachments_resource_size () const |
| 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 () |
Protected Member Functions | |
Sub-pass transition | |
| void | subpass_transition_impl (const GPUAttachmentState depth_attachment_state, Span< GPUAttachmentState > color_attachment_states) override |
| Protected Member Functions inherited from blender::gpu::FrameBuffer | |
| void | set_color_attachment_bit (GPUAttachmentType type, bool value) |
Clear | |
| void | clear (GPUFrameBufferBits buffers, const double4 clear_color, 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 |
Additional Inherited Members | |
| Public Attributes inherited from blender::gpu::FrameBuffer | |
| void ** | py_ref = nullptr |
| 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 |
Definition at line 25 of file vk_framebuffer.hh.
| blender::gpu::VKFrameBuffer::VKFrameBuffer | ( | const char * | name | ) |
Create a conventional frame-buffer to attach texture to.
Definition at line 31 of file vk_framebuffer.cc.
References blender::gpu::default_load_store(), blender::gpu::FrameBuffer::FrameBuffer(), blender::GPU_ATTACHMENT_WRITE, blender::GPU_FB_MAX_ATTACHMENT, and blender::gpu::FrameBuffer::size_set().
Referenced by blit_to(), blender::gpu::VKBackend::framebuffer_alloc(), and blender::gpu::VKContext::VKContext().
|
virtual |
Definition at line 41 of file vk_framebuffer.cc.
References blender::gpu::VKContext::get().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 279 of file vk_framebuffer.cc.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 51 of file vk_framebuffer.cc.
References blender::gpu::default_load_store(), blender::gpu::VKContext::get(), blender::GPU_ATTACHMENT_WRITE, blender::gpu::FrameBuffer::scissor_reset(), blender::gpu::Shader::set_framebuffer_srgb_target(), update_size(), and blender::gpu::FrameBuffer::viewport_reset().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 476 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, blender::BLI_assert(), BLI_assert_msg, BLI_assert_unreachable, blender::gpu::blit_aspect(), ELEM, blender::gpu::FrameBuffer::FrameBuffer(), blender::gpu::VKContext::get(), blender::GPU_COLOR_BIT, blender::GPU_DEPTH_BIT, blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_FB_DEPTH_ATTACHMENT, blender::GPU_FB_DEPTH_STENCIL_ATTACHMENT, blender::GPUAttachment::tex, UNUSED_VARS_NDEBUG, blender::gpu::unwrap(), and VKFrameBuffer().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 129 of file vk_framebuffer.cc.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 194 of file vk_framebuffer.cc.
References clear(), blender::gpu::VKTexture::clear_depth_stencil(), blender::gpu::FrameBuffer::depth_attachment(), blender::gpu::VKContext::get(), blender::GPU_COLOR_BIT, blender::GPU_DEPTH_BIT, blender::GPU_DEVICE_ATI, blender::GPU_DRIVER_OFFICIAL, GPU_FB_MAX_COLOR_ATTACHMENT, blender::GPU_OS_ANY, blender::GPU_STENCIL_BIT, blender::GPU_type_matches(), blender::GPU_WRITE_DEPTH, blender::GPU_WRITE_NONE, blender::GPU_WRITE_STENCIL, blender::GPUAttachment::layer, render_area_update(), blender::GPUAttachment::tex, and blender::gpu::unwrap().
Referenced by clear(), and clear_multi().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 265 of file vk_framebuffer.cc.
References BLI_assert_unreachable.
Implements blender::gpu::FrameBuffer.
Definition at line 252 of file vk_framebuffer.cc.
References clear(), and render_area_update().
| Span< VkFormat > blender::gpu::VKFrameBuffer::color_attachment_formats_get | ( | ) | const |
Get color attachment formats in used by the framebuffer.
Definition at line 800 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().
| int blender::gpu::VKFrameBuffer::color_attachments_resource_size | ( | ) | const |
Return the number of color attachments of this frame buffer, including unused color attachments.
Frame-buffers can have unused attachments. When higher attachment slots are being used, unused lower attachment slots will be counted as they are required resources in render-passes.
Definition at line 567 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::color_tex(), GPU_FB_MAX_COLOR_ATTACHMENT, blender::IndexRange::IndexRange(), and blender::max_ii().
| VkFormat blender::gpu::VKFrameBuffer::depth_attachment_format_get | ( | ) | const |
Definition at line 792 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().
|
inline |
Definition at line 121 of file vk_framebuffer.hh.
Referenced by blender::gpu::VKContext::deactivate_framebuffer(), and blender::gpu::VKContext::flush_render_graph().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 372 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, BLI_assert_msg, BLI_assert_unreachable, blender::GPU_COLOR_BIT, blender::GPU_DEPTH_BIT, blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_FB_DEPTH_ATTACHMENT, blender::GPU_FB_DEPTH_STENCIL_ATTACHMENT, blender::GPUAttachment::layer, blender::max_ii(), blender::GPUAttachment::tex, texture(), and blender::gpu::unwrap().
| void blender::gpu::VKFrameBuffer::render_area_update | ( | VkRect2D & | render_area | ) | const |
Definition at line 94 of file vk_framebuffer.cc.
References blender::BLI_assert(), blender::clamp_i(), blender::gpu::VKBackend::device, blender::gpu::VKBackend::get(), blender::gpu::FrameBuffer::height_, blender::max_ii(), blender::gpu::VKDevice::physical_device_properties_get(), blender::gpu::FrameBuffer::scissor_get(), blender::gpu::FrameBuffer::scissor_test_get(), and blender::gpu::FrameBuffer::width_.
Referenced by clear(), clear_multi(), rendering_ensure_dynamic_rendering(), and vk_render_areas_append().
| void blender::gpu::VKFrameBuffer::rendering_end | ( | VKContext & | context | ) |
End the rendering on this framebuffer. Is being triggered when framebuffer is deactivated or when
Definition at line 805 of file vk_framebuffer.cc.
References rendering_ensure(), and blender::gpu::FrameBuffer::use_explicit_load_store_.
Referenced by blender::gpu::VKContext::deactivate_framebuffer(), blender::gpu::VKContext::flush_render_graph(), blender::gpu::VKContext::rendering_end(), rendering_ensure(), and subpass_transition_impl().
| void blender::gpu::VKFrameBuffer::rendering_ensure | ( | VKContext & | context | ) |
Ensure that the framebuffer is ready to be rendered on and that its state is up to date with the latest changes that can happen between drawing commands inside VKStateManager.
Definition at line 773 of file vk_framebuffer.cc.
References blender::gpu::default_load_store(), blender::gpu::VKBackend::device, blender::gpu::FrameBuffer::dirty_attachments_, blender::gpu::FrameBuffer::dirty_state_, blender::gpu::VKDevice::extensions_get(), blender::gpu::VKBackend::get(), rendering_end(), rendering_ensure_dynamic_rendering(), and blender::gpu::FrameBuffer::use_explicit_load_store_.
Referenced by blender::gpu::VKBatch::draw(), blender::gpu::VKImmediate::end(), blender::gpu::VKBatch::multi_draw_indirect(), rendering_end(), and subpass_transition_impl().
| void blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering | ( | VKContext & | context, |
| const VKExtensions & | extensions ) |
Definition at line 585 of file vk_framebuffer.cc.
References blender::gpu::Attachment, blender::gpu::FrameBuffer::attachments_, BLI_assert_msg, blender::gpu::render_graph::VKBeginRenderingData::color_attachments, blender::gpu::render_graph::VKBeginRenderingData::depth_attachment, blender::gpu::VKBackend::device, blender::gpu::VKTexture::device_format_get(), blender::gpu::DONT_CARE, blender::gpu::VKExtensions::dynamic_rendering_local_read, blender::gpu::VKExtensions::dynamic_rendering_unused_attachments, blender::gpu::VKDevice::extensions_get(), blender::gpu::Texture::format_get(), blender::gpu::VKBackend::get(), blender::GPU_ATTACHMENT_WRITE, blender::GPU_DATA_FLOAT, blender::GPU_DATA_UINT, blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_FB_DEPTH_ATTACHMENT, blender::GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPU_FB_MAX_COLOR_ATTACHMENT, blender::GPU_TEXTURE_USAGE_ATTACHMENT, blender::gpu::VKTexture::image_view_get(), blender::gpu::render_graph::VKResourceAccessInfo::images, blender::IndexRange::IndexRange(), blender::GPUAttachment::layer, blender::gpu::Texture::layer_count(), blender::max_ii(), blender::GPUAttachment::mip, blender::gpu::render_graph::VKBeginRenderingCreateInfo::node_data, render_area_update(), blender::gpu::set_load_store(), blender::gpu::render_graph::VKBeginRenderingData::stencil_attachment, blender::GPUAttachment::tex, blender::gpu::to_texture_data_format(), blender::gpu::to_vk_format(), blender::gpu::to_vk_image_aspect_flag_bits(), blender::gpu::unwrap(), blender::gpu::Texture::usage_get(), VK_FORMAT_R8G8B8_SRGB, VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_R8G8B8A8_SRGB, VK_FORMAT_R8G8B8A8_UNORM, blender::gpu::VKImageView::vk_handle(), blender::gpu::VKTexture::vk_image_handle(), and blender::gpu::render_graph::VKBeginRenderingData::vk_rendering_info.
Referenced by rendering_ensure().
| void blender::gpu::VKFrameBuffer::rendering_reset | ( | ) |
Mark this framebuffer to be not being rendered on.
Between binding a framebuffer and actually using it the state and clear operations can change. The rendering state is used to find out if the framebuffer begin rendering command should be recorded
Definition at line 580 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKContext::activate_framebuffer().
| VkFormat blender::gpu::VKFrameBuffer::stencil_attachment_format_get | ( | ) | const |
Definition at line 796 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), and blender::gpu::VKContext::update_pipeline_data().
|
overrideprotectedvirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 325 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::color_tex(), blender::GPUSamplerState::default_sampler(), blender::gpu::VKBackend::device, blender::gpu::VKExtensions::dynamic_rendering_local_read, blender::gpu::VKDevice::extensions_get(), blender::gpu::VKBackend::get(), blender::gpu::VKContext::get(), blender::GPU_ATTACHMENT_READ, blender::GPU_FB_COLOR_ATTACHMENT0, blender::GPU_FB_DEPTH_ATTACHMENT, blender::IndexRange::IndexRange(), rendering_end(), rendering_ensure(), blender::Span< T >::size(), texture(), and blender::gpu::unwrap().
| void blender::gpu::VKFrameBuffer::update_size | ( | ) |
Ensure that the size of the frame-buffer matches the first attachment resolution.
Frame buffers attachments are updated when actually used as the image layout has to be correct. After binding frame-buffers the layout of images can still be modified.
But for correct behavior of blit/clear operation the size of the frame-buffer should be set, when activating the frame buffer.
Definition at line 539 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, blender::gpu::FrameBuffer::dirty_attachments_, blender::GPU_FB_MAX_ATTACHMENT, blender::GPU_texture_get_mipmap_size(), blender::GPUAttachment::mip, blender::gpu::FrameBuffer::size_set(), and blender::GPUAttachment::tex.
Referenced by blender::gpu::VKContext::activate_framebuffer(), and bind().
| void blender::gpu::VKFrameBuffer::update_srgb | ( | ) |
Definition at line 556 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::color_tex(), GPU_FB_MAX_COLOR_ATTACHMENT, blender::gpu::GPU_FORMAT_SRGB, blender::IndexRange::IndexRange(), texture(), and blender::gpu::unwrap().
Referenced by blender::gpu::VKContext::activate_framebuffer().
| uint32_t blender::gpu::VKFrameBuffer::viewport_size | ( | ) | const |
Definition at line 74 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::multi_viewport_.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().
| void blender::gpu::VKFrameBuffer::vk_render_areas_append | ( | Vector< VkRect2D, GPU_MAX_VIEWPORTS > & | r_render_areas | ) | const |
Definition at line 120 of file vk_framebuffer.cc.
References blender::BLI_assert(), blender::gpu::FrameBuffer::multi_viewport_, and render_area_update().
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), and blender::gpu::VKContext::update_pipeline_data().
| void blender::gpu::VKFrameBuffer::vk_viewports_append | ( | Vector< VkViewport, GPU_MAX_VIEWPORTS > & | r_viewports | ) | const |
Definition at line 79 of file vk_framebuffer.cc.
References blender::BLI_assert(), blender::IndexRange::IndexRange(), blender::gpu::FrameBuffer::multi_viewport_, and blender::gpu::FrameBuffer::viewport_.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), and blender::gpu::VKContext::update_pipeline_data().