|
Blender V5.0
|
#include <vk_framebuffer.hh>
Inherits blender::gpu::FrameBuffer.
Public Member Functions | |
| void | bind (bool enabled_srgb) override |
| bool | check (char err_out[256]) override |
| void | vk_viewports_append (Vector< VkViewport > &r_viewports) const |
| void | vk_render_areas_append (Vector< VkRect2D > &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 |
| 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) |
| 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 |
| blender::gpu::Texture * | depth_tex () const |
| blender::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 () |
Public Attributes | |
| uint32_t | color_attachment_size = 0u |
| Public Attributes inherited from blender::gpu::FrameBuffer | |
| void ** | py_ref = nullptr |
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 float clear_color[4], float clear_depth, uint clear_stencil) override |
| void | clear_multi (const float(*clear_color)[4]) override |
| void | clear_attachment (GPUAttachmentType type, eGPUDataFormat data_format, const void *clear_value) override |
Additional Inherited Members | |
| 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 29 of file vk_framebuffer.cc.
References blender::gpu::default_load_store(), blender::gpu::FrameBuffer::FrameBuffer(), GPU_ATTACHMENT_WRITE, GPU_FB_MAX_ATTACHMENT, name, and blender::gpu::FrameBuffer::size_set().
Referenced by blit_to().
|
virtual |
Definition at line 39 of file vk_framebuffer.cc.
References blender::gpu::VKContext::get().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 260 of file vk_framebuffer.cc.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 49 of file vk_framebuffer.cc.
References blender::gpu::default_load_store(), blender::gpu::VKContext::get(), 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 456 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, BLI_assert, BLI_assert_msg, BLI_assert_unreachable, blender::gpu::blit_aspect(), ELEM, blender::gpu::FrameBuffer::FrameBuffer(), blender::gpu::VKContext::get(), GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPUAttachment::tex, UNUSED_VARS_NDEBUG, blender::gpu::unwrap(), and VKFrameBuffer().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 121 of file vk_framebuffer.cc.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 177 of file vk_framebuffer.cc.
References buffers, clear(), blender::gpu::VKTexture::clear_depth_stencil(), copy_v4_v4(), blender::gpu::FrameBuffer::depth_attachment(), blender::gpu::VKContext::get(), GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_DEVICE_ATI, GPU_DRIVER_OFFICIAL, GPU_OS_ANY, GPU_STENCIL_BIT, GPU_type_matches(), GPU_WRITE_DEPTH, GPU_WRITE_NONE, GPU_WRITE_STENCIL, GPUAttachment::layer, render_area_update(), GPUAttachment::tex, and blender::gpu::unwrap().
Referenced by clear(), and clear_multi().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 244 of file vk_framebuffer.cc.
References BLI_assert_unreachable.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 231 of file vk_framebuffer.cc.
References clear(), and render_area_update().
| Span< VkFormat > blender::gpu::VKFrameBuffer::color_attachment_formats_get | ( | ) | const |
Definition at line 760 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 547 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::color_tex(), GPU_FB_MAX_COLOR_ATTACHMENT, max_ii(), and size().
| VkFormat blender::gpu::VKFrameBuffer::depth_attachment_format_get | ( | ) | const |
Definition at line 752 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().
|
inline |
Definition at line 122 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 362 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, BLI_assert_msg, BLI_assert_unreachable, GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPUAttachment::layer, max_ii(), GPUAttachment::tex, texture(), and blender::gpu::unwrap().
| void blender::gpu::VKFrameBuffer::render_area_update | ( | VkRect2D & | render_area | ) | const |
Definition at line 87 of file vk_framebuffer.cc.
References BLI_assert, clamp_i(), blender::gpu::VKBackend::device, blender::gpu::VKBackend::get(), blender::gpu::FrameBuffer::height_, 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 765 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 735 of file vk_framebuffer.cc.
References 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(), and rendering_ensure_dynamic_rendering().
Referenced by rendering_end().
| void blender::gpu::VKFrameBuffer::rendering_ensure_dynamic_rendering | ( | VKContext & | context, |
| const VKExtensions & | extensions ) |
Definition at line 565 of file vk_framebuffer.cc.
References blender::gpu::Attachment, blender::gpu::FrameBuffer::attachments_, BLI_assert_msg, color_attachment_size, 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::VKBackend::get(), GPU_ATTACHMENT_WRITE, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPU_FB_MAX_COLOR_ATTACHMENT, GPU_TEXTURE_USAGE_ATTACHMENT, blender::gpu::VKTexture::image_view_get(), blender::gpu::render_graph::VKResourceAccessInfo::images, GPUAttachment::layer, blender::gpu::Texture::layer_count(), max_ii(), GPUAttachment::mip, blender::gpu::render_graph::VKBeginRenderingCreateInfo::node_data, render_area_update(), blender::gpu::set_load_store(), blender::gpu::render_graph::VKBeginRenderingData::stencil_attachment, GPUAttachment::tex, blender::gpu::to_vk_format(), blender::gpu::to_vk_image_aspect_flag_bits(), blender::gpu::unwrap(), blender::gpu::Texture::usage_get(), blender::gpu::VKImageView::vk_format(), 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 560 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKContext::activate_framebuffer().
| VkFormat blender::gpu::VKFrameBuffer::stencil_attachment_format_get | ( | ) | const |
Definition at line 756 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().
|
overrideprotectedvirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 305 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::color_tex(), blender::gpu::default_load_store(), 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(), GPU_ATTACHMENT_READ, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, rendering_end(), 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 519 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, blender::gpu::FrameBuffer::dirty_attachments_, GPU_FB_MAX_ATTACHMENT, GPU_texture_get_mipmap_size(), i, GPUAttachment::mip, size(), blender::gpu::FrameBuffer::size_set(), and GPUAttachment::tex.
Referenced by blender::gpu::VKContext::activate_framebuffer(), and bind().
| void blender::gpu::VKFrameBuffer::update_srgb | ( | ) |
Definition at line 536 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::color_tex(), GPU_FB_MAX_COLOR_ATTACHMENT, blender::gpu::GPU_FORMAT_SRGB, i, texture(), and blender::gpu::unwrap().
Referenced by blender::gpu::VKContext::activate_framebuffer().
| void blender::gpu::VKFrameBuffer::vk_render_areas_append | ( | Vector< VkRect2D > & | r_render_areas | ) | const |
Definition at line 113 of file vk_framebuffer.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append_n_times(), BLI_assert, GPU_MAX_VIEWPORTS, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::gpu::FrameBuffer::multi_viewport_, and render_area_update().
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().
| void blender::gpu::VKFrameBuffer::vk_viewports_append | ( | Vector< VkViewport > & | r_viewports | ) | const |
Definition at line 72 of file vk_framebuffer.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, GPU_MAX_VIEWPORTS, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::gpu::FrameBuffer::multi_viewport_, and blender::gpu::FrameBuffer::viewport_.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().
| uint32_t blender::gpu::VKFrameBuffer::color_attachment_size = 0u |
Definition at line 40 of file vk_framebuffer.hh.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), and rendering_ensure_dynamic_rendering().