Blender V4.3
vk_resource_state_tracker.hh File Reference
#include <mutex>
#include "BLI_map.hh"
#include "BLI_vector.hh"
#include "vk_common.hh"

Go to the source code of this file.

Classes

struct  blender::gpu::render_graph::ResourceWithStamp
 
struct  blender::gpu::render_graph::VKResourceBarrierState
 
class  blender::gpu::render_graph::VKResourceStateTracker
 

Namespaces

namespace  blender
 
namespace  blender::gpu
 
namespace  blender::gpu::render_graph
 

Typedefs

using blender::gpu::render_graph::ResourceHandle = uint64_t
 
using blender::gpu::render_graph::ModificationStamp = uint64_t
 

Enumerations

enum class  blender::gpu::render_graph::VKResourceType { blender::gpu::render_graph::NONE = (0 << 0) , blender::gpu::render_graph::IMAGE = (1 << 0) , blender::gpu::render_graph::BUFFER = (1 << 1) }
 
enum class  blender::gpu::render_graph::ResourceOwner { blender::gpu::render_graph::APPLICATION , blender::gpu::render_graph::SWAP_CHAIN }
 

Functions

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

Detailed Description

The state of resources needs to be tracked on device level.

The state that are being tracked include:

  • Modification stamps: Each time a resource is modified, this stamp is increased. Inside the render graph nodes track the resources including this stamp.
  • Image layouts: The layout of pixels of an image on the GPU depends on the command being executed. A certain vkCmd* requires the image to be in a certain layout. Using incorrect layouts could lead to rendering artifacts.
  • Resource ownership: Resources that are externally managed (swap chain or external) uses a different workflow as its state can be altered externally and needs to be reset.
  • Read/Write access masks: To generate correct and performing pipeline barriers the src/dst access masks needs to be accurate and precise. When creating pipeline barriers the resource usage up to that point should be known and the resource usage from that point on.

Definition in file vk_resource_state_tracker.hh.