# VkRayTracingPipelineCreateInfoNV(3) Manual Page

## Name

VkRayTracingPipelineCreateInfoNV - Structure specifying parameters of a newly created ray tracing pipeline

## C Specification

The `VkRayTracingPipelineCreateInfoNV` structure is defined as:

    typedef struct VkRayTracingPipelineCreateInfoNV {
        VkStructureType                               sType;
        const void*                                   pNext;
        VkPipelineCreateFlags                         flags;
        uint32_t                                      stageCount;
        const VkPipelineShaderStageCreateInfo*        pStages;
        uint32_t                                      groupCount;
        const VkRayTracingShaderGroupCreateInfoNV*    pGroups;
        uint32_t                                      maxRecursionDepth;
        VkPipelineLayout                              layout;
        VkPipeline                                    basePipelineHandle;
        int32_t                                       basePipelineIndex;
    } VkRayTracingPipelineCreateInfoNV;

## Members

- `sType` is the type of this structure.

- `pNext` is `NULL` or a pointer to an extension-specific structure.

- `flags` is a bitmask of VkPipelineCreateFlagBits specifying how the pipeline will be generated.

- `stageCount` is the number of entries in the `pStages` array.

- `pStages` is an array of size `stageCount` structures of type VkPipelineShaderStageCreateInfo describing the set of the shader stages to be included in the ray tracing pipeline.

- `groupCount` is the number of entries in the `pGroups` array.

- `pGroups` is an array of size `groupCount` structures of type VkRayTracingShaderGroupCreateInfoNV describing the set of the shader stages to be included in each shader group in the ray tracing pipeline.

- `maxRecursionDepth` is the maximum recursion depth of shaders executed by this pipeline.

- `layout` is the description of binding locations used by both the pipeline and descriptor sets used with the pipeline.

- `basePipelineHandle` is a pipeline to derive from.

- `basePipelineIndex` is an index into the `pCreateInfos` parameter to use as a pipeline to derive from.

## Description

The parameters `basePipelineHandle` and `basePipelineIndex` are described in more detail in Pipeline Derivatives.

Valid Usage

- [[VUID-{refpage}-flags-03421]] If `flags` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, and `basePipelineIndex` is `-1`, `basePipelineHandle` must be a valid handle to a ray tracing `VkPipeline`

- [[VUID-{refpage}-flags-03422]] If `flags` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, and `basePipelineHandle` is VK_NULL_HANDLE, `basePipelineIndex` must be a valid index into the calling command’s `pCreateInfos` parameter

- [[VUID-{refpage}-flags-03423]] If `flags` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, and `basePipelineIndex` is not `-1`, `basePipelineHandle` must be VK_NULL_HANDLE

- [[VUID-{refpage}-flags-03424]] If `flags` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, and `basePipelineHandle` is not VK_NULL_HANDLE, `basePipelineIndex` must be `-1`

- [[VUID-{refpage}-stage-03425]] The `stage` member of at least one element of `pStages` must be `VK_SHADER_STAGE_RAYGEN_BIT_KHR`

- [[VUID-{refpage}-pStages-03426]] 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

- [[VUID-{refpage}-layout-03427]] `layout` must be consistent with all shaders specified in `pStages`

- [[VUID-{refpage}-layout-03428]] The number of resources in `layout` accessible to each shader stage that is used by the pipeline must be less than or equal to VkPhysicalDeviceLimits::`maxPerStageResources`

- [[VUID-{refpage}-flags-02904]] `flags` must not include `VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV`

- [[VUID-{refpage}-pipelineCreationCacheControl-02905]] If the `pipelineCreationCacheControl` feature is not enabled, `flags` must not include `VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT` or `VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT`

- `flags` must not include `VK_PIPELINE_CREATE_LIBRARY_BIT_KHR`

- `maxRecursionDepth` must be less than or equal to VkPhysicalDeviceRayTracingPropertiesNV::`maxRecursionDepth`

- `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR`

- `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR`

- `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR`

- `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR`

- `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR`

- `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR`

- `flags` must not include both `VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV` and `VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT` at the same time.

Valid Usage (Implicit)

- `sType` must be `VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV`

- `pNext` must be `NULL` or a pointer to a valid instance of VkPipelineCreationFeedbackCreateInfoEXT

- The `sType` value of each struct in the `pNext` chain must be unique

- `flags` must be a valid combination of VkPipelineCreateFlagBits values

- `pStages` must be a valid pointer to an array of `stageCount` valid VkPipelineShaderStageCreateInfo structures

- `pGroups` must be a valid pointer to an array of `groupCount` valid VkRayTracingShaderGroupCreateInfoNV structures

- `layout` must be a valid VkPipelineLayout handle

- `stageCount` must be greater than `0`

- `groupCount` must be greater than `0`

- Both of `basePipelineHandle`, and `layout` that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkDevice

## See Also

VkPipeline, VkPipelineCreateFlags, VkPipelineLayout, VkPipelineShaderStageCreateInfo, VkRayTracingShaderGroupCreateInfoNV, VkStructureType, vkCreateRayTracingPipelinesNV

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.