Blender V4.3
blender::gpu::render_graph Namespace Reference

Classes

class  CommandBufferLog
 
struct  LayeredImageBinding
 
struct  ResourceWithStamp
 
struct  VKBeginQueryData
 
class  VKBeginQueryNode
 
struct  VKBeginRenderingCreateInfo
 
struct  VKBeginRenderingData
 
class  VKBeginRenderingNode
 
struct  VKBlitImageData
 
class  VKBlitImageNode
 
struct  VKBoundPipeline
 
struct  VKBoundPipelines
 
struct  VKBufferAccess
 
struct  VKClearAttachmentsData
 
class  VKClearAttachmentsNode
 
struct  VKClearColorImageData
 
class  VKClearColorImageNode
 
struct  VKClearDepthStencilImageCreateInfo
 
struct  VKClearDepthStencilImageData
 
class  VKClearDepthStencilImageNode
 
class  VKCommandBufferInterface
 
class  VKCommandBufferWrapper
 
class  VKCommandBuilder
 
struct  VKCopyBufferData
 
class  VKCopyBufferNode
 
struct  VKCopyBufferToImageData
 
class  VKCopyBufferToImageNode
 
struct  VKCopyImageCreateInfo
 
struct  VKCopyImageData
 
class  VKCopyImageNode
 
struct  VKCopyImageToBufferData
 
class  VKCopyImageToBufferNode
 
struct  VKDispatchCreateInfo
 
struct  VKDispatchData
 
struct  VKDispatchIndirectCreateInfo
 
struct  VKDispatchIndirectData
 
class  VKDispatchIndirectNode
 
class  VKDispatchNode
 
struct  VKDrawCreateInfo
 
struct  VKDrawData
 
struct  VKDrawIndexedCreateInfo
 
struct  VKDrawIndexedData
 
struct  VKDrawIndexedIndirectCreateInfo
 
struct  VKDrawIndexedIndirectData
 
class  VKDrawIndexedIndirectNode
 
class  VKDrawIndexedNode
 
struct  VKDrawIndirectCreateInfo
 
struct  VKDrawIndirectData
 
class  VKDrawIndirectNode
 
class  VKDrawNode
 
struct  VKEndQueryData
 
class  VKEndQueryNode
 
struct  VKEndRenderingData
 
class  VKEndRenderingNode
 
struct  VKFillBufferData
 
class  VKFillBufferNode
 
union  VkHandle
 
struct  VKImageAccess
 
struct  VKIndexBufferBinding
 
class  VKNodeInfo
 
struct  VKPipelineData
 
class  VKRenderGraph
 
struct  VKRenderGraphLink
 
struct  VKRenderGraphNode
 
struct  VKRenderGraphNodeLinks
 
struct  VKResetQueryPoolData
 
class  VKResetQueryPoolNode
 
struct  VKResourceAccessInfo
 
struct  VKResourceBarrierState
 
class  VKResourceStateTracker
 
class  VKScheduler
 
struct  VKSynchronizationCreateInfo
 
struct  VKSynchronizationData
 
class  VKSynchronizationNode
 
struct  VKUpdateBufferData
 
class  VKUpdateBufferNode
 
struct  VKUpdateMipmapsData
 
class  VKUpdateMipmapsNode
 
struct  VKVertexBufferBindings
 

Typedefs

using NodeHandle = uint64_t
 
using ResourceHandle = uint64_t
 
using ModificationStamp = uint64_t
 

Enumerations

enum class  VKNodeType {
  UNUSED , BEGIN_QUERY , BEGIN_RENDERING , BLIT_IMAGE ,
  CLEAR_ATTACHMENTS , CLEAR_COLOR_IMAGE , CLEAR_DEPTH_STENCIL_IMAGE , COPY_BUFFER ,
  COPY_IMAGE , COPY_IMAGE_TO_BUFFER , COPY_BUFFER_TO_IMAGE , DISPATCH ,
  DISPATCH_INDIRECT , DRAW , DRAW_INDEXED , DRAW_INDEXED_INDIRECT ,
  DRAW_INDIRECT , END_QUERY , END_RENDERING , FILL_BUFFER ,
  RESET_QUERY_POOL , SYNCHRONIZATION , UPDATE_BUFFER , UPDATE_MIPMAPS
}
 
enum class  VKResourceType { NONE = (0 << 0) , IMAGE = (1 << 0) , BUFFER = (1 << 1) }
 
enum class  ResourceOwner { APPLICATION , SWAP_CHAIN }
 

Functions

BLI_INLINE std::ostream & operator<< (std::ostream &os, const VKNodeType node_type)
 
BLI_INLINE bool node_type_is_within_rendering (VKNodeType node_type)
 
BLI_INLINE bool node_type_is_rendering (VKNodeType node_type)
 
void vk_pipeline_data_copy (VKPipelineData &dst, const VKPipelineData &src)
 
void vk_pipeline_data_build_commands (VKCommandBufferInterface &command_buffer, const VKPipelineData &pipeline_data, VKBoundPipeline &r_bound_pipeline, VkPipelineBindPoint vk_pipeline_bind_point, VkShaderStageFlags vk_shader_stage_flags)
 
void vk_pipeline_data_free (VKPipelineData &data)
 
void vk_index_buffer_binding_build_links (VKResourceStateTracker &resources, VKRenderGraphNodeLinks &node_links, const VKIndexBufferBinding &index_buffer_binding)
 
void vk_index_buffer_binding_build_commands (VKCommandBufferInterface &command_buffer, const VKIndexBufferBinding &index_buffer_binding, VKIndexBufferBinding &r_bound_index_buffer)
 
void vk_vertex_buffer_bindings_build_links (VKResourceStateTracker &resources, VKRenderGraphNodeLinks &node_links, const VKVertexBufferBindings &vertex_buffers)
 
void vk_vertex_buffer_bindings_build_commands (VKCommandBufferInterface &command_buffer, const VKVertexBufferBindings &vertex_buffer_bindings, VKVertexBufferBindings &r_bound_vertex_buffers)
 
 TEST (vk_render_graph, dispatch_read_back)
 
 TEST (vk_render_graph, dispatch_dispatch_read_back)
 
 TEST (vk_render_graph, dispatch_dispatch_read_back_with_changing_descriptor_sets)
 
 TEST (vk_render_graph, dispatch_dispatch_read_back_with_changing_pipelines)
 
 TEST (vk_render_graph, dispatch_dispatch_read_back_with_changing_pipelines_descriptor_sets)
 
 TEST (vk_render_graph, dispatch_indirect_read_back)
 
 TEST (vk_render_graph, dispatch_indirect_dispatch_indirect_read_back)
 
 TEST (vk_render_graph, transfer_and_present)
 
 TEST (vk_render_graph, clear_and_present)
 
 TEST (vk_render_graph, begin_clear_attachments_end_read_back)
 
 TEST (vk_render_graph, begin_draw_end)
 
 TEST (vk_render_graph, begin_draw_end__layered)
 
 TEST (vk_render_graph, begin_rendering_copy_buffer_end_rendering)
 
 TEST (vk_render_graph, begin_clear_attachments_copy_buffer_end)
 
 TEST (vk_render_graph, begin_copy_buffer_clear_attachments_end)
 
 TEST (vk_render_graph, begin_clear_attachments_copy_buffer_clear_attachments_end)
 
 TEST (vk_render_graph, begin_draw_copy_framebuffer_draw_end)
 
 TEST (vk_render_graph, begin_update_draw_update_draw_update_draw_end)
 
 TEST (vk_render_graph, fill_and_read_back)
 
 TEST (vk_render_graph, fill_transfer_and_read_back)
 
 TEST (vk_render_graph, fill_fill_read_back)
 
 TEST (vk_render_graph, clear_clear_copy_and_read_back)
 
 TEST (vk_render_graph, clear_blit_copy_and_read_back)
 
BLI_INLINE std::string & endl ()
 
 ENUM_OPERATORS (VKResourceType, VKResourceType::BUFFER)
 

Variables

static constexpr VkAccessFlags VK_ACCESS_WRITE_MASK
 

Detailed Description

Enable VK_RESOURCE_STATE_TRACKER_VALIDATION to perform a consistency check on the state. The consistency check is time consuming and should only be turned on when needed.

Typedef Documentation

◆ ModificationStamp

ModificationStamp is used to track resource modifications.

When a resource is modified it will generate a new stamp by incrementing the previous stamp with 1. Consecutive reads should use this new stamp. The stamp stays active until the next modification to the resources is added to any render graph.

Definition at line 54 of file vk_resource_state_tracker.hh.

◆ NodeHandle

Index of a node inside the render graph.

Definition at line 40 of file vk_render_graph_node.hh.

◆ ResourceHandle

Enumeration Type Documentation

◆ ResourceOwner

Resources can have deviations in its lifetime based on who owns it.

Enumerator
APPLICATION 

Resource is owned by Blender.

These resources can be destroyed internally by Blender.

NOTE: Most resources are application owned.

SWAP_CHAIN 

Resource is owned by a swap chain.

These resources cannot be destroyed, could be recreated externally and its layout can be modified outside our context.

Definition at line 75 of file vk_resource_state_tracker.hh.

◆ VKNodeType

Type of nodes of the render graph.

Enumerator
UNUSED 
BEGIN_QUERY 
BEGIN_RENDERING 
BLIT_IMAGE 
CLEAR_ATTACHMENTS 
CLEAR_COLOR_IMAGE 
CLEAR_DEPTH_STENCIL_IMAGE 
COPY_BUFFER 
COPY_IMAGE 
COPY_IMAGE_TO_BUFFER 
COPY_BUFFER_TO_IMAGE 
DISPATCH 
DISPATCH_INDIRECT 
DRAW 
DRAW_INDEXED 
DRAW_INDEXED_INDIRECT 
DRAW_INDIRECT 
END_QUERY 
END_RENDERING 
FILL_BUFFER 
RESET_QUERY_POOL 
SYNCHRONIZATION 
UPDATE_BUFFER 
UPDATE_MIPMAPS 

Definition at line 22 of file vk_node_info.hh.

◆ VKResourceType

Enum containing the different resource types that are being tracked.

Enumerator
NONE 
IMAGE 
BUFFER 

Definition at line 69 of file vk_resource_state_tracker.hh.

Function Documentation

◆ endl()

BLI_INLINE std::string & blender::gpu::render_graph::endl ( )

◆ ENUM_OPERATORS()

blender::gpu::render_graph::ENUM_OPERATORS ( VKResourceType ,
VKResourceType::BUFFER  )

◆ node_type_is_rendering()

BLI_INLINE bool blender::gpu::render_graph::node_type_is_rendering ( VKNodeType node_type)

◆ node_type_is_within_rendering()

BLI_INLINE bool blender::gpu::render_graph::node_type_is_within_rendering ( VKNodeType node_type)

◆ operator<<()

◆ TEST() [1/23]

◆ TEST() [2/23]

◆ TEST() [3/23]

◆ TEST() [4/23]

◆ TEST() [5/23]

blender::gpu::render_graph::TEST ( vk_render_graph ,
begin_draw_copy_framebuffer_draw_end  )

When copying the frame buffer content between two draw calls we should not move the command.

This happens in EEVEE where the feedback radiance is copied before the world background is added to the combined texture.

Definition at line 529 of file vk_render_graph_test_scheduler.cc.

References blender::gpu::render_graph::VKResourceStateTracker::add_image(), APPLICATION, blender::gpu::render_graph::VKBeginRenderingData::color_attachments, blender::gpu::render_graph::VKCopyImageData::dst_image, endl(), EXPECT_EQ(), blender::gpu::render_graph::VKDrawData::first_instance, blender::gpu::render_graph::VKDrawData::first_vertex, blender::gpu::render_graph::VKResourceAccessInfo::images, blender::gpu::render_graph::VKDrawData::instance_count, log(), blender::gpu::render_graph::VKBeginRenderingCreateInfo::node_data, blender::gpu::render_graph::VKCopyImageCreateInfo::node_data, blender::gpu::render_graph::VKDrawCreateInfo::node_data, blender::gpu::render_graph::VKDrawData::pipeline_data, blender::gpu::render_graph::VKPipelineData::push_constants_data, blender::gpu::render_graph::VKPipelineData::push_constants_size, blender::gpu::render_graph::VKCopyImageData::region, blender::gpu::render_graph::VKCopyImageData::src_image, blender::gpu::render_graph::VKRenderGraph::submit(), blender::gpu::render_graph::VKDrawData::vertex_count, blender::gpu::render_graph::VKPipelineData::vk_descriptor_set, blender::gpu::render_graph::VKCopyImageCreateInfo::vk_image_aspect, blender::gpu::render_graph::VKPipelineData::vk_pipeline, blender::gpu::render_graph::VKPipelineData::vk_pipeline_layout, and blender::gpu::render_graph::VKBeginRenderingData::vk_rendering_info.

◆ TEST() [6/23]

◆ TEST() [7/23]

◆ TEST() [8/23]

◆ TEST() [9/23]

blender::gpu::render_graph::TEST ( vk_render_graph ,
begin_update_draw_update_draw_update_draw_end  )

Update buffers can be moved to before the rendering scope as when the destination buffer isn't used.

Definition at line 705 of file vk_render_graph_test_scheduler.cc.

References blender::gpu::render_graph::VKResourceStateTracker::add_buffer(), blender::gpu::render_graph::VKResourceStateTracker::add_image(), APPLICATION, blender::gpu::render_graph::VKResourceAccessInfo::buffers, blender::gpu::render_graph::VKBeginRenderingData::color_attachments, blender::gpu::render_graph::VKUpdateBufferData::data, blender::gpu::render_graph::VKUpdateBufferData::data_size, blender::gpu::render_graph::VKUpdateBufferData::dst_buffer, endl(), EXPECT_EQ(), blender::gpu::render_graph::VKDrawData::first_instance, blender::gpu::render_graph::VKDrawData::first_vertex, image(), blender::gpu::render_graph::VKResourceAccessInfo::images, blender::gpu::render_graph::VKDrawData::instance_count, log(), MEM_callocN, blender::gpu::render_graph::VKBeginRenderingCreateInfo::node_data, blender::gpu::render_graph::VKDrawCreateInfo::node_data, blender::gpu::render_graph::VKDrawData::pipeline_data, blender::gpu::render_graph::VKPipelineData::push_constants_data, blender::gpu::render_graph::VKPipelineData::push_constants_size, blender::gpu::render_graph::VKRenderGraph::submit(), blender::gpu::render_graph::VKDrawData::vertex_count, blender::gpu::render_graph::VKPipelineData::vk_descriptor_set, blender::gpu::render_graph::VKPipelineData::vk_pipeline, blender::gpu::render_graph::VKPipelineData::vk_pipeline_layout, and blender::gpu::render_graph::VKBeginRenderingData::vk_rendering_info.

◆ TEST() [10/23]

◆ TEST() [11/23]

◆ TEST() [12/23]

◆ TEST() [13/23]

◆ TEST() [14/23]

◆ TEST() [15/23]

◆ TEST() [16/23]

◆ TEST() [17/23]

◆ TEST() [18/23]

◆ TEST() [19/23]

◆ TEST() [20/23]

blender::gpu::render_graph::TEST ( vk_render_graph ,
fill_and_read_back  )

◆ TEST() [21/23]

blender::gpu::render_graph::TEST ( vk_render_graph ,
fill_fill_read_back  )

Fill a buffer twice, before reading back.

Between the two fills a write->write barrier should be created.

Definition at line 77 of file vk_render_graph_test_transfer.cc.

References blender::gpu::render_graph::VKResourceStateTracker::add_buffer(), endl(), EXPECT_EQ(), log(), and blender::gpu::render_graph::VKRenderGraph::submit_buffer_for_read().

◆ TEST() [22/23]

◆ TEST() [23/23]

blender::gpu::render_graph::TEST ( vk_render_graph ,
transfer_and_present  )

◆ vk_index_buffer_binding_build_commands()

◆ vk_index_buffer_binding_build_links()

◆ vk_pipeline_data_build_commands()

void blender::gpu::render_graph::vk_pipeline_data_build_commands ( VKCommandBufferInterface & command_buffer,
const VKPipelineData & pipeline_data,
VKBoundPipeline & r_bound_pipeline,
VkPipelineBindPoint vk_pipeline_bind_point,
VkShaderStageFlags vk_shader_stage_flags )

Record the commands to the given command buffer to bind the descriptor set, pipeline and push constants.

Descriptor set and pipeline are only bound, when they are different than the last bound. The r_bound_pipelines are checked to identify if they are the last bound. Descriptor set and pipeline are bound at the given pipeline bind point.

Any available push constants in the pipeline data always update the shader stages provided by vk_shader_stage_flags.

Definition at line 26 of file vk_pipeline_data.cc.

References blender::assign_if_different(), blender::gpu::render_graph::VKCommandBufferInterface::bind_descriptor_sets(), blender::gpu::render_graph::VKCommandBufferInterface::bind_pipeline(), blender::gpu::render_graph::VKCommandBufferInterface::push_constants(), blender::gpu::render_graph::VKPipelineData::push_constants_data, blender::gpu::render_graph::VKPipelineData::push_constants_size, blender::gpu::render_graph::VKBoundPipeline::vk_descriptor_set, blender::gpu::render_graph::VKPipelineData::vk_descriptor_set, blender::gpu::render_graph::VKBoundPipeline::vk_pipeline, blender::gpu::render_graph::VKPipelineData::vk_pipeline, and blender::gpu::render_graph::VKPipelineData::vk_pipeline_layout.

Referenced by blender::gpu::render_graph::VKDispatchIndirectNode::build_commands(), blender::gpu::render_graph::VKDispatchNode::build_commands(), blender::gpu::render_graph::VKDrawIndexedIndirectNode::build_commands(), blender::gpu::render_graph::VKDrawIndexedNode::build_commands(), blender::gpu::render_graph::VKDrawIndirectNode::build_commands(), and blender::gpu::render_graph::VKDrawNode::build_commands().

◆ vk_pipeline_data_copy()

void blender::gpu::render_graph::vk_pipeline_data_copy ( VKPipelineData & dst,
const VKPipelineData & src )

◆ vk_pipeline_data_free()

◆ vk_vertex_buffer_bindings_build_commands()

◆ vk_vertex_buffer_bindings_build_links()

Variable Documentation

◆ VK_ACCESS_WRITE_MASK

VkAccessFlags blender::gpu::render_graph::VK_ACCESS_WRITE_MASK
staticconstexpr
Initial value:
=
VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT |
VK_ACCESS_HOST_WRITE_BIT

Which access flags are considered for write access.

Definition at line 46 of file vk_resource_access_info.cc.

Referenced by blender::gpu::render_graph::VKResourceAccessInfo::build_links().