Vulkan: VK_EXT_subgroup_size_control should be chained on the stage

Previousl the VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT was
chained on the VkComputePielineCreateInfo when instead it should be
chained on the VkPipelineShaderStageCreateInfo, causing Vulkan
Validation errors.

Fixed: dawn:671
Change-Id: I9cc803a4f9120cf81f4e143818c3be58b73635d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40604
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2021-02-09 11:08:48 +00:00 committed by Commit Bot service account
parent e7e42ebbed
commit ab8e7e5006
1 changed files with 2 additions and 2 deletions

View File

@ -51,14 +51,14 @@ namespace dawn_native { namespace vulkan {
Device* device = ToBackend(GetDevice());
PNextChainBuilder extChain(&createInfo);
PNextChainBuilder stageExtChain(&createInfo.stage);
VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT subgroupSizeInfo = {};
uint32_t computeSubgroupSize = device->GetComputeSubgroupSize();
if (computeSubgroupSize != 0u) {
ASSERT(device->GetDeviceInfo().HasExt(DeviceExt::SubgroupSizeControl));
subgroupSizeInfo.requiredSubgroupSize = computeSubgroupSize;
extChain.Add(
stageExtChain.Add(
&subgroupSizeInfo,
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT);
}