1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-05 00:10:24 +08:00
Files
gozel/core/RTAS.go
2026-03-22 23:38:41 +08:00

938 lines
53 KiB
Go

// Code generated by cmd/gen. DO NOT EDIT.
/*
*
* Copyright (C) 2019-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
* @file ze_api.h
* @version v1.15-r1.15.31
*
*/
package core
import (
"unsafe"
"github.com/fumiama/gozel/internal/zecall"
)
// ZE_RTAS_EXT_NAME Ray Tracing Acceleration Structure Extension Name
const ZE_RTAS_EXT_NAME = "ZE_extension_rtas"
// ZeRtasBuilderExtVersion (ze_rtas_builder_ext_version_t) Ray Tracing Acceleration Structure Builder Extension Version(s)
type ZeRtasBuilderExtVersion uintptr
const (
ZE_RTAS_BUILDER_EXT_VERSION_1_0 ZeRtasBuilderExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */((( 1 << 16 )|( 0 & 0x0000ffff))) // ZE_RTAS_BUILDER_EXT_VERSION_1_0 version 1.0
ZE_RTAS_BUILDER_EXT_VERSION_CURRENT ZeRtasBuilderExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */((( 1 << 16 )|( 0 & 0x0000ffff))) // ZE_RTAS_BUILDER_EXT_VERSION_CURRENT latest known version
ZE_RTAS_BUILDER_EXT_VERSION_FORCE_UINT32 ZeRtasBuilderExtVersion = 0x7fffffff // ZE_RTAS_BUILDER_EXT_VERSION_FORCE_UINT32 Value marking end of ZE_RTAS_BUILDER_EXT_VERSION_* ENUMs
)
// ZeRtasDeviceExtFlags (ze_rtas_device_ext_flags_t) Ray tracing acceleration structure device flags
type ZeRtasDeviceExtFlags uint32
const (
ZE_RTAS_DEVICE_EXT_FLAG_RESERVED ZeRtasDeviceExtFlags = /* ZE_BIT(0) */(( 1 << 0 )) // ZE_RTAS_DEVICE_EXT_FLAG_RESERVED reserved for future use
ZE_RTAS_DEVICE_EXT_FLAG_FORCE_UINT32 ZeRtasDeviceExtFlags = 0x7fffffff // ZE_RTAS_DEVICE_EXT_FLAG_FORCE_UINT32 Value marking end of ZE_RTAS_DEVICE_EXT_FLAG_* ENUMs
)
// ZeRtasFormatExt (ze_rtas_format_ext_t) Ray tracing acceleration structure format
///
/// @details
/// - This is an opaque ray tracing acceleration structure format
/// identifier.
type ZeRtasFormatExt uintptr
const (
ZE_RTAS_FORMAT_EXT_INVALID ZeRtasFormatExt = 0x0 // ZE_RTAS_FORMAT_EXT_INVALID Invalid acceleration structure format code
ZE_RTAS_FORMAT_EXT_MAX ZeRtasFormatExt = 0x7ffffffe // ZE_RTAS_FORMAT_EXT_MAX Maximum acceleration structure format code
ZE_RTAS_FORMAT_EXT_FORCE_UINT32 ZeRtasFormatExt = 0x7fffffff // ZE_RTAS_FORMAT_EXT_FORCE_UINT32 Value marking end of ZE_RTAS_FORMAT_EXT_* ENUMs
)
// ZeRtasBuilderExtFlags (ze_rtas_builder_ext_flags_t) Ray tracing acceleration structure builder flags
type ZeRtasBuilderExtFlags uint32
const (
ZE_RTAS_BUILDER_EXT_FLAG_RESERVED ZeRtasBuilderExtFlags = /* ZE_BIT(0) */(( 1 << 0 )) // ZE_RTAS_BUILDER_EXT_FLAG_RESERVED Reserved for future use
ZE_RTAS_BUILDER_EXT_FLAG_FORCE_UINT32 ZeRtasBuilderExtFlags = 0x7fffffff // ZE_RTAS_BUILDER_EXT_FLAG_FORCE_UINT32 Value marking end of ZE_RTAS_BUILDER_EXT_FLAG_* ENUMs
)
// ZeRtasParallelOperationExtFlags (ze_rtas_parallel_operation_ext_flags_t) Ray tracing acceleration structure builder parallel operation flags
type ZeRtasParallelOperationExtFlags uint32
const (
ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_RESERVED ZeRtasParallelOperationExtFlags = /* ZE_BIT(0) */(( 1 << 0 )) // ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_RESERVED Reserved for future use
ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_FORCE_UINT32 ZeRtasParallelOperationExtFlags = 0x7fffffff // ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_FORCE_UINT32 Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_* ENUMs
)
// ZeRtasBuilderGeometryExtFlags (ze_rtas_builder_geometry_ext_flags_t) Ray tracing acceleration structure builder geometry flags
type ZeRtasBuilderGeometryExtFlags uint32
const (
ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_NON_OPAQUE ZeRtasBuilderGeometryExtFlags = /* ZE_BIT(0) */(( 1 << 0 )) // ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_NON_OPAQUE non-opaque geometries invoke an any-hit shader
ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_FORCE_UINT32 ZeRtasBuilderGeometryExtFlags = 0x7fffffff // ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_FORCE_UINT32 Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_* ENUMs
)
// ZeRtasBuilderPackedGeometryExtFlags (ze_rtas_builder_packed_geometry_ext_flags_t) Packed ray tracing acceleration structure builder geometry flags (see
/// ::ze_rtas_builder_geometry_ext_flags_t)
type ZeRtasBuilderPackedGeometryExtFlags uint8
// ZeRtasBuilderInstanceExtFlags (ze_rtas_builder_instance_ext_flags_t) Ray tracing acceleration structure builder instance flags
type ZeRtasBuilderInstanceExtFlags uint32
const (
ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_CULL_DISABLE ZeRtasBuilderInstanceExtFlags = /* ZE_BIT(0) */(( 1 << 0 )) // ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_CULL_DISABLE disables culling of front-facing and back-facing triangles
ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE ZeRtasBuilderInstanceExtFlags = /* ZE_BIT(1) */(( 1 << 1 )) // ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE reverses front and back face of triangles
ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_OPAQUE ZeRtasBuilderInstanceExtFlags = /* ZE_BIT(2) */(( 1 << 2 )) // ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_OPAQUE forces instanced geometry to be opaque, unless ray flag forces it to
///< be non-opaque
ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_NON_OPAQUE ZeRtasBuilderInstanceExtFlags = /* ZE_BIT(3) */(( 1 << 3 )) // ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_NON_OPAQUE forces instanced geometry to be non-opaque, unless ray flag forces it
///< to be opaque
ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_FORCE_UINT32 ZeRtasBuilderInstanceExtFlags = 0x7fffffff // ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_FORCE_UINT32 Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_* ENUMs
)
// ZeRtasBuilderPackedInstanceExtFlags (ze_rtas_builder_packed_instance_ext_flags_t) Packed ray tracing acceleration structure builder instance flags (see
/// ::ze_rtas_builder_instance_ext_flags_t)
type ZeRtasBuilderPackedInstanceExtFlags uint8
// ZeRtasBuilderBuildOpExtFlags (ze_rtas_builder_build_op_ext_flags_t) Ray tracing acceleration structure builder build operation flags
///
/// @details
/// - These flags allow the application to tune the acceleration structure
/// build operation.
/// - The acceleration structure builder implementation might choose to use
/// spatial splitting to split large or long primitives into smaller
/// pieces. This may result in any-hit shaders being invoked multiple
/// times for non-opaque primitives, unless
/// ::ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified.
/// - Usage of any of these flags may reduce ray tracing performance.
type ZeRtasBuilderBuildOpExtFlags uint32
const (
ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_COMPACT ZeRtasBuilderBuildOpExtFlags = /* ZE_BIT(0) */(( 1 << 0 )) // ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_COMPACT build more compact acceleration structure
ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION ZeRtasBuilderBuildOpExtFlags = /* ZE_BIT(1) */(( 1 << 1 )) // ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION guarantees single any-hit shader invocation per primitive
ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_FORCE_UINT32 ZeRtasBuilderBuildOpExtFlags = 0x7fffffff // ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_FORCE_UINT32 Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_* ENUMs
)
// ZeRtasBuilderBuildQualityHintExt (ze_rtas_builder_build_quality_hint_ext_t) Ray tracing acceleration structure builder build quality hint
///
/// @details
/// - Depending on use case different quality modes for acceleration
/// structure build are supported.
/// - A low-quality build builds an acceleration structure fast, but at the
/// cost of some reduction in ray tracing performance. This mode is
/// recommended for dynamic content, such as animated characters.
/// - A medium-quality build uses a compromise between build quality and ray
/// tracing performance. This mode should be used by default.
/// - Higher ray tracing performance can be achieved by using a high-quality
/// build, but acceleration structure build performance might be
/// significantly reduced.
type ZeRtasBuilderBuildQualityHintExt uintptr
const (
ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW ZeRtasBuilderBuildQualityHintExt = 0 // ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW build low-quality acceleration structure (fast)
ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_MEDIUM ZeRtasBuilderBuildQualityHintExt = 1 // ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_MEDIUM build medium-quality acceleration structure (slower)
ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH ZeRtasBuilderBuildQualityHintExt = 2 // ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH build high-quality acceleration structure (slow)
ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_FORCE_UINT32 ZeRtasBuilderBuildQualityHintExt = 0x7fffffff // ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_FORCE_UINT32 Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_* ENUMs
)
// ZeRtasBuilderGeometryTypeExt (ze_rtas_builder_geometry_type_ext_t) Ray tracing acceleration structure builder geometry type
type ZeRtasBuilderGeometryTypeExt uintptr
const (
ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES ZeRtasBuilderGeometryTypeExt = 0 // ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES triangle mesh geometry type
ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS ZeRtasBuilderGeometryTypeExt = 1 // ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS quad mesh geometry type
ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL ZeRtasBuilderGeometryTypeExt = 2 // ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL procedural geometry type
ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE ZeRtasBuilderGeometryTypeExt = 3 // ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE instance geometry type
ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_FORCE_UINT32 ZeRtasBuilderGeometryTypeExt = 0x7fffffff // ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_FORCE_UINT32 Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_* ENUMs
)
// ZeRtasBuilderPackedGeometryTypeExt (ze_rtas_builder_packed_geometry_type_ext_t) Packed ray tracing acceleration structure builder geometry type (see
/// ::ze_rtas_builder_geometry_type_ext_t)
type ZeRtasBuilderPackedGeometryTypeExt uint8
// ZeRtasBuilderInputDataFormatExt (ze_rtas_builder_input_data_format_ext_t) Ray tracing acceleration structure data buffer element format
///
/// @details
/// - Specifies the format of data buffer elements.
/// - Data buffers may contain instancing transform matrices, triangle/quad
/// vertex indices, etc...
type ZeRtasBuilderInputDataFormatExt uintptr
const (
ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 ZeRtasBuilderInputDataFormatExt = 0 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 3-component float vector (see ::ze_rtas_float3_ext_t)
ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR ZeRtasBuilderInputDataFormatExt = 1 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR 3x4 affine transformation in column-major format (see
///< ::ze_rtas_transform_float3x4_column_major_ext_t)
ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR ZeRtasBuilderInputDataFormatExt = 2 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR 3x4 affine transformation in column-major format (see
///< ::ze_rtas_transform_float3x4_aligned_column_major_ext_t)
ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR ZeRtasBuilderInputDataFormatExt = 3 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR 3x4 affine transformation in row-major format (see
///< ::ze_rtas_transform_float3x4_row_major_ext_t)
ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_AABB ZeRtasBuilderInputDataFormatExt = 4 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_AABB 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_ext_t)
ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 ZeRtasBuilderInputDataFormatExt = 5 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 Unsigned 32-bit triangle indices (see
///< ::ze_rtas_triangle_indices_uint32_ext_t)
ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 ZeRtasBuilderInputDataFormatExt = 6 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_ext_t)
ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FORCE_UINT32 ZeRtasBuilderInputDataFormatExt = 0x7fffffff // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FORCE_UINT32 Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_* ENUMs
)
// ZeRtasBuilderPackedInputDataFormatExt (ze_rtas_builder_packed_input_data_format_ext_t) Packed ray tracing acceleration structure data buffer element format
/// (see ::ze_rtas_builder_input_data_format_ext_t)
type ZeRtasBuilderPackedInputDataFormatExt uint8
// ZeRtasBuilderExtHandle (ze_rtas_builder_ext_handle_t) Handle of ray tracing acceleration structure builder object
type ZeRtasBuilderExtHandle uintptr
// ZeRtasParallelOperationExtHandle (ze_rtas_parallel_operation_ext_handle_t) Handle of ray tracing acceleration structure builder parallel
/// operation object
type ZeRtasParallelOperationExtHandle uintptr
// ZeRtasBuilderExtDesc (ze_rtas_builder_ext_desc_t) Ray tracing acceleration structure builder descriptor
type ZeRtasBuilderExtDesc struct {
Stype ZeStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Builderversion ZeRtasBuilderExtVersion // Builderversion [in] ray tracing acceleration structure builder version
}
// ZeRtasBuilderExtProperties (ze_rtas_builder_ext_properties_t) Ray tracing acceleration structure builder properties
type ZeRtasBuilderExtProperties struct {
Stype ZeStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Flags ZeRtasBuilderExtFlags // Flags [out] ray tracing acceleration structure builder flags
Rtasbuffersizebytesexpected uintptr // Rtasbuffersizebytesexpected [out] expected size (in bytes) required for acceleration structure buffer - When using an acceleration structure buffer of this size, the build is expected to succeed; however, it is possible that the build may fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY
Rtasbuffersizebytesmaxrequired uintptr // Rtasbuffersizebytesmaxrequired [out] worst-case size (in bytes) required for acceleration structure buffer - When using an acceleration structure buffer of this size, the build is guaranteed to not run out of memory.
Scratchbuffersizebytes uintptr // Scratchbuffersizebytes [out] scratch buffer size (in bytes) required for acceleration structure build.
}
// ZeRtasParallelOperationExtProperties (ze_rtas_parallel_operation_ext_properties_t) Ray tracing acceleration structure builder parallel operation
/// properties
type ZeRtasParallelOperationExtProperties struct {
Stype ZeStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Flags ZeRtasParallelOperationExtFlags // Flags [out] ray tracing acceleration structure builder parallel operation flags
Maxconcurrency uint32 // Maxconcurrency [out] maximum number of threads that may join the parallel operation
}
// ZeRtasDeviceExtProperties (ze_rtas_device_ext_properties_t) Ray tracing acceleration structure device properties
///
/// @details
/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext`
/// member of ::ze_device_properties_t.
/// - The implementation shall populate `format` with a value other than
/// ::ZE_RTAS_FORMAT_EXT_INVALID when the device supports ray tracing.
type ZeRtasDeviceExtProperties struct {
Stype ZeStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Flags ZeRtasDeviceExtFlags // Flags [out] ray tracing acceleration structure device flags
Rtasformat ZeRtasFormatExt // Rtasformat [out] ray tracing acceleration structure format
Rtasbufferalignment uint32 // Rtasbufferalignment [out] required alignment of acceleration structure buffer
}
// ZeRtasFloat3Ext (ze_rtas_float3_ext_t) A 3-component vector type
type ZeRtasFloat3Ext struct {
X float32 // X [in] x-coordinate of float3 vector
Y float32 // Y [in] y-coordinate of float3 vector
Z float32 // Z [in] z-coordinate of float3 vector
}
// ZeRtasTransformFloat3x4ColumnMajorExt (ze_rtas_transform_float3x4_column_major_ext_t) 3x4 affine transformation in column-major layout
///
/// @details
/// - A 3x4 affine transformation in column major layout, consisting of vectors
/// - vx=(vx_x, vx_y, vx_z),
/// - vy=(vy_x, vy_y, vy_z),
/// - vz=(vz_x, vz_y, vz_z), and
/// - p=(p_x, p_y, p_z)
/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy +
/// z*vz + p`.
type ZeRtasTransformFloat3x4ColumnMajorExt struct {
VxX float32 // VxX [in] element 0 of column 0 of 3x4 matrix
VxY float32 // VxY [in] element 1 of column 0 of 3x4 matrix
VxZ float32 // VxZ [in] element 2 of column 0 of 3x4 matrix
VyX float32 // VyX [in] element 0 of column 1 of 3x4 matrix
VyY float32 // VyY [in] element 1 of column 1 of 3x4 matrix
VyZ float32 // VyZ [in] element 2 of column 1 of 3x4 matrix
VzX float32 // VzX [in] element 0 of column 2 of 3x4 matrix
VzY float32 // VzY [in] element 1 of column 2 of 3x4 matrix
VzZ float32 // VzZ [in] element 2 of column 2 of 3x4 matrix
PX float32 // PX [in] element 0 of column 3 of 3x4 matrix
PY float32 // PY [in] element 1 of column 3 of 3x4 matrix
PZ float32 // PZ [in] element 2 of column 3 of 3x4 matrix
}
// ZeRtasTransformFloat3x4AlignedColumnMajorExt (ze_rtas_transform_float3x4_aligned_column_major_ext_t) 3x4 affine transformation in column-major layout with aligned column
/// vectors
///
/// @details
/// - A 3x4 affine transformation in column major layout, consisting of vectors
/// - vx=(vx_x, vx_y, vx_z),
/// - vy=(vy_x, vy_y, vy_z),
/// - vz=(vz_x, vz_y, vz_z), and
/// - p=(p_x, p_y, p_z)
/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy +
/// z*vz + p`.
/// - The column vectors are aligned to 16-bytes and pad members are
/// ignored.
type ZeRtasTransformFloat3x4AlignedColumnMajorExt struct {
VxX float32 // VxX [in] element 0 of column 0 of 3x4 matrix
VxY float32 // VxY [in] element 1 of column 0 of 3x4 matrix
VxZ float32 // VxZ [in] element 2 of column 0 of 3x4 matrix
Pad0 float32 // Pad0 [in] ignored padding
VyX float32 // VyX [in] element 0 of column 1 of 3x4 matrix
VyY float32 // VyY [in] element 1 of column 1 of 3x4 matrix
VyZ float32 // VyZ [in] element 2 of column 1 of 3x4 matrix
Pad1 float32 // Pad1 [in] ignored padding
VzX float32 // VzX [in] element 0 of column 2 of 3x4 matrix
VzY float32 // VzY [in] element 1 of column 2 of 3x4 matrix
VzZ float32 // VzZ [in] element 2 of column 2 of 3x4 matrix
Pad2 float32 // Pad2 [in] ignored padding
PX float32 // PX [in] element 0 of column 3 of 3x4 matrix
PY float32 // PY [in] element 1 of column 3 of 3x4 matrix
PZ float32 // PZ [in] element 2 of column 3 of 3x4 matrix
Pad3 float32 // Pad3 [in] ignored padding
}
// ZeRtasTransformFloat3x4RowMajorExt (ze_rtas_transform_float3x4_row_major_ext_t) 3x4 affine transformation in row-major layout
///
/// @details
/// - A 3x4 affine transformation in row-major layout, consisting of vectors
/// - vx=(vx_x, vx_y, vx_z),
/// - vy=(vy_x, vy_y, vy_z),
/// - vz=(vz_x, vz_y, vz_z), and
/// - p=(p_x, p_y, p_z)
/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy +
/// z*vz + p`.
type ZeRtasTransformFloat3x4RowMajorExt struct {
VxX float32 // VxX [in] element 0 of row 0 of 3x4 matrix
VyX float32 // VyX [in] element 1 of row 0 of 3x4 matrix
VzX float32 // VzX [in] element 2 of row 0 of 3x4 matrix
PX float32 // PX [in] element 3 of row 0 of 3x4 matrix
VxY float32 // VxY [in] element 0 of row 1 of 3x4 matrix
VyY float32 // VyY [in] element 1 of row 1 of 3x4 matrix
VzY float32 // VzY [in] element 2 of row 1 of 3x4 matrix
PY float32 // PY [in] element 3 of row 1 of 3x4 matrix
VxZ float32 // VxZ [in] element 0 of row 2 of 3x4 matrix
VyZ float32 // VyZ [in] element 1 of row 2 of 3x4 matrix
VzZ float32 // VzZ [in] element 2 of row 2 of 3x4 matrix
PZ float32 // PZ [in] element 3 of row 2 of 3x4 matrix
}
// ZeRtasAabbExt (ze_rtas_aabb_ext_t) A 3-dimensional axis-aligned bounding-box with lower and upper bounds
/// in each dimension
type ZeRtasAabbExt struct {
Lower ZeRtasFloat3Ext // Lower [in] lower bounds of AABB
Upper ZeRtasFloat3Ext // Upper [in] upper bounds of AABB
}
// ZeRtasTriangleIndicesUint32Ext (ze_rtas_triangle_indices_uint32_ext_t) Triangle represented using 3 vertex indices
///
/// @details
/// - Represents a triangle using 3 vertex indices that index into a vertex
/// array that needs to be provided together with the index array.
/// - The linear barycentric u/v parametrization of the triangle is defined as:
/// - (u=0, v=0) at v0,
/// - (u=1, v=0) at v1, and
/// - (u=0, v=1) at v2
type ZeRtasTriangleIndicesUint32Ext struct {
V0 uint32 // V0 [in] first index pointing to the first triangle vertex in vertex array
V1 uint32 // V1 [in] second index pointing to the second triangle vertex in vertex array
V2 uint32 // V2 [in] third index pointing to the third triangle vertex in vertex array
}
// ZeRtasQuadIndicesUint32Ext (ze_rtas_quad_indices_uint32_ext_t) Quad represented using 4 vertex indices
///
/// @details
/// - Represents a quad composed of 4 indices that index into a vertex array
/// that needs to be provided together with the index array.
/// - A quad is a triangle pair represented using 4 vertex indices v0, v1,
/// v2, v3.
/// The first triangle is made out of indices v0, v1, v3 and the second triangle
/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization
/// of the quad is defined as:
/// - (u=0, v=0) at v0,
/// - (u=1, v=0) at v1,
/// - (u=0, v=1) at v3, and
/// - (u=1, v=1) at v2
/// This is achieved by correcting the u'/v' coordinates of the second
/// triangle by
/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization.
type ZeRtasQuadIndicesUint32Ext struct {
V0 uint32 // V0 [in] first index pointing to the first quad vertex in vertex array
V1 uint32 // V1 [in] second index pointing to the second quad vertex in vertex array
V2 uint32 // V2 [in] third index pointing to the third quad vertex in vertex array
V3 uint32 // V3 [in] fourth index pointing to the fourth quad vertex in vertex array
}
// ZeRtasBuilderGeometryInfoExt (ze_rtas_builder_geometry_info_ext_t) Ray tracing acceleration structure builder geometry info
type ZeRtasBuilderGeometryInfoExt struct {
Geometrytype ZeRtasBuilderPackedGeometryTypeExt // Geometrytype [in] geometry type
}
// ZeRtasBuilderTrianglesGeometryInfoExt (ze_rtas_builder_triangles_geometry_info_ext_t) Ray tracing acceleration structure builder triangle mesh geometry info
///
/// @details
/// - The linear barycentric u/v parametrization of the triangle is defined as:
/// - (u=0, v=0) at v0,
/// - (u=1, v=0) at v1, and
/// - (u=0, v=1) at v2
type ZeRtasBuilderTrianglesGeometryInfoExt struct {
Geometrytype ZeRtasBuilderPackedGeometryTypeExt // Geometrytype [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES
Geometryflags ZeRtasBuilderPackedGeometryExtFlags // Geometryflags [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t bits representing the geometry flags for all primitives of this geometry
Geometrymask uint8 // Geometrymask [in] 8-bit geometry mask for ray masking
Triangleformat ZeRtasBuilderPackedInputDataFormatExt // Triangleformat [in] format of triangle buffer data, must be ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32
Vertexformat ZeRtasBuilderPackedInputDataFormatExt // Vertexformat [in] format of vertex buffer data, must be ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3
Trianglecount uint32 // Trianglecount [in] number of triangles in triangle buffer
Vertexcount uint32 // Vertexcount [in] number of vertices in vertex buffer
Trianglestride uint32 // Trianglestride [in] stride (in bytes) of triangles in triangle buffer
Vertexstride uint32 // Vertexstride [in] stride (in bytes) of vertices in vertex buffer
Ptrianglebuffer unsafe.Pointer // Ptrianglebuffer [in] pointer to array of triangle indices in specified format
Pvertexbuffer unsafe.Pointer // Pvertexbuffer [in] pointer to array of triangle vertices in specified format
}
// ZeRtasBuilderQuadsGeometryInfoExt (ze_rtas_builder_quads_geometry_info_ext_t) Ray tracing acceleration structure builder quad mesh geometry info
///
/// @details
/// - A quad is a triangle pair represented using 4 vertex indices v0, v1,
/// v2, v3.
/// The first triangle is made out of indices v0, v1, v3 and the second triangle
/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization
/// of the quad is defined as:
/// - (u=0, v=0) at v0,
/// - (u=1, v=0) at v1,
/// - (u=0, v=1) at v3, and
/// - (u=1, v=1) at v2
/// This is achieved by correcting the u'/v' coordinates of the second
/// triangle by
/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization.
type ZeRtasBuilderQuadsGeometryInfoExt struct {
Geometrytype ZeRtasBuilderPackedGeometryTypeExt // Geometrytype [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS
Geometryflags ZeRtasBuilderPackedGeometryExtFlags // Geometryflags [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t bits representing the geometry flags for all primitives of this geometry
Geometrymask uint8 // Geometrymask [in] 8-bit geometry mask for ray masking
Quadformat ZeRtasBuilderPackedInputDataFormatExt // Quadformat [in] format of quad buffer data, must be ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32
Vertexformat ZeRtasBuilderPackedInputDataFormatExt // Vertexformat [in] format of vertex buffer data, must be ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3
Quadcount uint32 // Quadcount [in] number of quads in quad buffer
Vertexcount uint32 // Vertexcount [in] number of vertices in vertex buffer
Quadstride uint32 // Quadstride [in] stride (in bytes) of quads in quad buffer
Vertexstride uint32 // Vertexstride [in] stride (in bytes) of vertices in vertex buffer
Pquadbuffer unsafe.Pointer // Pquadbuffer [in] pointer to array of quad indices in specified format
Pvertexbuffer unsafe.Pointer // Pvertexbuffer [in] pointer to array of quad vertices in specified format
}
// ZeRtasGeometryAabbsExtCbParams (ze_rtas_geometry_aabbs_ext_cb_params_t) AABB callback function parameters
type ZeRtasGeometryAabbsExtCbParams struct {
Stype ZeStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Primid uint32 // Primid [in] first primitive to return bounds for
Primidcount uint32 // Primidcount [in] number of primitives to return bounds for
Pgeomuserptr unsafe.Pointer // Pgeomuserptr [in] pointer provided through geometry descriptor
Pbuilduserptr unsafe.Pointer // Pbuilduserptr [in] pointer provided through ::zeRTASBuilderBuildExt function
Pboundsout *ZeRtasAabbExt // Pboundsout [out] destination buffer to write AABB bounds to
}
// ZeRtasGeometryAabbsCbExt (ze_rtas_geometry_aabbs_cb_ext_t) Callback function pointer type to return AABBs for a range of
/// procedural primitives
// gozel warn: please use C function pointer loaded from C library!
type ZeRtasGeometryAabbsCbExt uintptr
// ZeRtasBuilderProceduralGeometryInfoExt (ze_rtas_builder_procedural_geometry_info_ext_t) Ray tracing acceleration structure builder procedural primitives
/// geometry info
///
/// @details
/// - A host-side bounds callback function is invoked by the acceleration
/// structure builder to query the bounds of procedural primitives on
/// demand. The callback is passed some `pGeomUserPtr` that can point to
/// an application-side representation of the procedural primitives.
/// Further, a second `pBuildUserPtr`, which is set by a parameter to
/// ::zeRTASBuilderBuildExt, is passed to the callback. This allows the
/// build to change the bounds of the procedural geometry, for example, to
/// build a BVH only over a short time range to implement multi-segment
/// motion blur.
type ZeRtasBuilderProceduralGeometryInfoExt struct {
Geometrytype ZeRtasBuilderPackedGeometryTypeExt // Geometrytype [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL
Geometryflags ZeRtasBuilderPackedGeometryExtFlags // Geometryflags [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t bits representing the geometry flags for all primitives of this geometry
Geometrymask uint8 // Geometrymask [in] 8-bit geometry mask for ray masking
Reserved uint8 // Reserved [in] reserved for future use
Primcount uint32 // Primcount [in] number of primitives in geometry
Pfngetboundscb ZeRtasGeometryAabbsCbExt // Pfngetboundscb [in] pointer to callback function to get the axis-aligned bounding-box for a range of primitives
Pgeomuserptr unsafe.Pointer // Pgeomuserptr [in] user data pointer passed to callback
}
// ZeRtasBuilderInstanceGeometryInfoExt (ze_rtas_builder_instance_geometry_info_ext_t) Ray tracing acceleration structure builder instance geometry info
type ZeRtasBuilderInstanceGeometryInfoExt struct {
Geometrytype ZeRtasBuilderPackedGeometryTypeExt // Geometrytype [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE
Instanceflags ZeRtasBuilderPackedInstanceExtFlags // Instanceflags [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t bits representing the geometry flags for all primitives of this geometry
Geometrymask uint8 // Geometrymask [in] 8-bit geometry mask for ray masking
Transformformat ZeRtasBuilderPackedInputDataFormatExt // Transformformat [in] format of the specified transformation
Instanceuserid uint32 // Instanceuserid [in] user-specified identifier for the instance
Ptransform unsafe.Pointer // Ptransform [in] object-to-world instance transformation in specified format
Pbounds *ZeRtasAabbExt // Pbounds [in] object-space axis-aligned bounding-box of the instanced acceleration structure
Paccelerationstructure unsafe.Pointer // Paccelerationstructure [in] device pointer to acceleration structure to instantiate
}
// ZeRtasBuilderBuildOpExtDesc (ze_rtas_builder_build_op_ext_desc_t)
type ZeRtasBuilderBuildOpExtDesc struct {
Stype ZeStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Rtasformat ZeRtasFormatExt // Rtasformat [in] ray tracing acceleration structure format
Buildquality ZeRtasBuilderBuildQualityHintExt // Buildquality [in] acceleration structure build quality hint
Buildflags ZeRtasBuilderBuildOpExtFlags // Buildflags [in] 0 or some combination of ::ze_rtas_builder_build_op_ext_flag_t flags
Ppgeometries **ZeRtasBuilderGeometryInfoExt // Ppgeometries [in][optional][range(0, `numGeometries`)] NULL or a valid array of pointers to geometry infos
Numgeometries uint32 // Numgeometries [in] number of geometries in geometry infos array, can be zero when `ppGeometries` is NULL
}
// ZeRTASBuilderCreateExt Creates a ray tracing acceleration structure builder object
///
/// @details
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function must be thread-safe.
/// - The implementation must support ::ZE_RTAS_EXT_NAME extension.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hDriver`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pDescriptor`
/// + `nullptr == phBuilder`
/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION
/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion`
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
func ZeRTASBuilderCreateExt(
hDriver ZeDriverHandle, // hDriver [in] handle of driver object
pDescriptor *ZeRtasBuilderExtDesc, // pDescriptor [in] pointer to builder descriptor
phBuilder *ZeRtasBuilderExtHandle, // phBuilder [out] handle of builder object
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASBuilderCreateExt", uintptr(hDriver), uintptr(unsafe.Pointer(pDescriptor)), uintptr(unsafe.Pointer(phBuilder)))
}
// ZeRTASBuilderGetBuildPropertiesExt Retrieves ray tracing acceleration structure builder properties
///
/// @details
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function must be thread-safe.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hBuilder`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pBuildOpDescriptor`
/// + `nullptr == pProperties`
/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION
/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat`
/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality`
/// + `0x3 < pBuildOpDescriptor->buildFlags`
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
func ZeRTASBuilderGetBuildPropertiesExt(
hBuilder ZeRtasBuilderExtHandle, // hBuilder [in] handle of builder object
pBuildOpDescriptor *ZeRtasBuilderBuildOpExtDesc, // pBuildOpDescriptor [in] pointer to build operation descriptor
pProperties *ZeRtasBuilderExtProperties, // pProperties [in,out] query result for builder properties
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASBuilderGetBuildPropertiesExt", uintptr(hBuilder), uintptr(unsafe.Pointer(pBuildOpDescriptor)), uintptr(unsafe.Pointer(pProperties)))
}
// ZeDriverRTASFormatCompatibilityCheckExt Checks ray tracing acceleration structure format compatibility
///
/// @details
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function must be thread-safe.
///
/// @returns
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hDriver`
/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION
/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA`
/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB`
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
/// - ::ZE_RESULT_SUCCESS
/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`.
/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE
/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`.
func ZeDriverRTASFormatCompatibilityCheckExt(
hDriver ZeDriverHandle, // hDriver [in] handle of driver object
rtasFormatA ZeRtasFormatExt, // rtasFormatA [in] operand A
rtasFormatB ZeRtasFormatExt, // rtasFormatB [in] operand B
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeDriverRTASFormatCompatibilityCheckExt", uintptr(hDriver), uintptr(rtasFormatA), uintptr(rtasFormatB))
}
// ZeRTASBuilderBuildExt Build ray tracing acceleration structure
///
/// @details
/// - This function builds an acceleration structure of the scene consisting
/// of the specified geometry information and writes the acceleration
/// structure to the provided destination buffer. All types of geometries
/// can get freely mixed inside a scene.
/// - Before an acceleration structure can be built, the user must allocate
/// the memory for the acceleration structure buffer and scratch buffer
/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function.
/// - When using the "worst-case" size for the acceleration structure
/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY.
/// - When using the "expected" size for the acceleration structure buffer,
/// the acceleration structure construction may fail with
/// ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. If this happens, the user may resize
/// their acceleration structure buffer using the returned
/// `*pRtasBufferSizeBytes` value, which will be updated with an improved
/// size estimate that will likely result in a successful build.
/// - The acceleration structure construction is run on the host and is
/// synchronous, thus after the function returns with a successful result,
/// the acceleration structure may be used.
/// - All provided data buffers must be host-accessible. The referenced
/// scene data (index- and vertex- buffers) have to be accessible from the
/// host, and will **not** be referenced by the build acceleration structure.
/// - The acceleration structure buffer is typicall a host allocation that
/// is later manually copied to a device allocation. Alternatively one can
/// also use a shared USM allocation as acceration structure buffer and
/// skip the copy.
/// - A successfully constructed acceleration structure is entirely
/// self-contained. There is no requirement for input data to persist
/// beyond build completion.
/// - A successfully constructed acceleration structure is non-copyable.
/// - Acceleration structure construction may be parallelized by passing a
/// valid handle to a parallel operation object and joining that parallel
/// operation using ::zeRTASParallelOperationJoinExt with user-provided
/// worker threads.
/// - A successfully constructed acceleration structure is generally
/// non-copyable. It can only get copied from host to device using the
/// special ::zeRTASBuilderCommandListAppendCopyExt function.
/// - **Additional Notes**
/// - "The geometry infos array, geometry infos, and scratch buffer must
/// all be standard host memory allocations."
/// - "A pointer to a geometry info can be a null pointer, in which case
/// the geometry is treated as empty."
/// - "If no parallel operation handle is provided, the build is run
/// sequentially on the current thread."
/// - "A parallel operation object may only be associated with a single
/// acceleration structure build at a time."
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hBuilder`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pBuildOpDescriptor`
/// + `nullptr == pScratchBuffer`
/// + `nullptr == pRtasBuffer`
/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION
/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat`
/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality`
/// + `0x3 < pBuildOpDescriptor->buildFlags`
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION
/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED
/// + Acceleration structure build completion is deferred to parallel operation join.
/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY
/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation.
/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE
/// + Acceleration structure build failed due to parallel operation object participation in another build operation.
func ZeRTASBuilderBuildExt(
hBuilder ZeRtasBuilderExtHandle, // hBuilder [in] handle of builder object
pBuildOpDescriptor *ZeRtasBuilderBuildOpExtDesc, // pBuildOpDescriptor [in] pointer to build operation descriptor
pScratchBuffer unsafe.Pointer, // pScratchBuffer [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used during acceleration structure construction
scratchBufferSizeBytes uintptr, // scratchBufferSizeBytes [in] size of scratch buffer, in bytes
pRtasBuffer unsafe.Pointer, // pRtasBuffer [in] pointer to destination buffer
rtasBufferSizeBytes uintptr, // rtasBufferSizeBytes [in] destination buffer size, in bytes
hParallelOperation ZeRtasParallelOperationExtHandle, // hParallelOperation [in][optional] handle to parallel operation object
pBuildUserPtr unsafe.Pointer, // pBuildUserPtr [in][optional] pointer passed to callbacks
pBounds *ZeRtasAabbExt, // pBounds [in,out][optional] pointer to destination address for acceleration structure bounds
pRtasBufferSizeBytes *uintptr, // pRtasBufferSizeBytes [out][optional] updated acceleration structure size requirement, in bytes
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASBuilderBuildExt", uintptr(hBuilder), uintptr(unsafe.Pointer(pBuildOpDescriptor)), uintptr(unsafe.Pointer(pScratchBuffer)), uintptr(scratchBufferSizeBytes), uintptr(unsafe.Pointer(pRtasBuffer)), uintptr(rtasBufferSizeBytes), uintptr(hParallelOperation), uintptr(unsafe.Pointer(pBuildUserPtr)), uintptr(unsafe.Pointer(pBounds)), uintptr(unsafe.Pointer(pRtasBufferSizeBytes)))
}
// ZeRTASBuilderCommandListAppendCopyExt Copies a ray tracing acceleration structure (RTAS) from host to device
/// memory.
///
/// @details
/// - The memory pointed to by srcptr must be host memory containing a valid
/// ray tracing acceleration structure.
/// - The number of bytes to copy must be larger or equal to the size of the
/// ray tracing acceleration structure.
/// - The application must ensure the memory pointed to by dstptr and srcptr
/// is accessible by the device on which the command list was created.
/// - The implementation must not access the memory pointed to by dstptr and
/// srcptr as they are free to be modified by either the Host or device up
/// until execution.
/// - The application must ensure the events are accessible by the device on
/// which the command list was created.
/// - The application must ensure the command list and events were created,
/// and the memory was allocated, on the same context.
/// - The application must **not** call this function from simultaneous
/// threads with the same command list handle.
/// - The implementation of this function should be lock-free.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hCommandList`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == dstptr`
/// + `nullptr == srcptr`
/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT
/// - ::ZE_RESULT_ERROR_INVALID_SIZE
/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)`
func ZeRTASBuilderCommandListAppendCopyExt(
hCommandList ZeCommandListHandle, // hCommandList [in] handle of command list
dstptr unsafe.Pointer, // dstptr [in] pointer to destination in device memory to copy the ray tracing acceleration structure to
srcptr unsafe.Pointer, // srcptr [in] pointer to a valid source ray tracing acceleration structure in host memory to copy from
size uintptr, // size [in] size in bytes to copy
hSignalEvent ZeEventHandle, // hSignalEvent [in][optional] handle of the event to signal on completion
numWaitEvents uint32, // numWaitEvents [in][optional] number of events to wait on before launching; must be 0 if `nullptr == phWaitEvents`
phWaitEvents *ZeEventHandle, // phWaitEvents [in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASBuilderCommandListAppendCopyExt", uintptr(hCommandList), uintptr(unsafe.Pointer(dstptr)), uintptr(unsafe.Pointer(srcptr)), uintptr(size), uintptr(hSignalEvent), uintptr(numWaitEvents), uintptr(unsafe.Pointer(phWaitEvents)))
}
// ZeRTASBuilderDestroyExt Destroys a ray tracing acceleration structure builder object
///
/// @details
/// - The implementation of this function may immediately release any
/// internal Host and Device resources associated with this builder.
/// - The application must **not** call this function from simultaneous
/// threads with the same builder handle.
/// - The implementation of this function must be thread-safe.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hBuilder`
/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE
func ZeRTASBuilderDestroyExt(
hBuilder ZeRtasBuilderExtHandle, // hBuilder [in][release] handle of builder object to destroy
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASBuilderDestroyExt", uintptr(hBuilder))
}
// ZeRTASParallelOperationCreateExt Creates a ray tracing acceleration structure builder parallel
/// operation object
///
/// @details
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function must be thread-safe.
/// - The implementation must support ::ZE_RTAS_EXT_NAME extension.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hDriver`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == phParallelOperation`
func ZeRTASParallelOperationCreateExt(
hDriver ZeDriverHandle, // hDriver [in] handle of driver object
phParallelOperation *ZeRtasParallelOperationExtHandle, // phParallelOperation [out] handle of parallel operation object
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASParallelOperationCreateExt", uintptr(hDriver), uintptr(unsafe.Pointer(phParallelOperation)))
}
// ZeRTASParallelOperationGetPropertiesExt Retrieves ray tracing acceleration structure builder parallel
/// operation properties
///
/// @details
/// - The application must first bind the parallel operation object to a
/// build operation before it may query the parallel operation properties.
/// In other words, the application must first call
/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling
/// this function.
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function must be thread-safe.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hParallelOperation`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pProperties`
func ZeRTASParallelOperationGetPropertiesExt(
hParallelOperation ZeRtasParallelOperationExtHandle, // hParallelOperation [in] handle of parallel operation object
pProperties *ZeRtasParallelOperationExtProperties, // pProperties [in,out] query result for parallel operation properties
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASParallelOperationGetPropertiesExt", uintptr(hParallelOperation), uintptr(unsafe.Pointer(pProperties)))
}
// ZeRTASParallelOperationJoinExt Joins a parallel build operation
///
/// @details
/// - All worker threads return the same error code for the parallel build
/// operation upon build completion
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hParallelOperation`
func ZeRTASParallelOperationJoinExt(
hParallelOperation ZeRtasParallelOperationExtHandle, // hParallelOperation [in] handle of parallel operation object
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASParallelOperationJoinExt", uintptr(hParallelOperation))
}
// ZeRTASParallelOperationDestroyExt Destroys a ray tracing acceleration structure builder parallel
/// operation object
///
/// @details
/// - The implementation of this function may immediately release any
/// internal Host and Device resources associated with this parallel
/// operation.
/// - The application must **not** call this function from simultaneous
/// threads with the same parallel operation handle.
/// - The implementation of this function must be thread-safe.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hParallelOperation`
func ZeRTASParallelOperationDestroyExt(
hParallelOperation ZeRtasParallelOperationExtHandle, // hParallelOperation [in][release] handle of parallel operation object to destroy
) (ZeResult, error) {
return zecall.Call[ZeResult]("zeRTASParallelOperationDestroyExt", uintptr(hParallelOperation))
}