FidelityFX Brixelizer
FidelityFX Brixelizer runtime library.
Typedefs
Type |
Description |
---|---|
typedef uint32_t |
An ID value for an instance created with Brixelizer.
|
Enumerations
Name |
Description |
---|---|
FfxBrixelizerCascadeDebugAABB |
Flags used for specifying debug drawing of AABBs.
FFX_BRIXELIZER_CASCADE_DEBUG_AABB_NONE
FFX_BRIXELIZER_CASCADE_DEBUG_AABB_BOUNDING_BOX
FFX_BRIXELIZER_CASCADE_DEBUG_AABB_AABB_TREE
|
FfxBrixelizerCascadeFlag |
Flags used for cascade creation. A cascade may be specified as having static geometry, dynamic geometry, or both by combining these flags.
FFX_BRIXELIZER_CASCADE_STATIC = (1 << 0)
FFX_BRIXELIZER_CASCADE_DYNAMIC = (1 << 1)
|
FfxBrixelizerContextFlags |
Flags for options for Brixelizer context creation.
FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_CONTEXT_READBACK_BUFFERS = (1 << 0) – Create a context with context readback buffers enabled. Needed to use “ffxBrixelizerContextGetDebugCounters“.
FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_CASCADE_READBACK_BUFFERS = (1 << 1) – Create a context with cascade readback buffers enabled. Needed to use “ffxBrixelizerContextGetCascadeCounters“.
FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_AABBS = (1 << 2) – Create a context with debug AABBs enabled.
FFX_BRIXELIZER_CONTEXT_FLAG_ALL_DEBUG = FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_CONTEXT_READBACK_BUFFERS | FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_CASCADE_READBACK_BUFFERS | FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_AABBS – Create a context with all debugging features enabled.
|
FfxBrixelizerInstanceFlags |
Flags used for specifying instance properties.
FFX_BRIXELIZER_INSTANCE_FLAG_NONE = 0 – No instance flags set.
FFX_BRIXELIZER_INSTANCE_FLAG_DYNAMIC = 1 << 0 – This flag is set for any instance which should be added to the dynamic cascade. Indicates that this instance will be resubmitted every frame.
|
FfxBrixelizerPass |
An enumeration of all the passes which constitute the Brixelizer algorithm.
FFX_BRIXELIZER_PASS_CONTEXT_CLEAR_COUNTERS
FFX_BRIXELIZER_PASS_CONTEXT_COLLECT_CLEAR_BRICKS
FFX_BRIXELIZER_PASS_CONTEXT_PREPARE_CLEAR_BRICKS
FFX_BRIXELIZER_PASS_CONTEXT_CLEAR_BRICK
FFX_BRIXELIZER_PASS_CONTEXT_COLLECT_DIRTY_BRICKS
FFX_BRIXELIZER_PASS_CONTEXT_PREPARE_EIKONAL_ARGS
FFX_BRIXELIZER_PASS_CONTEXT_EIKONAL
FFX_BRIXELIZER_PASS_CONTEXT_MERGE_CASCADES
FFX_BRIXELIZER_PASS_CONTEXT_PREPARE_MERGE_BRICKS_ARGS
FFX_BRIXELIZER_PASS_CONTEXT_MERGE_BRICKS
FFX_BRIXELIZER_PASS_CASCADE_CLEAR_BUILD_COUNTERS
FFX_BRIXELIZER_PASS_CASCADE_RESET_CASCADE
FFX_BRIXELIZER_PASS_CASCADE_SCROLL_CASCADE
FFX_BRIXELIZER_PASS_CASCADE_CLEAR_REF_COUNTERS
FFX_BRIXELIZER_PASS_CASCADE_CLEAR_JOB_COUNTER
FFX_BRIXELIZER_PASS_CASCADE_INVALIDATE_JOB_AREAS
FFX_BRIXELIZER_PASS_CASCADE_COARSE_CULLING
FFX_BRIXELIZER_PASS_CASCADE_SCAN_JOBS
FFX_BRIXELIZER_PASS_CASCADE_VOXELIZE
FFX_BRIXELIZER_PASS_CASCADE_SCAN_REFERENCES
FFX_BRIXELIZER_PASS_CASCADE_COMPACT_REFERENCES
FFX_BRIXELIZER_PASS_CASCADE_CLEAR_BRICK_STORAGE
FFX_BRIXELIZER_PASS_CASCADE_EMIT_SDF
FFX_BRIXELIZER_PASS_CASCADE_COMPRESS_BRICK
FFX_BRIXELIZER_PASS_CASCADE_INITIALIZE_CASCADE
FFX_BRIXELIZER_PASS_CASCADE_MARK_UNINITIALIZED
FFX_BRIXELIZER_PASS_CASCADE_BUILD_TREE_AABB
FFX_BRIXELIZER_PASS_CASCADE_FREE_CASCADE
FFX_BRIXELIZER_PASS_DEBUG_VISUALIZATION
FFX_BRIXELIZER_PASS_DEBUG_INSTANCE_AABBS
FFX_BRIXELIZER_PASS_DEBUG_AABB_TREE
FFX_BRIXELIZER_PASS_COUNT – The number of passes performed by Brixelizer.
|
FfxBrixelizerPopulateDebugAABBsFlags |
Flags used for setting which AABBs to draw in a debug visualization of Brixelizer.
FFX_BRIXELIZER_POPULATE_AABBS_NONE = 0 – Draw no AABBs.
FFX_BRIXELIZER_POPULATE_AABBS_STATIC_INSTANCES = 1 << 0 – Draw AABBs for all static instances.
FFX_BRIXELIZER_POPULATE_AABBS_DYNAMIC_INSTANCES = 1 << 1 – Draw AABBs for all dynamic instances.
FFX_BRIXELIZER_POPULATE_AABBS_INSTANCES = FFX_BRIXELIZER_POPULATE_AABBS_STATIC_INSTANCES | FFX_BRIXELIZER_POPULATE_AABBS_DYNAMIC_INSTANCES – Draw AABBs for all instances.
FFX_BRIXELIZER_POPULATE_AABBS_CASCADE_AABBS = 1 << 2 – Draw AABBs for all cascades.
|
FfxBrixelizerRawInstanceFlags |
Flags used for creating Brixelizer instances.
FFX_BRIXELIZER_RAW_INSTANCE_FLAG_NONE = 0u
FFX_BRIXELIZER_RAW_INSTANCE_FLAG_USE_INDEXLESS_QUAD_LIST = 1u << 1u
|
FfxBrixelizerRawJobFlags |
Flags used for creating Brixelizer jobs. Determines whether a job is a submission of geometry or invalidating an area described by an AABB.
FFX_BRIXELIZER_RAW_JOB_FLAG_NONE = 0u
FFX_BRIXELIZER_RAW_JOB_FLAG_INVALIDATE = 1u << 2u
|
Structs
Name |
Description |
---|---|
A structure representing an axis aligned bounding box for use with Brixelizer.
|
|
A structure generated by Brixelizer from an “FfxBrixelizerUpdateDescription“ structure used for storing parameters necessary for an update with the underlying raw Brixelizer API.
|
|
A structure encapsulating the parameters necessary to register a buffer with the Brixelizer API.
|
|
A structure encapsulating the parameters for cascade creation.
|
|
A structure representing the external resources needed for a Brixelizer cascade.
|
|
A structure containing the statistics for a Brixelizer cascade readable after an update of the Brixelizer API.
|
|
A structure encapsulating the FidelityFX Brixelizer context.
|
|
A structure encapsulating the parameters for creating a Brixelizer context.
|
|
A structure containing the statistics for a Brixelizer context readable after an update of the Brixelizer API.
|
|
A structure encapsulating the parameters for drawing a debug visualization.
|
|
A structure encapsulating the parameters necessary to create an instance with Brixelizer.
|
|
A structure encapsulating the parameters for creating a Brixelizer cascade.
|
|
A structure encapsulating the parameters for updating a Brixelizer cascade.
|
|
A structure encapsulating the FidelityFX Brixelizer context.
|
|
A structure encapsulating the parameters for creating a Brixelizer context.
|
|
A structure encapsulating the parameters for an instance to be added to a Brixelizer context.
|
|
A structure describing a Brixelizer job.
|
|
A structure representing all external resources for use with Brixelizer.
|
|
A structure containing the statistics readable after an update of the Brixelizer API.
|
|
A structure encapsulating the parameters used for computing an update by the Brixelizer context.
|
Functions
Return type |
Description |
---|---|
size_t |
Get the size in bytes needed for an “FfxBrixelizerContext“ struct. Note that this function is provided for consistency, and the size of the “FfxBrixelizerContext“ is a known compile time value which can be obtained using “sizeof(FfxBrixelizerContext)“.
|
ffxBrixelizerContextCreate ( const FfxBrixelizerContextDescription * desc, FfxBrixelizerContext * outContext )
Create a FidelityFX Brixelizer context from the parameters specified to the “FfxBrixelizerContextDesc“ struct.
|
|
ffxBrixelizerContextDestroy (FfxBrixelizerContext * context)
Delete the Brixelizer context associated with the “FfxBrixelizerContext“ struct.
|
|
ffxBrixelizerGetContextInfo ( FfxBrixelizerContext * context, FfxBrixelizerContextInfo * contextInfo )
Fill in an “FfxBrixelizerContextInfo“ struct for necessary for updating a constant buffer for use by Brixelizer when ray marching.
|
|
ffxBrixelizerBakeUpdate ( FfxBrixelizerContext * context, const FfxBrixelizerUpdateDescription * desc, FfxBrixelizerBakedUpdateDescription * outDesc )
Build an “FfxBrixelizerBakedUpdateDescription“ struct from an “FfxBrixelizerUpdateDescription“ struct for use in doing a Brixelizer update.
|
|
ffxBrixelizerUpdate ( FfxBrixelizerContext * context, FfxBrixelizerBakedUpdateDescription * desc, FfxResource scratchBuffer, FfxCommandList commandList )
Perform an update of Brixelizer, recording GPU commands to a command list.
|
|
ffxBrixelizerRegisterBuffers ( FfxBrixelizerContext * context, const FfxBrixelizerBufferDescription * bufferDescs, uint32_t numBufferDescs )
Register a vertex or index buffer to use with Brixelizer.
|
|
ffxBrixelizerUnregisterBuffers ( FfxBrixelizerContext * context, const uint32_t* indices, uint32_t numIndices )
Unregister a previously registered vertex or index buffer.
|
|
ffxBrixelizerCreateInstances ( FfxBrixelizerContext * context, const FfxBrixelizerInstanceDescription * descs, uint32_t numDescs )
Create a static instance for a Brixelizer context.
|
|
ffxBrixelizerDeleteInstances ( FfxBrixelizerContext * context, const FfxBrixelizerInstanceID * instanceIDs, uint32_t numInstanceIDs )
Delete a static instance from a Brixelizer context.
|
|
ffxBrixelizerGetRawContext ( FfxBrixelizerContext * context, FfxBrixelizerRawContext ** outContext )
Get a pointer to the underlying Brixelizer raw context from a Brixelizer context.
|
|
size_t |
Get the size in bytes needed for an “FfxBrixelizerRawContext“ struct. Note that this function is provided for consistency, and the size of the “FfxBrixelizerRawContext“ is a known compile time value which can be obtained using “sizeof(FfxBrixelizerRawContext)“.
|
ffxBrixelizerRawContextCreate ( FfxBrixelizerRawContext * context, const FfxBrixelizerRawContextDescription * contextDescription )
Create a FidelityFX Brixelizer context from the parameters specified to the “FfxBrixelizerRawContextDescription“ struct.
|
|
Destroy the FidelityFX Brixelizer context.
|
|
ffxBrixelizerRawContextGetInfo ( FfxBrixelizerRawContext * context, FfxBrixelizerContextInfo * contextInfo )
Get an “FfxBrixelizerContextInfo“ structure with the details for “context“. This call is intended to be used to fill in a constant buffer necessary for making ray queries.
|
|
ffxBrixelizerRawContextCreateCascade ( FfxBrixelizerRawContext * context, const FfxBrixelizerRawCascadeDescription * cascadeDescription )
Create a cascade for use with Brixelizer.
|
|
ffxBrixelizerRawContextDestroyCascade ( FfxBrixelizerRawContext * context, uint32_t cascadeIndex )
Destroy a cascade previously created with “ffxBrixelizerContextCreateCascade“.
|
|
ffxBrixelizerRawContextResetCascade ( FfxBrixelizerRawContext * context, uint32_t cascadeIndex )
Reset a cascade previously created with “ffxBrixelizerContextCreateCascade“.
|
|
ffxBrixelizerRawContextBegin ( FfxBrixelizerRawContext * context, FfxBrixelizerResources resources )
Begin constructing GPU commands for updating SDF acceleration structures with Brixelizer. Must be called between calls to “ffxBrixelizerContextBegin“ and “ffxBrixelizerContextEnd“.
|
|
ffxBrixelizerRawContextEnd (FfxBrixelizerRawContext * context)
End construcring GPU commands for updating the SDF acceleration structures with Brixelizer.
|
|
Record GPU commands to a “FfxCommandList“ for updating acceleration structures with Brixelizer.
|
|
ffxBrixelizerRawContextGetScratchMemorySize ( FfxBrixelizerRawContext * context, const FfxBrixelizerRawCascadeUpdateDescription * cascadeUpdateDescription, size_t* size )
Get the size in bytes needed from a “FfxResource“ to be used as a scratch buffer in a cascade update.
|
|
ffxBrixelizerRawContextUpdateCascade ( FfxBrixelizerRawContext * context, const FfxBrixelizerRawCascadeUpdateDescription * cascadeUpdateDescription )
Update a cascade in a Brixelizer context.
|
|
ffxBrixelizerRawContextMergeCascades ( FfxBrixelizerRawContext * context, uint32_t src_cascade_A_idx, uint32_t src_cascade_B_idx, uint32_t dst_cascade_idx )
Merge two cascades in a Brixelizer context. Must be called between calls to “ffxBrixelizerRawContextBegin“ and “ffxBrixelizerRawContextEnd“.
|
|
ffxBrixelizerRawContextBuildAABBTree ( FfxBrixelizerRawContext * context, uint32_t cascadeIndex )
Build an AABB tree for a cascade in a Brixelizer context. Must be called between calls to “ffxBrixelizerRawContextBegin“ and “ffxBrixelizerRawContextEnd“.
|
|
ffxBrixelizerRawContextDebugVisualization ( FfxBrixelizerRawContext * context, const FfxBrixelizerDebugVisualizationDescription * debugVisualizationDescription )
Create a debug visualization output of a Brixelizer context. Must be called between calls to “ffxBrixelizerRawContextBegin“ and “ffxBrixelizerRawContextEnd“.
|
|
ffxBrixelizerRawContextGetDebugCounters ( FfxBrixelizerRawContext * context, FfxBrixelizerDebugCounters * debugCounters )
Get the debug counters from a Brixelizer context. Note to use this function the flag “FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_CONTEXT_READBACK_BUFFERS“ must be passed at context creation.
|
|
ffxBrixelizerRawContextGetCascadeCounters ( FfxBrixelizerRawContext * context, uint32_t cascadeIndex, FfxBrixelizerScratchCounters * counters )
Get the cascade counters from a Brixelizer context. Note to use this function the flag “FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_CASCADE_READBACK_BUFFERS“ must be passed at context creation.
|
|
ffxBrixelizerRawContextCreateInstances ( FfxBrixelizerRawContext * context, const FfxBrixelizerRawInstanceDescription * instanceDescriptions, uint32_t numInstanceDescriptions )
Create an instance in a Brixelizer context.
|
|
ffxBrixelizerRawContextDestroyInstances ( FfxBrixelizerRawContext * context, const FfxBrixelizerInstanceID * instanceIDs, uint32_t numInstanceIDs )
Destroy an instance in a Brixelizer context.
|
|
Flush all instances added to the Brixelizer context with “ffxBrixelizerRawContextCreateInstance“ to the GPU.
|
|
ffxBrixelizerRawContextRegisterBuffers ( FfxBrixelizerRawContext * context, const FfxBrixelizerBufferDescription * bufferDescs, uint32_t numBufferDescs )
Register a vertex or index buffer for use with Brixelizer.
|
|
ffxBrixelizerRawContextUnregisterBuffers ( FfxBrixelizerRawContext * context, const uint32_t* indices, uint32_t numIndices )
Unregister a previously registered vertex or index buffer.
|
|
ffxBrixelizerRawContextRegisterScratchBuffer ( FfxBrixelizerRawContext * context, FfxResource scratchBuffer )
Get the index of the recommended cascade to update given the total number of cascades and current frame. Follows the pattern 0 1 0 2 0 1 0 3 0 etc. If 0 is the most detailed cascade and “maxCascades – 1“ is the least detailed cascade this ordering updates more detailed cascades more often.
|
|
FFX_API uint32_t |
ffxBrixelizerRawGetCascadeToUpdate (uint32_t frameIndex, uint32_t maxCascades)
Get the index of the recommended cascade to update given the total number of cascades and current frame. Follows the pattern 0 1 0 2 0 1 0 3 0 etc. If 0 is the most detailed cascade and “maxCascades – 1“ is the least detailed cascade this ordering updates more detailed cascades more often.
|
FFX_API bool |
ffxBrixelizerRawResourceIsNull (FfxResource resource)
Check whether an “FfxResource“ is “NULL“.
|
Queries the effect version number.
|
Macros
Name |
Description |
---|---|
FidelityFX Brixelizer context count.
|
|
FFX_BRIXELIZER_CONTEXT_SIZE (5938838) |
The size of the context specified in 32bit values.
|
FFX_BRIXELIZER_RAW_CONTEXT_SIZE (2924058) |
The size of the raw context specified in 32bit values.
|
The size of the update description specified in 32bit values.
|
|
FidelityFX Brixelizer major version.
|
|
FidelityFX Brixelizer minor version.
|
|
FidelityFX Brixelizer patch version.
|
Detailed description
FidelityFX Brixelizer runtime library.
Typedefs
FfxBrixelizerInstanceID
An ID value for an instance created with Brixelizer.
Global functions
ffxBrixelizerGetContextSize
Get the size in bytes needed for an FfxBrixelizerContext
struct. Note that this function is provided for consistency, and the size of the FfxBrixelizerContext
is a known compile time value which can be obtained using sizeof(FfxBrixelizerContext)
.
Returns:
The size in bytes of an FfxBrixelizerContext
struct.
ffxBrixelizerContextCreate
FFX_API FfxErrorCode ffxBrixelizerContextCreate (
const FfxBrixelizerContextDescription * desc,
FfxBrixelizerContext * outContext
)
Create a FidelityFX Brixelizer context from the parameters specified to the FfxBrixelizerContextDesc
struct.
The context structure is the main object used to interact with the Brixelizer API, and is responsible for the management of the internal resources used by the Brixelizer algorithm. When this API is called, multiple calls will be made via the pointers contained in the *backendInterface* structure. This backend will attempt to retrieve the device capabilities, and create the internal resources, and pipelines required by Brixelizer.
Depending on the parameters passed in via the *contextDescription* a different set of resources and pipelines may be requested by the callback functions.
The “FfxBrixelizerContext“ should be destroyed when use of it is completed. To destroy the context you should call “ffxBrixelizerContextDestroy“.
**
Parameters:
desc |
An |
outContext |
An |
Return values:
FFX_OK |
The operation completed successfully. |
**
ffxBrixelizerContextDestroy
FFX_API FfxErrorCode ffxBrixelizerContextDestroy (FfxBrixelizerContext * context)
Delete the Brixelizer context associated with the FfxBrixelizerContext
struct.
Parameters:
context |
An |
Return values:
FFX_OK |
The operation completed successfully. |
ffxBrixelizerGetContextInfo
FFX_API FfxErrorCode ffxBrixelizerGetContextInfo (
FfxBrixelizerContext * context,
FfxBrixelizerContextInfo * contextInfo
)
Fill in an FfxBrixelizerContextInfo
struct for necessary for updating a constant buffer for use by Brixelizer when ray marching.
Parameters:
context |
An |
contextInfo |
An |
Return values:
FFX_OK |
The operation completed successfully. |
ffxBrixelizerBakeUpdate
FFX_API FfxErrorCode ffxBrixelizerBakeUpdate (
FfxBrixelizerContext * context,
const FfxBrixelizerUpdateDescription * desc,
FfxBrixelizerBakedUpdateDescription * outDesc
)
Build an FfxBrixelizerBakedUpdateDescription
struct from an FfxBrixelizerUpdateDescription
struct for use in doing a Brixelizer update.
Parameters:
context |
An |
desc |
An |
outDesc |
An |
Return values:
FFX_OK |
The operation completed successfully. |
ffxBrixelizerUpdate
FFX_API FfxErrorCode ffxBrixelizerUpdate (
FfxBrixelizerContext * context,
FfxBrixelizerBakedUpdateDescription * desc,
FfxResource scratchBuffer,
FfxCommandList commandList
)
Perform an update of Brixelizer, recording GPU commands to a command list.
Parameters:
context |
An |
desc |
An |
scratchBuffer |
An |
commandList |
An |
Return values:
FFX_OK |
The operation completed successfully. |
ffxBrixelizerRegisterBuffers
FFX_API FfxErrorCode ffxBrixelizerRegisterBuffers (
FfxBrixelizerContext * context,
const FfxBrixelizerBufferDescription * bufferDescs,
uint32_t numBufferDescs
)
Register a vertex or index buffer to use with Brixelizer.
Parameters:
context |
An |
buffer |
An |
index |
The index of the registered buffer. |
Return values:
FFX_OK |
The operation completed successfully. |
ffxBrixelizerUnregisterBuffers
FFX_API FfxErrorCode ffxBrixelizerUnregisterBuffers (
FfxBrixelizerContext * context,
const uint32_t* indices,
uint32_t numIndices
)
Unregister a previously registered vertex or index buffer.
Parameters:
context |
An |
index |
The index of the buffer to unregister. |
Return values:
FFX_OK |
The operation completed successfully. |
ffxBrixelizerCreateInstances
FFX_API FfxErrorCode ffxBrixelizerCreateInstances (
FfxBrixelizerContext * context,
const FfxBrixelizerInstanceDescription * descs,
uint32_t numDescs
)
Create a static instance for a Brixelizer context.
Parameters:
context |
An |
descs |
An array of |
numDescs |
The number of entries in the array passed in by |
Return values:
FFX_OK |
The operation completed successfully. |
ffxBrixelizerDeleteInstances
FFX_API FfxErrorCode ffxBrixelizerDeleteInstances (
FfxBrixelizerContext * context,
const FfxBrixelizerInstanceID * instanceIDs,
uint32_t numInstanceIDs
)
Delete a static instance from a Brixelizer context.
Parameters:
context |
An |
instanceIDs |
An array of |
numInstnaceIDs |
The number of elements in the array passed in by |
Return values:
FFX_OK |
The operation completed successfully. |
ffxBrixelizerGetRawContext
FFX_API FfxErrorCode ffxBrixelizerGetRawContext (
FfxBrixelizerContext * context,
FfxBrixelizerRawContext ** outContext
)
Get a pointer to the underlying Brixelizer raw context from a Brixelizer context.
Parameters:
context |
An |
outContext |
A |
Returns:
FFX_ERROR_INVALID_POINTER The pointer given was invalid.
FFX_OK The operation completed successfully.
ffxBrixelizerRawGetContextSize
Get the size in bytes needed for an FfxBrixelizerRawContext
struct. Note that this function is provided for consistency, and the size of the FfxBrixelizerRawContext
is a known compile time value which can be obtained using sizeof(FfxBrixelizerRawContext)
.
Returns:
The size in bytes of an FfxBrixelizerRawContext
struct.
ffxBrixelizerRawContextCreate
FFX_API FfxErrorCode ffxBrixelizerRawContextCreate (
FfxBrixelizerRawContext * context,
const FfxBrixelizerRawContextDescription * contextDescription
)
Create a FidelityFX Brixelizer context from the parameters specified to the FfxBrixelizerRawContextDescription
struct.
The context structure is the main object used to interact with the Brixelizer API, and is responsible for the management of the internal resources used by the Brixelizer algorithm. When this API is called, multiple calls will be made via the pointers contained in the *backendInterface* structure. This backend will attempt to retrieve the device capabilities, and create the internal resources, and pipelines required by Brixelizer.
Depending on the parameters passed in via the *contextDescription* a different set of resources and pipelines may be requested by the callback functions.
The “FfxBrixelizerRawContext“ should be destroyed when use of it is completed. To destroy the context you should call “ffxBrixelizerContextDestroy“.
**
Parameters:
context |
A pointer to a |
contextDescription |
A pointer to a |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because either |
FFX_ERROR_INCOMPLETE_INTERFACE |
The operation failed because |
FFX_ERROR_BACKEND_API_ERROR |
The operation failed because of an error from the backend. |
**
ffxBrixelizerRawContextDestroy
FFX_API FfxErrorCode ffxBrixelizerRawContextDestroy (FfxBrixelizerRawContext * context)
Destroy the FidelityFX Brixelizer context.
Parameters:
context |
A pointer to a |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The |
ffxBrixelizerRawContextGetInfo
FFX_API FfxErrorCode ffxBrixelizerRawContextGetInfo (
FfxBrixelizerRawContext * context,
FfxBrixelizerContextInfo * contextInfo
)
Get an FfxBrixelizerContextInfo
structure with the details for context
. This call is intended to be used to fill in a constant buffer necessary for making ray queries.
Parameters:
context |
The |
contextInfo |
A |
Return values:
FFX_OK |
The operation was successful. |
FFX_ERROR_INVALID_POINTER |
The |
ffxBrixelizerRawContextCreateCascade
FFX_API FfxErrorCode ffxBrixelizerRawContextCreateCascade (
FfxBrixelizerRawContext * context,
const FfxBrixelizerRawCascadeDescription * cascadeDescription
)
Create a cascade for use with Brixelizer.
Parameters:
context |
The |
cascadeDescription |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because one of |
FFX_ERROR_BACKEND_API_ERROR |
The operation encountered an error in the backend. |
ffxBrixelizerRawContextDestroyCascade
FFX_API FfxErrorCode ffxBrixelizerRawContextDestroyCascade (
FfxBrixelizerRawContext * context,
uint32_t cascadeIndex
)
Destroy a cascade previously created with ffxBrixelizerContextCreateCascade
.
Parameters:
context |
The |
cascadeIndex |
The index of the cascade to delete. |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawContextResetCascade
FFX_API FfxErrorCode ffxBrixelizerRawContextResetCascade (
FfxBrixelizerRawContext * context,
uint32_t cascadeIndex
)
Reset a cascade previously created with ffxBrixelizerContextCreateCascade
.
Parameters:
context |
The |
cascadeIndex |
The index of the cascade to reset. |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_INVALID_ARGUMENT |
No cascade with index |
ffxBrixelizerRawContextBegin
FFX_API FfxErrorCode ffxBrixelizerRawContextBegin (
FfxBrixelizerRawContext * context,
FfxBrixelizerResources resources
)
Begin constructing GPU commands for updating SDF acceleration structures with Brixelizer. Must be called between calls to ffxBrixelizerContextBegin
and ffxBrixelizerContextEnd
.
Parameters:
context |
The |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_NULL_DEVICE |
The operation failed because the |
ffxBrixelizerRawContextEnd
FFX_API FfxErrorCode ffxBrixelizerRawContextEnd (FfxBrixelizerRawContext * context)
End construcring GPU commands for updating the SDF acceleration structures with Brixelizer.
Parameters:
context |
The |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_NULL_DEVICE |
The operation failed because the |
ffxBrixelizerRawContextSubmit
FFX_API FfxErrorCode ffxBrixelizerRawContextSubmit (
FfxBrixelizerRawContext * context,
FfxCommandList cmdList
)
Record GPU commands to a FfxCommandList
for updating acceleration structures with Brixelizer.
Parameters:
context |
The |
cmdList |
The |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_NULL_DEVICE |
The operation failed because the |
ffxBrixelizerRawContextGetScratchMemorySize
FFX_API FfxErrorCode ffxBrixelizerRawContextGetScratchMemorySize (
FfxBrixelizerRawContext * context,
const FfxBrixelizerRawCascadeUpdateDescription * cascadeUpdateDescription,
size_t* size
)
Get the size in bytes needed from a FfxResource
to be used as a scratch buffer in a cascade update.
Parameters:
context |
The |
cascadeUpdateDescription |
A |
size |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_NULL_DEVICE |
|
ffxBrixelizerRawContextUpdateCascade
FFX_API FfxErrorCode ffxBrixelizerRawContextUpdateCascade (
FfxBrixelizerRawContext * context,
const FfxBrixelizerRawCascadeUpdateDescription * cascadeUpdateDescription
)
Update a cascade in a Brixelizer context.
Parameters:
context |
The |
cascadeUpdateDescription |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_NULL_DEVICE |
|
ffxBrixelizerRawContextMergeCascades
FFX_API FfxErrorCode ffxBrixelizerRawContextMergeCascades (
FfxBrixelizerRawContext * context,
uint32_t src_cascade_A_idx,
uint32_t src_cascade_B_idx,
uint32_t dst_cascade_idx
)
Merge two cascades in a Brixelizer context. Must be called between calls to ffxBrixelizerRawContextBegin
and ffxBrixelizerRawContextEnd
.
Parameters:
context |
The |
srcCascadeAIdx |
The index of the first source cascade. |
srcCascadeBIdx |
A |
dstCascadeIdx |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_NULL_DEVICE |
The operation failed because the |
ffxBrixelizerRawContextBuildAABBTree
FFX_API FfxErrorCode ffxBrixelizerRawContextBuildAABBTree (
FfxBrixelizerRawContext * context,
uint32_t cascadeIndex
)
Build an AABB tree for a cascade in a Brixelizer context. Must be called between calls to ffxBrixelizerRawContextBegin
and ffxBrixelizerRawContextEnd
.
Parameters:
context |
The |
cascadeIndex |
The index of the cascade to build the AABB tree of. |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_NULL_DEVICE |
The operation failed because the |
ffxBrixelizerRawContextDebugVisualization
FFX_API FfxErrorCode ffxBrixelizerRawContextDebugVisualization (
FfxBrixelizerRawContext * context,
const FfxBrixelizerDebugVisualizationDescription * debugVisualizationDescription
)
Create a debug visualization output of a Brixelizer context. Must be called between calls to ffxBrixelizerRawContextBegin
and ffxBrixelizerRawContextEnd
.
Parameters:
context |
The |
debugVisualizationDescription |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
FFX_ERROR_NULL_DEVICE |
The operation failed because the |
ffxBrixelizerRawContextGetDebugCounters
FFX_API FfxErrorCode ffxBrixelizerRawContextGetDebugCounters (
FfxBrixelizerRawContext * context,
FfxBrixelizerDebugCounters * debugCounters
)
Get the debug counters from a Brixelizer context. Note to use this function the flag FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_CONTEXT_READBACK_BUFFERS
must be passed at context creation.
Parameters:
context |
The |
debugCounters |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawContextGetCascadeCounters
FFX_API FfxErrorCode ffxBrixelizerRawContextGetCascadeCounters (
FfxBrixelizerRawContext * context,
uint32_t cascadeIndex,
FfxBrixelizerScratchCounters * counters
)
Get the cascade counters from a Brixelizer context. Note to use this function the flag FFX_BRIXELIZER_CONTEXT_FLAG_DEBUG_CASCADE_READBACK_BUFFERS
must be passed at context creation.
Parameters:
context |
The |
cascadeIndex |
The index of the cascade to read the cascade counters of. |
counters |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawContextCreateInstances
FFX_API FfxErrorCode ffxBrixelizerRawContextCreateInstances (
FfxBrixelizerRawContext * context,
const FfxBrixelizerRawInstanceDescription * instanceDescriptions,
uint32_t numInstanceDescriptions
)
Create an instance in a Brixelizer context.
Parameters:
context |
The |
instanceDescription |
A |
numInstanceDescriptions |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawContextDestroyInstances
FFX_API FfxErrorCode ffxBrixelizerRawContextDestroyInstances (
FfxBrixelizerRawContext * context,
const FfxBrixelizerInstanceID * instanceIDs,
uint32_t numInstanceIDs
)
Destroy an instance in a Brixelizer context.
Parameters:
context |
The |
instanceId |
The |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawContextFlushInstances
FFX_API FfxErrorCode ffxBrixelizerRawContextFlushInstances (
FfxBrixelizerRawContext * context,
FfxCommandList cmdList
)
Flush all instances added to the Brixelizer context with ffxBrixelizerRawContextCreateInstance
to the GPU.
Parameters:
context |
The |
cmdList |
An |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawContextRegisterBuffers
FFX_API FfxErrorCode ffxBrixelizerRawContextRegisterBuffers (
FfxBrixelizerRawContext * context,
const FfxBrixelizerBufferDescription * bufferDescs,
uint32_t numBufferDescs
)
Register a vertex or index buffer for use with Brixelizer.
Parameters:
context |
The |
buffer |
An |
index |
The index of the registered buffer. |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawContextUnregisterBuffers
FFX_API FfxErrorCode ffxBrixelizerRawContextUnregisterBuffers (
FfxBrixelizerRawContext * context,
const uint32_t* indices,
uint32_t numIndices
)
Unregister a previously registered vertex or index buffer.
Parameters:
context |
The |
index |
The index of the buffer to unregister. |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawContextRegisterScratchBuffer
FFX_API FfxErrorCode ffxBrixelizerRawContextRegisterScratchBuffer (
FfxBrixelizerRawContext * context,
FfxResource scratchBuffer
)
Get the index of the recommended cascade to update given the total number of cascades and current frame. Follows the pattern 0 1 0 2 0 1 0 3 0 etc. If 0 is the most detailed cascade and maxCascades - 1
is the least detailed cascade this ordering updates more detailed cascades more often.
Parameters:
context |
The |
scratchBuffer |
A |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
The operation failed because |
ffxBrixelizerRawGetCascadeToUpdate
FFX_API uint32_t ffxBrixelizerRawGetCascadeToUpdate (
uint32_t frameIndex,
uint32_t maxCascades
)
Get the index of the recommended cascade to update given the total number of cascades and current frame. Follows the pattern 0 1 0 2 0 1 0 3 0 etc. If 0 is the most detailed cascade and maxCascades - 1
is the least detailed cascade this ordering updates more detailed cascades more often.
Parameters:
frameIndex |
The current frame index. |
maxCascades |
The total number of cascades. |
Return values:
The |
index of the cascade to update. |
ffxBrixelizerRawResourceIsNull
FFX_API bool ffxBrixelizerRawResourceIsNull (FfxResource resource)
Check whether an FfxResource
is NULL
.
Parameters:
resource |
An |
Return values:
<c><i>true</c></i> |
if |
ffxBrixelizerGetEffectVersion
FFX_API FfxVersionNumber ffxBrixelizerGetEffectVersion ()
Queries the effect version number.
Returns:
The SDK version the effect was built with.
Macros
FFX_BRIXELIZER_CONTEXT_COUNT
FidelityFX Brixelizer context count.
Defines the number of internal effect contexts required by Brixelizer
FFX_BRIXELIZER_CONTEXT_SIZE
The size of the context specified in 32bit values.
FFX_BRIXELIZER_RAW_CONTEXT_SIZE
The size of the raw context specified in 32bit values.
FFX_BRIXELIZER_UPDATE_DESCRIPTION_SIZE
The size of the update description specified in 32bit values.
FFX_BRIXELIZER_VERSION_MAJOR
FidelityFX Brixelizer major version.
FFX_BRIXELIZER_VERSION_MINOR
FidelityFX Brixelizer minor version.
FFX_BRIXELIZER_VERSION_PATCH
FidelityFX Brixelizer patch version.