Blender V5.0
blender::gpu::render_graph Namespace Reference

Classes

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

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) }

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_dynamic_graphics_build_commands (VKCommandBufferInterface &command_buffer, const VKViewportData &viewport, const std::optional< float > line_width, VKBoundPipelines &r_bound_pipelines)
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)
static void vk_pipeline_data_copy (VKPipelineDataGraphics &dst, const VKPipelineDataGraphics &src)
static void vk_pipeline_data_free (VKPipelineDataGraphics &data)
 TEST_F (VKRenderGraphTestCompute, dispatch_read_back)
 TEST_F (VKRenderGraphTestCompute, dispatch_dispatch_read_back)
 TEST_F (VKRenderGraphTestCompute, dispatch_dispatch_read_back_with_changing_descriptor_sets)
 TEST_F (VKRenderGraphTestCompute, dispatch_dispatch_read_back_with_changing_pipelines)
 TEST_F (VKRenderGraphTestCompute, dispatch_dispatch_read_back_with_changing_pipelines_descriptor_sets)
 TEST_F (VKRenderGraphTestCompute, dispatch_indirect_read_back)
 TEST_F (VKRenderGraphTestCompute, dispatch_indirect_dispatch_indirect_read_back)
 TEST_F (VKRenderGraphTestPresent, transfer_and_present)
 TEST_F (VKRenderGraphTestPresent, clear_and_present)
 TEST_P (VKRenderGraphTestRender, begin_clear_attachments_end_read_back)
 TEST_P (VKRenderGraphTestRender, begin_draw_end)
 TEST_P (VKRenderGraphTestRender, begin_draw_end__layered)
 INSTANTIATE_TEST_SUITE_P (, VKRenderGraphTestRender, ::testing::Values(true, false))
 TEST_P (VKRenderGraphTestScheduler, begin_rendering_copy_buffer_end_rendering)
 TEST_P (VKRenderGraphTestScheduler, begin_clear_attachments_copy_buffer_end)
 TEST_P (VKRenderGraphTestScheduler, begin_copy_buffer_clear_attachments_end)
 TEST_P (VKRenderGraphTestScheduler, begin_clear_attachments_copy_buffer_clear_attachments_end)
 TEST_P (VKRenderGraphTestScheduler, begin_draw_copy_framebuffer_draw_end)
 TEST_P (VKRenderGraphTestScheduler, begin_update_draw_update_draw_update_draw_end)
 TEST_P (VKRenderGraphTestScheduler, begin_draw_copy_to_attachment_draw_end)
 INSTANTIATE_TEST_SUITE_P (, VKRenderGraphTestScheduler, ::testing::Values(true, false))
 TEST_F (VKRenderGraphTestTransfer, fill_and_read_back)
 TEST_F (VKRenderGraphTestTransfer, fill_transfer_and_read_back)
 TEST_F (VKRenderGraphTestTransfer, fill_fill_read_back)
 TEST_F (VKRenderGraphTestTransfer, clear_clear_copy_and_read_back)
 TEST_F (VKRenderGraphTestTransfer, clear_blit_copy_and_read_back)
 TEST_F (VKRenderGraphTestTransfer, copy_buffer_modify_data)
BLI_INLINE std::string & endl ()
static void submit (std::unique_ptr< VKRenderGraph > &render_graph, std::unique_ptr< CommandBufferLog > &command_buffer)
 BLI_STATIC_ASSERT (sizeof(VKRenderGraphNode)<=96, "VKRenderGraphNode should be kept small. Consider moving data to the " "VKRenderGraphStorage class.")
 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 53 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

◆ 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 68 of file vk_resource_state_tracker.hh.

Function Documentation

◆ BLI_STATIC_ASSERT()

blender::gpu::render_graph::BLI_STATIC_ASSERT ( sizeof(VKRenderGraphNode)<= 96,
"VKRenderGraphNode should be kept small. Consider moving data to the " "VKRenderGraphStorage class."  )

◆ endl()

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

◆ ENUM_OPERATORS()

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

References BUFFER.

◆ INSTANTIATE_TEST_SUITE_P() [1/2]

blender::gpu::render_graph::INSTANTIATE_TEST_SUITE_P ( VKRenderGraphTestRender ,
::testing::Values(true, false)  )

◆ INSTANTIATE_TEST_SUITE_P() [2/2]

blender::gpu::render_graph::INSTANTIATE_TEST_SUITE_P ( VKRenderGraphTestScheduler ,
::testing::Values(true, false)  )

◆ 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<<()

◆ submit()

◆ TEST_F() [1/15]

◆ TEST_F() [2/15]

◆ TEST_F() [3/15]

◆ TEST_F() [4/15]

◆ TEST_F() [5/15]

◆ TEST_F() [6/15]

◆ TEST_F() [7/15]

◆ TEST_F() [8/15]

◆ TEST_F() [9/15]

◆ TEST_F() [10/15]

◆ TEST_F() [11/15]

◆ TEST_F() [12/15]

blender::gpu::render_graph::TEST_F ( VKRenderGraphTestTransfer ,
copy_buffer_modify_data  )

Modify a previous added copy buffer command.

Definition at line 347 of file vk_render_graph_test_transfer.cc.

References endl(), EXPECT_EQ(), log, blender::gpu::render_graph::VKCopyBufferData::region, and submit().

◆ TEST_F() [13/15]

blender::gpu::render_graph::TEST_F ( VKRenderGraphTestTransfer ,
fill_and_read_back  )

Fill a single buffer and read it back.

Definition at line 16 of file vk_render_graph_test_transfer.cc.

References EXPECT_EQ(), log, and submit().

◆ TEST_F() [14/15]

blender::gpu::render_graph::TEST_F ( VKRenderGraphTestTransfer ,
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 73 of file vk_render_graph_test_transfer.cc.

References endl(), EXPECT_EQ(), log, and submit().

◆ TEST_F() [15/15]

blender::gpu::render_graph::TEST_F ( VKRenderGraphTestTransfer ,
fill_transfer_and_read_back  )

◆ TEST_P() [1/10]

◆ TEST_P() [2/10]

◆ TEST_P() [3/10]

◆ TEST_P() [4/10]

◆ TEST_P() [5/10]

◆ TEST_P() [6/10]

◆ TEST_P() [7/10]

◆ TEST_P() [8/10]

◆ TEST_P() [9/10]

◆ TEST_P() [10/10]

◆ 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 42 of file vk_pipeline_data.cc.

References blender::assign_if_different(), blender::gpu::render_graph::VKCommandBufferInterface::bind_descriptor_buffers(), blender::gpu::render_graph::VKCommandBufferInterface::bind_descriptor_sets(), blender::gpu::render_graph::VKCommandBufferInterface::bind_pipeline(), blender::gpu::render_graph::VKBoundPipeline::descriptor_buffer_device_address, blender::gpu::render_graph::VKPipelineData::descriptor_buffer_device_address, blender::gpu::render_graph::VKBoundPipeline::descriptor_buffer_offset, blender::gpu::render_graph::VKPipelineData::descriptor_buffer_offset, 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::VKCommandBufferInterface::set_descriptor_buffer_offsets(), 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() [1/2]

◆ vk_pipeline_data_copy() [2/2]

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

◆ vk_pipeline_data_free() [1/2]

◆ vk_pipeline_data_free() [2/2]

void blender::gpu::render_graph::vk_pipeline_data_free ( VKPipelineDataGraphics & data)
inlinestatic

Definition at line 179 of file vk_pipeline_data.hh.

References data, and vk_pipeline_data_free().

◆ vk_pipeline_dynamic_graphics_build_commands()

◆ 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 53 of file vk_resource_access_info.cc.

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