Toast Engine
Loading...
Searching...
No Matches
gpu_sync.hpp File Reference
#include <cstdint>
#include <span>
#include <toast/export.hpp>
#include <vector>
#include <vulkan/vulkan_raii.hpp>
Include dependency graph for gpu_sync.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  renderer::sync::UsageInfo
struct  renderer::sync::ImageState
 Owned next to the image it describes. More...
struct  renderer::sync::QueueHandoff
class  renderer::sync::BarrierBatch
 Skips a barrier only when neither side writes and the layout and next read stages are already covered. More...
struct  renderer::sync::SemaphoreWait
struct  renderer::sync::SemaphoreSignal
struct  renderer::sync::SubmitDesc

Enumerations

enum class  renderer::sync::Usage : uint8_t {
  none , color_attachment , depth_attachment , depth_sampled ,
  fragment_sampled , compute_sampled , shader_sampled , compute_storage_read ,
  compute_storage_write , vertex_storage_read , mesh_storage_read , fragment_storage_read ,
  uniform_read , vertex_input , indirect_read , transfer_src ,
  transfer_dst , host_read , host_write , present ,
  acceleration_build , acceleration_trace_fragment , general
}

Functions

auto renderer::sync::info (Usage usage) -> UsageInfo
auto renderer::sync::writes (Usage usage) -> bool
void renderer::sync::transition (vk::CommandBuffer cmd, vk::Image image, const vk::ImageSubresourceRange &range, Usage previous, Usage next)
void renderer::sync::transition (vk::CommandBuffer cmd, ImageState &state, Usage next)
void renderer::sync::submit (vk::Queue queue, const SubmitDesc &desc)
 The caller holds any lock the queue needs.

Detailed Description

Author
dario
Date
09/10/2026

Enumeration Type Documentation

◆ Usage

enum class renderer::sync::Usage : uint8_t
strong
Enumerator
none 

Contents discarded and the layout undefined.

color_attachment 

Includes load and store ops.

depth_attachment 

eDepthAttachmentOptimal including load and store ops

depth_sampled 

eDepthReadOnlyOptimal sampled by fragment and compute shaders

shader_sampled 

Vertex fragment and compute.

vertex_storage_read 

Vertex pulling.

mesh_storage_read 

Task and mesh shaders on devices with VK_EXT_mesh_shader only.

uniform_read 

Any shader stage.

vertex_input 

Vertex and index buffers.

present 

Colour attachment output stage so the next use chains onto the acquire semaphore wait.

acceleration_build 

Build input output and scratch.

acceleration_trace_fragment 

Fragment shader ray queries.

general 

Every stage and access in eGeneral so correct anywhere and slow everywhere.