|
Blender V4.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 |
| Array< VkViewport, 16 > | vk_viewports_get () const |
| Array< VkRect2D, 16 > | vk_render_areas_get () 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_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 (eGPUFrameBufferBits planes, eGPUDataFormat format, const int area[4], int channel_len, int slot, void *r_data) override |
Blit operations | |
| void | blit_to (eGPUFrameBufferBits 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 () |
| GPUTexture * | depth_tex () const |
| GPUTexture * | color_tex (int slot) const |
| const char *const | name_get () const |
| void | set_use_explicit_loadstore (bool use_explicit_loadstore) |
| bool | get_use_explicit_loadstore () const |
| 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) |
| void | recursive_downsample (int max_lvl, void(*callback)(void *user_data, int level), void *user_data) |
| 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 |
Clear | |
| void | clear (eGPUFrameBufferBits 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 | |
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 |
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 30 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::size_set().
|
virtual |
Definition at line 40 of file vk_framebuffer.cc.
References blender::gpu::VKContext::get().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 245 of file vk_framebuffer.cc.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 50 of file vk_framebuffer.cc.
References blender::gpu::default_load_store(), blender::Array< T, InlineBufferCapacity, Allocator >::fill(), blender::gpu::VKContext::get(), GPU_ATTACHMENT_WRITE, blender::gpu::FrameBuffer::scissor_reset(), blender::gpu::Shader::set_framebuffer_srgb_target(), and blender::gpu::FrameBuffer::viewport_reset().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 421 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::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, and blender::gpu::unwrap().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 111 of file vk_framebuffer.cc.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 167 of file vk_framebuffer.cc.
References buffers, clear(), blender::gpu::VKTexture::clear_depth_stencil(), copy_v4_v4(), blender::gpu::FrameBuffer::depth_tex(), 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, blender::gpu::unwrap(), blender::gpu::render_graph::VKClearAttachmentsData::vk_clear_rect, and vk_render_areas_get().
Referenced by clear(), and clear_multi().
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 229 of file vk_framebuffer.cc.
References BLI_assert_unreachable.
|
overridevirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 216 of file vk_framebuffer.cc.
References clear(), blender::gpu::render_graph::VKClearAttachmentsData::vk_clear_rect, and vk_render_areas_get().
| Span< VkFormat > blender::gpu::VKFrameBuffer::color_attachment_formats_get | ( | ) | const |
Definition at line 684 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 512 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 676 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 328 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, and blender::gpu::unwrap().
| 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 689 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(), 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 530 of file vk_framebuffer.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::gpu::Attachment, blender::gpu::FrameBuffer::attachments_, blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), 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::FrameBuffer::dirty_attachments_, blender::gpu::FrameBuffer::dirty_state_, blender::gpu::DONT_CARE, blender::gpu::VKWorkarounds::dynamic_rendering_unused_attachments, 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, 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, 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::VKImageView::vk_handle(), blender::gpu::VKTexture::vk_image_handle(), vk_render_areas_get(), blender::gpu::render_graph::VKBeginRenderingData::vk_rendering_info, and blender::gpu::VKDevice::workarounds_get().
Referenced by rendering_end().
| 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 525 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKContext::activate_framebuffer().
| VkFormat blender::gpu::VKFrameBuffer::stencil_attachment_format_get | ( | ) | const |
Definition at line 680 of file vk_framebuffer.cc.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().
|
overrideprotectedvirtual |
Implements blender::gpu::FrameBuffer.
Definition at line 290 of file vk_framebuffer.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::gpu::FrameBuffer::color_tex(), blender::gpu::default_load_store(), GPUSamplerState::default_sampler(), blender::Array< T, InlineBufferCapacity, Allocator >::fill(), blender::gpu::VKContext::get(), GPU_ATTACHMENT_READ, GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, rendering_end(), blender::Span< T >::size(), 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 484 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::attachments_, blender::gpu::FrameBuffer::dirty_attachments_, GPU_FB_MAX_ATTACHMENT, GPU_texture_get_mipmap_size(), GPUAttachment::mip, blender::gpu::FrameBuffer::size_set(), and GPUAttachment::tex.
Referenced by blender::gpu::VKContext::activate_framebuffer().
| void blender::gpu::VKFrameBuffer::update_srgb | ( | ) |
Definition at line 501 of file vk_framebuffer.cc.
References blender::gpu::FrameBuffer::color_tex(), GPU_FB_MAX_COLOR_ATTACHMENT, blender::gpu::GPU_FORMAT_SRGB, and blender::gpu::unwrap().
Referenced by blender::gpu::VKContext::activate_framebuffer().
| Array< VkRect2D, 16 > blender::gpu::VKFrameBuffer::vk_render_areas_get | ( | ) | const |
Definition at line 88 of file vk_framebuffer.cc.
References clamp_i(), GPU_MAX_VIEWPORTS, blender::gpu::FrameBuffer::height_, blender::gpu::FrameBuffer::multi_viewport_, blender::gpu::FrameBuffer::scissor_get(), blender::gpu::FrameBuffer::scissor_test_get(), and blender::gpu::FrameBuffer::width_.
Referenced by clear(), clear_multi(), blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), and rendering_ensure().
| Array< VkViewport, 16 > blender::gpu::VKFrameBuffer::vk_viewports_get | ( | ) | const |
Definition at line 71 of file vk_framebuffer.cc.
References GPU_MAX_VIEWPORTS, blender::gpu::FrameBuffer::multi_viewport_, and blender::gpu::FrameBuffer::viewport_.
Referenced by blender::gpu::VKShader::ensure_and_get_graphics_pipeline().