Barriers
-
class ResourceBarrierDesc
The ResourceBarrierDesc class represents the input type for ‘d3d::resource_barrier’. It allows one function to handle multiple input data layouts. Inputs can be simple single values, arrays of values, pointers to values, and initializer lists of values. To interpret the stored values, use the provided enumerate functions to get the buffer and texture barriers. For more details on resource barriers, see https://info.gaijin.lan/display/DE4/Resource+and+Execution+Barriers.
Public Functions
-
inline ResourceBarrierDesc()
Default constructor for ResourceBarrierDesc.
-
ResourceBarrierDesc(const ResourceBarrierDesc&) = default
Copy constructor for ResourceBarrierDesc.
- Parameters:
desc – The ResourceBarrierDesc object to be copied.
-
inline ResourceBarrierDesc(Sbuffer *buf, ResourceBarrier rb)
Constructor for ResourceBarrierDesc with a single buffer and resource barrier.
- Parameters:
buf – The buffer.
rb – The resource barrier.
-
inline ResourceBarrierDesc(Sbuffer *const *bufs, const ResourceBarrier *rb, unsigned count)
Constructor for ResourceBarrierDesc with an array of buffers and resource barriers.
- Parameters:
bufs – The array of buffers.
rb – The array of resource barriers.
count – The number of buffers and resource barriers.
-
template<unsigned N>
inline ResourceBarrierDesc(Sbuffer *(&bufs)[N], ResourceBarrier (&rb)[N]) Constructor for ResourceBarrierDesc with a fixed-size array of buffers and resource barriers.
- Template Parameters:
N – The size of the fixed-size array.
- Parameters:
bufs – The fixed-size array of buffers.
rb – The fixed-size array of resource barriers.
-
inline ResourceBarrierDesc(std::initializer_list<Sbuffer*> bufs, std::initializer_list<ResourceBarrier> rb)
Constructor for ResourceBarrierDesc with initializer lists of buffers and resource barriers.
- Parameters:
bufs – The initializer list of buffers.
rb – The initializer list of resource barriers.
-
inline ResourceBarrierDesc(BaseTexture *tex, ResourceBarrier rb, unsigned sub_res_index, unsigned sub_res_range)
Constructor for ResourceBarrierDesc with a single texture, resource barrier, and sub-resource index and range.
- Parameters:
tex – The texture.
rb – The resource barrier.
sub_res_index – The sub-resource index.
sub_res_range – The sub-resource range.
-
inline ResourceBarrierDesc(BaseTexture *const *texs, const ResourceBarrier *rb, const unsigned *sub_res_index, const unsigned *sub_res_range, unsigned count)
Constructor for ResourceBarrierDesc with an array of textures, resource barriers, sub-resource indices, and sub-resource ranges.
- Parameters:
texs – The array of textures.
rb – The array of resource barriers.
sub_res_index – The array of sub-resource indices.
sub_res_range – The array of sub-resource ranges.
count – The number of textures, resource barriers, sub-resource indices, and sub-resource ranges.
-
template<unsigned N>
inline ResourceBarrierDesc(BaseTexture *(&texs)[N], ResourceBarrier (&rb)[N], unsigned (&sub_res_index)[N], unsigned (&sub_res_range)[N]) Constructor for ResourceBarrierDesc with a fixed-size array of textures, resource barriers, sub-resource indices, and sub-resource ranges.
- Template Parameters:
N – The size of the fixed-size array.
- Parameters:
texs – The fixed-size array of textures.
rb – The fixed-size array of resource barriers.
sub_res_index – The fixed-size array of sub-resource indices.
sub_res_range – The fixed-size array of sub-resource ranges.
-
inline ResourceBarrierDesc(std::initializer_list<BaseTexture*> texs, std::initializer_list<ResourceBarrier> rb, std::initializer_list<unsigned> sub_res_index, std::initializer_list<unsigned> sub_res_range)
Constructor for ResourceBarrierDesc with initializer lists of textures, resource barriers, sub-resource indices, and sub-resource ranges.
- Parameters:
texs – The initializer list of textures.
rb – The initializer list of resource barriers.
sub_res_index – The initializer list of sub-resource indices.
sub_res_range – The initializer list of sub-resource ranges.
-
inline ResourceBarrierDesc(RaytraceBottomAccelerationStructure *blas)
Constructor for ResourceBarrierDesc with a single bottom level acceleration structure.
- Parameters:
blas – The bottom level acceleration structure.
-
inline ResourceBarrierDesc(RaytraceBottomAccelerationStructure *const *blases, unsigned count)
Constructor for ResourceBarrierDesc with an array of bottom level acceleration structures.
- Parameters:
blases – The array of bottom level acceleration structures.
count – The number of bottom level acceleration structures.
-
template<unsigned N>
inline ResourceBarrierDesc(RaytraceBottomAccelerationStructure *(&blases)[N]) Constructor for ResourceBarrierDesc with a fixed-size array of bottom level acceleration structures.
- Template Parameters:
N – The size of the fixed-size array.
- Parameters:
blases – The fixed-size array of bottom level acceleration structures.
-
inline ResourceBarrierDesc(std::initializer_list<RaytraceBottomAccelerationStructure*> blases)
Constructor for ResourceBarrierDesc with initializer lists of bottom level acceleration structures.
- Parameters:
blases – The initializer list of bottom level acceleration structures.
-
inline ResourceBarrierDesc(Sbuffer *const *bufs, const ResourceBarrier *b_rb, unsigned b_count, BaseTexture *const *texs, const ResourceBarrier *t_rb, const unsigned *t_sub_res_index, const unsigned *t_sub_res_range, unsigned t_count)
Constructor for ResourceBarrierDesc with arrays of buffers, resource barriers, textures, resource barriers, sub-resource indices, and sub-resource ranges.
- Parameters:
bufs – The array of buffers.
b_rb – The array of resource barriers for buffers.
b_count – The number of buffers and resource barriers for buffers.
texs – The array of textures.
t_rb – The array of resource barriers for textures.
t_sub_res_index – The array of sub-resource indices for textures.
t_sub_res_range – The array of sub-resource ranges for textures.
t_count – The number of textures, resource barriers for textures, sub-resource indices for textures, and sub-resource ranges for textures.
-
inline ResourceBarrierDesc(Sbuffer *buf, ResourceBarrier b_rb, BaseTexture *const *texs, const ResourceBarrier *t_rb, const unsigned *t_sub_res_index, const unsigned *t_sub_res_range, unsigned t_count)
Constructor for ResourceBarrierDesc with a single buffer, resource barrier, array of textures, resource barriers, sub-resource indices, and sub-resource ranges.
- Parameters:
buf – The buffer.
b_rb – The resource barrier for the buffer.
texs – The array of textures.
t_rb – The array of resource barriers for textures.
t_sub_res_index – The array of sub-resource indices for textures.
t_sub_res_range – The array of sub-resource ranges for textures.
t_count – The number of textures, resource barriers for textures, sub-resource indices for textures, and sub-resource ranges for textures.
-
inline ResourceBarrierDesc(Sbuffer *const *bufs, const ResourceBarrier *b_rb, unsigned b_count, BaseTexture *tex, ResourceBarrier t_rb, unsigned t_sub_res_index, unsigned t_sub_res_range)
Constructor for ResourceBarrierDesc with arrays of buffers, resource barriers, a single texture, resource barrier, sub-resource index, and sub-resource range.
- Parameters:
bufs – The array of buffers.
b_rb – The array of resource barriers for buffers.
b_count – The number of buffers and resource barriers for buffers.
tex – The texture.
t_rb – The resource barrier for the texture.
t_sub_res_index – The sub-resource index for the texture.
t_sub_res_range – The sub-resource range for the texture.
-
inline ResourceBarrierDesc(Sbuffer *buf, ResourceBarrier b_rb, BaseTexture *tex, ResourceBarrier t_rb, unsigned t_sub_res_index, unsigned t_sub_res_range)
Constructor for ResourceBarrierDesc with a single buffer, resource barrier, a single texture, resource barrier, sub-resource index, and sub-resource range.
- Parameters:
buf – The buffer.
b_rb – The resource barrier for the buffer.
tex – The texture.
t_rb – The resource barrier for the texture.
t_sub_res_index – The sub-resource index for the texture.
t_sub_res_range – The sub-resource range for the texture.
-
inline ResourceBarrierDesc(std::initializer_list<Sbuffer*> bufs, std::initializer_list<ResourceBarrier> buf_rb, std::initializer_list<BaseTexture*> texs, std::initializer_list<ResourceBarrier> tex_rb, std::initializer_list<unsigned> sub_res_index, std::initializer_list<unsigned> sub_res_range)
Constructor for ResourceBarrierDesc with initializer lists of buffers, resource barriers, textures, resource barriers, sub-resource indices, and sub-resource ranges.
- Parameters:
bufs – The initializer list of buffers.
buf_rb – The initializer list of resource barriers for buffers.
texs – The initializer list of textures.
tex_rb – The initializer list of resource barriers for textures.
sub_res_index – The initializer list of sub-resource indices for textures.
sub_res_range – The initializer list of sub-resource ranges for textures.
-
inline explicit ResourceBarrierDesc(ResourceBarrier rb)
Constructor for ResourceBarrierDesc with a single resource barrier. The expected use case is that ‘rb’ has the RB_FLUSH_UAV flag set for all pending UAV access.
- Parameters:
rb – The resource barrier.
-
template<typename T>
inline void enumerateBufferBarriers(T clb) Enumerates the buffer barriers and calls the provided callback function for each buffer barrier.
- Template Parameters:
T – The type of the callback function.
- Parameters:
clb – The callback function that takes a buffer and a resource barrier as arguments.
-
template<typename T>
inline void enumerateTextureBarriers(T clb) Enumerates the texture barriers and calls the provided callback function for each texture barrier.
- Template Parameters:
T – The type of the callback function.
- Parameters:
clb – The callback function that takes a texture, a resource barrier, a sub-resource index, and a sub-resource range as arguments.
-
template<typename T>
inline void enumerateBlasBarriers(T clb) Enumerates the bottom level acceleration structure barriers and calls the provided callback function for each bottom level acceleration structure barrier.
- Template Parameters:
T – The type of the callback function.
- Parameters:
clb – The callback function that takes a bottom level acceleration structure as argument.
Public Members
-
BaseTexture *texture
-
BaseTexture *const *textures
-
RaytraceBottomAccelerationStructure *blas
-
RaytraceBottomAccelerationStructure *const *blases
-
ResourceBarrier bufferState
-
const ResourceBarrier *bufferStates
-
ResourceBarrier textureState
-
const ResourceBarrier *textureStates
-
unsigned textureSubResIndex
-
const unsigned *textureSubResIndices
-
unsigned textureSubResRange
-
const unsigned *textureSubResRanges
Private Members
-
union ResourceBarrierDesc::[anonymous] [anonymous]
-
union ResourceBarrierDesc::[anonymous] [anonymous]
-
union ResourceBarrierDesc::[anonymous] [anonymous]
-
union ResourceBarrierDesc::[anonymous] [anonymous]
-
union ResourceBarrierDesc::[anonymous] [anonymous]
-
union ResourceBarrierDesc::[anonymous] [anonymous]
-
union ResourceBarrierDesc::[anonymous] [anonymous]
-
unsigned bufferCount = 0
-
unsigned textureCount = 0
-
unsigned blasCount = 0
Private Static Attributes
-
static constexpr unsigned single_element_count = ~0u
-
inline ResourceBarrierDesc()