Created
April 21, 2020 03:55
-
-
Save SpexGuy/e83ea7b55d75598ccbf0bbe5eced76b6 to your computer and use it in GitHub Desktop.
The NV_ray_tracing extension subset of vulkan_core.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub const NV_ray_tracing = 1; | |
pub const AccelerationStructureNV = *@OpaqueType(); | |
pub const NV_RAY_TRACING_SPEC_VERSION = 3; | |
pub const NV_RAY_TRACING_EXTENSION_NAME = "VK_NV_ray_tracing"; | |
pub const SHADER_UNUSED_NV = (~@as(u32, 0)); | |
pub const AccelerationStructureTypeNV = extern enum(i32) { | |
TOP_LEVEL = 0, | |
BOTTOM_LEVEL = 1, | |
_, | |
}; | |
pub const RayTracingShaderGroupTypeNV = extern enum(i32) { | |
GENERAL = 0, | |
TRIANGLES_HIT_GROUP = 1, | |
PROCEDURAL_HIT_GROUP = 2, | |
_, | |
}; | |
pub const GeometryTypeNV = extern enum(i32) { | |
TRIANGLES = 0, | |
AABBS = 1, | |
_, | |
}; | |
pub const CopyAccelerationStructureModeNV = extern enum(i32) { | |
CLONE = 0, | |
COMPACT = 1, | |
_, | |
}; | |
pub const AccelerationStructureMemoryRequirementsTypeNV = extern enum(i32) { | |
OBJECT = 0, | |
BUILD_SCRATCH = 1, | |
UPDATE_SCRATCH = 2, | |
_, | |
}; | |
pub const GeometryFlagsNV = packed struct { | |
opaque: bool = false, | |
noDuplicateAnyHitInvocation: bool = false, | |
__reserved: u30 = 0, | |
pub usingnamespace FlagsMixin(@This()); | |
}; | |
pub const GeometryInstanceFlagsNV = packed struct { | |
triangleCullDisable: bool = false, | |
triangleFrontCounterclockwise: bool = false, | |
forceOpaque: bool = false, | |
forceNoOpaque: bool = false, | |
__reserved: u28 = 0, | |
pub usingnamespace FlagsMixin(@This()); | |
}; | |
pub const BuildAccelerationStructureFlagsNV = packed struct { | |
allowUpdate: bool = false, | |
allowCompaction: bool = false, | |
preferFastTrace: bool = false, | |
preferFastBuild: bool = false, | |
lowMemory: bool = false, | |
__reserved: u27 = 0, | |
pub usingnamespace FlagsMixin(@This()); | |
}; | |
pub const RayTracingShaderGroupCreateInfoNV = extern struct { | |
sType: StructureType = .RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV, | |
pNext: ?*const c_void = null, | |
inType: RayTracingShaderGroupTypeNV, | |
generalShader: u32, | |
closestHitShader: u32, | |
anyHitShader: u32, | |
intersectionShader: u32, | |
}; | |
pub const RayTracingPipelineCreateInfoNV = extern struct { | |
sType: StructureType = .RAY_TRACING_PIPELINE_CREATE_INFO_NV, | |
pNext: ?*const c_void = null, | |
flags: PipelineCreateFlags align(4) = PipelineCreateFlags{}, | |
stageCount: u32, | |
pStages: [*]const PipelineShaderStageCreateInfo, | |
groupCount: u32, | |
pGroups: [*]const RayTracingShaderGroupCreateInfoNV, | |
maxRecursionDepth: u32, | |
layout: PipelineLayout, | |
basePipelineHandle: ?Pipeline = null, | |
basePipelineIndex: i32, | |
}; | |
pub const GeometryTrianglesNV = extern struct { | |
sType: StructureType = .GEOMETRY_TRIANGLES_NV, | |
pNext: ?*const c_void = null, | |
vertexData: ?Buffer = null, | |
vertexOffset: DeviceSize, | |
vertexCount: u32, | |
vertexStride: DeviceSize, | |
vertexFormat: Format, | |
indexData: ?Buffer = null, | |
indexOffset: DeviceSize, | |
indexCount: u32, | |
indexType: IndexType, | |
transformData: ?Buffer = null, | |
transformOffset: DeviceSize, | |
}; | |
pub const GeometryAABBNV = extern struct { | |
sType: StructureType = .GEOMETRY_AABB_NV, | |
pNext: ?*const c_void = null, | |
aabbData: ?Buffer = null, | |
numAABBs: u32, | |
stride: u32, | |
offset: DeviceSize, | |
}; | |
pub const GeometryDataNV = extern struct { | |
triangles: GeometryTrianglesNV, | |
aabbs: GeometryAABBNV, | |
}; | |
pub const GeometryNV = extern struct { | |
sType: StructureType = .GEOMETRY_NV, | |
pNext: ?*const c_void = null, | |
geometryType: GeometryTypeNV, | |
geometry: GeometryDataNV, | |
flags: GeometryFlagsNV align(4) = GeometryFlagsNV{}, | |
}; | |
pub const AccelerationStructureInfoNV = extern struct { | |
sType: StructureType = .ACCELERATION_STRUCTURE_INFO_NV, | |
pNext: ?*const c_void = null, | |
inType: AccelerationStructureTypeNV, | |
flags: BuildAccelerationStructureFlagsNV align(4) = BuildAccelerationStructureFlagsNV{}, | |
instanceCount: u32 = 0, | |
geometryCount: u32 = 0, | |
pGeometries: [*]const GeometryNV = undefined, | |
}; | |
pub const AccelerationStructureCreateInfoNV = extern struct { | |
sType: StructureType = .ACCELERATION_STRUCTURE_CREATE_INFO_NV, | |
pNext: ?*const c_void = null, | |
compactedSize: DeviceSize, | |
info: AccelerationStructureInfoNV, | |
}; | |
pub const BindAccelerationStructureMemoryInfoNV = extern struct { | |
sType: StructureType = .BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV, | |
pNext: ?*const c_void = null, | |
accelerationStructure: AccelerationStructureNV, | |
memory: DeviceMemory, | |
memoryOffset: DeviceSize, | |
deviceIndexCount: u32 = 0, | |
pDeviceIndices: [*]const u32 = undefined, | |
}; | |
pub const WriteDescriptorSetAccelerationStructureNV = extern struct { | |
sType: StructureType = .WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV, | |
pNext: ?*const c_void = null, | |
accelerationStructureCount: u32, | |
pAccelerationStructures: [*]const AccelerationStructureNV, | |
}; | |
pub const AccelerationStructureMemoryRequirementsInfoNV = extern struct { | |
sType: StructureType = .ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV, | |
pNext: ?*const c_void = null, | |
inType: AccelerationStructureMemoryRequirementsTypeNV, | |
accelerationStructure: AccelerationStructureNV, | |
}; | |
pub const PhysicalDeviceRayTracingPropertiesNV = extern struct { | |
sType: StructureType = .PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV, | |
pNext: ?*c_void = null, | |
shaderGroupHandleSize: u32, | |
maxRecursionDepth: u32, | |
maxShaderGroupStride: u32, | |
shaderGroupBaseAlignment: u32, | |
maxGeometryCount: u64, | |
maxInstanceCount: u64, | |
maxTriangleCount: u64, | |
maxDescriptorSetAccelerationStructures: u32, | |
}; | |
pub extern fn vkCreateAccelerationStructureNV( | |
device: Device, | |
pCreateInfo: *const AccelerationStructureCreateInfoNV, | |
pAllocator: ?*const AllocationCallbacks, | |
pAccelerationStructure: *AccelerationStructureNV, | |
) callconv(CallConv) Result; | |
pub extern fn vkDestroyAccelerationStructureNV( | |
device: Device, | |
accelerationStructure: AccelerationStructureNV, | |
pAllocator: ?*const AllocationCallbacks, | |
) callconv(CallConv) void; | |
pub extern fn vkGetAccelerationStructureMemoryRequirementsNV( | |
device: Device, | |
pInfo: *const AccelerationStructureMemoryRequirementsInfoNV, | |
pMemoryRequirements: *MemoryRequirements2KHR, | |
) callconv(CallConv) void; | |
pub extern fn vkBindAccelerationStructureMemoryNV( | |
device: Device, | |
bindInfoCount: u32, | |
pBindInfos: [*]const BindAccelerationStructureMemoryInfoNV, | |
) callconv(CallConv) Result; | |
pub extern fn vkCmdBuildAccelerationStructureNV( | |
commandBuffer: CommandBuffer, | |
pInfo: *const AccelerationStructureInfoNV, | |
instanceData: ?Buffer, | |
instanceOffset: DeviceSize, | |
update: Bool32, | |
dst: AccelerationStructureNV, | |
src: ?AccelerationStructureNV, | |
scratch: Buffer, | |
scratchOffset: DeviceSize, | |
) callconv(CallConv) void; | |
pub extern fn vkCmdCopyAccelerationStructureNV( | |
commandBuffer: CommandBuffer, | |
dst: AccelerationStructureNV, | |
src: AccelerationStructureNV, | |
mode: CopyAccelerationStructureModeNV, | |
) callconv(CallConv) void; | |
pub extern fn vkCmdTraceRaysNV( | |
commandBuffer: CommandBuffer, | |
raygenShaderBindingTableBuffer: Buffer, | |
raygenShaderBindingOffset: DeviceSize, | |
missShaderBindingTableBuffer: ?Buffer, | |
missShaderBindingOffset: DeviceSize, | |
missShaderBindingStride: DeviceSize, | |
hitShaderBindingTableBuffer: ?Buffer, | |
hitShaderBindingOffset: DeviceSize, | |
hitShaderBindingStride: DeviceSize, | |
callableShaderBindingTableBuffer: ?Buffer, | |
callableShaderBindingOffset: DeviceSize, | |
callableShaderBindingStride: DeviceSize, | |
width: u32, | |
height: u32, | |
depth: u32, | |
) callconv(CallConv) void; | |
pub extern fn vkCreateRayTracingPipelinesNV( | |
device: Device, | |
pipelineCache: ?PipelineCache, | |
createInfoCount: u32, | |
pCreateInfos: [*]const RayTracingPipelineCreateInfoNV, | |
pAllocator: ?*const AllocationCallbacks, | |
pPipelines: [*]Pipeline, | |
) callconv(CallConv) Result; | |
pub extern fn vkGetRayTracingShaderGroupHandlesNV( | |
device: Device, | |
pipeline: Pipeline, | |
firstGroup: u32, | |
groupCount: u32, | |
dataSize: usize, | |
pData: ?*c_void, | |
) callconv(CallConv) Result; | |
pub extern fn vkGetAccelerationStructureHandleNV( | |
device: Device, | |
accelerationStructure: AccelerationStructureNV, | |
dataSize: usize, | |
pData: ?*c_void, | |
) callconv(CallConv) Result; | |
pub extern fn vkCmdWriteAccelerationStructuresPropertiesNV( | |
commandBuffer: CommandBuffer, | |
accelerationStructureCount: u32, | |
pAccelerationStructures: [*]const AccelerationStructureNV, | |
queryType: QueryType, | |
queryPool: QueryPool, | |
firstQuery: u32, | |
) callconv(CallConv) void; | |
pub extern fn vkCompileDeferredNV( | |
device: Device, | |
pipeline: Pipeline, | |
shader: u32, | |
) callconv(CallConv) Result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment