Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::gpu::vulkan::TextureSyncStateTable Class Reference

Tracked state for a set of textures, under the discipline the backend records against. More...

#include "donner/gpu/vulkan/VulkanResourceState.h"

Public Member Functions

TextureSyncState stateOf (uint32_t textureSlot) const
 The state textureSlot will be in at this point of an encode: the staged state when one was recorded, otherwise the committed one. A slot never seen reads as untouched.
void stage (uint32_t textureSlot, const TextureSyncState &state)
 Records that a transition to state was encoded, pending submission.
void commitStaged ()
 Promotes every staged transition to committed. Call only once the submission succeeded.
void discardStaged ()
 Drops every staged transition, leaving committed state untouched.
void forget (uint32_t textureSlot)
 Forgets a slot entirely, for a texture that no longer exists.
bool hasStagedChanges () const
 Whether any transition is staged and not yet committed.

Detailed Description

Tracked state for a set of textures, under the discipline the backend records against.

A transition recorded into a command buffer updates the staged view; only a submission that actually reached the queue commits it. An encode that fails partway, or a submit the driver rejects, discards the staging instead - so the table never claims a transition the GPU never ran, which would make every later barrier compute the wrong source scope from a state that does not exist.

Member Function Documentation

◆ forget()

void donner::gpu::vulkan::TextureSyncStateTable::forget ( uint32_t textureSlot)

Forgets a slot entirely, for a texture that no longer exists.

Parameters
textureSlotTexture slot to drop.

◆ stage()

void donner::gpu::vulkan::TextureSyncStateTable::stage ( uint32_t textureSlot,
const TextureSyncState & state )

Records that a transition to state was encoded, pending submission.

Parameters
textureSlotTexture slot the transition applies to.
stateResulting state.

◆ stateOf()

TextureSyncState donner::gpu::vulkan::TextureSyncStateTable::stateOf ( uint32_t textureSlot) const
nodiscard

The state textureSlot will be in at this point of an encode: the staged state when one was recorded, otherwise the committed one. A slot never seen reads as untouched.

Parameters
textureSlotTexture slot to query.

The documentation for this class was generated from the following file: