Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Name
VK_KHR_ray_tracing_pipeline - device extension
VK_KHR_ray_tracing_pipeline
- Name String
VK_KHR_ray_tracing_pipeline
- Extension Type
- Device extension
- Registered Extension Number
- 348
- Revision
- 1
- Ratification Status
- Ratified
- Extension and Version Dependencies
- VK_KHR_spirv_1_4 and VK_KHR_acceleration_structure
- Contact
Other Extension Metadata
- Last Modified Date
- 2020-11-12
- Interactions and External Dependencies
- This extension requires SPV_KHR_ray_tracing
- This extension provides API support for GLSL_EXT_ray_tracing
- This extension interacts with
Vulkan 1.2
and
VK_KHR_vulkan_memory_model
, adding the shader-call-related relation of invocations, shader-call-order partial order of dynamic instances of instructions, and the ShaderCallKHR scope. - This extension interacts with
VK_KHR_pipeline_library
, enabling pipeline libraries to be used with ray tracing pipelines and enabling usage ofRayTracingPipelineInterfaceCreateInfoKHR
.
- Contributors
- Matthäus Chajdas, AMD
- Greg Grebe, AMD
- Nicolai Hähnle, AMD
- Tobias Hector, AMD
- Dave Oldcorn, AMD
- Skyler Saleh, AMD
- Mathieu Robart, Arm
- Marius Bjorge, Arm
- Tom Olson, Arm
- Sebastian Tafuri, EA
- Henrik Rydgard, Embark
- Juan Cañada, Epic Games
- Patrick Kelly, Epic Games
- Yuriy O’Donnell, Epic Games
- Michael Doggett, Facebook/Oculus
- Andrew Garrard, Imagination
- Don Scorgie, Imagination
- Dae Kim, Imagination
- Joshua Barczak, Intel
- Slawek Grajewski, Intel
- Jeff Bolz, NVIDIA
- Pascal Gautron, NVIDIA
- Daniel Koch, NVIDIA
- Christoph Kubisch, NVIDIA
- Ashwin Lele, NVIDIA
- Robert Stepinski, NVIDIA
- Martin Stich, NVIDIA
- Nuno Subtil, NVIDIA
- Eric Werness, NVIDIA
- Jon Leech, Khronos
- Jeroen van Schijndel, OTOY
- Juul Joosten, OTOY
- Alex Bourd, Qualcomm
- Roman Larionov, Qualcomm
- David McAllister, Qualcomm
- Spencer Fricke, Samsung
- Lewis Gordon, Samsung
- Ralph Potter, Samsung
- Jasper Bekkers, Traverse Research
- Jesse Barker, Unity
- Baldur Karlsson, Valve
Description
Rasterization has been the dominant method to produce interactive graphics, but increasing performance of graphics hardware has made ray tracing a viable option for interactive rendering. Being able to integrate ray tracing with traditional rasterization makes it easier for applications to incrementally add ray traced effects to existing applications or to do hybrid approaches with rasterization for primary visibility and ray tracing for secondary queries.
To enable ray tracing, this extension adds a few different categories of new functionality:
- A new ray tracing pipeline type with new shader domains: ray generation, intersection, any-hit, closest hit, miss, and callable
- A shader binding indirection table to link shader groups with acceleration structure items
- Ray tracing commands which initiate the ray pipeline traversal and invocation of the various new shader domains depending on which traversal conditions are met
This extension adds support for the following SPIR-V extension in Vulkan:
SPV_KHR_ray_tracing
New Commands
cmdTraceRaysIndirectKHR
cmdTraceRaysKHR
createRayTracingPipelinesKHR
getRayTracingCaptureReplayShaderGroupHandlesKHR
getRayTracingShaderGroupHandlesKHR
getRayTracingShaderGroupStackSizeKHR
New Structures
RayTracingPipelineInterfaceCreateInfoKHR
RayTracingShaderGroupCreateInfoKHR
StridedDeviceAddressRegionKHR
TraceRaysIndirectCommandKHR
Extending
PhysicalDeviceFeatures2
,DeviceCreateInfo
:Extending
PhysicalDeviceProperties2
:
New Enums
New Enum Constants
KHR_RAY_TRACING_PIPELINE_SPEC_VERSION
SHADER_UNUSED_KHR
Extending
BufferUsageFlagBits
:Extending
DynamicState
:Extending
PipelineBindPoint
:Extending
PipelineCreateFlagBits
:PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
Extending
PipelineStageFlagBits
:Extending
ShaderStageFlagBits
:Extending
StructureType
:
New or Modified Built-In Variables
- LaunchSizeKHR
- WorldRayOriginKHR
- WorldRayDirectionKHR
- ObjectRayOriginKHR
- ObjectRayDirectionKHR
- RayTminKHR
- RayTmaxKHR
- InstanceCustomIndexKHR
- InstanceId
- ObjectToWorldKHR
- WorldToObjectKHR
- HitKindKHR
- IncomingRayFlagsKHR
- RayGeometryIndexKHR
- (modified)
PrimitiveId
New SPIR-V Capabilities
Issues
- How does this extension differ from VK_NV_ray_tracing?
DISCUSSION:
The following is a summary of the main functional differences between VK_KHR_ray_tracing_pipeline and VK_NV_ray_tracing:
- added support for indirect ray tracing (
cmdTraceRaysIndirectKHR
) uses SPV_KHR_ray_tracing instead of SPV_NV_ray_tracing
- refer to KHR SPIR-V enums instead of NV SPIR-V enums (which are functionally equivalent and aliased to the same values).
- added
RayGeometryIndexKHR
built-in
- removed vkCompileDeferredNV compilation functionality and replaced with deferred host operations interactions for ray tracing
- added
PhysicalDeviceRayTracingPipelineFeaturesKHR
structure extended
PhysicalDeviceRayTracingPipelinePropertiesKHR
structure- renamed
maxRecursionDepth
tomaxRayRecursionDepth
and it has a minimum of 1 instead of 31 - require
shaderGroupHandleSize
to be 32 bytes - added
maxRayDispatchInvocationCount
,shaderGroupHandleAlignment
andmaxRayHitAttributeSize
- renamed
- reworked geometry structures so they could be better shared between device, host, and indirect builds
- changed SBT parameters to a structure and added size
(
StridedDeviceAddressRegionKHR
) - add parameter for requesting memory requirements for host and/or device build
- added pipeline library support for ray tracing
- added watertightness guarantees
- added no-null-shader pipeline flags
(
VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_*_SHADERS_BIT_KHR
) - added memory model interactions with ray tracing and define how subgroups work and can be repacked
- Can you give a more detailed comparison of differences and similarities between VK_NV_ray_tracing and VK_KHR_ray_tracing_pipeline?
DISCUSSION:
The following is a more detailed comparison of which commands, structures, and enums are aliased, changed, or removed.
Aliased functionality — enums, structures, and commands that are considered equivalent:
Changed enums, structures, and commands:
RayTracingShaderGroupCreateInfoNV
→RayTracingShaderGroupCreateInfoKHR
(addedpShaderGroupCaptureReplayHandle
)RayTracingPipelineCreateInfoNV
→RayTracingPipelineCreateInfoKHR
(changed type ofpGroups
, addedlibraries
,pLibraryInterface
, andpDynamicState
)PhysicalDeviceRayTracingPropertiesNV
→ VkPhysicalDeviceRayTracingPropertiesKHR (renamedmaxTriangleCount
tomaxPrimitiveCount
, addedshaderGroupHandleCaptureReplaySize
)cmdTraceRaysNV
→cmdTraceRaysKHR
(params to struct)createRayTracingPipelinesNV
→createRayTracingPipelinesKHR
(different struct, changed functionality)
Added enums, structures and commands:
PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
,PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
,PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
,PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
,PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
toPipelineCreateFlagBits
PhysicalDeviceRayTracingPipelineFeaturesKHR
structureDeviceOrHostAddressKHR
andDeviceOrHostAddressConstKHR
unionsPipelineLibraryCreateInfoKHR
structRayTracingPipelineInterfaceCreateInfoKHR
structStridedDeviceAddressRegionKHR
structcmdTraceRaysIndirectKHR
command andTraceRaysIndirectCommandKHR
structgetRayTracingCaptureReplayShaderGroupHandlesKHR
(shader group capture/replay)cmdSetRayTracingPipelineStackSizeKHR
andgetRayTracingShaderGroupStackSizeKHR
commands for stack size control
Functionality removed:
PIPELINE_CREATE_DEFER_COMPILE_BIT_NV
compileDeferredNV
command (replaced withVK_KHR_deferred_host_operations
)
- What are the changes between the public provisional (VK_KHR_ray_tracing v8) release and the internal provisional (VK_KHR_ray_tracing v9) release?
- Require Vulkan 1.1 and SPIR-V 1.4
- Added interactions with Vulkan 1.2 and
VK_KHR_vulkan_memory_model
added creation time capture and replay flags
- replace
VkStridedBufferRegionKHR
withStridedDeviceAddressRegionKHR
and changecmdTraceRaysKHR
,cmdTraceRaysIndirectKHR
, to take these for the shader binding table and use device addresses instead of buffers. - require the shader binding table buffers to have the
VK_BUFFER_USAGE_RAY_TRACING_BIT_KHR
set - make
VK_KHR_pipeline_library
an interaction instead of required extension - rename the
libraries
member ofRayTracingPipelineCreateInfoKHR
topLibraryInfo
and make it a pointer - make
VK_KHR_deferred_host_operations
an interaction instead of a required extension (later went back on this) added explicit stack size management for ray tracing pipelines
- removed the
maxCallableSize
member ofRayTracingPipelineInterfaceCreateInfoKHR
- added the
pDynamicState
member toRayTracingPipelineCreateInfoKHR
- added
DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR
dynamic state for ray tracing pipelines - added
getRayTracingShaderGroupStackSizeKHR
andcmdSetRayTracingPipelineStackSizeKHR
commands - added
ShaderGroupShaderKHR
enum
- removed the
- Added
maxRayDispatchInvocationCount
limit toPhysicalDeviceRayTracingPipelinePropertiesKHR
- Added
shaderGroupHandleAlignment
property toPhysicalDeviceRayTracingPipelinePropertiesKHR
- Added
maxRayHitAttributeSize
property toPhysicalDeviceRayTracingPipelinePropertiesKHR
Clarify deferred host ops for pipeline creation
DeferredOperationKHR
is now a top-level parameter forcreateRayTracingPipelinesKHR
- removed
VkDeferredOperationInfoKHR
structure - change deferred host creation/return parameter behavior such that the implementation can modify such parameters until the deferred host operation completes
VK_KHR_deferred_host_operations
is required again
- What are the changes between the internal provisional (VK_KHR_ray_tracing v9) release and the final (VK_KHR_acceleration_structure v11 / VK_KHR_ray_tracing_pipeline v1) release?
refactor VK_KHR_ray_tracing into 3 extensions, enabling implementation flexibility and decoupling ray query support from ray pipelines:
VK_KHR_acceleration_structure
(for acceleration structure operations)VK_KHR_ray_tracing_pipeline
(for ray tracing pipeline and shader stages)VK_KHR_ray_query
(for ray queries in existing shader stages)
Require
Volatile
for the following builtins in the ray generation, closest hit, miss, intersection, and callable shader stages:SubgroupSize
,SubgroupLocalInvocationId
,SubgroupEqMask
,SubgroupGeMask
,SubgroupGtMask
,SubgroupLeMask
,SubgroupLtMask
SMIDNV
,WarpIDNV
clarify buffer usage flags for ray tracing
BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
is added as an alias ofBUFFER_USAGE_RAY_TRACING_BIT_NV
and is required on shader binding table buffersBUFFER_USAGE_STORAGE_BUFFER_BIT
is used inVK_KHR_acceleration_structure
forscratchData
- rename
maxRecursionDepth
tomaxRayPipelineRecursionDepth
(pipeline creation) andmaxRayRecursionDepth
(limit) to reduce confusion - Add queryable
maxRayHitAttributeSize
limit and rename members ofRayTracingPipelineInterfaceCreateInfoKHR
tomaxPipelineRayPayloadSize
andmaxPipelineRayHitAttributeSize
for clarity - Update SPIRV capabilities to use
RayTracingKHR
- extension is no longer provisional
- define synchronization requirements for indirect trace rays and indirect buffer
- This extension adds gl_InstanceID for the intersection, any-hit, and closest hit shaders, but in KHR_vulkan_glsl, gl_InstanceID is replaced with gl_InstanceIndex. Which should be used for Vulkan in this extension?
RESOLVED: This extension uses gl_InstanceID and maps it to
InstanceId
in SPIR-V. It is acknowledged that this is different than
other shader stages in Vulkan. There are two main reasons for the
difference here:
- symmetry with gl_PrimitiveID which is also available in these shaders
- there is no “baseInstance” relevant for these shaders, and so ID makes it more obvious that this is zero-based.
- Why is
VK_KHR_pipeline_library
an interaction instead of a required dependency, particularly when the “Feature Requirements” section says it is required to be supported anyhow?
RESOLVED: If VK_KHR_pipeline_library
were a required extension
dependency, then every application would need to enable the extension
whether or not they actually want to use the pipeline library
functionality. Developers found this to be annoying and unfriendly
behavior. We do wish to require all implementations to support it
though, and thus it is listed in the feature requirements section.
Sample Code
Example ray generation GLSL shader
#version 450 core #extension GL_EXT_ray_tracing : require layout(set = 0, binding = 0, rgba8) uniform image2D image; layout(set = 0, binding = 1) uniform accelerationStructureEXT as; layout(location = 0) rayPayloadEXT float payload; void main() { vec4 col = vec4(0, 0, 0, 1); vec3 origin = vec3(float(gl_LaunchIDEXT.x)/float(gl_LaunchSizeEXT.x), float(gl_LaunchIDEXT.y)/float(gl_LaunchSizeEXT.y), 1.0); vec3 dir = vec3(0.0, 0.0, -1.0); traceRayEXT(as, 0, 0xff, 0, 1, 0, origin, 0.0, dir, 1000.0, 0); col.y = payload; imageStore(image, ivec2(gl_LaunchIDEXT.xy), col); }
Version History
Revision 1, 2020-11-12 (Mathieu Robart, Daniel Koch, Eric Werness, Tobias Hector)
- Decomposition of the specification, from VK_KHR_ray_tracing to VK_KHR_ray_tracing_pipeline (#1918,!3912)
- require certain subgroup and sm_shader_builtin shader builtins to be decorated as volatile in the ray generation, closest hit, miss, intersection, and callable stages (#1924,!3903,!3954)
- clarify buffer usage flags for ray tracing (#2181,!3939)
- rename maxRecursionDepth to maxRayPipelineRecursionDepth and maxRayRecursionDepth (#2203,!3937)
- add queryable maxRayHitAttributeSize and rename members of VkRayTracingPipelineInterfaceCreateInfoKHR (#2102,!3966)
- update to use
RayTracingKHR
SPIR-V capability - add VUs for matching hit group type against geometry type (#2245,!3994)
- require
RayTMaxKHR
be volatile in intersection shaders (#2268,!4030) - add numerical limits for ray parameters (#2235,!3960)
- fix SBT indexing rules for device addresses (#2308,!4079)
- relax formula for ray intersection candidate determination (#2322,!4080)
- add more details on
ShaderRecordBufferKHR
variables (#2230,!4083) - clarify valid bits for
InstanceCustomIndexKHR
(GLSL/GLSL#19,!4128) - allow at most one
IncomingRayPayloadKHR
,IncomingCallableDataKHR
, andHitAttributeKHR
(!4129) - add minimum for maxShaderGroupStride (#2353,!4131)
- require VK_KHR_pipeline_library extension to be supported (#2348,!4135)
- clarify meaning of 'geometry index' (#2272,!4137)
- restrict traces to TLAS (#2239,!4141)
- add note about maxPipelineRayPayloadSize (#2383,!4172)
- do not require raygen shader in pipeline libraries (!4185)
- define sync for indirect trace rays and indirect buffer (#2407,!4208)
See Also
SHADER_UNUSED_KHR
,
PhysicalDeviceRayTracingPipelineFeaturesKHR
,
PhysicalDeviceRayTracingPipelinePropertiesKHR
,
RayTracingPipelineCreateInfoKHR
,
RayTracingPipelineInterfaceCreateInfoKHR
,
RayTracingShaderGroupCreateInfoKHR
, RayTracingShaderGroupTypeKHR
,
ShaderGroupShaderKHR
, StridedDeviceAddressRegionKHR
,
TraceRaysIndirectCommandKHR
, cmdSetRayTracingPipelineStackSizeKHR
,
cmdTraceRaysIndirectKHR
, cmdTraceRaysKHR
,
createRayTracingPipelinesKHR
,
getRayTracingCaptureReplayShaderGroupHandlesKHR
,
getRayTracingShaderGroupHandlesKHR
,
getRayTracingShaderGroupStackSizeKHR
Document Notes
For more information, see the Vulkan Specification
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
Synopsis
- cmdTraceRaysKHR :: forall io. MonadIO io => CommandBuffer -> ("raygenShaderBindingTable" ::: StridedDeviceAddressRegionKHR) -> ("missShaderBindingTable" ::: StridedDeviceAddressRegionKHR) -> ("hitShaderBindingTable" ::: StridedDeviceAddressRegionKHR) -> ("callableShaderBindingTable" ::: StridedDeviceAddressRegionKHR) -> ("width" ::: Word32) -> ("height" ::: Word32) -> ("depth" ::: Word32) -> io ()
- getRayTracingShaderGroupHandlesKHR :: forall io. MonadIO io => Device -> Pipeline -> ("firstGroup" ::: Word32) -> ("groupCount" ::: Word32) -> ("dataSize" ::: Word64) -> ("data" ::: Ptr ()) -> io ()
- getRayTracingCaptureReplayShaderGroupHandlesKHR :: forall io. MonadIO io => Device -> Pipeline -> ("firstGroup" ::: Word32) -> ("groupCount" ::: Word32) -> ("dataSize" ::: Word64) -> ("data" ::: Ptr ()) -> io ()
- createRayTracingPipelinesKHR :: forall io. MonadIO io => Device -> DeferredOperationKHR -> PipelineCache -> ("createInfos" ::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR)) -> ("allocator" ::: Maybe AllocationCallbacks) -> io (Result, "pipelines" ::: Vector Pipeline)
- withRayTracingPipelinesKHR :: forall io r. MonadIO io => Device -> DeferredOperationKHR -> PipelineCache -> Vector (SomeStruct RayTracingPipelineCreateInfoKHR) -> Maybe AllocationCallbacks -> (io (Result, Vector Pipeline) -> ((Result, Vector Pipeline) -> io ()) -> r) -> r
- cmdTraceRaysIndirectKHR :: forall io. MonadIO io => CommandBuffer -> ("raygenShaderBindingTable" ::: StridedDeviceAddressRegionKHR) -> ("missShaderBindingTable" ::: StridedDeviceAddressRegionKHR) -> ("hitShaderBindingTable" ::: StridedDeviceAddressRegionKHR) -> ("callableShaderBindingTable" ::: StridedDeviceAddressRegionKHR) -> ("indirectDeviceAddress" ::: DeviceAddress) -> io ()
- getRayTracingShaderGroupStackSizeKHR :: forall io. MonadIO io => Device -> Pipeline -> ("group" ::: Word32) -> ShaderGroupShaderKHR -> io DeviceSize
- cmdSetRayTracingPipelineStackSizeKHR :: forall io. MonadIO io => CommandBuffer -> ("pipelineStackSize" ::: Word32) -> io ()
- data RayTracingShaderGroupCreateInfoKHR = RayTracingShaderGroupCreateInfoKHR {}
- data RayTracingPipelineCreateInfoKHR (es :: [Type]) = RayTracingPipelineCreateInfoKHR {
- next :: Chain es
- flags :: PipelineCreateFlags
- stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
- groups :: Vector RayTracingShaderGroupCreateInfoKHR
- maxPipelineRayRecursionDepth :: Word32
- libraryInfo :: Maybe PipelineLibraryCreateInfoKHR
- libraryInterface :: Maybe RayTracingPipelineInterfaceCreateInfoKHR
- dynamicState :: Maybe PipelineDynamicStateCreateInfo
- layout :: PipelineLayout
- basePipelineHandle :: Pipeline
- basePipelineIndex :: Int32
- data PhysicalDeviceRayTracingPipelineFeaturesKHR = PhysicalDeviceRayTracingPipelineFeaturesKHR {}
- data PhysicalDeviceRayTracingPipelinePropertiesKHR = PhysicalDeviceRayTracingPipelinePropertiesKHR {}
- data StridedDeviceAddressRegionKHR = StridedDeviceAddressRegionKHR {}
- data TraceRaysIndirectCommandKHR = TraceRaysIndirectCommandKHR {}
- data RayTracingPipelineInterfaceCreateInfoKHR = RayTracingPipelineInterfaceCreateInfoKHR {}
- newtype RayTracingShaderGroupTypeKHR where
- RayTracingShaderGroupTypeKHR Int32
- pattern RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR :: RayTracingShaderGroupTypeKHR
- pattern RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR :: RayTracingShaderGroupTypeKHR
- pattern RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR :: RayTracingShaderGroupTypeKHR
- newtype ShaderGroupShaderKHR where
- type KHR_RAY_TRACING_PIPELINE_SPEC_VERSION = 1
- pattern KHR_RAY_TRACING_PIPELINE_SPEC_VERSION :: forall a. Integral a => a
- type KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME = "VK_KHR_ray_tracing_pipeline"
- pattern KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
- newtype DeferredOperationKHR = DeferredOperationKHR Word64
- data PipelineLibraryCreateInfoKHR = PipelineLibraryCreateInfoKHR {}
- type SHADER_UNUSED_KHR = 4294967295
- pattern SHADER_UNUSED_KHR :: Word32
Documentation
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> ("raygenShaderBindingTable" ::: StridedDeviceAddressRegionKHR) |
|
-> ("missShaderBindingTable" ::: StridedDeviceAddressRegionKHR) |
|
-> ("hitShaderBindingTable" ::: StridedDeviceAddressRegionKHR) |
|
-> ("callableShaderBindingTable" ::: StridedDeviceAddressRegionKHR) |
|
-> ("width" ::: Word32) |
|
-> ("height" ::: Word32) |
|
-> ("depth" ::: Word32) |
|
-> io () |
vkCmdTraceRaysKHR - Initialize a ray tracing dispatch
Description
When the command is executed, a ray generation group of width
×
height
× depth
rays is assembled.
Valid Usage
- If a
Sampler
created withmagFilter
orminFilter
equal toFILTER_LINEAR
andcompareEnable
equal toFALSE
is used to sample aImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
Sampler
created withmipmapMode
equal toSAMPLER_MIPMAP_MODE_LINEAR
andcompareEnable
equal toFALSE
is used to sample aImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
ImageView
is sampled with depth comparison, the image view’s format features must containFORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
- If a
ImageView
is accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a
DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containFORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
- If a
ImageView
is sampled withFILTER_CUBIC_EXT
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- If the
VK_EXT_filter_cubic
extension is not enabled and any
ImageView
is sampled withFILTER_CUBIC_EXT
as a result of this command, it must not have aImageViewType
ofIMAGE_VIEW_TYPE_3D
,IMAGE_VIEW_TYPE_CUBE
, orIMAGE_VIEW_TYPE_CUBE_ARRAY
- Any
ImageView
being sampled withFILTER_CUBIC_EXT
as a result of this command must have aImageViewType
and format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT
::filterCubic
returned bygetPhysicalDeviceImageFormatProperties2
- Any
ImageView
being sampled withFILTER_CUBIC_EXT
with a reduction mode of eitherSAMPLER_REDUCTION_MODE_MIN
orSAMPLER_REDUCTION_MODE_MAX
as a result of this command must have aImageViewType
and format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT
::filterCubicMinmax
returned bygetPhysicalDeviceImageFormatProperties2
- If the
cubicRangeClamp
feature is not enabled, then any
ImageView
being sampled withFILTER_CUBIC_EXT
as a result of this command must not have aSamplerReductionModeCreateInfo
::reductionMode
equal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM
- Any
ImageView
being sampled with aSamplerReductionModeCreateInfo
::reductionMode
equal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM
as a result of this command must sample withFILTER_CUBIC_EXT
- If the
selectableCubicWeights
feature is not enabled, then any
ImageView
being sampled withFILTER_CUBIC_EXT
as a result of this command must haveSamplerCubicWeightsCreateInfoQCOM
::cubicWeights
equal toCUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM
- Any
Image
created with aImageCreateInfo
::flags
containingIMAGE_CREATE_CORNER_SAMPLED_BIT_NV
sampled as a result of this command must only be sampled using aSamplerAddressMode
ofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For any
ImageView
being written as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containFORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
- For any
ImageView
being read as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containFORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
- For any
BufferView
being written as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
, the view’s buffer features must containFORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
- Any
BufferView
being read as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
then the view’s buffer features must containFORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
- For each set n that is
statically used by
a bound shader,
a descriptor set must have been bound to n at the same pipeline
bind point, with a
PipelineLayout
that is compatible for set n, with thePipelineLayout
orDescriptorSetLayout
array that was used to create the currentPipeline
orShaderEXT
, as described in ??? - For each push constant that is
statically used by
a bound shader,
a push constant value must have been set for the same pipeline
bind point, with a
PipelineLayout
that is compatible for push constants, with thePipelineLayout
orDescriptorSetLayout
andPushConstantRange
arrays used to create the currentPipeline
orShaderEXT
, as described in ??? - If the
maintenance4
feature is not enabled, then for each push constant that is
statically used by
a bound shader,
a push constant value must have been set for the same pipeline
bind point, with a
PipelineLayout
that is compatible for push constants, with thePipelineLayout
orDescriptorSetLayout
andPushConstantRange
arrays used to create the currentPipeline
orShaderEXT
, as described in ??? - Descriptors in each bound
descriptor set, specified via
cmdBindDescriptorSets
, must be valid if they are statically used by thePipeline
bound to the pipeline bind point used by this command and the boundPipeline
was not created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- If the descriptors used by the
Pipeline
bound to the pipeline bind point were specified viacmdBindDescriptorSets
, the boundPipeline
must have been created withoutPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- Descriptors in bound descriptor
buffers, specified via
cmdSetDescriptorBufferOffsetsEXT
, must be valid if they are dynamically used by thePipeline
bound to the pipeline bind point used by this command and the boundPipeline
was created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- Descriptors in bound descriptor
buffers, specified via
cmdSetDescriptorBufferOffsetsEXT
, must be valid if they are dynamically used by anyShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command - If the descriptors used by the
Pipeline
bound to the pipeline bind point were specified viacmdSetDescriptorBufferOffsetsEXT
, the boundPipeline
must have been created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- If a descriptor is dynamically
used with a
Pipeline
created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
, the descriptor memory must be resident - If a descriptor is dynamically
used with a
ShaderEXT
created with aDescriptorSetLayout
that was created withDESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
, the descriptor memory must be resident - If the shaderObject feature is not enabled, a valid pipeline must be bound to the pipeline bind point used by this command
- If the
shaderObject
is enabled, either a valid pipeline must be bound to the pipeline
bind point used by this command, or a valid combination of valid and
NULL_HANDLE
shader objects must be bound to every supported shader stage corresponding to the pipeline bind point used by this command - If a pipeline is bound to the
pipeline bind point used by this command, there must not have been
any calls to dynamic state setting commands for any state not
specified as dynamic in the
Pipeline
object bound to the pipeline bind point used by this command, since that pipeline was bound - If the
Pipeline
object bound to the pipeline bind point used by this command or anyShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses aSampler
object that uses unnormalized coordinates, that sampler must not be used to sample from anyImage
with aImageView
of the typeIMAGE_VIEW_TYPE_3D
,IMAGE_VIEW_TYPE_CUBE
,IMAGE_VIEW_TYPE_1D_ARRAY
,IMAGE_VIEW_TYPE_2D_ARRAY
orIMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage - If the
Pipeline
object bound to the pipeline bind point used by this command or anyShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses aSampler
object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage - If the
Pipeline
object bound to the pipeline bind point used by this command or anyShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses aSampler
object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage - If any stage of the
Pipeline
object bound to the pipeline bind point used by this command accesses a uniform buffer, and that stage was created without enabling eitherPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT
orPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT
foruniformBuffers
, and the robustBufferAccess feature is not enabled, that stage must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the
robustBufferAccess
feature is not enabled, and any
ShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If any stage of the
Pipeline
object bound to the pipeline bind point used by this command accesses a storage buffer, and that stage was created without enabling eitherPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT
orPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT
forstorageBuffers
, and the robustBufferAccess feature is not enabled, that stage must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the
robustBufferAccess
feature is not enabled, and any
ShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If
commandBuffer
is an unprotected command buffer and protectedNoFault is not supported, any resource accessed by bound shaders must not be a protected resource - If
a bound shader
accesses a
Sampler
orImageView
object that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*
orOpImageSparseSample*
instructions - If
a bound shader
accesses a
Sampler
orImageView
object that enables sampler Y′CBCR conversion, that object must not use theConstOffset
andOffset
operands - If a
ImageView
is accessed as a result of this command, then the image view’sviewType
must match theDim
operand of theOpTypeImage
as described in ??? - If a
ImageView
is accessed as a result of this command, then the numeric type of the image view’sformat
and theSampled
Type
operand of theOpTypeImage
must match - If a
ImageView
created with a format other thanFORMAT_A8_UNORM_KHR
is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the image view’s format - If a
ImageView
created with the formatFORMAT_A8_UNORM_KHR
is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have four components - If a
BufferView
is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the buffer view’s format - If a
ImageView
with aFormat
that has a 64-bit component width is accessed as a result of this command, theSampledType
of theOpTypeImage
operand of that instruction must have aWidth
of 64 - If a
ImageView
with aFormat
that has a component width less than 64-bit is accessed as a result of this command, theSampledType
of theOpTypeImage
operand of that instruction must have aWidth
of 32 - If a
BufferView
with aFormat
that has a 64-bit component width is accessed as a result of this command, theSampledType
of theOpTypeImage
operand of that instruction must have aWidth
of 64 - If a
BufferView
with aFormat
that has a component width less than 64-bit is accessed as a result of this command, theSampledType
of theOpTypeImage
operand of that instruction must have aWidth
of 32 - If the
sparseImageInt64Atomics
feature is not enabled,
Image
objects created with theIMAGE_CREATE_SPARSE_RESIDENCY_BIT
flag must not be accessed by atomic instructions through anOpTypeImage
with aSampledType
with aWidth
of 64 by this command - If the
sparseImageInt64Atomics
feature is not enabled,
Buffer
objects created with theBUFFER_CREATE_SPARSE_RESIDENCY_BIT
flag must not be accessed by atomic instructions through anOpTypeImage
with aSampledType
with aWidth
of 64 by this command - If
OpImageWeightedSampleQCOM
is used to sample aImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM
- If
OpImageWeightedSampleQCOM
uses aImageView
as a sample weight image as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM
- If
OpImageBoxFilterQCOM
is used to sample aImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM
- If
OpImageBlockMatchSSDQCOM
is used to read from anImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If
OpImageBlockMatchSADQCOM
is used to read from anImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If
OpImageBlockMatchSADQCOM
or OpImageBlockMatchSSDQCOM is used to read from a reference image as result of this command, then the specified reference coordinates must not fail integer texel coordinate validation - If
OpImageWeightedSampleQCOM
,OpImageBoxFilterQCOM
,OpImageBlockMatchWindowSSDQCOM
,OpImageBlockMatchWindowSADQCOM
,OpImageBlockMatchGatherSSDQCOM
,OpImageBlockMatchGatherSADQCOM
,OpImageBlockMatchSSDQCOM
, orOpImageBlockMatchSADQCOM
uses aSampler
as a result of this command, then the sampler must have been created withSAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM
- If any
command other than
OpImageWeightedSampleQCOM
,OpImageBoxFilterQCOM
,OpImageBlockMatchWindowSSDQCOM
,OpImageBlockMatchWindowSADQCOM
,OpImageBlockMatchGatherSSDQCOM
,OpImageBlockMatchGatherSADQCOM
,OpImageBlockMatchSSDQCOM
, orOpImageBlockMatchSADQCOM
uses aSampler
as a result of this command, then the sampler must not have been created withSAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM
- If a
OpImageBlockMatchWindow*QCOM
orOpImageBlockMatchGather*QCOM
instruction is used to read from anImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If a
OpImageBlockMatchWindow*QCOM
orOpImageBlockMatchGather*QCOM
instruction is used to read from anImageView
as a result of this command, then the image view’s format must be a single-component format. - If a
OpImageBlockMatchWindow*QCOM
orOpImageBlockMatchGather*QCOM
read from a reference image as result of this command, then the specified reference coordinates must not fail integer texel coordinate validation - Any shader invocation executed by this command must terminate
- Any shader group handle referenced by this call must have been queried from the currently bound ray tracing pipeline
- This
command must not cause a shader call instruction to be executed
from a shader invocation with a
recursion depth
greater than the value of
maxPipelineRayRecursionDepth
used to create the bound ray tracing pipeline -
commandBuffer
must not be a protected command buffer - The
size
member ofpRayGenShaderBindingTable
must be equal to itsstride
member - If the
buffer from which
pRayGenShaderBindingTable->deviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object - The buffer
from which the
pRayGenShaderBindingTable->deviceAddress
is queried must have been created with theBUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
usage flag -
pRayGenShaderBindingTable->deviceAddress
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupBaseAlignment
- If the buffer
from which
pMissShaderBindingTable->deviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object - The buffer
from which the
pMissShaderBindingTable->deviceAddress
is queried must have been created with theBUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
usage flag -
pMissShaderBindingTable->deviceAddress
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupBaseAlignment
-
pMissShaderBindingTable->stride
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupHandleAlignment
-
pMissShaderBindingTable->stride
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxShaderGroupStride
- If the buffer
from which
pHitShaderBindingTable->deviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object - The buffer
from which the
pHitShaderBindingTable->deviceAddress
is queried must have been created with theBUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
usage flag -
pHitShaderBindingTable->deviceAddress
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupBaseAlignment
-
pHitShaderBindingTable->stride
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupHandleAlignment
-
pHitShaderBindingTable->stride
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxShaderGroupStride
- If the
buffer from which
pCallableShaderBindingTable->deviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object - The
buffer from which the
pCallableShaderBindingTable->deviceAddress
is queried must have been created with theBUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
usage flag -
pCallableShaderBindingTable->deviceAddress
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupBaseAlignment
-
pCallableShaderBindingTable->stride
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupHandleAlignment
-
pCallableShaderBindingTable->stride
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxShaderGroupStride
- If the currently bound ray
tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
,pHitShaderBindingTable->deviceAddress
must not be zero - If the currently bound ray
tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
,pHitShaderBindingTable->deviceAddress
must not be zero - If the currently bound ray
tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
, the shader group handle identified bypMissShaderBindingTable->deviceAddress
must not be set to zero - If the currently bound ray
tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
, entries in the table identified bypHitShaderBindingTable->deviceAddress
accessed as a result of this command in order to execute an any-hit shader must not be set to zero - If the currently bound ray
tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
, entries in the table identified bypHitShaderBindingTable->deviceAddress
accessed as a result of this command in order to execute a closest hit shader must not be set to zero - If the currently bound ray
tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
, entries in the table identified bypHitShaderBindingTable->deviceAddress
accessed as a result of this command in order to execute an intersection shader must not be set to zero - Any non-zero
hit shader group entries in the table identified by
pHitShaderBindingTable->deviceAddress
accessed by this call from a geometry with ageometryType
ofGEOMETRY_TYPE_TRIANGLES_KHR
must have been created withRAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR
- Any non-zero
hit shader group entries in the table identified by
pHitShaderBindingTable->deviceAddress
accessed by this call from a geometry with ageometryType
ofGEOMETRY_TYPE_AABBS_KHR
must have been created withRAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR
-
width
must be less than or equal toPhysicalDeviceLimits
::maxComputeWorkGroupCount
[0] ×PhysicalDeviceLimits
::maxComputeWorkGroupSize
[0] -
height
must be less than or equal toPhysicalDeviceLimits
::maxComputeWorkGroupCount
[1] ×PhysicalDeviceLimits
::maxComputeWorkGroupSize
[1] -
depth
must be less than or equal toPhysicalDeviceLimits
::maxComputeWorkGroupCount
[2] ×PhysicalDeviceLimits
::maxComputeWorkGroupSize
[2] -
width
×height
×depth
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxRayDispatchInvocationCount
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
pRaygenShaderBindingTable
must be a valid pointer to a validStridedDeviceAddressRegionKHR
structure -
pMissShaderBindingTable
must be a valid pointer to a validStridedDeviceAddressRegionKHR
structure -
pHitShaderBindingTable
must be a valid pointer to a validStridedDeviceAddressRegionKHR
structure -
pCallableShaderBindingTable
must be a valid pointer to a validStridedDeviceAddressRegionKHR
structure -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support compute operations - This command must only be called outside of a render pass instance
- This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
'
Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
---|---|---|---|---|
Primary Secondary | Outside | Outside | Compute | Action |
See Also
VK_KHR_ray_tracing_pipeline,
CommandBuffer
, StridedDeviceAddressRegionKHR
getRayTracingShaderGroupHandlesKHR Source #
:: forall io. MonadIO io | |
=> Device |
|
-> Pipeline |
|
-> ("firstGroup" ::: Word32) |
|
-> ("groupCount" ::: Word32) |
|
-> ("dataSize" ::: Word64) |
|
-> ("data" ::: Ptr ()) |
|
-> io () |
vkGetRayTracingShaderGroupHandlesKHR - Query ray tracing pipeline shader group handles
Description
If pipeline
was created with
PIPELINE_CREATE_LIBRARY_BIT_KHR
and the
pipelineLibraryGroupHandles
feature is enabled applications can query group handles from that
pipeline, even if the pipeline is a library and is never bound to a
command buffer. These group handles remain bitwise identical for any
pipeline
which references the pipeline library. Group indices are
assigned as-if the pipeline was created without
PIPELINE_CREATE_LIBRARY_BIT_KHR
.
Valid Usage
-
firstGroup
must be less than the number of shader groups inpipeline
- The sum
of
firstGroup
andgroupCount
must be less than or equal to the number of shader groups inpipeline
-
dataSize
must be at leastPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupHandleSize
×groupCount
- If the
pipelineLibraryGroupHandles
feature is not enabled,
pipeline
must not have been created withPIPELINE_CREATE_LIBRARY_BIT_KHR
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
pipeline
must be a validPipeline
handle -
pData
must be a valid pointer to an array ofdataSize
bytes -
dataSize
must be greater than0
-
pipeline
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
VK_KHR_ray_tracing_pipeline,
VK_NV_ray_tracing,
Device
, Pipeline
getRayTracingCaptureReplayShaderGroupHandlesKHR Source #
:: forall io. MonadIO io | |
=> Device |
|
-> Pipeline |
|
-> ("firstGroup" ::: Word32) |
|
-> ("groupCount" ::: Word32) |
|
-> ("dataSize" ::: Word64) |
|
-> ("data" ::: Ptr ()) |
|
-> io () |
vkGetRayTracingCaptureReplayShaderGroupHandlesKHR - Query opaque capture replay data for pipeline shader group handles
Description
Once queried, this opaque data can be provided at pipeline creation
time (in a subsequent execution), using
RayTracingShaderGroupCreateInfoKHR
::pShaderGroupCaptureReplayHandle
,
as described in
Ray Tracing Capture Replay.
If pipeline
was created with
PIPELINE_CREATE_LIBRARY_BIT_KHR
and the
pipelineLibraryGroupHandles
feature is enabled applications can query capture replay group handles
from that pipeline. The capture replay handle remains bitwise identical
for any pipeline
which references the pipeline library. Group indices
are assigned as-if the pipeline was created without
PIPELINE_CREATE_LIBRARY_BIT_KHR
.
Valid Usage
-
firstGroup
must be less than the number of shader groups inpipeline
-
The sum of
firstGroup
andgroupCount
must be less than or equal to the number of shader groups inpipeline
-
dataSize
must be at leastPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupHandleCaptureReplaySize
×groupCount
-
PhysicalDeviceRayTracingPipelineFeaturesKHR
::rayTracingPipelineShaderGroupHandleCaptureReplay
must be enabled to call this function -
pipeline
must have been created with aflags
that includedPIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
-
If the
pipelineLibraryGroupHandles
feature is not enabled,
pipeline
must not have been created withPIPELINE_CREATE_LIBRARY_BIT_KHR
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
pipeline
must be a validPipeline
handle -
pData
must be a valid pointer to an array ofdataSize
bytes -
dataSize
must be greater than0
-
pipeline
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
createRayTracingPipelinesKHR Source #
:: forall io. MonadIO io | |
=> Device |
|
-> DeferredOperationKHR |
|
-> PipelineCache |
|
-> ("createInfos" ::: Vector (SomeStruct RayTracingPipelineCreateInfoKHR)) |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> io (Result, "pipelines" ::: Vector Pipeline) |
vkCreateRayTracingPipelinesKHR - Creates a new ray tracing pipeline object
Description
The ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS
error is returned if the implementation is unable to reuse the shader
group handles provided in
RayTracingShaderGroupCreateInfoKHR
::pShaderGroupCaptureReplayHandle
when
PhysicalDeviceRayTracingPipelineFeaturesKHR
::rayTracingPipelineShaderGroupHandleCaptureReplay
is enabled.
Valid Usage
- If the
flags
member of any element ofpCreateInfos
contains thePIPELINE_CREATE_DERIVATIVE_BIT
flag, and thebasePipelineIndex
member of that same element is not-1
,basePipelineIndex
must be less than the index intopCreateInfos
that corresponds to that element
- If the
flags
member of any element ofpCreateInfos
contains thePIPELINE_CREATE_DERIVATIVE_BIT
flag, the base pipeline must have been created with thePIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
flag set -
flags
must not contain thePIPELINE_CREATE_DISPATCH_BASE
flag - If
pipelineCache
was created withPIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT
, host access topipelineCache
must be externally synchronized - If
deferredOperation
is notNULL_HANDLE
, it must be a validDeferredOperationKHR
object - Any
previous deferred operation that was associated with
deferredOperation
must be complete - The rayTracingPipeline feature must be enabled
- If
deferredOperation
is notNULL_HANDLE
, theflags
member of elements ofpCreateInfos
must not includePIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT
Valid Usage (Implicit)
-
device
must be a validDevice
handle
- If
deferredOperation
is notNULL_HANDLE
,deferredOperation
must be a validDeferredOperationKHR
handle - If
pipelineCache
is notNULL_HANDLE
,pipelineCache
must be a validPipelineCache
handle -
pCreateInfos
must be a valid pointer to an array ofcreateInfoCount
validRayTracingPipelineCreateInfoKHR
structures - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure -
pPipelines
must be a valid pointer to an array ofcreateInfoCount
Pipeline
handles -
createInfoCount
must be greater than0
- If
deferredOperation
is a valid handle, it must have been created, allocated, or retrieved fromdevice
- If
pipelineCache
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
VK_KHR_ray_tracing_pipeline,
AllocationCallbacks
,
DeferredOperationKHR
,
Device
, Pipeline
,
PipelineCache
, RayTracingPipelineCreateInfoKHR
withRayTracingPipelinesKHR :: forall io r. MonadIO io => Device -> DeferredOperationKHR -> PipelineCache -> Vector (SomeStruct RayTracingPipelineCreateInfoKHR) -> Maybe AllocationCallbacks -> (io (Result, Vector Pipeline) -> ((Result, Vector Pipeline) -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createRayTracingPipelinesKHR
and destroyPipeline
To ensure that destroyPipeline
is always called: pass
bracket
(or the allocate function from your
favourite resource management library) as the last argument.
To just extract the pair pass (,)
as the last argument.
cmdTraceRaysIndirectKHR Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> ("raygenShaderBindingTable" ::: StridedDeviceAddressRegionKHR) |
|
-> ("missShaderBindingTable" ::: StridedDeviceAddressRegionKHR) |
|
-> ("hitShaderBindingTable" ::: StridedDeviceAddressRegionKHR) |
|
-> ("callableShaderBindingTable" ::: StridedDeviceAddressRegionKHR) |
|
-> ("indirectDeviceAddress" ::: DeviceAddress) |
|
-> io () |
vkCmdTraceRaysIndirectKHR - Initialize an indirect ray tracing dispatch
Description
cmdTraceRaysIndirectKHR
behaves similarly to cmdTraceRaysKHR
except
that the ray trace query dimensions are read by the device from
indirectDeviceAddress
during execution.
Valid Usage
- If a
Sampler
created withmagFilter
orminFilter
equal toFILTER_LINEAR
andcompareEnable
equal toFALSE
is used to sample aImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
Sampler
created withmipmapMode
equal toSAMPLER_MIPMAP_MODE_LINEAR
andcompareEnable
equal toFALSE
is used to sample aImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
ImageView
is sampled with depth comparison, the image view’s format features must containFORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT
- If a
ImageView
is accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a
DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
descriptor is accessed using atomic operations as a result of this command, then the storage texel buffer’s format features must containFORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
- If a
ImageView
is sampled withFILTER_CUBIC_EXT
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- If the
VK_EXT_filter_cubic
extension is not enabled and any
ImageView
is sampled withFILTER_CUBIC_EXT
as a result of this command, it must not have aImageViewType
ofIMAGE_VIEW_TYPE_3D
,IMAGE_VIEW_TYPE_CUBE
, orIMAGE_VIEW_TYPE_CUBE_ARRAY
- Any
ImageView
being sampled withFILTER_CUBIC_EXT
as a result of this command must have aImageViewType
and format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT
::filterCubic
returned bygetPhysicalDeviceImageFormatProperties2
- Any
ImageView
being sampled withFILTER_CUBIC_EXT
with a reduction mode of eitherSAMPLER_REDUCTION_MODE_MIN
orSAMPLER_REDUCTION_MODE_MAX
as a result of this command must have aImageViewType
and format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT
::filterCubicMinmax
returned bygetPhysicalDeviceImageFormatProperties2
- If the
cubicRangeClamp
feature is not enabled, then any
ImageView
being sampled withFILTER_CUBIC_EXT
as a result of this command must not have aSamplerReductionModeCreateInfo
::reductionMode
equal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM
- Any
ImageView
being sampled with aSamplerReductionModeCreateInfo
::reductionMode
equal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM
as a result of this command must sample withFILTER_CUBIC_EXT
- If the
selectableCubicWeights
feature is not enabled, then any
ImageView
being sampled withFILTER_CUBIC_EXT
as a result of this command must haveSamplerCubicWeightsCreateInfoQCOM
::cubicWeights
equal toCUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM
- Any
Image
created with aImageCreateInfo
::flags
containingIMAGE_CREATE_CORNER_SAMPLED_BIT_NV
sampled as a result of this command must only be sampled using aSamplerAddressMode
ofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For any
ImageView
being written as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containFORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
- For any
ImageView
being read as a storage image where the image format field of theOpTypeImage
isUnknown
, the view’s format features must containFORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
- For any
BufferView
being written as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
, the view’s buffer features must containFORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT
- Any
BufferView
being read as a storage texel buffer where the image format field of theOpTypeImage
isUnknown
then the view’s buffer features must containFORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
- For each set n that is
statically used by
a bound shader,
a descriptor set must have been bound to n at the same pipeline
bind point, with a
PipelineLayout
that is compatible for set n, with thePipelineLayout
orDescriptorSetLayout
array that was used to create the currentPipeline
orShaderEXT
, as described in ??? - For each push constant
that is statically used by
a bound shader,
a push constant value must have been set for the same pipeline
bind point, with a
PipelineLayout
that is compatible for push constants, with thePipelineLayout
orDescriptorSetLayout
andPushConstantRange
arrays used to create the currentPipeline
orShaderEXT
, as described in ??? - If the
maintenance4
feature is not enabled, then for each push constant that is
statically used by
a bound shader,
a push constant value must have been set for the same pipeline
bind point, with a
PipelineLayout
that is compatible for push constants, with thePipelineLayout
orDescriptorSetLayout
andPushConstantRange
arrays used to create the currentPipeline
orShaderEXT
, as described in ??? - Descriptors in each
bound descriptor set, specified via
cmdBindDescriptorSets
, must be valid if they are statically used by thePipeline
bound to the pipeline bind point used by this command and the boundPipeline
was not created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- If the descriptors used
by the
Pipeline
bound to the pipeline bind point were specified viacmdBindDescriptorSets
, the boundPipeline
must have been created withoutPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- Descriptors in bound
descriptor buffers, specified via
cmdSetDescriptorBufferOffsetsEXT
, must be valid if they are dynamically used by thePipeline
bound to the pipeline bind point used by this command and the boundPipeline
was created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- Descriptors in bound
descriptor buffers, specified via
cmdSetDescriptorBufferOffsetsEXT
, must be valid if they are dynamically used by anyShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command - If the descriptors used
by the
Pipeline
bound to the pipeline bind point were specified viacmdSetDescriptorBufferOffsetsEXT
, the boundPipeline
must have been created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- If a descriptor is
dynamically used with a
Pipeline
created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
, the descriptor memory must be resident - If a descriptor is
dynamically used with a
ShaderEXT
created with aDescriptorSetLayout
that was created withDESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
, the descriptor memory must be resident - If the shaderObject feature is not enabled, a valid pipeline must be bound to the pipeline bind point used by this command
- If the
shaderObject
is enabled, either a valid pipeline must be bound to the pipeline
bind point used by this command, or a valid combination of valid and
NULL_HANDLE
shader objects must be bound to every supported shader stage corresponding to the pipeline bind point used by this command - If a pipeline is bound
to the pipeline bind point used by this command, there must not
have been any calls to dynamic state setting commands for any state
not specified as dynamic in the
Pipeline
object bound to the pipeline bind point used by this command, since that pipeline was bound - If the
Pipeline
object bound to the pipeline bind point used by this command or anyShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses aSampler
object that uses unnormalized coordinates, that sampler must not be used to sample from anyImage
with aImageView
of the typeIMAGE_VIEW_TYPE_3D
,IMAGE_VIEW_TYPE_CUBE
,IMAGE_VIEW_TYPE_1D_ARRAY
,IMAGE_VIEW_TYPE_2D_ARRAY
orIMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage - If the
Pipeline
object bound to the pipeline bind point used by this command or anyShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses aSampler
object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage - If the
Pipeline
object bound to the pipeline bind point used by this command or anyShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses aSampler
object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage - If any stage
of the
Pipeline
object bound to the pipeline bind point used by this command accesses a uniform buffer, and that stage was created without enabling eitherPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT
orPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT
foruniformBuffers
, and the robustBufferAccess feature is not enabled, that stage must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the
robustBufferAccess
feature is not enabled, and any
ShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If any stage
of the
Pipeline
object bound to the pipeline bind point used by this command accesses a storage buffer, and that stage was created without enabling eitherPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT
orPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT
forstorageBuffers
, and the robustBufferAccess feature is not enabled, that stage must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the
robustBufferAccess
feature is not enabled, and any
ShaderEXT
bound to a stage corresponding to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If
commandBuffer
is an unprotected command buffer and protectedNoFault is not supported, any resource accessed by bound shaders must not be a protected resource - If
a bound shader
accesses a
Sampler
orImageView
object that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*
orOpImageSparseSample*
instructions - If
a bound shader
accesses a
Sampler
orImageView
object that enables sampler Y′CBCR conversion, that object must not use theConstOffset
andOffset
operands - If a
ImageView
is accessed as a result of this command, then the image view’sviewType
must match theDim
operand of theOpTypeImage
as described in ??? - If a
ImageView
is accessed as a result of this command, then the numeric type of the image view’sformat
and theSampled
Type
operand of theOpTypeImage
must match - If a
ImageView
created with a format other thanFORMAT_A8_UNORM_KHR
is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the image view’s format - If a
ImageView
created with the formatFORMAT_A8_UNORM_KHR
is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have four components - If a
BufferView
is accessed usingOpImageWrite
as a result of this command, then theType
of theTexel
operand of that instruction must have at least as many components as the buffer view’s format - If a
ImageView
with aFormat
that has a 64-bit component width is accessed as a result of this command, theSampledType
of theOpTypeImage
operand of that instruction must have aWidth
of 64 - If a
ImageView
with aFormat
that has a component width less than 64-bit is accessed as a result of this command, theSampledType
of theOpTypeImage
operand of that instruction must have aWidth
of 32 - If a
BufferView
with aFormat
that has a 64-bit component width is accessed as a result of this command, theSampledType
of theOpTypeImage
operand of that instruction must have aWidth
of 64 - If a
BufferView
with aFormat
that has a component width less than 64-bit is accessed as a result of this command, theSampledType
of theOpTypeImage
operand of that instruction must have aWidth
of 32 - If
the
sparseImageInt64Atomics
feature is not enabled,
Image
objects created with theIMAGE_CREATE_SPARSE_RESIDENCY_BIT
flag must not be accessed by atomic instructions through anOpTypeImage
with aSampledType
with aWidth
of 64 by this command - If
the
sparseImageInt64Atomics
feature is not enabled,
Buffer
objects created with theBUFFER_CREATE_SPARSE_RESIDENCY_BIT
flag must not be accessed by atomic instructions through anOpTypeImage
with aSampledType
with aWidth
of 64 by this command - If
OpImageWeightedSampleQCOM
is used to sample aImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM
- If
OpImageWeightedSampleQCOM
uses aImageView
as a sample weight image as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM
- If
OpImageBoxFilterQCOM
is used to sample aImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM
- If
OpImageBlockMatchSSDQCOM
is used to read from anImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If
OpImageBlockMatchSADQCOM
is used to read from anImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If
OpImageBlockMatchSADQCOM
or OpImageBlockMatchSSDQCOM is used to read from a reference image as result of this command, then the specified reference coordinates must not fail integer texel coordinate validation - If
OpImageWeightedSampleQCOM
,OpImageBoxFilterQCOM
,OpImageBlockMatchWindowSSDQCOM
,OpImageBlockMatchWindowSADQCOM
,OpImageBlockMatchGatherSSDQCOM
,OpImageBlockMatchGatherSADQCOM
,OpImageBlockMatchSSDQCOM
, orOpImageBlockMatchSADQCOM
uses aSampler
as a result of this command, then the sampler must have been created withSAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM
- If
any command other than
OpImageWeightedSampleQCOM
,OpImageBoxFilterQCOM
,OpImageBlockMatchWindowSSDQCOM
,OpImageBlockMatchWindowSADQCOM
,OpImageBlockMatchGatherSSDQCOM
,OpImageBlockMatchGatherSADQCOM
,OpImageBlockMatchSSDQCOM
, orOpImageBlockMatchSADQCOM
uses aSampler
as a result of this command, then the sampler must not have been created withSAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM
- If a
OpImageBlockMatchWindow*QCOM
orOpImageBlockMatchGather*QCOM
instruction is used to read from anImageView
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM
- If a
OpImageBlockMatchWindow*QCOM
orOpImageBlockMatchGather*QCOM
instruction is used to read from anImageView
as a result of this command, then the image view’s format must be a single-component format. - If a
OpImageBlockMatchWindow*QCOM
orOpImageBlockMatchGather*QCOM
read from a reference image as result of this command, then the specified reference coordinates must not fail integer texel coordinate validation - Any shader invocation executed by this command must terminate
- Any shader group handle referenced by this call must have been queried from the currently bound ray tracing pipeline
-
This command must not cause a shader call instruction to be
executed from a shader invocation with a
recursion depth
greater than the value of
maxPipelineRayRecursionDepth
used to create the bound ray tracing pipeline -
commandBuffer
must not be a protected command buffer - The
size
member ofpRayGenShaderBindingTable
must be equal to itsstride
member - If
the buffer from which
pRayGenShaderBindingTable->deviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object - The
buffer from which the
pRayGenShaderBindingTable->deviceAddress
is queried must have been created with theBUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
usage flag -
pRayGenShaderBindingTable->deviceAddress
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupBaseAlignment
- If
the buffer from which
pMissShaderBindingTable->deviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object - The
buffer from which the
pMissShaderBindingTable->deviceAddress
is queried must have been created with theBUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
usage flag -
pMissShaderBindingTable->deviceAddress
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupBaseAlignment
-
pMissShaderBindingTable->stride
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupHandleAlignment
-
pMissShaderBindingTable->stride
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxShaderGroupStride
- If the
buffer from which
pHitShaderBindingTable->deviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object - The
buffer from which the
pHitShaderBindingTable->deviceAddress
is queried must have been created with theBUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
usage flag -
pHitShaderBindingTable->deviceAddress
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupBaseAlignment
-
pHitShaderBindingTable->stride
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupHandleAlignment
-
pHitShaderBindingTable->stride
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxShaderGroupStride
-
If the buffer from which
pCallableShaderBindingTable->deviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object -
The buffer from which the
pCallableShaderBindingTable->deviceAddress
is queried must have been created with theBUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR
usage flag -
pCallableShaderBindingTable->deviceAddress
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupBaseAlignment
-
pCallableShaderBindingTable->stride
must be a multiple ofPhysicalDeviceRayTracingPipelinePropertiesKHR
::shaderGroupHandleAlignment
-
pCallableShaderBindingTable->stride
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxShaderGroupStride
- If the currently bound
ray tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
,pHitShaderBindingTable->deviceAddress
must not be zero - If the currently bound
ray tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
,pHitShaderBindingTable->deviceAddress
must not be zero - If the currently bound
ray tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
, the shader group handle identified bypMissShaderBindingTable->deviceAddress
must not be set to zero - If the currently bound
ray tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
, entries in the table identified bypHitShaderBindingTable->deviceAddress
accessed as a result of this command in order to execute an any-hit shader must not be set to zero - If the currently bound
ray tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
, entries in the table identified bypHitShaderBindingTable->deviceAddress
accessed as a result of this command in order to execute a closest hit shader must not be set to zero - If the currently bound
ray tracing pipeline was created with
flags
that includedPIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
, entries in the table identified bypHitShaderBindingTable->deviceAddress
accessed as a result of this command in order to execute an intersection shader must not be set to zero - Any
non-zero hit shader group entries in the table identified by
pHitShaderBindingTable->deviceAddress
accessed by this call from a geometry with ageometryType
ofGEOMETRY_TYPE_TRIANGLES_KHR
must have been created withRAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR
- Any
non-zero hit shader group entries in the table identified by
pHitShaderBindingTable->deviceAddress
accessed by this call from a geometry with ageometryType
ofGEOMETRY_TYPE_AABBS_KHR
must have been created withRAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR
- If the
buffer from which
indirectDeviceAddress
was queried is non-sparse then it must be bound completely and contiguously to a singleDeviceMemory
object - The
buffer from which
indirectDeviceAddress
was queried must have been created with theBUFFER_USAGE_INDIRECT_BUFFER_BIT
bit set -
indirectDeviceAddress
must be a multiple of4
- All
device addresses between
indirectDeviceAddress
andindirectDeviceAddress
+sizeof
(TraceRaysIndirectCommandKHR
) - 1 must be in the buffer device address range of the same buffer - The rayTracingPipelineTraceRaysIndirect feature must be enabled
-
If the bound ray tracing pipeline was created with
PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV
PhysicalDeviceRayTracingMotionBlurFeaturesNV
::rayTracingMotionBlurPipelineTraceRaysIndirect
feature must be enabled
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
pRaygenShaderBindingTable
must be a valid pointer to a validStridedDeviceAddressRegionKHR
structure -
pMissShaderBindingTable
must be a valid pointer to a validStridedDeviceAddressRegionKHR
structure -
pHitShaderBindingTable
must be a valid pointer to a validStridedDeviceAddressRegionKHR
structure -
pCallableShaderBindingTable
must be a valid pointer to a validStridedDeviceAddressRegionKHR
structure -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support compute operations - This command must only be called outside of a render pass instance
- This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
'
Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
---|---|---|---|---|
Primary Secondary | Outside | Outside | Compute | Action |
See Also
VK_KHR_ray_tracing_pipeline,
CommandBuffer
,
DeviceAddress
,
StridedDeviceAddressRegionKHR
getRayTracingShaderGroupStackSizeKHR Source #
:: forall io. MonadIO io | |
=> Device |
|
-> Pipeline |
|
-> ("group" ::: Word32) |
|
-> ShaderGroupShaderKHR |
|
-> io DeviceSize |
vkGetRayTracingShaderGroupStackSizeKHR - Query ray tracing pipeline shader group shader stack size
Description
The return value is the ray tracing pipeline stack size in bytes for the specified shader as called from the specified shader group.
Valid Usage
- The value
of
group
must be less than the number of shader groups inpipeline
- The
shader identified by
groupShader
ingroup
must not beSHADER_UNUSED_KHR
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
pipeline
must be a validPipeline
handle -
groupShader
must be a validShaderGroupShaderKHR
value -
pipeline
must have been created, allocated, or retrieved fromdevice
See Also
VK_KHR_ray_tracing_pipeline,
Device
, Pipeline
,
ShaderGroupShaderKHR
cmdSetRayTracingPipelineStackSizeKHR Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> ("pipelineStackSize" ::: Word32) |
|
-> io () |
vkCmdSetRayTracingPipelineStackSizeKHR - Set the stack size dynamically for a ray tracing pipeline
Description
This command sets the stack size for subsequent ray tracing commands
when the ray tracing pipeline is created with
DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR
set in
PipelineDynamicStateCreateInfo
::pDynamicStates
.
Otherwise, the stack size is computed as described in
Ray Tracing Pipeline Stack.
Valid Usage
-
pipelineStackSize
must be large enough for any dynamic execution through the shaders in the ray tracing pipeline used by a subsequent trace call
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
commandBuffer
must be in the recording state -
The
CommandPool
thatcommandBuffer
was allocated from must support compute operations - This command must only be called outside of a render pass instance
- This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
'
Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
---|---|---|---|---|
Primary Secondary | Outside | Outside | Compute | State |
See Also
data RayTracingShaderGroupCreateInfoKHR Source #
VkRayTracingShaderGroupCreateInfoKHR - Structure specifying shaders in a shader group
Description
If the pipeline is created with
PIPELINE_CREATE_LIBRARY_BIT_KHR
and the
pipelineLibraryGroupHandles
feature is enabled, pShaderGroupCaptureReplayHandle
is inherited by
all pipelines which link against this pipeline and remains bitwise
identical for any pipeline which references this pipeline library.
Valid Usage
- If
type
isRAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR
thengeneralShader
must be a valid index intoRayTracingPipelineCreateInfoKHR
::pStages
referring to a shader ofSHADER_STAGE_RAYGEN_BIT_KHR
,SHADER_STAGE_MISS_BIT_KHR
, orSHADER_STAGE_CALLABLE_BIT_KHR
- If
type
isRAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR
thenclosestHitShader
,anyHitShader
, andintersectionShader
must beSHADER_UNUSED_KHR
- If
type
isRAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR
thenintersectionShader
must be a valid index intoRayTracingPipelineCreateInfoKHR
::pStages
referring to a shader ofSHADER_STAGE_INTERSECTION_BIT_KHR
- If
type
isRAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR
thenintersectionShader
must beSHADER_UNUSED_KHR
-
closestHitShader
must be eitherSHADER_UNUSED_KHR
or a valid index intoRayTracingPipelineCreateInfoKHR
::pStages
referring to a shader ofSHADER_STAGE_CLOSEST_HIT_BIT_KHR
-
anyHitShader
must be eitherSHADER_UNUSED_KHR
or a valid index intoRayTracingPipelineCreateInfoKHR
::pStages
referring to a shader ofSHADER_STAGE_ANY_HIT_BIT_KHR
-
If
PhysicalDeviceRayTracingPipelineFeaturesKHR
::rayTracingPipelineShaderGroupHandleCaptureReplayMixed
isFALSE
thenpShaderGroupCaptureReplayHandle
must not be provided if it has not been provided on a previous call to ray tracing pipeline creation -
If
PhysicalDeviceRayTracingPipelineFeaturesKHR
::rayTracingPipelineShaderGroupHandleCaptureReplayMixed
isFALSE
then the caller must guarantee that no ray tracing pipeline creation commands withpShaderGroupCaptureReplayHandle
provided execute simultaneously with ray tracing pipeline creation commands withoutpShaderGroupCaptureReplayHandle
provided
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR
-
pNext
must beNULL
-
type
must be a validRayTracingShaderGroupTypeKHR
value
See Also
VK_KHR_ray_tracing_pipeline,
RayTracingPipelineCreateInfoKHR
, RayTracingShaderGroupTypeKHR
,
StructureType
RayTracingShaderGroupCreateInfoKHR | |
|
Instances
data RayTracingPipelineCreateInfoKHR (es :: [Type]) Source #
VkRayTracingPipelineCreateInfoKHR - Structure specifying parameters of a newly created ray tracing pipeline
Description
The parameters basePipelineHandle
and basePipelineIndex
are
described in more detail in
Pipeline Derivatives.
When
PIPELINE_CREATE_LIBRARY_BIT_KHR
is specified, this pipeline defines a pipeline library which cannot
be bound as a ray tracing pipeline directly. Instead, pipeline libraries
define common shaders and shader groups which can be included in
future pipeline creation.
If pipeline libraries are included in pLibraryInfo
, shaders defined in
those libraries are treated as if they were defined as additional
entries in pStages
, appended in the order they appear in the
pLibraries
array and in the pStages
array when those libraries were
defined.
When referencing shader groups in order to obtain a shader group handle,
groups defined in those libraries are treated as if they were defined as
additional entries in pGroups
, appended in the order they appear in
the pLibraries
array and in the pGroups
array when those libraries
were defined. The shaders these groups reference are set when the
pipeline library is created, referencing those specified in the pipeline
library, not in the pipeline that includes it.
The default stack size for a pipeline if
DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR
is not provided is computed as described in
Ray Tracing Pipeline Stack.
If a
PipelineCreateFlags2CreateInfoKHR
structure is present in the pNext
chain,
PipelineCreateFlags2CreateInfoKHR
::flags
from that structure is used instead of flags
from this structure.
Valid Usage
- If
flags
contains thePIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineIndex
is -1,basePipelineHandle
must be a valid ray tracingPipeline
handle
- If
flags
contains thePIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineHandle
isNULL_HANDLE
,basePipelineIndex
must be a valid index into the calling command’spCreateInfos
parameter - If
flags
contains thePIPELINE_CREATE_DERIVATIVE_BIT
flag,basePipelineIndex
must be -1 orbasePipelineHandle
must beNULL_HANDLE
- If a push
constant block is declared in a shader, a push constant range in
layout
must match both the shader stage and range - If a
resource variables
is declared in a shader, a descriptor slot in
layout
must match the shader stage - If a
resource variables
is declared in a shader, and the descriptor type is not
DESCRIPTOR_TYPE_MUTABLE_EXT
, a descriptor slot inlayout
must match the descriptor type - If a
resource variables
is declared in a shader as an array, a descriptor slot in
layout
must match the descriptor count - The shader
code for the entry points identified by
pStages
, and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter - The number of
resources in
layout
accessible to each shader stage that is used by the pipeline must be less than or equal toPhysicalDeviceLimits
::maxPerStageResources
-
flags
must not includePIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV
-
If the
pipelineCreationCacheControl
feature is not enabled,
flags
must not includePIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT
orPIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT
- If
flags
does not includePIPELINE_CREATE_LIBRARY_BIT_KHR
, thestage
member of at least one element ofpStages
, including those implicitly added bypLibraryInfo
, must beSHADER_STAGE_RAYGEN_BIT_KHR
-
maxPipelineRayRecursionDepth
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxRayRecursionDepth
- If
flags
includesPIPELINE_CREATE_LIBRARY_BIT_KHR
,pLibraryInterface
must not beNULL
- If
pLibraryInfo
is notNULL
and itslibraryCount
member is greater than0
,pLibraryInterface
must not beNULL
- Each
element of
pLibraryInfo->pLibraries
must have been created with the value ofmaxPipelineRayRecursionDepth
equal to that in this pipeline - If
pLibraryInfo
is notNULL
, each element of itspLibraries
member must have been created with alayout
that is compatible with thelayout
in this pipeline - If
pLibraryInfo
is notNULL
, each element of itspLibraries
member must have been created with values of themaxPipelineRayPayloadSize
andmaxPipelineRayHitAttributeSize
members ofpLibraryInterface
equal to those in this pipeline - If
flags
includesPIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
bit set - If
flags
includesPIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
bit set - If
flags
includesPIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
bit set - If
flags
includesPIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
bit set - If
flags
includesPIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
bit set - If
flags
includesPIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR
bit set - If
flags
includesPIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR
bit set - If the
VK_KHR_pipeline_library
extension is not enabled,pLibraryInfo
andpLibraryInterface
must beNULL
- If
flags
includesPIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR
, for any element ofpGroups
with atype
ofRAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR
orRAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR
, theanyHitShader
of that element must not beSHADER_UNUSED_KHR
- If
flags
includesPIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR
, for any element ofpGroups
with atype
ofRAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR
orRAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR
, theclosestHitShader
of that element must not beSHADER_UNUSED_KHR
-
If the
rayTraversalPrimitiveCulling
feature is not enabled,
flags
must not includePIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
-
If the
rayTraversalPrimitiveCulling
feature is not enabled,
flags
must not includePIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
-
flags
must not include bothPIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR
andPIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR
- If
flags
includesPIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
, rayTracingPipelineShaderGroupHandleCaptureReplay must be enabled -
If
PhysicalDeviceRayTracingPipelineFeaturesKHR
::rayTracingPipelineShaderGroupHandleCaptureReplay
isTRUE
and thepShaderGroupCaptureReplayHandle
member of any element ofpGroups
is notNULL
,flags
must includePIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR
- If
pLibraryInfo
isNULL
or itslibraryCount
is0
,stageCount
must not be0
- If
flags
does not includePIPELINE_CREATE_LIBRARY_BIT_KHR
and eitherpLibraryInfo
isNULL
or itslibraryCount
is0
,groupCount
must not be0
- Any
element of the
pDynamicStates
member ofpDynamicState
must beDYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR
-
If
PipelineCreationFeedbackCreateInfo
::pipelineStageCreationFeedbackCount
is not0
, it must be equal tostageCount
- The
stage
value in allpStages
elements must be one ofSHADER_STAGE_RAYGEN_BIT_KHR
,SHADER_STAGE_ANY_HIT_BIT_KHR
,SHADER_STAGE_CLOSEST_HIT_BIT_KHR
,SHADER_STAGE_MISS_BIT_KHR
,SHADER_STAGE_INTERSECTION_BIT_KHR
, orSHADER_STAGE_CALLABLE_BIT_KHR
- If
flags
includesPIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT
bit set - If
flags
includesPIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV
, each element ofpLibraryInfo->pLibraries
must have been created with thePIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV
bit set
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofPipelineCreateFlags2CreateInfoKHR
,PipelineCreationFeedbackCreateInfo
, orPipelineRobustnessCreateInfoEXT
- The
sType
value of each struct in thepNext
chain must be unique -
flags
must be a valid combination ofPipelineCreateFlagBits
values - If
stageCount
is not0
,pStages
must be a valid pointer to an array ofstageCount
validPipelineShaderStageCreateInfo
structures - If
groupCount
is not0
,pGroups
must be a valid pointer to an array ofgroupCount
validRayTracingShaderGroupCreateInfoKHR
structures - If
pLibraryInfo
is notNULL
,pLibraryInfo
must be a valid pointer to a validPipelineLibraryCreateInfoKHR
structure -
If
pLibraryInterface
is notNULL
,pLibraryInterface
must be a valid pointer to a validRayTracingPipelineInterfaceCreateInfoKHR
structure - If
pDynamicState
is notNULL
,pDynamicState
must be a valid pointer to a validPipelineDynamicStateCreateInfo
structure -
layout
must be a validPipelineLayout
handle - Both of
basePipelineHandle
, andlayout
that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameDevice
See Also
VK_KHR_ray_tracing_pipeline,
Pipeline
,
PipelineCreateFlags
,
PipelineDynamicStateCreateInfo
,
PipelineLayout
,
PipelineLibraryCreateInfoKHR
,
PipelineShaderStageCreateInfo
,
RayTracingPipelineInterfaceCreateInfoKHR
,
RayTracingShaderGroupCreateInfoKHR
,
StructureType
,
createRayTracingPipelinesKHR
RayTracingPipelineCreateInfoKHR | |
|
Instances
data PhysicalDeviceRayTracingPipelineFeaturesKHR Source #
VkPhysicalDeviceRayTracingPipelineFeaturesKHR - Structure describing the ray tracing features that can be supported by an implementation
Members
This structure describes the following features:
Description
sType
is aStructureType
value identifying this structure.
pNext
isNULL
or a pointer to a structure extending this structure.-
rayTracingPipeline
indicates whether the implementation supports the ray tracing pipeline functionality. See Ray Tracing. -
rayTracingPipelineShaderGroupHandleCaptureReplay
indicates whether the implementation supports saving and reusing shader group handles, e.g. for trace capture and replay. -
rayTracingPipelineShaderGroupHandleCaptureReplayMixed
indicates whether the implementation supports reuse of shader group handles being arbitrarily mixed with creation of non-reused shader group handles. If this isFALSE
, all reused shader group handles must be specified before any non-reused handles may be created. -
rayTracingPipelineTraceRaysIndirect
indicates whether the implementation supports indirect ray tracing commands, e.g.cmdTraceRaysIndirectKHR
. -
rayTraversalPrimitiveCulling
indicates whether the implementation supports primitive culling during ray traversal.
If the PhysicalDeviceRayTracingPipelineFeaturesKHR
structure is
included in the pNext
chain of the
PhysicalDeviceFeatures2
structure passed to
getPhysicalDeviceFeatures2
,
it is filled in to indicate whether each corresponding feature is
supported. PhysicalDeviceRayTracingPipelineFeaturesKHR
can also be
used in the pNext
chain of DeviceCreateInfo
to
selectively enable these features.
Valid Usage
-
If
rayTracingPipelineShaderGroupHandleCaptureReplayMixed
isTRUE
,rayTracingPipelineShaderGroupHandleCaptureReplay
must also beTRUE
Valid Usage (Implicit)
See Also
Instances
data PhysicalDeviceRayTracingPipelinePropertiesKHR Source #
VkPhysicalDeviceRayTracingPipelinePropertiesKHR - Properties of the physical device for ray tracing
Description
If the PhysicalDeviceRayTracingPipelinePropertiesKHR
structure is
included in the pNext
chain of the
PhysicalDeviceProperties2
structure passed to
getPhysicalDeviceProperties2
,
it is filled in with each corresponding implementation-dependent
property.
Limits specified by this structure must match those specified with the
same name in
PhysicalDeviceRayTracingPropertiesNV
.
Valid Usage (Implicit)
See Also
PhysicalDeviceRayTracingPipelinePropertiesKHR | |
|
Instances
data StridedDeviceAddressRegionKHR Source #
VkStridedDeviceAddressRegionKHR - Structure specifying a region of device addresses with a stride
Valid Usage
- If
size
is not zero, all addresses betweendeviceAddress
anddeviceAddress
+size
- 1 must be in the buffer device address range of the same buffer
- If
size
is not zero,stride
must be less than or equal to the size of the buffer from whichdeviceAddress
was queried
See Also
VK_KHR_ray_tracing_pipeline,
DeviceAddress
,
DeviceSize
, cmdTraceRaysIndirectKHR
,
cmdTraceRaysKHR
StridedDeviceAddressRegionKHR | |
|
Instances
data TraceRaysIndirectCommandKHR Source #
VkTraceRaysIndirectCommandKHR - Structure specifying the parameters of an indirect ray tracing command
Description
The members of TraceRaysIndirectCommandKHR
have the same meaning as
the similarly named parameters of cmdTraceRaysKHR
.
Valid Usage
-
width
must be less than or equal toPhysicalDeviceLimits
::maxComputeWorkGroupCount
[0] ×PhysicalDeviceLimits
::maxComputeWorkGroupSize
[0]
-
height
must be less than or equal toPhysicalDeviceLimits
::maxComputeWorkGroupCount
[1] ×PhysicalDeviceLimits
::maxComputeWorkGroupSize
[1] -
depth
must be less than or equal toPhysicalDeviceLimits
::maxComputeWorkGroupCount
[2] ×PhysicalDeviceLimits
::maxComputeWorkGroupSize
[2] -
width
×height
×depth
must be less than or equal toPhysicalDeviceRayTracingPipelinePropertiesKHR
::maxRayDispatchInvocationCount
See Also
Instances
data RayTracingPipelineInterfaceCreateInfoKHR Source #
VkRayTracingPipelineInterfaceCreateInfoKHR - Structure specifying additional interface information when using libraries
Description
maxPipelineRayPayloadSize
is calculated as the maximum number of bytes
used by any block declared in the RayPayloadKHR
or
IncomingRayPayloadKHR
storage classes.
maxPipelineRayHitAttributeSize
is calculated as the maximum number of
bytes used by any block declared in the HitAttributeKHR
storage class.
As variables in these storage classes do not have explicit offsets, the
size should be calculated as if each variable has a
scalar alignment
equal to the largest scalar alignment of any of the block’s members.
Note
There is no explicit upper limit for maxPipelineRayPayloadSize
, but in
practice it should be kept as small as possible. Similar to invocation
local memory, it must be allocated for each shader invocation and for
devices which support many simultaneous invocations, this storage can
rapidly be exhausted, resulting in failure.
Valid Usage (Implicit)
See Also
VK_KHR_ray_tracing_pipeline,
RayTracingPipelineCreateInfoKHR
,
StructureType
RayTracingPipelineInterfaceCreateInfoKHR | |
|
Instances
newtype RayTracingShaderGroupTypeKHR Source #
VkRayTracingShaderGroupTypeKHR - Shader group types
Description
Note
For current group types, the hit group type could be inferred from the presence or absence of the intersection shader, but we provide the type explicitly for future hit groups that do not have that property.
See Also
VK_KHR_ray_tracing_pipeline,
VK_NV_ray_tracing,
RayTracingShaderGroupCreateInfoKHR
,
RayTracingShaderGroupCreateInfoNV
pattern RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR :: RayTracingShaderGroupTypeKHR |
|
pattern RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR :: RayTracingShaderGroupTypeKHR |
|
pattern RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR :: RayTracingShaderGroupTypeKHR |
|
Instances
newtype ShaderGroupShaderKHR Source #
VkShaderGroupShaderKHR - Shader group shaders
See Also
VK_KHR_ray_tracing_pipeline,
getRayTracingShaderGroupStackSizeKHR
pattern SHADER_GROUP_SHADER_GENERAL_KHR :: ShaderGroupShaderKHR |
|
pattern SHADER_GROUP_SHADER_CLOSEST_HIT_KHR :: ShaderGroupShaderKHR |
|
pattern SHADER_GROUP_SHADER_ANY_HIT_KHR :: ShaderGroupShaderKHR |
|
pattern SHADER_GROUP_SHADER_INTERSECTION_KHR :: ShaderGroupShaderKHR |
|
Instances
type KHR_RAY_TRACING_PIPELINE_SPEC_VERSION = 1 Source #
pattern KHR_RAY_TRACING_PIPELINE_SPEC_VERSION :: forall a. Integral a => a Source #
type KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME = "VK_KHR_ray_tracing_pipeline" Source #
pattern KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #
newtype DeferredOperationKHR Source #
VkDeferredOperationKHR - A deferred operation
Description
This handle refers to a tracking structure which manages the execution state for a deferred command.
See Also
VK_KHR_deferred_host_operations,
buildAccelerationStructuresKHR
,
buildMicromapsEXT
,
copyAccelerationStructureKHR
,
copyAccelerationStructureToMemoryKHR
,
copyMemoryToAccelerationStructureKHR
,
copyMemoryToMicromapEXT
,
copyMicromapEXT
,
copyMicromapToMemoryEXT
,
createDeferredOperationKHR
,
createRayTracingPipelinesKHR
,
deferredOperationJoinKHR
,
destroyDeferredOperationKHR
,
getDeferredOperationMaxConcurrencyKHR
,
getDeferredOperationResultKHR
Instances
data PipelineLibraryCreateInfoKHR Source #
VkPipelineLibraryCreateInfoKHR - Structure specifying pipeline libraries to use when creating a pipeline
Valid Usage
- Each element
of
pLibraries
must have been created withPIPELINE_CREATE_LIBRARY_BIT_KHR
- If any
library in
pLibraries
was created with a shader stage withPipelineShaderStageModuleIdentifierCreateInfoEXT
andidentifierSize
not equal to 0, the pipeline must be created with thePIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT
flag set - If any
element of
pLibraries
was created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
, all elements must have been created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
- If
pipeline
is being created withPIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT
, every element ofpLibraries
must have been created withPIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT
- If
pipeline
is being created withoutPIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT
, every element ofpLibraries
must have been created withoutPIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT
- If
pipeline
is being created withPIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
, every element ofpLibraries
must have been created withPIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
- If
pipeline
is being created withoutPIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
, every element ofpLibraries
must have been created withoutPIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR
- If
libraryCount
is not0
,pLibraries
must be a valid pointer to an array oflibraryCount
validPipeline
handles
See Also
VK_KHR_pipeline_library,
ExecutionGraphPipelineCreateInfoAMDX
,
Pipeline
,
RayTracingPipelineCreateInfoKHR
,
StructureType
Instances
type SHADER_UNUSED_KHR = 4294967295 Source #
pattern SHADER_UNUSED_KHR :: Word32 Source #
VK_SHADER_UNUSED_KHR - Sentinel for an unused shader index