vkCmdBindShadersEXT(3)
C Specification
Once shader objects have been created, theycan be bound to the commandbuffer using the command:
// Provided by VK_EXT_shader_objectvoid vkCmdBindShadersEXT( VkCommandBuffer commandBuffer, uint32_t stageCount, const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders);Parameters
commandBufferis the command buffer that the shader object will bebound to.stageCountis the length of thepStagesandpShadersarrays.pStagesis a pointer to an array ofVkShaderStageFlagBitsvalues specifying one stage per array index that is affected by thecorresponding value in thepShadersarray.pShadersis a pointer to an array ofVkShaderEXThandlesand/orVK_NULL_HANDLE values describing the shader bindingoperations to be performed on each stage inpStages.
Description
When binding linked shaders, an applicationmay bind them in anycombination of one or more calls tovkCmdBindShadersEXT (i.e., shadersthat were created linked together do not need to be bound in the samevkCmdBindShadersEXT call).
Any shader object bound to a particular stagemay be unbound by setting itsvalue inpShaders toVK_NULL_HANDLE.IfpShaders isNULL,vkCmdBindShadersEXT behaves as ifpShaders was an array ofstageCountVK_NULL_HANDLE values(i.e., any shaders bound to the stages specified inpStages areunbound).
VUID-vkCmdBindShadersEXT-None-08462
TheshaderObjectfeaturemust beenabledVUID-vkCmdBindShadersEXT-pStages-08463
Every element ofpStagesmust be uniqueVUID-vkCmdBindShadersEXT-pStages-08464
pStagesmust not containVK_SHADER_STAGE_ALL_GRAPHICS orVK_SHADER_STAGE_ALLVUID-vkCmdBindShadersEXT-pStages-08465
pStagesmust not containVK_SHADER_STAGE_RAYGEN_BIT_KHR,VK_SHADER_STAGE_ANY_HIT_BIT_KHR,VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR,VK_SHADER_STAGE_MISS_BIT_KHR,VK_SHADER_STAGE_INTERSECTION_BIT_KHR, orVK_SHADER_STAGE_CALLABLE_BIT_KHRVUID-vkCmdBindShadersEXT-pStages-08467
pStagesmust not containVK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEIVUID-vkCmdBindShadersEXT-pStages-08468
pStagesmust not containVK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEIVUID-vkCmdBindShadersEXT-pShaders-08469
For each element ofpStages, ifpShadersis notNULL, andthe element of thepShadersarray with the same index is notVK_NULL_HANDLE, itmust have been created with astageequal to the corresponding element ofpStagesVUID-vkCmdBindShadersEXT-pShaders-08470
IfpStagescontains bothVK_SHADER_STAGE_TASK_BIT_EXT andVK_SHADER_STAGE_VERTEX_BIT, andpShadersis notNULL, andthe same index inpShadersasVK_SHADER_STAGE_TASK_BIT_EXTinpStagesis notVK_NULL_HANDLE, the same index inpShadersasVK_SHADER_STAGE_VERTEX_BIT inpStagesmust beVK_NULL_HANDLEVUID-vkCmdBindShadersEXT-pShaders-08471
IfpStagescontains bothVK_SHADER_STAGE_MESH_BIT_EXT andVK_SHADER_STAGE_VERTEX_BIT, andpShadersis notNULL, andthe same index inpShadersasVK_SHADER_STAGE_MESH_BIT_EXTinpStagesis notVK_NULL_HANDLE, the same index inpShadersasVK_SHADER_STAGE_VERTEX_BIT inpStagesmust beVK_NULL_HANDLEVUID-vkCmdBindShadersEXT-pShaders-08476
IfpStagescontainsVK_SHADER_STAGE_COMPUTE_BIT, theVkCommandPoolthatcommandBufferwas allocated frommustsupport compute operationsVUID-vkCmdBindShadersEXT-pShaders-08477
IfpStagescontainsVK_SHADER_STAGE_VERTEX_BIT,VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT,VK_SHADER_STAGE_GEOMETRY_BIT, orVK_SHADER_STAGE_FRAGMENT_BIT, theVkCommandPoolthatcommandBufferwas allocated frommust support graphics operationsVUID-vkCmdBindShadersEXT-pShaders-08478
IfpStagescontainsVK_SHADER_STAGE_MESH_BIT_EXT orVK_SHADER_STAGE_TASK_BIT_EXT, theVkCommandPoolthatcommandBufferwas allocated frommust support graphics operations
VUID-vkCmdBindShadersEXT-commandBuffer-parameter
commandBuffermust be a validVkCommandBuffer handleVUID-vkCmdBindShadersEXT-pStages-parameter
pStagesmust be a valid pointer to an array ofstageCountvalidVkShaderStageFlagBits valuesVUID-vkCmdBindShadersEXT-pShaders-parameter
IfpShadersis notNULL,pShadersmust be a valid pointer to an array ofstageCountvalid orVK_NULL_HANDLEVkShaderEXT handlesVUID-vkCmdBindShadersEXT-commandBuffer-recording
commandBuffermust be in therecording stateVUID-vkCmdBindShadersEXT-commandBuffer-cmdpool
TheVkCommandPoolthatcommandBufferwas allocated frommust supportVK_QUEUE_COMPUTE_BIT, orVK_QUEUE_GRAPHICS_BIT operationsVUID-vkCmdBindShadersEXT-videocoding
This commandmust only be called outside of a video coding scopeVUID-vkCmdBindShadersEXT-stageCount-arraylength
stageCountmust be greater than0VUID-vkCmdBindShadersEXT-commonparent
Both ofcommandBuffer, and the elements ofpShadersthat are valid handles of non-ignored parametersmust have been created, allocated, or retrieved from the sameVkDevice
Host access to
commandBuffermust be externally synchronizedHost access to the
VkCommandPoolthatcommandBufferwas allocated frommust be externally synchronized
| Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
|---|---|---|---|---|
Primary | Both | Outside | VK_QUEUE_COMPUTE_BIT | State |
vkCmdBindShadersEXT is not affected byconditional rendering
Document Notes
For more information, see theVulkan Specification.
This page is extracted from the Vulkan Specification.Fixes and changes should be made to the Specification, not directly.