Class HUAWEISubpassShading
The GlobalInvocationId.xy of a subpass shading pipeline is equal to the FragCoord.xy of a graphic pipeline in the same render pass subtracted the offset of the VkRenderPassBeginInfo::renderArea. GlobalInvocationId.z is mapped to the Layer if VK_EXT_shader_viewport_index_layer is supported. The GlobalInvocationId.xy is equal to the index of the local workgroup multiplied by the size of the local workgroup plus the LocalInvocationId and the offset of the VkRenderPassBeginInfo::renderArea.
This extension allows a subpass’s pipeline bind point to be PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI.
Sample Code
Example of subpass shading in a GLSL shader
#extension GL_HUAWEI_subpass_shading: enable
#extension GL_KHR_shader_subgroup_arithmetic: enable
layout(constant_id = 0) const uint tileWidth = 8;
layout(constant_id = 1) const uint tileHeight = 8;
layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z = 1) in;
layout(set=0, binding=0, input_attachment_index=0) uniform subpassInput depth;
void main()
{
float d = subpassLoad(depth).x;
float minD = subgroupMin(d);
float maxD = subgroupMax(d);
}
Example of subpass shading dispatching in a subpass
vkCmdNextSubpass(commandBuffer, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI, subpassShadingPipeline);
vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI, subpassShadingPipelineLayout,
firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
vkCmdSubpassShadingHUAWEI(commandBuffer)
vkCmdEndRenderPass(commandBuffer);
Example of subpass shading render pass creation
VkAttachmentDescription2 attachments[] = {
{
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, NULL,
0, VK_FORMAT_R8G8B8A8_UNORM, VK_SAMPLE_COUNT_1_BIT,
VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_DONT_CARE,
VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
},
{
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, NULL,
0, VK_FORMAT_R8G8B8A8_UNORM, VK_SAMPLE_COUNT_1_BIT,
VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_DONT_CARE,
VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
},
{
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, NULL,
0, VK_FORMAT_R8G8B8A8_UNORM, VK_SAMPLE_COUNT_1_BIT,
VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_DONT_CARE,
VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
},
{
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, NULL,
0, VK_FORMAT_D24_UNORM_S8_UINT, VK_SAMPLE_COUNT_1_BIT,
VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_DONT_CARE,
VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
},
{
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, NULL,
0, VK_FORMAT_R8G8B8A8_UNORM, VK_SAMPLE_COUNT_1_BIT,
VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_STORE,
VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
}
};
VkAttachmentReference2 gBufferAttachmentReferences[] = {
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_COLOR_BIT },
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 1, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_COLOR_BIT },
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 2, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_COLOR_BIT }
};
VkAttachmentReference2 gBufferDepthStencilAttachmentReferences =
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 3, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_DEPTH_BIT|VK_IMAGE_ASPECT_STENCIL_BIT };
VkAttachmentReference2 depthInputAttachmentReferences[] = {
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 3, VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_ASPECT_DEPTH_BIT|VK_IMAGE_ASPECT_STENCIL_BIT };
};
VkAttachmentReference2 preserveAttachmentReferences[] = {
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_COLOR_BIT },
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 1, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_COLOR_BIT },
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 2, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_COLOR_BIT },
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 3, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_DEPTH_BIT|VK_IMAGE_ASPECT_STENCIL_BIT }
}; // G buffer including depth/stencil
VkAttachmentReference2 colorAttachmentReferences[] = {
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 4, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_COLOR_BIT }
};
VkAttachmentReference2 resolveAttachmentReference =
{ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, NULL, 4, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_ASPECT_COLOR_BIT };
VkSubpassDescription2 subpasses[] = {
{
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, NULL, 0, VK_PIPELINE_BIND_POINT_GRAPHICS, 0,
0, NULL, // input
sizeof(gBufferAttachmentReferences)/sizeof(gBufferAttachmentReferences[0]), gBufferAttachmentReferences, // color
NULL, &gBufferDepthStencilAttachmentReferences, // resolve & DS
0, NULL
},
{
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, NULL, 0, VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI , 0,
sizeof(depthInputAttachmentReferences)/sizeof(depthInputAttachmentReferences[0]), depthInputAttachmentReferences, // input
0, NULL, // color
NULL, NULL, // resolve & DS
sizeof(preserveAttachmentReferences)/sizeof(preserveAttachmentReferences[0]), preserveAttachmentReferences,
},
{
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, NULL, 0, VK_PIPELINE_BIND_POINT_GRAPHICS, 0,
sizeof(gBufferAttachmentReferences)/sizeof(gBufferAttachmentReferences[0]), gBufferAttachmentReferences, // input
sizeof(colorAttachmentReferences)/sizeof(colorAttachmentReferences[0]), colorAttachmentReferences, // color
&resolveAttachmentReference, &gBufferDepthStencilAttachmentReferences, // resolve & DS
0, NULL
},
};
VkMemoryBarrier2KHR fragmentToSubpassShading = {
VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR, NULL,
VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT|VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI, VK_ACCESS_INPUT_ATTACHMENT_READ_BIT
};
VkMemoryBarrier2KHR subpassShadingToFragment = {
VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR, NULL,
VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI, VK_ACCESS_SHADER_WRITE_BIT,
VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR, VK_ACCESS_SHADER_READ_BIT
};
VkSubpassDependency2 dependencies[] = {
{
VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, &fragmentToSubpassShading,
0, 1,
0, 0, 0, 0,
0, 0
},
{
VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, &subpassShadingToFragment,
1, 2,
0, 0, 0, 0,
0, 0
},
};
VkRenderPassCreateInfo2 renderPassCreateInfo = {
VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, NULL, 0,
sizeof(attachments)/sizeof(attachments[0]), attachments,
sizeof(subpasses)/sizeof(subpasses[0]), subpasses,
sizeof(dependencies)/sizeof(dependencies[0]), dependencies,
0, NULL
};
VKRenderPass renderPass;
vkCreateRenderPass2(device, &renderPassCreateInfo, NULL, &renderPass);
Example of subpass shading pipeline creation
VkExtent2D maxWorkgroupSize;
VkSpecializationMapEntry subpassShadingConstantMapEntries[] = {
{ 0, 0 * sizeof(uint32_t), sizeof(uint32_t) },
{ 1, 1 * sizeof(uint32_t), sizeof(uint32_t) }
};
VkSpecializationInfo subpassShadingConstants = {
2, subpassShadingConstantMapEntries,
sizeof(VkExtent2D), &maxWorkgroupSize
};
VkSubpassShadingPipelineCreateInfoHUAWEI subpassShadingPipelineCreateInfo {
VK_STRUCTURE_TYPE_SUBPASSS_SHADING_PIPELINE_CREATE_INFO_HUAWEI, NULL,
renderPass, 1
};
VkPipelineShaderStageCreateInfo subpassShadingPipelineStageCreateInfo {
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, NULL,
0, VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI,
shaderModule, "main",
&subpassShadingConstants
};
VkComputePipelineCreateInfo subpassShadingComputePipelineCreateInfo = {
VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, &subpassShadingPipelineCreateInfo,
0, &subpassShadingPipelineStageCreateInfo,
pipelineLayout, basePipelineHandle, basePipelineIndex
};
VKPipeline pipeline;
vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(device, renderPass, &maxWorkgroupSize);
vkCreateComputePipelines(device, pipelineCache, 1, &subpassShadingComputePipelineCreateInfo, NULL, &pipeline);
- Name String
VK_HUAWEI_subpass_shading- Extension Type
- Device extension
- Registered Extension Number
- 370
- Revision
- 3
- Extension and Version Dependencies
VK_KHR_create_renderpass2or Version 1.2 andVK_KHR_synchronization2or Version 1.3- SPIR-V Dependencies
- Contact
- Pan Gao PanGao-h
Other Extension Metadata
- Last Modified Date
- 2021-06-01
- Interactions and External Dependencies
- This extension provides API support for
GL_HUAWEI_subpass_shading.
- This extension provides API support for
- Contributors
- Hueilong Wang
- Juntao Li, Huawei
- Renmiao Lu, Huawei
- Pan Gao, Huawei
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsVkPipelineBindPoint.static final longExtendsVkPipelineStageFlagBits2.static final longExtendsVkPipelineStageFlagBits2.static final intExtendsVkShaderStageFlagBits.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnvkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(org.lwjgl.vulkan.VkDevice device, long renderpass, long pMaxWorkgroupSize) Unsafe version of:GetDeviceSubpassShadingMaxWorkgroupSizeHUAWEIstatic voidvkCmdSubpassShadingHUAWEI(org.lwjgl.vulkan.VkCommandBuffer commandBuffer) Dispatch compute work items.static intvkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(org.lwjgl.vulkan.VkDevice device, long renderpass, VkExtent2D pMaxWorkgroupSize) Query maximum supported subpass shading workgroup size for a give render pass.
-
Field Details
-
VK_HUAWEI_SUBPASS_SHADING_SPEC_VERSION
public static final int VK_HUAWEI_SUBPASS_SHADING_SPEC_VERSIONThe extension specification version.- See Also:
-
VK_HUAWEI_SUBPASS_SHADING_EXTENSION_NAME
The extension name.- See Also:
-
VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI
public static final int VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEIExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEIExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEIExtendsVkStructureType.Enum values:
- See Also:
-
VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI
public static final int VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEIExtendsVkPipelineBindPoint.- See Also:
-
VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI
public static final long VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEIExtendsVkPipelineStageFlagBits2.Enum values:
- See Also:
-
VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI
public static final long VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEIExtendsVkPipelineStageFlagBits2.Enum values:
- See Also:
-
VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI
public static final int VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEIExtendsVkShaderStageFlagBits.- See Also:
-
-
Method Details
-
nvkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI
public static int nvkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(org.lwjgl.vulkan.VkDevice device, long renderpass, long pMaxWorkgroupSize) Unsafe version of:GetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI -
vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI
public static int vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI(org.lwjgl.vulkan.VkDevice device, long renderpass, VkExtent2D pMaxWorkgroupSize) Query maximum supported subpass shading workgroup size for a give render pass.C Specification
A subpass shading pipeline’s workgroup size is a 2D vector with number of power-of-two in width and height. The maximum number of width and height is implementation-dependent, and may vary for different formats and sample counts of attachments in a render pass.
To query the maximum workgroup size, call:
VkResult vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( VkDevice device, VkRenderPass renderpass, VkExtent2D* pMaxWorkgroupSize);Valid Usage (Implicit)
devicemust be a validVkDevicehandlerenderpassmust be a validVkRenderPasshandlepMaxWorkgroupSizemust be a valid pointer toVkExtent2Dstructuresrenderpassmust have been created, allocated, or retrieved fromdevice
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- a handle to a local device object that was used to create the given render pass.pMaxWorkgroupSize- a pointer to aVkExtent2Dstructure.
-
vkCmdSubpassShadingHUAWEI
public static void vkCmdSubpassShadingHUAWEI(org.lwjgl.vulkan.VkCommandBuffer commandBuffer) Dispatch compute work items.C Specification
A subpass shading dispatches a compute pipeline work with the work dimension of render area of the calling subpass and work groups are partitioned by specified work group size. Subpass operations like
subpassLoadare allowed to be used.To record a subpass shading, call:
void vkCmdSubpassShadingHUAWEI( VkCommandBuffer commandBuffer);Description
When the command is executed, a global workgroup consisting of ceil (render area size / local workgroup size) local workgroups is assembled.
Valid Usage
- If a
VkSamplercreated withmagFilterorminFilterequal toFILTER_LINEAR,reductionModeequal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, andcompareEnableequal toFALSEis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT - If a
VkSamplercreated withmagFilterorminFilterequal toFILTER_LINEARandreductionModeequal to eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT - If a
VkSamplercreated withmipmapModeequal toSAMPLER_MIPMAP_MODE_LINEAR,reductionModeequal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, andcompareEnableequal toFALSEis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT - If a
VkSamplercreated withmipmapModeequal toSAMPLER_MIPMAP_MODE_LINEARandreductionModeequal to eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT - If a
VkSamplercreated withunnormalizedCoordinatesequal toTRUEis used to sample aVkImageViewas a result of this command, then the image view’slevelCountandlayerCountmust be 1 - If a
VkSamplercreated withunnormalizedCoordinatesequal toTRUEis used to sample aVkImageViewas a result of this command, then the image view’sviewTypemust beIMAGE_VIEW_TYPE_1DorIMAGE_VIEW_TYPE_2D - If a
VkSamplercreated withunnormalizedCoordinatesequal toTRUEis used to sample aVkImageViewas a result of this command, then the sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name - If a
VkSamplercreated withunnormalizedCoordinatesequal toTRUEis used to sample aVkImageViewas a result of this command, then the sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values - If a
VkImageViewis sampled with depth comparison, the image view’s format features must containFORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT - If a
VkImageViewis 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_BUFFERdescriptor 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
VkImageViewis sampled withFILTER_CUBIC_EXTas 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_cubicextension is not enabled and anyVkImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, it must not have aVkImageViewTypeofIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE, orIMAGE_VIEW_TYPE_CUBE_ARRAY - Any
VkImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aVkImageViewTypeand format that supports cubic filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned byGetPhysicalDeviceImageFormatProperties2 - Any
VkImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aVkImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned byGetPhysicalDeviceImageFormatProperties2 - If the
cubicRangeClampfeature is not enabled, then anyVkImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must not have aVkSamplerReductionModeCreateInfo::reductionModeequal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM - Any
VkImageViewbeing sampled with aVkSamplerReductionModeCreateInfo::reductionModeequal toSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOMas a result of this command must sample withFILTER_CUBIC_EXT - If the
selectableCubicWeightsfeature is not enabled, then anyVkImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must haveVkSamplerCubicWeightsCreateInfoQCOM::cubicWeightsequal toCUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM - Any
VkImagecreated with aVkImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aVkSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE - For any
VkImageViewbeing written as a storage image where the image format field of theOpTypeImageisUnknown, the view’s format features must containFORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT - For any
VkImageViewbeing read as a storage image where the image format field of theOpTypeImageisUnknown, the view’s format features must containFORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT - For any
VkBufferViewbeing written as a storage texel buffer where the image format field of theOpTypeImageisUnknown, the view’s buffer features must containFORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT - Any
VkBufferViewbeing read as a storage texel buffer where the image format field of theOpTypeImageisUnknownthen 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
VkPipelineLayoutthat is compatible for set n, with theVkPipelineLayoutused to create the currentVkPipelineor theVkDescriptorSetLayoutarray used to create the currentVkShaderEXT, as described in Pipeline Layout Compatibility - 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
VkPipelineLayoutthat is compatible for push constants, with theVkPipelineLayoutused to create the currentVkPipelineor theVkDescriptorSetLayoutarray used to create the currentVkShaderEXT, as described in Pipeline Layout Compatibility - For each array of resources that is used by a bound shader, the indices used to access members of the array must be less than the descriptor count for the identified binding in the descriptor sets used by this command
- If the
maintenance4feature 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 aVkPipelineLayoutthat is compatible for push constants, with theVkPipelineLayoutused to create the currentVkPipelineor theVkDescriptorSetLayoutandVkPushConstantRangearrays used to create the currentVkShaderEXT, as described in Pipeline Layout Compatibility - Descriptors in each bound descriptor set, specified via
CmdBindDescriptorSets, must be valid as described by descriptor validity if they are statically used by theVkPipelinebound to the pipeline bind point used by this command and the boundVkPipelinewas not created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT - If the descriptors used by the
VkPipelinebound to the pipeline bind point were specified viaCmdBindDescriptorSets, the boundVkPipelinemust 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 theVkPipelinebound to the pipeline bind point used by this command and the boundVkPipelinewas created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT - Descriptors in bound descriptor buffers, specified via
CmdSetDescriptorBufferOffsetsEXT, must be valid if they are dynamically used by anyVkShaderEXTbound to a stage corresponding to the pipeline bind point used by this command - If the descriptors used by the
VkPipelinebound to the pipeline bind point were specified viaCmdSetDescriptorBufferOffsetsEXT, the boundVkPipelinemust have been created withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT - If a descriptor is dynamically used with a
VkPipelinecreated withPIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, the descriptor memory must be resident - If a descriptor is dynamically used with a
VkShaderEXTcreated with aVkDescriptorSetLayoutthat was created withDESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, the descriptor memory must be resident - If the
shaderObjectfeature is not enabled, a valid pipeline must be bound 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 specified statically in the
VkPipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound - If the
shaderObjectfeature is enabled, either a valid pipeline must be bound to the pipeline bind point used by this command, or a valid combination of valid andNULL_HANDLEshader objects must be bound to every supported shader stage corresponding to the pipeline bind point used by this command - If any stage of the
VkPipelineobject 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_ACCESSorPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2foruniformBuffers, and therobustBufferAccessfeature 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
robustBufferAccessfeature is not enabled, and anyVkShaderEXTbound 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
VkPipelineobject 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_ACCESSorPIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2forstorageBuffers, and therobustBufferAccessfeature 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
robustBufferAccessfeature is not enabled, and anyVkShaderEXTbound 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
commandBufferis an unprotected command buffer andprotectedNoFaultis not supported, any resource accessed by bound shaders must not be a protected resource - If a bound shader accesses a
VkSamplerorVkImageViewobject that enables sampler Y′CBCR conversion, that object must only be used withOpImageSample*orOpImageSparseSample*instructions - If a bound shader accesses a
VkSamplerorVkImageViewobject that enables sampler Y′CBCR conversion, that object must not use theConstOffsetandOffsetoperands - If a
VkImageViewis accessed as a result of this command, then the image view’sviewTypemust match theDimoperand of theOpTypeImageas described in Compatibility Between SPIR-V Image Dimensions and Vulkan ImageView Types - If a
VkImageViewis accessed as a result of this command, then the numeric type of the image view’sformatand theSampledTypeoperand of theOpTypeImagemust match - If a
VkImageViewcreated with a format other thanFORMAT_A8_UNORMis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the image view’s format - If a
VkImageViewcreated with the formatFORMAT_A8_UNORMis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have four components - If a
VkBufferViewis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the buffer view’s format - If a
VkImageViewwith aVkFormatthat has a 64-bit component width is accessed as a result of this command, theSampledTypeof theOpTypeImageoperand of that instruction must have aWidthof 64 - If a
VkImageViewwith aVkFormatthat has a component width less than 64-bit is accessed as a result of this command, theSampledTypeof theOpTypeImageoperand of that instruction must have aWidthof 32 - If a
VkBufferViewwith aVkFormatthat has a 64-bit component width is accessed as a result of this command, theSampledTypeof theOpTypeImageoperand of that instruction must have aWidthof 64 - If a
VkBufferViewwith aVkFormatthat has a component width less than 64-bit is accessed as a result of this command, theSampledTypeof theOpTypeImageoperand of that instruction must have aWidthof 32 - If the
sparseImageInt64Atomicsfeature is not enabled,VkImageobjects created with theIMAGE_CREATE_SPARSE_RESIDENCY_BITflag must not be accessed by atomic instructions through anOpTypeImagewith aSampledTypewith aWidthof 64 by this command - If the
sparseImageInt64Atomicsfeature is not enabled,VkBufferobjects created with theBUFFER_CREATE_SPARSE_RESIDENCY_BITflag must not be accessed by atomic instructions through anOpTypeImagewith aSampledTypewith aWidthof 64 by this command - If
OpImageWeightedSampleQCOMis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM - If
OpImageWeightedSampleQCOMuses aVkImageViewas 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
OpImageBoxFilterQCOMis used to sample aVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM - If
OpImageBlockMatchSSDQCOMis used to read from anVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM - If
OpImageBlockMatchSADQCOMis used to read from anVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM - If
OpImageBlockMatchSADQCOMor 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, orOpImageBlockMatchSADQCOMuses aVkSampleras 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, orOpImageBlockMatchSADQCOMuses aVkSampleras a result of this command, then the sampler must not have been created withSAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM - If a
OpImageBlockMatchWindow*QCOMorOpImageBlockMatchGather*QCOMinstruction is used to read from anVkImageViewas a result of this command, then the image view’s format features must containFORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM - If a
OpImageBlockMatchWindow*QCOMorOpImageBlockMatchGather*QCOMinstruction is used to read from anVkImageViewas a result of this command, then the image view’s format must be a single-component format - If a
OpImageBlockMatchWindow*QCOMorOpImageBlockMatchGather*QCOMread 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
- If a descriptor with type equal to any of
DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM,DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM,DESCRIPTOR_TYPE_SAMPLED_IMAGE,DESCRIPTOR_TYPE_STORAGE_IMAGE, orDESCRIPTOR_TYPE_INPUT_ATTACHMENTis accessed as a result of this command, the image subresource identified by that descriptor must be in the image layout identified when the descriptor was written - This command must be called in a subpass with bind point
PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI. No draw commands can be called in the same subpass. Only oneCmdSubpassShadingHUAWEIcommand can be called in a subpass
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics operations - This command must only be called inside of a render pass instance
- This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Video Coding Scope Supported Queue Types Command Type Primary Secondary Inside Outside Graphics Action - Parameters:
commandBuffer- the command buffer into which the command will be recorded.
- If a
-