org.lwjgl.vulkan.KHRRayTracingPipeline Maven / Gradle / Ivy
Show all versions of lwjgl-vulkan Show documentation
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* 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:
*
*
* - {@code SPV_KHR_ray_tracing}
*
*
* 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);
* }
*
* VK_KHR_ray_tracing_pipeline
*
*
* - Name String
* - {@code VK_KHR_ray_tracing_pipeline}
* - Extension Type
* - Device extension
* - Registered Extension Number
* - 348
* - Revision
* - 1
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.1
* - Requires {@link KHRSpirv14 VK_KHR_spirv_1_4}
* - Requires {@link KHRAccelerationStructure VK_KHR_acceleration_structure}
*
* - Contact
*
* - Daniel Koch dgkoch
*
*
*
* Other Extension Metadata
*
*
* - Last Modified Date
* - 2020-11-12
* - Interactions and External Dependencies
*
* - This extension requires {@code SPV_KHR_ray_tracing}
* - This extension provides API support for {@code GLSL_EXT_ray_tracing}
* - This extension interacts with Vulkan 1.2 and {@link KHRVulkanMemoryModel 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 {@code ShaderCallKHR} scope.
* - This extension interacts with {@link KHRPipelineLibrary VK_KHR_pipeline_library}, enabling pipeline libraries to be used with ray tracing pipelines and enabling usage of {@link VkRayTracingPipelineInterfaceCreateInfoKHR}.
*
* - 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
*
*
*/
public class KHRRayTracingPipeline {
/** The extension specification version. */
public static final int VK_KHR_RAY_TRACING_PIPELINE_SPEC_VERSION = 1;
/** The extension name. */
public static final String VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME = "VK_KHR_ray_tracing_pipeline";
/** VK_SHADER_UNUSED_KHR */
public static final int VK_SHADER_UNUSED_KHR = (~0);
/**
* Extends {@code VkStructureType}.
*
* Enum values:
*
*
* - {@link #VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR}
* - {@link #VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR}
* - {@link #VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR}
*
*/
public static final int
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR = 1000347000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR = 1000347001,
VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR = 1000150015,
VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR = 1000150016,
VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR = 1000150018;
/**
* Extends {@code VkShaderStageFlagBits}.
*
* Enum values:
*
*
* - {@link #VK_SHADER_STAGE_RAYGEN_BIT_KHR SHADER_STAGE_RAYGEN_BIT_KHR}
* - {@link #VK_SHADER_STAGE_ANY_HIT_BIT_KHR SHADER_STAGE_ANY_HIT_BIT_KHR}
* - {@link #VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR SHADER_STAGE_CLOSEST_HIT_BIT_KHR}
* - {@link #VK_SHADER_STAGE_MISS_BIT_KHR SHADER_STAGE_MISS_BIT_KHR}
* - {@link #VK_SHADER_STAGE_INTERSECTION_BIT_KHR SHADER_STAGE_INTERSECTION_BIT_KHR}
* - {@link #VK_SHADER_STAGE_CALLABLE_BIT_KHR SHADER_STAGE_CALLABLE_BIT_KHR}
*
*/
public static final int
VK_SHADER_STAGE_RAYGEN_BIT_KHR = 0x100,
VK_SHADER_STAGE_ANY_HIT_BIT_KHR = 0x200,
VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR = 0x400,
VK_SHADER_STAGE_MISS_BIT_KHR = 0x800,
VK_SHADER_STAGE_INTERSECTION_BIT_KHR = 0x1000,
VK_SHADER_STAGE_CALLABLE_BIT_KHR = 0x2000;
/** Extends {@code VkPipelineStageFlagBits}. */
public static final int VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR = 0x200000;
/** Extends {@code VkBufferUsageFlagBits}. */
public static final int VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR = 0x400;
/** Extends {@code VkPipelineBindPoint}. */
public static final int VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR = 1000165000;
/**
* Extends {@code VkPipelineCreateFlagBits}.
*
* Enum values:
*
*
* - {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR}
* - {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR}
* - {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR}
* - {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR}
* - {@link #VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR}
* - {@link #VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR}
* - {@link #VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR}
*
*/
public static final int
VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 0x4000,
VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 0x8000,
VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 0x10000,
VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR = 0x20000,
VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR = 0x1000,
VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR = 0x2000,
VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR = 0x80000;
/** Extends {@code VkDynamicState}. */
public static final int VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR = 1000347000;
/**
* VkRayTracingShaderGroupTypeKHR - Shader group types
*
* Description
*
*
* - {@link #VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR} indicates a shader group with a single {@link #VK_SHADER_STAGE_RAYGEN_BIT_KHR SHADER_STAGE_RAYGEN_BIT_KHR}, {@link #VK_SHADER_STAGE_MISS_BIT_KHR SHADER_STAGE_MISS_BIT_KHR}, or {@link #VK_SHADER_STAGE_CALLABLE_BIT_KHR SHADER_STAGE_CALLABLE_BIT_KHR} shader in it.
* - {@link #VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR} specifies a shader group that only hits triangles and must not contain an intersection shader, only closest hit and any-hit shaders.
* - {@link #VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR} specifies a shader group that only intersects with custom geometry and must contain an intersection shader and may contain closest hit and any-hit shaders.
*
*
* 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
*
* {@link VkRayTracingShaderGroupCreateInfoKHR}, {@link VkRayTracingShaderGroupCreateInfoNV}
*/
public static final int
VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR = 0,
VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR = 1,
VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR = 2;
/**
* VkShaderGroupShaderKHR - Shader group shaders
*
* Description
*
*
* - {@link #VK_SHADER_GROUP_SHADER_GENERAL_KHR SHADER_GROUP_SHADER_GENERAL_KHR} uses the shader specified in the group with {@link VkRayTracingShaderGroupCreateInfoKHR}{@code ::generalShader}
* - {@link #VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR SHADER_GROUP_SHADER_CLOSEST_HIT_KHR} uses the shader specified in the group with {@link VkRayTracingShaderGroupCreateInfoKHR}{@code ::closestHitShader}
* - {@link #VK_SHADER_GROUP_SHADER_ANY_HIT_KHR SHADER_GROUP_SHADER_ANY_HIT_KHR} uses the shader specified in the group with {@link VkRayTracingShaderGroupCreateInfoKHR}{@code ::anyHitShader}
* - {@link #VK_SHADER_GROUP_SHADER_INTERSECTION_KHR SHADER_GROUP_SHADER_INTERSECTION_KHR} uses the shader specified in the group with {@link VkRayTracingShaderGroupCreateInfoKHR}{@code ::intersectionShader}
*
*
* See Also
*
* {@link #vkGetRayTracingShaderGroupStackSizeKHR GetRayTracingShaderGroupStackSizeKHR}
*/
public static final int
VK_SHADER_GROUP_SHADER_GENERAL_KHR = 0,
VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR = 1,
VK_SHADER_GROUP_SHADER_ANY_HIT_KHR = 2,
VK_SHADER_GROUP_SHADER_INTERSECTION_KHR = 3;
protected KHRRayTracingPipeline() {
throw new UnsupportedOperationException();
}
// --- [ vkCmdTraceRaysKHR ] ---
/** Unsafe version of: {@link #vkCmdTraceRaysKHR CmdTraceRaysKHR} */
public static void nvkCmdTraceRaysKHR(VkCommandBuffer commandBuffer, long pRaygenShaderBindingTable, long pMissShaderBindingTable, long pHitShaderBindingTable, long pCallableShaderBindingTable, int width, int height, int depth) {
long __functionAddress = commandBuffer.getCapabilities().vkCmdTraceRaysKHR;
if (CHECKS) {
check(__functionAddress);
}
callPPPPPV(commandBuffer.address(), pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable, pCallableShaderBindingTable, width, height, depth, __functionAddress);
}
/**
* Initialize a ray tracing dispatch.
*
* C Specification
*
* To dispatch ray tracing use:
*
*
* void vkCmdTraceRaysKHR(
* VkCommandBuffer commandBuffer,
* const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
* const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
* const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
* const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable,
* uint32_t width,
* uint32_t height,
* uint32_t depth);
*
* Description
*
* When the command is executed, a ray generation group of width × height × depth
rays is assembled.
*
* Valid Usage
*
*
* - If a {@code VkSampler} created with {@code magFilter} or {@code minFilter} equal to {@link VK10#VK_FILTER_LINEAR FILTER_LINEAR} and {@code compareEnable} equal to {@link VK10#VK_FALSE FALSE} is used to sample a {@code VkImageView} as a result of this command, then the image view’s format features must contain {@link VK10#VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT}
* - If a {@code VkSampler} created with {@code mipmapMode} equal to {@link VK10#VK_SAMPLER_MIPMAP_MODE_LINEAR SAMPLER_MIPMAP_MODE_LINEAR} and {@code compareEnable} equal to {@link VK10#VK_FALSE FALSE} is used to sample a {@code VkImageView} as a result of this command, then the image view’s format features must contain {@link VK10#VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT}
* - If a {@code VkImageView} is accessed using atomic operations as a result of this command, then the image view’s format features must contain {@link VK10#VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT}
* - If a {@code VkImageView} is sampled with {@link EXTFilterCubic#VK_FILTER_CUBIC_EXT FILTER_CUBIC_EXT} as a result of this command, then the image view’s format features must contain {@link EXTFilterCubic#VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT}
* - Any {@code VkImageView} being sampled with {@link EXTFilterCubic#VK_FILTER_CUBIC_EXT FILTER_CUBIC_EXT} as a result of this command must have a {@code VkImageViewType} and format that supports cubic filtering, as specified by {@link VkFilterCubicImageViewImageFormatPropertiesEXT}{@code ::filterCubic} returned by {@code vkGetPhysicalDeviceImageFormatProperties2}
* - Any {@code VkImageView} being sampled with {@link EXTFilterCubic#VK_FILTER_CUBIC_EXT FILTER_CUBIC_EXT} with a reduction mode of either {@link VK12#VK_SAMPLER_REDUCTION_MODE_MIN SAMPLER_REDUCTION_MODE_MIN} or {@link VK12#VK_SAMPLER_REDUCTION_MODE_MAX SAMPLER_REDUCTION_MODE_MAX} as a result of this command must have a {@code VkImageViewType} and format that supports cubic filtering together with minmax filtering, as specified by {@link VkFilterCubicImageViewImageFormatPropertiesEXT}{@code ::filterCubicMinmax} returned by {@code vkGetPhysicalDeviceImageFormatProperties2}
* - Any {@code VkImage} created with a {@link VkImageCreateInfo}{@code ::flags} containing {@link NVCornerSampledImage#VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV IMAGE_CREATE_CORNER_SAMPLED_BIT_NV} sampled as a result of this command must only be sampled using a {@code VkSamplerAddressMode} of {@link VK10#VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE}
* - Any {@code VkImageView} or {@code VkBufferView} being written as a storage image or storage texel buffer where the image format field of the {@code OpTypeImage} is {@code Unknown} must have image format features that support {@link KHRFormatFeatureFlags2#VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR}
* - Any {@code VkImageView} or {@code VkBufferView} being read as a storage image or storage texel buffer where the image format field of the {@code OpTypeImage} is {@code Unknown} must have image format features that support {@link KHRFormatFeatureFlags2#VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR}
* - For each set n that is statically used by the {@code VkPipeline} bound to the pipeline bind point used by this command, a descriptor set must have been bound to n at the same pipeline bind point, with a {@code VkPipelineLayout} that is compatible for set n, with the {@code VkPipelineLayout} used to create the current {@code VkPipeline}, as described in Pipeline Layout Compatibility
* - If the {@code maintenance4} feature is not enabled, then for each push constant that is statically used by the {@code VkPipeline} bound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with a {@code VkPipelineLayout} that is compatible for push constants, with the {@code VkPipelineLayout} used to create the current {@code VkPipeline}, as described in Pipeline Layout Compatibility
* - Descriptors in each bound descriptor set, specified via {@code vkCmdBindDescriptorSets}, must be valid if they are statically used by the {@code VkPipeline} bound to the pipeline bind point used by this command
* - A valid pipeline must be bound to the pipeline bind point used by this command
* - If the {@code VkPipeline} object bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set or inherited (if the {@link NVInheritedViewportScissor VK_NV_inherited_viewport_scissor} extension is enabled) for {@code commandBuffer}, and done so after any previously bound pipeline with the corresponding state not specified as dynamic
* - There must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the {@code VkPipeline} object bound to the pipeline bind point used by this command, since that pipeline was bound
* - If the {@code VkPipeline} object bound to the pipeline bind point used by this command accesses a {@code VkSampler} object that uses unnormalized coordinates, that sampler must not be used to sample from any {@code VkImage} with a {@code VkImageView} of the type {@link VK10#VK_IMAGE_VIEW_TYPE_3D IMAGE_VIEW_TYPE_3D}, {@link VK10#VK_IMAGE_VIEW_TYPE_CUBE IMAGE_VIEW_TYPE_CUBE}, {@link VK10#VK_IMAGE_VIEW_TYPE_1D_ARRAY IMAGE_VIEW_TYPE_1D_ARRAY}, {@link VK10#VK_IMAGE_VIEW_TYPE_2D_ARRAY IMAGE_VIEW_TYPE_2D_ARRAY} or {@link VK10#VK_IMAGE_VIEW_TYPE_CUBE_ARRAY IMAGE_VIEW_TYPE_CUBE_ARRAY}, in any shader stage
* - If the {@code VkPipeline} object bound to the pipeline bind point used by this command accesses a {@code VkSampler} object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V {@code OpImageSample*} or {@code OpImageSparseSample*} instructions with {@code ImplicitLod}, {@code Dref} or {@code Proj} in their name, in any shader stage
* - If the {@code VkPipeline} object bound to the pipeline bind point used by this command accesses a {@code VkSampler} object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V {@code OpImageSample*} or {@code OpImageSparseSample*} instructions that includes a LOD bias or any offset values, in any shader stage
* - If the robust buffer access feature is not enabled, and if the {@code VkPipeline} object bound 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 the robust buffer access feature is not enabled, and if the {@code VkPipeline} object bound 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 {@code commandBuffer} is an unprotected command buffer and {@code protectedNoFault} is not supported, any resource accessed by the {@code VkPipeline} object bound to the pipeline bind point used by this command must not be a protected resource
* - If a {@code VkImageView} is accessed using {@code OpImageWrite} as a result of this command, then the {@code Type} of the {@code Texel} operand of that instruction must have at least as many components as the image view’s format
* - If a {@code VkBufferView} is accessed using {@code OpImageWrite} as a result of this command, then the {@code Type} of the {@code Texel} operand of that instruction must have at least as many components as the buffer view’s format
* - If a {@code VkImageView} with a {@code VkFormat} that has a 64-bit component width is accessed as a result of this command, the {@code SampledType} of the {@code OpTypeImage} operand of that instruction must have a {@code Width} of 64
* - If a {@code VkImageView} with a {@code VkFormat} that has a component width less than 64-bit is accessed as a result of this command, the {@code SampledType} of the {@code OpTypeImage} operand of that instruction must have a {@code Width} of 32
* - If a {@code VkBufferView} with a {@code VkFormat} that has a 64-bit component width is accessed as a result of this command, the {@code SampledType} of the {@code OpTypeImage} operand of that instruction must have a {@code Width} of 64
* - If a {@code VkBufferView} with a {@code VkFormat} that has a component width less than 64-bit is accessed as a result of this command, the {@code SampledType} of the {@code OpTypeImage} operand of that instruction must have a {@code Width} of 32
* - If the {@code sparseImageInt64Atomics} feature is not enabled, {@code VkImage} objects created with the {@link VK10#VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT IMAGE_CREATE_SPARSE_RESIDENCY_BIT} flag must not be accessed by atomic instructions through an {@code OpTypeImage} with a {@code SampledType} with a {@code Width} of 64 by this command
* - If the {@code sparseImageInt64Atomics} feature is not enabled, {@code VkBuffer} objects created with the {@link VK10#VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT BUFFER_CREATE_SPARSE_RESIDENCY_BIT} flag must not be accessed by atomic instructions through an {@code OpTypeImage} with a {@code SampledType} with a {@code Width} of 64 by this command
* - 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 {@code maxPipelineRayRecursionDepth} used to create the bound ray tracing pipeline
* - If the buffer from which {@code pRayGenShaderBindingTable→deviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which the {@code pRayGenShaderBindingTable→deviceAddress} is queried must have been created with the {@link #VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR} usage flag
* - {@code pRayGenShaderBindingTable→deviceAddress} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupBaseAlignment}
* - The {@code size} member of {@code pRayGenShaderBindingTable} must be equal to its {@code stride} member
* - If the buffer from which {@code pMissShaderBindingTable→deviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which the {@code pMissShaderBindingTable→deviceAddress} is queried must have been created with the {@link #VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR} usage flag
* - {@code pMissShaderBindingTable→deviceAddress} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupBaseAlignment}
* - The {@code stride} member of {@code pMissShaderBindingTable} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupHandleAlignment}
* - The {@code stride} member of {@code pMissShaderBindingTable} must be less than or equal to {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::maxShaderGroupStride}
* - If the buffer from which {@code pHitShaderBindingTable→deviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which the {@code pHitShaderBindingTable→deviceAddress} is queried must have been created with the {@link #VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR} usage flag
* - {@code pHitShaderBindingTable→deviceAddress} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupBaseAlignment}
* - The {@code stride} member of {@code pHitShaderBindingTable} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupHandleAlignment}
* - The {@code stride} member of {@code pHitShaderBindingTable} must be less than or equal to {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::maxShaderGroupStride}
* - If the buffer from which {@code pCallableShaderBindingTable→deviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which the {@code pCallableShaderBindingTable→deviceAddress} is queried must have been created with the {@link #VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR} usage flag
* - {@code pCallableShaderBindingTable→deviceAddress} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupBaseAlignment}
* - The {@code stride} member of {@code pCallableShaderBindingTable} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupHandleAlignment}
* - The {@code stride} member of {@code pCallableShaderBindingTable} must be less than or equal to {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::maxShaderGroupStride}
* - If the currently bound ray tracing pipeline was created with {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR}, the {@code deviceAddress} member of {@code pHitShaderBindingTable} must not be zero
* - If the currently bound ray tracing pipeline was created with {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR}, the {@code deviceAddress} member of {@code pHitShaderBindingTable} must not be zero
* - If the currently bound ray tracing pipeline was created with {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR}, the shader group handle identified by {@code pMissShaderBindingTable} must not be set to zero
* - If the currently bound ray tracing pipeline was created with {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR}, entries in {@code pHitShaderBindingTable} 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 {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR}, entries in {@code pHitShaderBindingTable} 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 {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR}, entries in {@code pHitShaderBindingTable} 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 {@code pHitShaderBindingTable} accessed by this call from a geometry with a {@code geometryType} of {@link KHRAccelerationStructure#VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR} must have been created with {@link #VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR}
* - Any non-zero hit shader group entries in {@code pHitShaderBindingTable} accessed by this call from a geometry with a {@code geometryType} of {@link KHRAccelerationStructure#VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR} must have been created with {@link #VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR}
*
*
*
* - {@code commandBuffer} must not be a protected command buffer
* - {@code width} must be less than or equal to
{@link VkPhysicalDeviceLimits}::maxComputeWorkGroupCount[0] × {@link VkPhysicalDeviceLimits}::maxComputeWorkGroupSize[0]
* - {@code height} must be less than or equal to
{@link VkPhysicalDeviceLimits}::maxComputeWorkGroupCount[1] × {@link VkPhysicalDeviceLimits}::maxComputeWorkGroupSize[1]
* - {@code depth} must be less than or equal to
{@link VkPhysicalDeviceLimits}::maxComputeWorkGroupCount[2] × {@link VkPhysicalDeviceLimits}::maxComputeWorkGroupSize[2]
* width × height × depth
must be less than or equal to {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::maxRayDispatchInvocationCount}
*
*
* Valid Usage (Implicit)
*
*
* - {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
* - {@code pRaygenShaderBindingTable} must be a valid pointer to a valid {@link VkStridedDeviceAddressRegionKHR} structure
* - {@code pMissShaderBindingTable} must be a valid pointer to a valid {@link VkStridedDeviceAddressRegionKHR} structure
* - {@code pHitShaderBindingTable} must be a valid pointer to a valid {@link VkStridedDeviceAddressRegionKHR} structure
* - {@code pCallableShaderBindingTable} must be a valid pointer to a valid {@link VkStridedDeviceAddressRegionKHR} structure
* - {@code commandBuffer} must be in the recording state
* - The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
* - This command must only be called outside of a render pass instance
*
*
* Host Synchronization
*
*
* - Host access to {@code commandBuffer} must be externally synchronized
* - Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
*
*
* Command Properties
*
*
* Command Buffer Levels Render Pass Scope Supported Queue Types
* Primary Secondary Outside Compute
*
*
* See Also
*
* {@link VkStridedDeviceAddressRegionKHR}
*
* @param commandBuffer the command buffer into which the command will be recorded.
* @param pRaygenShaderBindingTable a {@link VkStridedDeviceAddressRegionKHR} that holds the shader binding table data for the ray generation shader stage.
* @param pMissShaderBindingTable a {@link VkStridedDeviceAddressRegionKHR} that holds the shader binding table data for the miss shader stage.
* @param pHitShaderBindingTable a {@link VkStridedDeviceAddressRegionKHR} that holds the shader binding table data for the hit shader stage.
* @param pCallableShaderBindingTable a {@link VkStridedDeviceAddressRegionKHR} that holds the shader binding table data for the callable shader stage.
* @param width the width of the ray trace query dimensions.
* @param height height of the ray trace query dimensions.
* @param depth depth of the ray trace query dimensions.
*/
public static void vkCmdTraceRaysKHR(VkCommandBuffer commandBuffer, @NativeType("VkStridedDeviceAddressRegionKHR const *") VkStridedDeviceAddressRegionKHR pRaygenShaderBindingTable, @NativeType("VkStridedDeviceAddressRegionKHR const *") VkStridedDeviceAddressRegionKHR pMissShaderBindingTable, @NativeType("VkStridedDeviceAddressRegionKHR const *") VkStridedDeviceAddressRegionKHR pHitShaderBindingTable, @NativeType("VkStridedDeviceAddressRegionKHR const *") VkStridedDeviceAddressRegionKHR pCallableShaderBindingTable, @NativeType("uint32_t") int width, @NativeType("uint32_t") int height, @NativeType("uint32_t") int depth) {
nvkCmdTraceRaysKHR(commandBuffer, pRaygenShaderBindingTable.address(), pMissShaderBindingTable.address(), pHitShaderBindingTable.address(), pCallableShaderBindingTable.address(), width, height, depth);
}
// --- [ vkCreateRayTracingPipelinesKHR ] ---
/**
* Unsafe version of: {@link #vkCreateRayTracingPipelinesKHR CreateRayTracingPipelinesKHR}
*
* @param createInfoCount the length of the {@code pCreateInfos} and {@code pPipelines} arrays.
*/
public static int nvkCreateRayTracingPipelinesKHR(VkDevice device, long deferredOperation, long pipelineCache, int createInfoCount, long pCreateInfos, long pAllocator, long pPipelines) {
long __functionAddress = device.getCapabilities().vkCreateRayTracingPipelinesKHR;
if (CHECKS) {
check(__functionAddress);
Struct.validate(pCreateInfos, createInfoCount, VkRayTracingPipelineCreateInfoKHR.SIZEOF, VkRayTracingPipelineCreateInfoKHR::validate);
if (pAllocator != NULL) { VkAllocationCallbacks.validate(pAllocator); }
}
return callPJJPPPI(device.address(), deferredOperation, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, __functionAddress);
}
/**
* Creates a new ray tracing pipeline object.
*
* C Specification
*
* To create ray tracing pipelines, call:
*
*
* VkResult vkCreateRayTracingPipelinesKHR(
* VkDevice device,
* VkDeferredOperationKHR deferredOperation,
* VkPipelineCache pipelineCache,
* uint32_t createInfoCount,
* const VkRayTracingPipelineCreateInfoKHR* pCreateInfos,
* const VkAllocationCallbacks* pAllocator,
* VkPipeline* pPipelines);
*
* Description
*
* The {@link VK12#VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS} error is returned if the implementation is unable to re-use the shader group handles provided in {@link VkRayTracingShaderGroupCreateInfoKHR}{@code ::pShaderGroupCaptureReplayHandle} when {@link VkPhysicalDeviceRayTracingPipelineFeaturesKHR}{@code ::rayTracingPipelineShaderGroupHandleCaptureReplay} is enabled.
*
* Valid Usage
*
*
* - If the {@code flags} member of any element of {@code pCreateInfos} contains the {@link VK10#VK_PIPELINE_CREATE_DERIVATIVE_BIT PIPELINE_CREATE_DERIVATIVE_BIT} flag, and the {@code basePipelineIndex} member of that same element is not {@code -1}, {@code basePipelineIndex} must be less than the index into {@code pCreateInfos} that corresponds to that element
* - If the {@code flags} member of any element of {@code pCreateInfos} contains the {@link VK10#VK_PIPELINE_CREATE_DERIVATIVE_BIT PIPELINE_CREATE_DERIVATIVE_BIT} flag, the base pipeline must have been created with the {@link VK10#VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT} flag set
* - {@code flags} must not contain the {@link VK11#VK_PIPELINE_CREATE_DISPATCH_BASE PIPELINE_CREATE_DISPATCH_BASE} flag
* - If {@code pipelineCache} was created with {@link EXTPipelineCreationCacheControl#VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT}, host access to {@code pipelineCache} must be externally synchronized
*
*
*
* - If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, it must be a valid {@code VkDeferredOperationKHR} object
* - Any previous deferred operation that was associated with {@code deferredOperation} must be complete
* - The {@code rayTracingPipeline} feature must be enabled
* - If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, the {@code flags} member of elements of {@code pCreateInfos} must not include {@link EXTPipelineCreationCacheControl#VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT}
*
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - If {@code deferredOperation} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, {@code deferredOperation} must be a valid {@code VkDeferredOperationKHR} handle
* - If {@code pipelineCache} is not {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, {@code pipelineCache} must be a valid {@code VkPipelineCache} handle
* - {@code pCreateInfos} must be a valid pointer to an array of {@code createInfoCount} valid {@link VkRayTracingPipelineCreateInfoKHR} structures
* - If {@code pAllocator} is not {@code NULL}, {@code pAllocator} must be a valid pointer to a valid {@link VkAllocationCallbacks} structure
* - {@code pPipelines} must be a valid pointer to an array of {@code createInfoCount} {@code VkPipeline} handles
* - {@code createInfoCount} must be greater than 0
* - If {@code deferredOperation} is a valid handle, it must have been created, allocated, or retrieved from {@code device}
* - If {@code pipelineCache} is a valid handle, it must have been created, allocated, or retrieved from {@code device}
*
*
* Return Codes
*
*
* - On success, this command returns
*
* - {@link VK10#VK_SUCCESS SUCCESS}
* - {@link KHRDeferredHostOperations#VK_OPERATION_DEFERRED_KHR OPERATION_DEFERRED_KHR}
* - {@link KHRDeferredHostOperations#VK_OPERATION_NOT_DEFERRED_KHR OPERATION_NOT_DEFERRED_KHR}
* - {@link EXTPipelineCreationCacheControl#VK_PIPELINE_COMPILE_REQUIRED_EXT PIPELINE_COMPILE_REQUIRED_EXT}
*
* - On failure, this command returns
*
* - {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
* - {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
* - {@link VK12#VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS}
*
*
*
* See Also
*
* {@link VkAllocationCallbacks}, {@link VkRayTracingPipelineCreateInfoKHR}
*
* @param device the logical device that creates the ray tracing pipelines.
* @param deferredOperation {@link VK10#VK_NULL_HANDLE NULL_HANDLE} or the handle of a valid {@code VkDeferredOperationKHR} request deferral object for this command.
* @param pipelineCache either {@link VK10#VK_NULL_HANDLE NULL_HANDLE}, indicating that pipeline caching is disabled, or the handle of a valid pipeline cache object, in which case use of that cache is enabled for the duration of the command.
* @param pCreateInfos a pointer to an array of {@link VkRayTracingPipelineCreateInfoKHR} structures.
* @param pAllocator controls host memory allocation as described in the Memory Allocation chapter.
* @param pPipelines a pointer to an array in which the resulting ray tracing pipeline objects are returned.
*/
@NativeType("VkResult")
public static int vkCreateRayTracingPipelinesKHR(VkDevice device, @NativeType("VkDeferredOperationKHR") long deferredOperation, @NativeType("VkPipelineCache") long pipelineCache, @NativeType("VkRayTracingPipelineCreateInfoKHR const *") VkRayTracingPipelineCreateInfoKHR.Buffer pCreateInfos, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator, @NativeType("VkPipeline *") LongBuffer pPipelines) {
if (CHECKS) {
check(pPipelines, pCreateInfos.remaining());
}
return nvkCreateRayTracingPipelinesKHR(device, deferredOperation, pipelineCache, pCreateInfos.remaining(), pCreateInfos.address(), memAddressSafe(pAllocator), memAddress(pPipelines));
}
// --- [ vkGetRayTracingShaderGroupHandlesKHR ] ---
/**
* Unsafe version of: {@link #vkGetRayTracingShaderGroupHandlesKHR GetRayTracingShaderGroupHandlesKHR}
*
* @param dataSize the size in bytes of the buffer pointed to by {@code pData}.
*/
public static int nvkGetRayTracingShaderGroupHandlesKHR(VkDevice device, long pipeline, int firstGroup, int groupCount, long dataSize, long pData) {
long __functionAddress = device.getCapabilities().vkGetRayTracingShaderGroupHandlesKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPJPPI(device.address(), pipeline, firstGroup, groupCount, dataSize, pData, __functionAddress);
}
/**
* Query ray tracing pipeline shader group handles.
*
* C Specification
*
* To query the opaque handles of shaders in the ray tracing pipeline, call:
*
*
* VkResult vkGetRayTracingShaderGroupHandlesKHR(
* VkDevice device,
* VkPipeline pipeline,
* uint32_t firstGroup,
* uint32_t groupCount,
* size_t dataSize,
* void* pData);
*
* or the equivalent command
*
*
* VkResult vkGetRayTracingShaderGroupHandlesNV(
* VkDevice device,
* VkPipeline pipeline,
* uint32_t firstGroup,
* uint32_t groupCount,
* size_t dataSize,
* void* pData);
*
* Valid Usage
*
*
* - {@code pipeline} must be a ray tracing pipeline
* - {@code firstGroup} must be less than the number of shader groups in {@code pipeline}
* - The sum of {@code firstGroup} and {@code groupCount} must be less than or equal to the number of shader groups in {@code pipeline}
* - {@code dataSize} must be at least
{@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}::shaderGroupHandleSize × groupCount
* - {@code pipeline} must have not been created with {@link KHRPipelineLibrary#VK_PIPELINE_CREATE_LIBRARY_BIT_KHR PIPELINE_CREATE_LIBRARY_BIT_KHR}
*
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code pipeline} must be a valid {@code VkPipeline} handle
* - {@code pData} must be a valid pointer to an array of {@code dataSize} bytes
* - {@code dataSize} must be greater than 0
* - {@code pipeline} must have been created, allocated, or retrieved from {@code device}
*
*
* Return Codes
*
*
* - On success, this command returns
*
* - {@link VK10#VK_SUCCESS SUCCESS}
*
* - On failure, this command returns
*
* - {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
* - {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
*
*
*
* @param device the logical device containing the ray tracing pipeline.
* @param pipeline the ray tracing pipeline object containing the shaders.
* @param firstGroup the index of the first group to retrieve a handle for from the {@link VkRayTracingPipelineCreateInfoKHR}{@code ::pGroups} or {@link VkRayTracingPipelineCreateInfoNV}{@code ::pGroups} array.
* @param groupCount the number of shader handles to retrieve.
* @param pData a pointer to a user-allocated buffer where the results will be written.
*/
@NativeType("VkResult")
public static int vkGetRayTracingShaderGroupHandlesKHR(VkDevice device, @NativeType("VkPipeline") long pipeline, @NativeType("uint32_t") int firstGroup, @NativeType("uint32_t") int groupCount, @NativeType("void *") ByteBuffer pData) {
return nvkGetRayTracingShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount, pData.remaining(), memAddress(pData));
}
// --- [ vkGetRayTracingCaptureReplayShaderGroupHandlesKHR ] ---
/**
* Unsafe version of: {@link #vkGetRayTracingCaptureReplayShaderGroupHandlesKHR GetRayTracingCaptureReplayShaderGroupHandlesKHR}
*
* @param dataSize the size in bytes of the buffer pointed to by {@code pData}.
*/
public static int nvkGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, long pipeline, int firstGroup, int groupCount, long dataSize, long pData) {
long __functionAddress = device.getCapabilities().vkGetRayTracingCaptureReplayShaderGroupHandlesKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPJPPI(device.address(), pipeline, firstGroup, groupCount, dataSize, pData, __functionAddress);
}
/**
* Query ray tracing capture replay pipeline shader group handles.
*
* C Specification
*
* To query the optional capture handle information of shaders in the ray tracing pipeline, call:
*
*
* VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
* VkDevice device,
* VkPipeline pipeline,
* uint32_t firstGroup,
* uint32_t groupCount,
* size_t dataSize,
* void* pData);
*
* Valid Usage
*
*
* - {@code pipeline} must be a ray tracing pipeline
* - {@code firstGroup} must be less than the number of shader groups in {@code pipeline}
* - The sum of {@code firstGroup} and {@code groupCount} must be less than or equal to the number of shader groups in {@code pipeline}
* - {@code dataSize} must be at least
{@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}::shaderGroupHandleCaptureReplaySize × groupCount
* - {@link VkPhysicalDeviceRayTracingPipelineFeaturesKHR}{@code ::rayTracingPipelineShaderGroupHandleCaptureReplay} must be enabled to call this function
* - {@code pipeline} must have been created with a {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR}
*
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code pipeline} must be a valid {@code VkPipeline} handle
* - {@code pData} must be a valid pointer to an array of {@code dataSize} bytes
* - {@code dataSize} must be greater than 0
* - {@code pipeline} must have been created, allocated, or retrieved from {@code device}
*
*
* Return Codes
*
*
* - On success, this command returns
*
* - {@link VK10#VK_SUCCESS SUCCESS}
*
* - On failure, this command returns
*
* - {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
* - {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
*
*
*
* @param device the logical device containing the ray tracing pipeline.
* @param pipeline the ray tracing pipeline object containing the shaders.
* @param firstGroup the index of the first group to retrieve a handle for from the {@link VkRayTracingPipelineCreateInfoKHR}{@code ::pGroups} array.
* @param groupCount the number of shader handles to retrieve.
* @param pData a pointer to a user-allocated buffer where the results will be written.
*/
@NativeType("VkResult")
public static int vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, @NativeType("VkPipeline") long pipeline, @NativeType("uint32_t") int firstGroup, @NativeType("uint32_t") int groupCount, @NativeType("void *") ByteBuffer pData) {
return nvkGetRayTracingCaptureReplayShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount, pData.remaining(), memAddress(pData));
}
// --- [ vkCmdTraceRaysIndirectKHR ] ---
/** Unsafe version of: {@link #vkCmdTraceRaysIndirectKHR CmdTraceRaysIndirectKHR} */
public static void nvkCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, long pRaygenShaderBindingTable, long pMissShaderBindingTable, long pHitShaderBindingTable, long pCallableShaderBindingTable, long indirectDeviceAddress) {
long __functionAddress = commandBuffer.getCapabilities().vkCmdTraceRaysIndirectKHR;
if (CHECKS) {
check(__functionAddress);
}
callPPPPPJV(commandBuffer.address(), pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable, pCallableShaderBindingTable, indirectDeviceAddress, __functionAddress);
}
/**
* Initialize an indirect ray tracing dispatch.
*
* C Specification
*
* To dispatch ray tracing, with some parameters sourced on the device, use:
*
*
* void vkCmdTraceRaysIndirectKHR(
* VkCommandBuffer commandBuffer,
* const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable,
* const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable,
* const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable,
* const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable,
* VkDeviceAddress indirectDeviceAddress);
*
* Description
*
* {@code vkCmdTraceRaysIndirectKHR} behaves similarly to {@link #vkCmdTraceRaysKHR CmdTraceRaysKHR} except that the ray trace query dimensions are read by the device from {@code indirectDeviceAddress} during execution.
*
* Valid Usage
*
*
* - If a {@code VkSampler} created with {@code magFilter} or {@code minFilter} equal to {@link VK10#VK_FILTER_LINEAR FILTER_LINEAR} and {@code compareEnable} equal to {@link VK10#VK_FALSE FALSE} is used to sample a {@code VkImageView} as a result of this command, then the image view’s format features must contain {@link VK10#VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT}
* - If a {@code VkSampler} created with {@code mipmapMode} equal to {@link VK10#VK_SAMPLER_MIPMAP_MODE_LINEAR SAMPLER_MIPMAP_MODE_LINEAR} and {@code compareEnable} equal to {@link VK10#VK_FALSE FALSE} is used to sample a {@code VkImageView} as a result of this command, then the image view’s format features must contain {@link VK10#VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT}
* - If a {@code VkImageView} is accessed using atomic operations as a result of this command, then the image view’s format features must contain {@link VK10#VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT}
* - If a {@code VkImageView} is sampled with {@link EXTFilterCubic#VK_FILTER_CUBIC_EXT FILTER_CUBIC_EXT} as a result of this command, then the image view’s format features must contain {@link EXTFilterCubic#VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT}
* - Any {@code VkImageView} being sampled with {@link EXTFilterCubic#VK_FILTER_CUBIC_EXT FILTER_CUBIC_EXT} as a result of this command must have a {@code VkImageViewType} and format that supports cubic filtering, as specified by {@link VkFilterCubicImageViewImageFormatPropertiesEXT}{@code ::filterCubic} returned by {@code vkGetPhysicalDeviceImageFormatProperties2}
* - Any {@code VkImageView} being sampled with {@link EXTFilterCubic#VK_FILTER_CUBIC_EXT FILTER_CUBIC_EXT} with a reduction mode of either {@link VK12#VK_SAMPLER_REDUCTION_MODE_MIN SAMPLER_REDUCTION_MODE_MIN} or {@link VK12#VK_SAMPLER_REDUCTION_MODE_MAX SAMPLER_REDUCTION_MODE_MAX} as a result of this command must have a {@code VkImageViewType} and format that supports cubic filtering together with minmax filtering, as specified by {@link VkFilterCubicImageViewImageFormatPropertiesEXT}{@code ::filterCubicMinmax} returned by {@code vkGetPhysicalDeviceImageFormatProperties2}
* - Any {@code VkImage} created with a {@link VkImageCreateInfo}{@code ::flags} containing {@link NVCornerSampledImage#VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV IMAGE_CREATE_CORNER_SAMPLED_BIT_NV} sampled as a result of this command must only be sampled using a {@code VkSamplerAddressMode} of {@link VK10#VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE}
* - Any {@code VkImageView} or {@code VkBufferView} being written as a storage image or storage texel buffer where the image format field of the {@code OpTypeImage} is {@code Unknown} must have image format features that support {@link KHRFormatFeatureFlags2#VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR}
* - Any {@code VkImageView} or {@code VkBufferView} being read as a storage image or storage texel buffer where the image format field of the {@code OpTypeImage} is {@code Unknown} must have image format features that support {@link KHRFormatFeatureFlags2#VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR}
* - For each set n that is statically used by the {@code VkPipeline} bound to the pipeline bind point used by this command, a descriptor set must have been bound to n at the same pipeline bind point, with a {@code VkPipelineLayout} that is compatible for set n, with the {@code VkPipelineLayout} used to create the current {@code VkPipeline}, as described in Pipeline Layout Compatibility
* - If the {@code maintenance4} feature is not enabled, then for each push constant that is statically used by the {@code VkPipeline} bound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with a {@code VkPipelineLayout} that is compatible for push constants, with the {@code VkPipelineLayout} used to create the current {@code VkPipeline}, as described in Pipeline Layout Compatibility
* - Descriptors in each bound descriptor set, specified via {@code vkCmdBindDescriptorSets}, must be valid if they are statically used by the {@code VkPipeline} bound to the pipeline bind point used by this command
* - A valid pipeline must be bound to the pipeline bind point used by this command
* - If the {@code VkPipeline} object bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set or inherited (if the {@link NVInheritedViewportScissor VK_NV_inherited_viewport_scissor} extension is enabled) for {@code commandBuffer}, and done so after any previously bound pipeline with the corresponding state not specified as dynamic
* - There must not have been any calls to dynamic state setting commands for any state not specified as dynamic in the {@code VkPipeline} object bound to the pipeline bind point used by this command, since that pipeline was bound
* - If the {@code VkPipeline} object bound to the pipeline bind point used by this command accesses a {@code VkSampler} object that uses unnormalized coordinates, that sampler must not be used to sample from any {@code VkImage} with a {@code VkImageView} of the type {@link VK10#VK_IMAGE_VIEW_TYPE_3D IMAGE_VIEW_TYPE_3D}, {@link VK10#VK_IMAGE_VIEW_TYPE_CUBE IMAGE_VIEW_TYPE_CUBE}, {@link VK10#VK_IMAGE_VIEW_TYPE_1D_ARRAY IMAGE_VIEW_TYPE_1D_ARRAY}, {@link VK10#VK_IMAGE_VIEW_TYPE_2D_ARRAY IMAGE_VIEW_TYPE_2D_ARRAY} or {@link VK10#VK_IMAGE_VIEW_TYPE_CUBE_ARRAY IMAGE_VIEW_TYPE_CUBE_ARRAY}, in any shader stage
* - If the {@code VkPipeline} object bound to the pipeline bind point used by this command accesses a {@code VkSampler} object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V {@code OpImageSample*} or {@code OpImageSparseSample*} instructions with {@code ImplicitLod}, {@code Dref} or {@code Proj} in their name, in any shader stage
* - If the {@code VkPipeline} object bound to the pipeline bind point used by this command accesses a {@code VkSampler} object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V {@code OpImageSample*} or {@code OpImageSparseSample*} instructions that includes a LOD bias or any offset values, in any shader stage
* - If the robust buffer access feature is not enabled, and if the {@code VkPipeline} object bound 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 the robust buffer access feature is not enabled, and if the {@code VkPipeline} object bound 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 {@code commandBuffer} is an unprotected command buffer and {@code protectedNoFault} is not supported, any resource accessed by the {@code VkPipeline} object bound to the pipeline bind point used by this command must not be a protected resource
* - If a {@code VkImageView} is accessed using {@code OpImageWrite} as a result of this command, then the {@code Type} of the {@code Texel} operand of that instruction must have at least as many components as the image view’s format
* - If a {@code VkBufferView} is accessed using {@code OpImageWrite} as a result of this command, then the {@code Type} of the {@code Texel} operand of that instruction must have at least as many components as the buffer view’s format
* - If a {@code VkImageView} with a {@code VkFormat} that has a 64-bit component width is accessed as a result of this command, the {@code SampledType} of the {@code OpTypeImage} operand of that instruction must have a {@code Width} of 64
* - If a {@code VkImageView} with a {@code VkFormat} that has a component width less than 64-bit is accessed as a result of this command, the {@code SampledType} of the {@code OpTypeImage} operand of that instruction must have a {@code Width} of 32
* - If a {@code VkBufferView} with a {@code VkFormat} that has a 64-bit component width is accessed as a result of this command, the {@code SampledType} of the {@code OpTypeImage} operand of that instruction must have a {@code Width} of 64
* - If a {@code VkBufferView} with a {@code VkFormat} that has a component width less than 64-bit is accessed as a result of this command, the {@code SampledType} of the {@code OpTypeImage} operand of that instruction must have a {@code Width} of 32
* - If the {@code sparseImageInt64Atomics} feature is not enabled, {@code VkImage} objects created with the {@link VK10#VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT IMAGE_CREATE_SPARSE_RESIDENCY_BIT} flag must not be accessed by atomic instructions through an {@code OpTypeImage} with a {@code SampledType} with a {@code Width} of 64 by this command
* - If the {@code sparseImageInt64Atomics} feature is not enabled, {@code VkBuffer} objects created with the {@link VK10#VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT BUFFER_CREATE_SPARSE_RESIDENCY_BIT} flag must not be accessed by atomic instructions through an {@code OpTypeImage} with a {@code SampledType} with a {@code Width} of 64 by this command
* - 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 {@code maxPipelineRayRecursionDepth} used to create the bound ray tracing pipeline
* - If the buffer from which {@code pRayGenShaderBindingTable→deviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which the {@code pRayGenShaderBindingTable→deviceAddress} is queried must have been created with the {@link #VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR} usage flag
* - {@code pRayGenShaderBindingTable→deviceAddress} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupBaseAlignment}
* - The {@code size} member of {@code pRayGenShaderBindingTable} must be equal to its {@code stride} member
* - If the buffer from which {@code pMissShaderBindingTable→deviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which the {@code pMissShaderBindingTable→deviceAddress} is queried must have been created with the {@link #VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR} usage flag
* - {@code pMissShaderBindingTable→deviceAddress} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupBaseAlignment}
* - The {@code stride} member of {@code pMissShaderBindingTable} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupHandleAlignment}
* - The {@code stride} member of {@code pMissShaderBindingTable} must be less than or equal to {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::maxShaderGroupStride}
* - If the buffer from which {@code pHitShaderBindingTable→deviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which the {@code pHitShaderBindingTable→deviceAddress} is queried must have been created with the {@link #VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR} usage flag
* - {@code pHitShaderBindingTable→deviceAddress} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupBaseAlignment}
* - The {@code stride} member of {@code pHitShaderBindingTable} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupHandleAlignment}
* - The {@code stride} member of {@code pHitShaderBindingTable} must be less than or equal to {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::maxShaderGroupStride}
* - If the buffer from which {@code pCallableShaderBindingTable→deviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which the {@code pCallableShaderBindingTable→deviceAddress} is queried must have been created with the {@link #VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR} usage flag
* - {@code pCallableShaderBindingTable→deviceAddress} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupBaseAlignment}
* - The {@code stride} member of {@code pCallableShaderBindingTable} must be a multiple of {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::shaderGroupHandleAlignment}
* - The {@code stride} member of {@code pCallableShaderBindingTable} must be less than or equal to {@link VkPhysicalDeviceRayTracingPipelinePropertiesKHR}{@code ::maxShaderGroupStride}
* - If the currently bound ray tracing pipeline was created with {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR}, the {@code deviceAddress} member of {@code pHitShaderBindingTable} must not be zero
* - If the currently bound ray tracing pipeline was created with {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR}, the {@code deviceAddress} member of {@code pHitShaderBindingTable} must not be zero
* - If the currently bound ray tracing pipeline was created with {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR}, the shader group handle identified by {@code pMissShaderBindingTable} must not be set to zero
* - If the currently bound ray tracing pipeline was created with {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR}, entries in {@code pHitShaderBindingTable} 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 {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR}, entries in {@code pHitShaderBindingTable} 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 {@code flags} that included {@link #VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR}, entries in {@code pHitShaderBindingTable} 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 {@code pHitShaderBindingTable} accessed by this call from a geometry with a {@code geometryType} of {@link KHRAccelerationStructure#VK_GEOMETRY_TYPE_TRIANGLES_KHR GEOMETRY_TYPE_TRIANGLES_KHR} must have been created with {@link #VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR}
* - Any non-zero hit shader group entries in {@code pHitShaderBindingTable} accessed by this call from a geometry with a {@code geometryType} of {@link KHRAccelerationStructure#VK_GEOMETRY_TYPE_AABBS_KHR GEOMETRY_TYPE_AABBS_KHR} must have been created with {@link #VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR}
*
*
*
* - If the buffer from which {@code indirectDeviceAddress} was queried is non-sparse then it must be bound completely and contiguously to a single {@code VkDeviceMemory} object
* - The buffer from which {@code indirectDeviceAddress} was queried must have been created with the {@link VK10#VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT BUFFER_USAGE_INDIRECT_BUFFER_BIT} bit set
* - {@code indirectDeviceAddress} must be a multiple of 4
* - {@code commandBuffer} must not be a protected command buffer
* - All device addresses between {@code indirectDeviceAddress} and
indirectDeviceAddress + sizeof({@link VkTraceRaysIndirectCommandKHR}) - 1
must be in the buffer device address range of the same buffer
* - The {@link VkPhysicalDeviceRayTracingPipelineFeaturesKHR}{@code ::rayTracingPipelineTraceRaysIndirect} feature must be enabled
* - If the bound ray tracing pipeline was created with {@link NVRayTracingMotionBlur#VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV} {@link VkPhysicalDeviceRayTracingMotionBlurFeaturesNV}{@code ::rayTracingMotionBlurPipelineTraceRaysIndirect} feature must be enabled
*
*
* Valid Usage (Implicit)
*
*
* - {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
* - {@code pRaygenShaderBindingTable} must be a valid pointer to a valid {@link VkStridedDeviceAddressRegionKHR} structure
* - {@code pMissShaderBindingTable} must be a valid pointer to a valid {@link VkStridedDeviceAddressRegionKHR} structure
* - {@code pHitShaderBindingTable} must be a valid pointer to a valid {@link VkStridedDeviceAddressRegionKHR} structure
* - {@code pCallableShaderBindingTable} must be a valid pointer to a valid {@link VkStridedDeviceAddressRegionKHR} structure
* - {@code commandBuffer} must be in the recording state
* - The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
* - This command must only be called outside of a render pass instance
*
*
* Host Synchronization
*
*
* - Host access to {@code commandBuffer} must be externally synchronized
* - Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
*
*
* Command Properties
*
*
* Command Buffer Levels Render Pass Scope Supported Queue Types
* Primary Secondary Outside Compute
*
*
* See Also
*
* {@link VkStridedDeviceAddressRegionKHR}
*
* @param commandBuffer the command buffer into which the command will be recorded.
* @param pRaygenShaderBindingTable a {@link VkStridedDeviceAddressRegionKHR} that holds the shader binding table data for the ray generation shader stage.
* @param pMissShaderBindingTable a {@link VkStridedDeviceAddressRegionKHR} that holds the shader binding table data for the miss shader stage.
* @param pHitShaderBindingTable a {@link VkStridedDeviceAddressRegionKHR} that holds the shader binding table data for the hit shader stage.
* @param pCallableShaderBindingTable a {@link VkStridedDeviceAddressRegionKHR} that holds the shader binding table data for the callable shader stage.
* @param indirectDeviceAddress a buffer device address which is a pointer to a {@link VkTraceRaysIndirectCommandKHR} structure containing the trace ray parameters.
*/
public static void vkCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, @NativeType("VkStridedDeviceAddressRegionKHR const *") VkStridedDeviceAddressRegionKHR pRaygenShaderBindingTable, @NativeType("VkStridedDeviceAddressRegionKHR const *") VkStridedDeviceAddressRegionKHR pMissShaderBindingTable, @NativeType("VkStridedDeviceAddressRegionKHR const *") VkStridedDeviceAddressRegionKHR pHitShaderBindingTable, @NativeType("VkStridedDeviceAddressRegionKHR const *") VkStridedDeviceAddressRegionKHR pCallableShaderBindingTable, @NativeType("VkDeviceAddress") long indirectDeviceAddress) {
nvkCmdTraceRaysIndirectKHR(commandBuffer, pRaygenShaderBindingTable.address(), pMissShaderBindingTable.address(), pHitShaderBindingTable.address(), pCallableShaderBindingTable.address(), indirectDeviceAddress);
}
// --- [ vkGetRayTracingShaderGroupStackSizeKHR ] ---
/**
* Query ray tracing pipeline shader group shader stack size.
*
* C Specification
*
* To query the pipeline stack size of shaders in a shader group in the ray tracing pipeline, call:
*
*
* VkDeviceSize vkGetRayTracingShaderGroupStackSizeKHR(
* VkDevice device,
* VkPipeline pipeline,
* uint32_t group,
* VkShaderGroupShaderKHR groupShader);
*
* 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
*
*
* - {@code pipeline} must be a ray tracing pipeline
* - The value of {@code group} must be less than the number of shader groups in {@code pipeline}
* - The shader identified by {@code groupShader} in {@code group} must not be {@link #VK_SHADER_UNUSED_KHR SHADER_UNUSED_KHR}
*
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code pipeline} must be a valid {@code VkPipeline} handle
* - {@code groupShader} must be a valid {@code VkShaderGroupShaderKHR} value
* - {@code pipeline} must have been created, allocated, or retrieved from {@code device}
*
*
* @param device the logical device containing the ray tracing pipeline.
* @param pipeline the ray tracing pipeline object containing the shaders groups.
* @param group the index of the shader group to query.
* @param groupShader the type of shader from the group to query.
*/
@NativeType("VkDeviceSize")
public static long vkGetRayTracingShaderGroupStackSizeKHR(VkDevice device, @NativeType("VkPipeline") long pipeline, @NativeType("uint32_t") int group, @NativeType("VkShaderGroupShaderKHR") int groupShader) {
long __functionAddress = device.getCapabilities().vkGetRayTracingShaderGroupStackSizeKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPJJ(device.address(), pipeline, group, groupShader, __functionAddress);
}
// --- [ vkCmdSetRayTracingPipelineStackSizeKHR ] ---
/**
* Set the stack size dynamically for a ray tracing pipeline.
*
* C Specification
*
* To dynamically set the stack size for a ray tracing pipeline, call:
*
*
* void vkCmdSetRayTracingPipelineStackSizeKHR(
* VkCommandBuffer commandBuffer,
* uint32_t pipelineStackSize);
*
* Description
*
* This command sets the stack size for subsequent ray tracing commands when the ray tracing pipeline is created with {@link #VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR} set in {@link VkPipelineDynamicStateCreateInfo}{@code ::pDynamicStates}. Otherwise, the stack size is computed as described in Ray Tracing Pipeline Stack.
*
* Valid Usage
*
*
* - {@code 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)
*
*
* - {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
* - {@code commandBuffer} must be in the recording state
* - The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support compute operations
* - This command must only be called outside of a render pass instance
*
*
* Host Synchronization
*
*
* - Host access to {@code commandBuffer} must be externally synchronized
* - Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
*
*
* Command Properties
*
*
* Command Buffer Levels Render Pass Scope Supported Queue Types
* Primary Secondary Outside Compute
*
*
* @param commandBuffer the command buffer into which the command will be recorded.
* @param pipelineStackSize the stack size to use for subsequent ray tracing trace commands.
*/
public static void vkCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, @NativeType("uint32_t") int pipelineStackSize) {
long __functionAddress = commandBuffer.getCapabilities().vkCmdSetRayTracingPipelineStackSizeKHR;
if (CHECKS) {
check(__functionAddress);
}
callPV(commandBuffer.address(), pipelineStackSize, __functionAddress);
}
/** Array version of: {@link #vkCreateRayTracingPipelinesKHR CreateRayTracingPipelinesKHR} */
@NativeType("VkResult")
public static int vkCreateRayTracingPipelinesKHR(VkDevice device, @NativeType("VkDeferredOperationKHR") long deferredOperation, @NativeType("VkPipelineCache") long pipelineCache, @NativeType("VkRayTracingPipelineCreateInfoKHR const *") VkRayTracingPipelineCreateInfoKHR.Buffer pCreateInfos, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator, @NativeType("VkPipeline *") long[] pPipelines) {
long __functionAddress = device.getCapabilities().vkCreateRayTracingPipelinesKHR;
if (CHECKS) {
check(__functionAddress);
check(pPipelines, pCreateInfos.remaining());
Struct.validate(pCreateInfos.address(), pCreateInfos.remaining(), VkRayTracingPipelineCreateInfoKHR.SIZEOF, VkRayTracingPipelineCreateInfoKHR::validate);
if (pAllocator != null) { VkAllocationCallbacks.validate(pAllocator.address()); }
}
return callPJJPPPI(device.address(), deferredOperation, pipelineCache, pCreateInfos.remaining(), pCreateInfos.address(), memAddressSafe(pAllocator), pPipelines, __functionAddress);
}
}