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

FfxBrixelizerAABB

A structure representing an axis aligned bounding box for use with Brixelizer.

FfxBrixelizerBakedUpdateDescription

A structure generated by Brixelizer from an “FfxBrixelizerUpdateDescription“ structure used for storing parameters necessary for an update with the underlying raw Brixelizer API.

FfxBrixelizerBufferDescription

A structure encapsulating the parameters necessary to register a buffer with the Brixelizer API.

FfxBrixelizerCascadeDescription

A structure encapsulating the parameters for cascade creation.

FfxBrixelizerCascadeResources

A structure representing the external resources needed for a Brixelizer cascade.

FfxBrixelizerCascadeStats

A structure containing the statistics for a Brixelizer cascade readable after an update of the Brixelizer API.

FfxBrixelizerContext

A structure encapsulating the FidelityFX Brixelizer context.

FfxBrixelizerContextDescription

A structure encapsulating the parameters for creating a Brixelizer context.

FfxBrixelizerContextStats

A structure containing the statistics for a Brixelizer context readable after an update of the Brixelizer API.

FfxBrixelizerDebugVisualizationDescription

A structure encapsulating the parameters for drawing a debug visualization.

FfxBrixelizerInstanceDescription

A structure encapsulating the parameters necessary to create an instance with Brixelizer.

FfxBrixelizerRawCascadeDescription

A structure encapsulating the parameters for creating a Brixelizer cascade.

FfxBrixelizerRawCascadeUpdateDescription

A structure encapsulating the parameters for updating a Brixelizer cascade.

FfxBrixelizerRawContext

A structure encapsulating the FidelityFX Brixelizer context.

FfxBrixelizerRawContextDescription

A structure encapsulating the parameters for creating a Brixelizer context.

FfxBrixelizerRawInstanceDescription

A structure encapsulating the parameters for an instance to be added to a Brixelizer context.

FfxBrixelizerRawJobDescription

A structure describing a Brixelizer job.

FfxBrixelizerResources

A structure representing all external resources for use with Brixelizer.

FfxBrixelizerStats

A structure containing the statistics readable after an update of the Brixelizer API.

FfxBrixelizerUpdateDescription

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)“.

FFX_API FfxErrorCode

Create a FidelityFX Brixelizer context from the parameters specified to the “FfxBrixelizerContextDesc“ struct.

FFX_API FfxErrorCode

Delete the Brixelizer context associated with the “FfxBrixelizerContext“ struct.

FFX_API FfxErrorCode

Fill in an “FfxBrixelizerContextInfo“ struct for necessary for updating a constant buffer for use by Brixelizer when ray marching.

FFX_API FfxErrorCode

Build an “FfxBrixelizerBakedUpdateDescription“ struct from an “FfxBrixelizerUpdateDescription“ struct for use in doing a Brixelizer update.

FFX_API FfxErrorCode

Perform an update of Brixelizer, recording GPU commands to a command list.

FFX_API FfxErrorCode

ffxBrixelizerRegisterBuffers ( FfxBrixelizerContext * context, const FfxBrixelizerBufferDescription * bufferDescs, uint32_t numBufferDescs )
Register a vertex or index buffer to use with Brixelizer.

FFX_API FfxErrorCode

ffxBrixelizerUnregisterBuffers ( FfxBrixelizerContext * context, const uint32_t* indices, uint32_t numIndices )
Unregister a previously registered vertex or index buffer.

FFX_API FfxErrorCode

Create a static instance for a Brixelizer context.

FFX_API FfxErrorCode

ffxBrixelizerDeleteInstances ( FfxBrixelizerContext * context, const FfxBrixelizerInstanceID * instanceIDs, uint32_t numInstanceIDs )
Delete a static instance from a Brixelizer context.

FFX_API FfxErrorCode

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)“.

FFX_API FfxErrorCode

Create a FidelityFX Brixelizer context from the parameters specified to the “FfxBrixelizerRawContextDescription“ struct.

FFX_API FfxErrorCode

Destroy the FidelityFX Brixelizer context.

FFX_API FfxErrorCode

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.

FFX_API FfxErrorCode

Create a cascade for use with Brixelizer.

FFX_API FfxErrorCode

Destroy a cascade previously created with “ffxBrixelizerContextCreateCascade“.

FFX_API FfxErrorCode

Reset a cascade previously created with “ffxBrixelizerContextCreateCascade“.

FFX_API FfxErrorCode

Begin constructing GPU commands for updating SDF acceleration structures with Brixelizer. Must be called between calls to “ffxBrixelizerContextBegin“ and “ffxBrixelizerContextEnd“.

FFX_API FfxErrorCode

End construcring GPU commands for updating the SDF acceleration structures with Brixelizer.

FFX_API FfxErrorCode

Record GPU commands to a “FfxCommandList“ for updating acceleration structures with Brixelizer.

FFX_API FfxErrorCode

Get the size in bytes needed from a “FfxResource“ to be used as a scratch buffer in a cascade update.

FFX_API FfxErrorCode

Update a cascade in a Brixelizer context.

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“.

FFX_API FfxErrorCode

Build an AABB tree for a cascade in a Brixelizer context. Must be called between calls to “ffxBrixelizerRawContextBegin“ and “ffxBrixelizerRawContextEnd“.

FFX_API FfxErrorCode

Create a debug visualization output of a Brixelizer context. Must be called between calls to “ffxBrixelizerRawContextBegin“ and “ffxBrixelizerRawContextEnd“.

FFX_API FfxErrorCode

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.

FFX_API FfxErrorCode

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.

FFX_API FfxErrorCode

ffxBrixelizerRawContextCreateInstances ( FfxBrixelizerRawContext * context, const FfxBrixelizerRawInstanceDescription * instanceDescriptions, uint32_t numInstanceDescriptions )
Create an instance in a Brixelizer context.

FFX_API FfxErrorCode

ffxBrixelizerRawContextDestroyInstances ( FfxBrixelizerRawContext * context, const FfxBrixelizerInstanceID * instanceIDs, uint32_t numInstanceIDs )
Destroy an instance in a Brixelizer context.

FFX_API FfxErrorCode

Flush all instances added to the Brixelizer context with “ffxBrixelizerRawContextCreateInstance“ to the GPU.

FFX_API FfxErrorCode

ffxBrixelizerRawContextRegisterBuffers ( FfxBrixelizerRawContext * context, const FfxBrixelizerBufferDescription * bufferDescs, uint32_t numBufferDescs )
Register a vertex or index buffer for use with Brixelizer.

FFX_API FfxErrorCode

ffxBrixelizerRawContextUnregisterBuffers ( FfxBrixelizerRawContext * context, const uint32_t* indices, uint32_t numIndices )
Unregister a previously registered vertex or index buffer.

FFX_API FfxErrorCode

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

Check whether an “FfxResource“ is “NULL“.

FFX_API FfxVersionNumber

Queries the effect version number.

Macros

Name

Description

FFX_BRIXELIZER_CONTEXT_COUNT 1

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.

FFX_BRIXELIZER_UPDATE_DESCRIPTION_SIZE 2099376

The size of the update description specified in 32bit values.

FFX_BRIXELIZER_VERSION_MAJOR (1)

FidelityFX Brixelizer major version.

FFX_BRIXELIZER_VERSION_MINOR (0)

FidelityFX Brixelizer minor version.

FFX_BRIXELIZER_VERSION_PATCH (0)

FidelityFX Brixelizer patch version.

Detailed description

FidelityFX Brixelizer runtime library.

Typedefs

FfxBrixelizerInstanceID

Copied!

typedef uint32_t FfxBrixelizerInstanceID

An ID value for an instance created with Brixelizer.


Global functions

ffxBrixelizerGetContextSize

Copied!

size_t 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

Copied!

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 FfxBrixelizerContextDescription structure with the parameters for context creation.

outContext

An FfxBrixelizerContext structure for receiving the initialized Brixelizer context.

Return values:

FFX_OK

The operation completed successfully.

**


ffxBrixelizerContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerContextDestroy (FfxBrixelizerContext * context)

Delete the Brixelizer context associated with the FfxBrixelizerContext struct.

Parameters:

context

An FfxBrixelizerContext containing the Brixelizer context.

Return values:

FFX_OK

The operation completed successfully.


ffxBrixelizerGetContextInfo

Copied!

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 FfxBrixelizerContext containing the Brixelizer context.

contextInfo

An FfxBrixelizerContextInfo struct to be filled.

Return values:

FFX_OK

The operation completed successfully.


ffxBrixelizerBakeUpdate

Copied!

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 FfxBrixelizerContext containing the Brixelizer context.

desc

An FfxBrixelizerUpdateDescription struct containing the parameters for the update.

outDesc

An FfxBrixelizerBakedUpdateDescription struct to be filled in.

Return values:

FFX_OK

The operation completed successfully.


ffxBrixelizerUpdate

Copied!

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 FfxBrixelizerContext containing the Brixelizer context.

desc

An FfxBrixelizerBakedUpdateDescription describing the update to compute.

scratchBuffer

An FfxResource to be used as scratch space by the update.

commandList

An FfxCommandList to write GPU commands to.

Return values:

FFX_OK

The operation completed successfully.


ffxBrixelizerRegisterBuffers

Copied!

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 FfxBrixelizerContext containing the Brixelizer context.

buffer

An FfxResource of the vertex or index buffer.

index

The index of the registered buffer.

Return values:

FFX_OK

The operation completed successfully.


ffxBrixelizerUnregisterBuffers

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerUnregisterBuffers (
    FfxBrixelizerContext * context,
    const uint32_t* indices,
    uint32_t numIndices
)

Unregister a previously registered vertex or index buffer.

Parameters:

context

An FfxBrixelizerContext containing the Brixelizer context.

index

The index of the buffer to unregister.

Return values:

FFX_OK

The operation completed successfully.


ffxBrixelizerCreateInstances

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerCreateInstances (
    FfxBrixelizerContext * context,
    const FfxBrixelizerInstanceDescription * descs,
    uint32_t numDescs
)

Create a static instance for a Brixelizer context.

Parameters:

context

An FfxBrixelizerContext containing the Brixelizer context.

descs

An array of FfxBrixelizerInstanceDescription structs with the parameters for instance creation.

numDescs

The number of entries in the array passed in by descs.

Return values:

FFX_OK

The operation completed successfully.


ffxBrixelizerDeleteInstances

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerDeleteInstances (
    FfxBrixelizerContext * context,
    const FfxBrixelizerInstanceID * instanceIDs,
    uint32_t numInstanceIDs
)

Delete a static instance from a Brixelizer context.

Parameters:

context

An FfxBrixelizerContext containing the Brixelizer context.

instanceIDs

An array of FfxBrixelizerInstanceID s corresponding to instances to be destroyed.

numInstnaceIDs

The number of elements in the array passed in by instanceIDs.

Return values:

FFX_OK

The operation completed successfully.


ffxBrixelizerGetRawContext

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerGetRawContext (
    FfxBrixelizerContext * context,
    FfxBrixelizerRawContext ** outContext
)

Get a pointer to the underlying Brixelizer raw context from a Brixelizer context.

Parameters:

context

An FfxBrixelizerContext containing the Brixelizer context.

outContext

A FfxBrixelizerRawContext representing the underlying Brixelizer raw context.

Returns:

FFX_ERROR_INVALID_POINTER The pointer given was invalid.

FFX_OK The operation completed successfully.


ffxBrixelizerRawGetContextSize

Copied!

size_t 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

Copied!

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 FfxBrixelizerRawContext to populate.

contextDescription

A pointer to a FfxBrixelizerRawContextDescription specifying the parameters for context creation.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because either context or contextDescription was NULL.

FFX_ERROR_INCOMPLETE_INTERFACE

The operation failed because contextDescription->backendInterface was not fully specified.

FFX_ERROR_BACKEND_API_ERROR

The operation failed because of an error from the backend.

**


ffxBrixelizerRawContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextDestroy (FfxBrixelizerRawContext * context)

Destroy the FidelityFX Brixelizer context.

Parameters:

context

A pointer to a FfxBrixelizerRawContext structure to destroy.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The context pointer provided was NULL.


ffxBrixelizerRawContextGetInfo

Copied!

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 FfxBrixelizerRawContext to receive the FfxBrixelizerContextInfo of.

contextInfo

A FfxBrixelizerContextInfo struct to be filled in.

Return values:

FFX_OK

The operation was successful.

FFX_ERROR_INVALID_POINTER

The context pointer provided was NULL.


ffxBrixelizerRawContextCreateCascade

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextCreateCascade (
    FfxBrixelizerRawContext * context,
    const FfxBrixelizerRawCascadeDescription * cascadeDescription
)

Create a cascade for use with Brixelizer.

Parameters:

context

The FfxBrixelizerRawContext to create a cascade for.

cascadeDescription

A FfxBrixelizerRawCascadeDescription struct specifying the parameters for cascade creation.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because one of context, cascadeDescription, c> cascadeDescription->aabbTree or c> cascadeDescription->brickMap was NULL.

FFX_ERROR_BACKEND_API_ERROR

The operation encountered an error in the backend.


ffxBrixelizerRawContextDestroyCascade

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextDestroyCascade (
    FfxBrixelizerRawContext * context,
    uint32_t cascadeIndex
)

Destroy a cascade previously created with ffxBrixelizerContextCreateCascade.

Parameters:

context

The FfxBrixelizerRawContext to delete a cascade for.

cascadeIndex

The index of the cascade to delete.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.


ffxBrixelizerRawContextResetCascade

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextResetCascade (
    FfxBrixelizerRawContext * context,
    uint32_t cascadeIndex
)

Reset a cascade previously created with ffxBrixelizerContextCreateCascade.

Parameters:

context

The FfxBrixelizerRawContext to reset a cascade for.

cascadeIndex

The index of the cascade to reset.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.

FFX_ERROR_INVALID_ARGUMENT

No cascade with index cascadeIndex exists.


ffxBrixelizerRawContextBegin

Copied!

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 FfxBrixelizerRawContext to begin a frame for.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.

FFX_ERROR_NULL_DEVICE

The operation failed because the FfxDevice provided to the context was NULL.


ffxBrixelizerRawContextEnd

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextEnd (FfxBrixelizerRawContext * context)

End construcring GPU commands for updating the SDF acceleration structures with Brixelizer.

Parameters:

context

The FfxBrixelizerRawContext to end a frame for.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.

FFX_ERROR_NULL_DEVICE

The operation failed because the FfxDevice provided to the context was NULL.


ffxBrixelizerRawContextSubmit

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextSubmit (
    FfxBrixelizerRawContext * context,
    FfxCommandList  cmdList
)

Record GPU commands to a FfxCommandList for updating acceleration structures with Brixelizer.

Parameters:

context

The FfxBrixelizerRawContext to record GPU commands from.

cmdList

The FfxCommandList to record commands to.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.

FFX_ERROR_NULL_DEVICE

The operation failed because the FfxDevice provided to the context was NULL.


ffxBrixelizerRawContextGetScratchMemorySize

Copied!

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 FfxBrixelizerRawContext to calculate the required scratch buffer size for.

cascadeUpdateDescription

A FfxBrixelizerRawCascadeUpdateDescription struct with the parameters for the cascade update.

size

A size_t to store the required scratch buffer size to.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context or cascadeUpdateDescription was *NULL*.

FFX_ERROR_NULL_DEVICE

The operation failed because the *FfxDevice* provided to the *context* was *NULL*.


ffxBrixelizerRawContextUpdateCascade

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextUpdateCascade (
    FfxBrixelizerRawContext * context,
    const FfxBrixelizerRawCascadeUpdateDescription * cascadeUpdateDescription
)

Update a cascade in a Brixelizer context.

Parameters:

context

The FfxBrixelizerRawContext to perform the cascade update on.

cascadeUpdateDescription

A FfxBrixelizerRawCascadeUpdateDescription struct with the parameters for the cascade update.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context or cascadeUpdateDescription was *NULL*.

FFX_ERROR_NULL_DEVICE

The operation failed because the *FfxDevice* provided to the *context* was *NULL*.


ffxBrixelizerRawContextMergeCascades

Copied!

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 FfxBrixelizerRawContext to merge cascades for.

srcCascadeAIdx

The index of the first source cascade.

srcCascadeBIdx

A FfxResource to store the required scratch buffer size to.

dstCascadeIdx

A FfxResource to store the required scratch buffer size to.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.

FFX_ERROR_NULL_DEVICE

The operation failed because the FfxDevice provided to the context was NULL.


ffxBrixelizerRawContextBuildAABBTree

Copied!

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 FfxBrixelizerRawContext to build an AABB tree for.

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 context was NULL.

FFX_ERROR_NULL_DEVICE

The operation failed because the FfxDevice provided to the context was NULL.


ffxBrixelizerRawContextDebugVisualization

Copied!

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 FfxBrixelizerRawContext to create a debug visualization for.

debugVisualizationDescription

A FfxBrixelizerDebugVisualizationDescription providing the parameters for the debug visualization.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context or debugVisualizationDescription was NULL.

FFX_ERROR_NULL_DEVICE

The operation failed because the FfxDevice provided to the context was NULL.


ffxBrixelizerRawContextGetDebugCounters

Copied!

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 FfxBrixelizerRawContext to read the debug counters of.

debugCounters

A FfxBrixelizerDebugCounters struct to read the debug counters to.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context or debugCounters was NULL.


ffxBrixelizerRawContextGetCascadeCounters

Copied!

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 FfxBrixelizerRawContext to read the cascade counters of.

cascadeIndex

The index of the cascade to read the cascade counters of.

counters

A FfxBrixelizerScratchCounters struct to read the cascade counters to.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context or counters was NULL.


ffxBrixelizerRawContextCreateInstances

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextCreateInstances (
    FfxBrixelizerRawContext * context,
    const FfxBrixelizerRawInstanceDescription * instanceDescriptions,
    uint32_t numInstanceDescriptions
)

Create an instance in a Brixelizer context.

Parameters:

context

The FfxBrixelizerRawContext to create an instance for.

instanceDescription

A FfxBrixelizerRawInstanceDescription struct with the parameters for the instance to create.

numInstanceDescriptions

A FfxBrixelizerInstanceID to read the instance ID to.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context or instanceDescription was NULL.


ffxBrixelizerRawContextDestroyInstances

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextDestroyInstances (
    FfxBrixelizerRawContext * context,
    const FfxBrixelizerInstanceID * instanceIDs,
    uint32_t numInstanceIDs
)

Destroy an instance in a Brixelizer context.

Parameters:

context

The FfxBrixelizerRawContext to delete an instance for.

instanceId

The FfxBrixelizerInstanceID of the instance to delete.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.


ffxBrixelizerRawContextFlushInstances

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextFlushInstances (
    FfxBrixelizerRawContext * context,
    FfxCommandList  cmdList
)

Flush all instances added to the Brixelizer context with ffxBrixelizerRawContextCreateInstance to the GPU.

Parameters:

context

The FfxBrixelizerRawContext to flush the instances for.

cmdList

An FfxCommandList to record GPU commands to.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.


ffxBrixelizerRawContextRegisterBuffers

Copied!

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 FfxBrixelizerRawContext to register a buffer for.

buffer

An FfxResource with the buffer to be set.

index

The index of the registered buffer.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.


ffxBrixelizerRawContextUnregisterBuffers

Copied!

FFX_API  FfxErrorCode  ffxBrixelizerRawContextUnregisterBuffers (
    FfxBrixelizerRawContext * context,
    const uint32_t* indices,
    uint32_t numIndices
)

Unregister a previously registered vertex or index buffer.

Parameters:

context

The FfxBrixelizerRawContext to unregister the buffer from

index

The index of the buffer to unregister.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.


ffxBrixelizerRawContextRegisterScratchBuffer

Copied!

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 FfxBrixelizerRawContext to set a buffer for.

scratchBuffer

A FfxResource for use as a scratch buffer.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

The operation failed because context was NULL.


ffxBrixelizerRawGetCascadeToUpdate

Copied!

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

Copied!

FFX_API  bool ffxBrixelizerRawResourceIsNull (FfxResource  resource)

Check whether an FfxResource is NULL.

Parameters:

resource

An FfxResource to check for nullness.

Return values:

<c><i>true</c></i>

if resource is NULL else false.


ffxBrixelizerGetEffectVersion

Copied!

FFX_API  FfxVersionNumber  ffxBrixelizerGetEffectVersion ()

Queries the effect version number.

Returns:

The SDK version the effect was built with.


Macros

FFX_BRIXELIZER_CONTEXT_COUNT

Copied!

#define FFX_BRIXELIZER_CONTEXT_COUNT 1

FidelityFX Brixelizer context count.

Defines the number of internal effect contexts required by Brixelizer


FFX_BRIXELIZER_CONTEXT_SIZE

Copied!

#define FFX_BRIXELIZER_CONTEXT_SIZE (5938838)

The size of the context specified in 32bit values.


FFX_BRIXELIZER_RAW_CONTEXT_SIZE

Copied!

#define FFX_BRIXELIZER_RAW_CONTEXT_SIZE (2924058)

The size of the raw context specified in 32bit values.


FFX_BRIXELIZER_UPDATE_DESCRIPTION_SIZE

Copied!

#define FFX_BRIXELIZER_UPDATE_DESCRIPTION_SIZE 2099376

The size of the update description specified in 32bit values.


FFX_BRIXELIZER_VERSION_MAJOR

Copied!

#define FFX_BRIXELIZER_VERSION_MAJOR (1)

FidelityFX Brixelizer major version.


FFX_BRIXELIZER_VERSION_MINOR

Copied!

#define FFX_BRIXELIZER_VERSION_MINOR (0)

FidelityFX Brixelizer minor version.


FFX_BRIXELIZER_VERSION_PATCH

Copied!

#define FFX_BRIXELIZER_VERSION_PATCH (0)

FidelityFX Brixelizer patch version.