|
1 | 1 | # DirectX Raytracing (DXR) Functional Spec, Part 2 <!-- omit in toc --> |
2 | 2 |
|
3 | | -v0.23 4/24/2026 |
| 3 | +v0.24 4/29/2026 |
4 | 4 |
|
5 | 5 | --- |
6 | 6 |
|
@@ -503,7 +503,7 @@ Conservative memory requirements for executing the described operation. |
503 | 503 |
|
504 | 504 | Member | Definition |
505 | 505 | ------ | ---------- |
506 | | -`UINT64 ResultDataMaxSizeInBytes` | Size required to hold the result of the operation based on the specified inputs. <br><br>In [D3D12_RTAS_OPERATION_INPUTS](#d3d12_rtas_operation_inputs), if the selected operation [Type](#d3d12_rtas_operation_type)'s corresponding union desc member has a [D3D12_RTAS_OPERATION_MODE](#d3d12_rtas_operation_mode) `Mode` field, here are the `Mode` semantics:<ul><li>`D3D12_RTAS_OPERATION_MODE_IMPLICIT_DESTINATIONS`: this field will contain the required size for all results of the operation. That is, the amount of memory required for `BatchResultData` in [D3D12_RTAS_BATCHED_OPERATION_DATA](#d3d12_rtas_batched_operation_data), under the union member `pBatchedOperationData` of [D3D12_RTAS_OPERATION_DESC](#d3d12_rtas_operation_desc). </li><li>`D3D12_RTAS_OPERATION_MODE_EXPLICIT_DESTINATIONS`: this field will contain the required size for a single result.</li><li>`D3D12_RTAS_OPERATION_MODE_GET_SIZES`: the field is unused and will be set to 0 by the call.</li></ul>In the implicit case, the implementation guarantees that the returned value fulfills an inequality: `prebuild(A) + prebuild(B) <= prebuild(A+B)` where: <ul><li>`prebuild(A)` is the value returned by [GetRTASOperationPrebuildInfo()](#getrtasoperationprebuildinfo) in `ResultDataMaxSizeInBytes` for a set of objects `A`.</li><li>`prebuild(B)` is the value returned by [GetRTASOperationPrebuildInfo()](#getrtasoperationprebuildinfo) in `ResultDataMaxSizeInBytes` for a set of objects `B`.</li><li>`prebuild(A+B)` is the value returned by [GetRTASOperationPrebuildInfo()](#getrtasoperationprebuildinfo) in `ResultDataMaxSizeInBytes` for the union of objects of `A` and `B`.</li></ul>This inequality guarantees that a single large buffer can be subdivided into several independent builds by distributing the objects built. <br><br>In [D3D12_RTAS_OPERATION_INPUTS](#d3d12_rtas_operation_inputs), if the selected operation [Type](#d3d12_rtas_operation_type) is `D3D12_RTAS_TYPE_MOVE_CLUSTER_OBJECTS` and [Mode](#d3d12_rtas_operation_mode) is `D3D12_RTAS_OPERATION_MODE_EXPLICIT_DESTINATIONS` the returned value will be zero as there is no way for the implementation to know the maximum size of a moved objects for this operation type. |
| 506 | +`UINT64 ResultDataMaxSizeInBytes` | Size required to hold the result of the operation based on the specified inputs. <br><br>In [D3D12_RTAS_OPERATION_INPUTS](#d3d12_rtas_operation_inputs), if the selected operation [Type](#d3d12_rtas_operation_type)'s corresponding union desc member has a [D3D12_RTAS_OPERATION_MODE](#d3d12_rtas_operation_mode) `Mode` field, here are the `Mode` semantics:<ul><li>`D3D12_RTAS_OPERATION_MODE_IMPLICIT_DESTINATIONS`: this field will contain the required size for all results of the operation. That is, the amount of memory required for `BatchResultData` in [D3D12_RTAS_BATCHED_OPERATION_DATA](#d3d12_rtas_batched_operation_data), under the union member `pBatchedOperationData` of [D3D12_RTAS_OPERATION_DESC](#d3d12_rtas_operation_desc). </li><li>`D3D12_RTAS_OPERATION_MODE_EXPLICIT_DESTINATIONS`: this field will contain the required size for a single result.</li><li>`D3D12_RTAS_OPERATION_MODE_GET_SIZES`: the field is unused and will be set to 0 by the call.</li></ul>In the implicit case, the implementation guarantees that the returned value fulfills an inequality: `prebuild(A) + prebuild(B) <= prebuild(A+B)` where: <ul><li>`prebuild(A)` is the value returned by [GetRTASOperationPrebuildInfo()](#getrtasoperationprebuildinfo) in `ResultDataMaxSizeInBytes` for a set of objects `A`.</li><li>`prebuild(B)` is the value returned by [GetRTASOperationPrebuildInfo()](#getrtasoperationprebuildinfo) in `ResultDataMaxSizeInBytes` for a set of objects `B`.</li><li>`prebuild(A+B)` is the value returned by [GetRTASOperationPrebuildInfo()](#getrtasoperationprebuildinfo) in `ResultDataMaxSizeInBytes` for the union of objects of `A` and `B`.</li></ul>This inequality guarantees that a single large buffer can be subdivided into several independent builds by distributing the objects built. <br><br>The inequality describes how the prebuild query composes across batches; it does not constrain how the implementation lays out individual results within `BatchResultData`. In `D3D12_RTAS_OPERATION_MODE_IMPLICIT_DESTINATIONS`, the implementation may choose any layout for the results within the buffer (for example, tightly packing them with a prefix sum, or reserving a worst-case-per-result slot for each argument). The only requirement is that `ResultDataMaxSizeInBytes` returned by `GetRTASOperationPrebuildInfo()` is sufficient for whatever layout the implementation will produce, and that the per-result addresses written to `ResultAddressArray` correctly identify where each result lives. <br><br>In [D3D12_RTAS_OPERATION_INPUTS](#d3d12_rtas_operation_inputs), if the selected operation [Type](#d3d12_rtas_operation_type) is `D3D12_RTAS_TYPE_MOVE_CLUSTER_OBJECTS` and [Mode](#d3d12_rtas_operation_mode) is `D3D12_RTAS_OPERATION_MODE_EXPLICIT_DESTINATIONS` the returned value will be zero as there is no way for the implementation to know the maximum size of a moved objects for this operation type. |
507 | 507 | `UINT64 ScratchDataSizeInBytes` | Scratch storage on GPU required during the operation based on the specified inputs. |
508 | 508 |
|
509 | 509 | Used by: |
@@ -2243,3 +2243,4 @@ v0.20|3/18/2026|<li>In [Compressed1 bitfield helper macros](#compressed1-bitfiel |
2243 | 2243 | v0.21|4/14/2026|<li>In [D3D12_RTAS_CLUSTER_OPERATION_CLAS_FLAGS](#d3d12_rtas_cluster_operation_clas_flags), for `D3D12_RTAS_CLUSTER_OPERATION_CLAS_FLAG_ALLOW_DISABLE_OMMS`, clarified that regardless of whether this flag is set, OMMs can always be disabled per-cluster by setting `OpacityMicromapArray` and `OpacityMicromapIndexBuffer` to NULL in [D3D12_RTAS_OPERATION_BUILD_CLAS_FROM_TRIANGLES_ARGS](#d3d12_rtas_operation_build_clas_from_triangles_args).</li><li>In [D3D12_RTAS_OPERATION_BUILD_CLAS_FROM_TRIANGLES_ARGS](#d3d12_rtas_operation_build_clas_from_triangles_args), updated `OpacityMicromapArray` and `OpacityMicromapIndexBuffer` so that OMMs are disabled only when both are NULL (previously only `OpacityMicromapArray` being NULL was required). Similarly, [D3D12_RTAS_OPERATION_FLAG_ALLOW_OMM](#d3d12_rtas_operation_flags) is required when either is non-NULL. For `OpacityMicromapIndexBuffer`, clarified that if the entire index buffer uses only special index values, `OpacityMicromapArray` can be null since it won't be referenced.</li> |
2244 | 2244 | v0.22|4/16/2026|<li>In [D3D12_RTAS_OPERATION_FLAGS](#d3d12_rtas_operation_flags) switched `D3D12_RTAS_OPERATION_FLAG_ALLOW_DATA_ACCESS` from `0x800` to `0x100` to align with `D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_DATA_ACCESS` in DXR1's [D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_DATA_ACCESS](raytracing.md#d3d12_raytracing_acceleration_structure_build_flags)</li> |
2245 | 2245 | v0.23|4/24/2026|<li>In [D3D12_RTAS_PARTITIONED_TLAS_OPERATION_WRITE_INSTANCE_ARGS](#d3d12_rtas_partitioned_tlas_operation_write_instance_args), clarified under `InstanceMask` that implementations may exclude an instance with a zero mask from the PTLAS entirely (similar to a degenerate `Transform`). Consequently, applications and tooling walking visualization output for a PTLAS must not assume one `WRITE_INSTANCE` arg appears per `InstanceCount`; the count of emitted args may be less when degenerate-transform or zero-mask instances are present.</li><li>In [D3D12_RTAS_PARTITIONED_TLAS_FLAGS](#d3d12_rtas_partitioned_tlas_flags), clarified that the perf hint flag (`FAST_TRACE`, `FAST_BUILD`, or neither) may differ between successive builds of the same PTLAS object, but noted that toggling them is expensive (implementation may need to substantially restructure internal data). Also clarified that `ENABLE_PARTITION_TRANSLATION` may be toggled across builds: turning it off drops all stored per-partition translations and invalidates any `TRANSLATE_PARTITION` op in the same build; turning it on initializes translations to zero. In [D3D12_RTAS_PARTITIONED_TLAS_INSTANCE_FLAGS](#d3d12_rtas_partitioned_tlas_instance_flags), under `ENABLE_EXPLICIT_AABB`, clarified that clearing the flag on a subsequent `WRITE_INSTANCE` drops the previously stored `ExplicitAABB` for that instance.</li><li>For [D3D12_RTAS_OPERATION_BUILD_CLAS_FROM_TRIANGLES_ARGS](#d3d12_rtas_operation_build_clas_from_triangles_args), clarified the OMM-disable / `ALLOW_OMM`-required predicate so it accounts for `OpacityMicromapIndexFormat == D3D12_INDEX_FORMAT_NONE` causing `OpacityMicromapIndexBuffer` to be ignored: OMMs are disabled (and `ALLOW_OMM` not required) when `OpacityMicromapArray` is NULL and the OMM index buffer is effectively absent (either `OpacityMicromapIndexBuffer` is NULL or `OpacityMicromapIndexFormat` is `D3D12_INDEX_FORMAT_NONE`). Cross-referenced from `D3D12_RTAS_CLUSTER_OPERATION_CLAS_FLAG_ALLOW_DISABLE_OMMS` in [D3D12_RTAS_CLUSTER_OPERATION_CLAS_FLAGS](#d3d12_rtas_cluster_operation_clas_flags).</li> |
| 2246 | +v0.24|4/29/2026|<li>In [D3D12_RTAS_OPERATION_PREBUILD_INFO](#d3d12_rtas_operation_prebuild_info), clarified for `ResultDataMaxSizeInBytes` that the `prebuild(A) + prebuild(B) <= prebuild(A+B)` inequality describes how the prebuild query composes across batches and does not constrain how the implementation lays out individual results within `BatchResultData`. In `D3D12_RTAS_OPERATION_MODE_IMPLICIT_DESTINATIONS` the implementation may choose any layout (for example, tightly packing with a prefix sum, or reserving a worst-case-per-result slot for each argument), provided `ResultDataMaxSizeInBytes` is sufficient for the chosen layout and the per-result addresses written to `ResultAddressArray` correctly identify where each result lives.</li> |
0 commit comments