Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VK_HUAWEI_subpass_shading and VUID-VkPipelineShaderStageCreateInfo-pName-00707 #8563

Open
Karpov-Ruslan opened this issue Sep 19, 2024 · 2 comments
Assignees
Labels
Bug Something isn't working

Comments

@Karpov-Ruslan
Copy link

Karpov-Ruslan commented Sep 19, 2024

Environment:

  • Mobile Device: Huawei Mate 60 Pro+
  • Layer: VK_LAYER_KHRONOS_validation

Describe the Issue

I used VK_HUAWEI_subpass_shading device extension, but faced with VVL error:

ERROR: [3012269921][VUID-VkPipelineShaderStageCreateInfo-pName-00707] : Validation Error: [ VUID-VkPipelineShaderStageCreateInfo-pName-00707 ] | MessageID = 0xb38b9761 | vkCreateComputePipelines(): pCreateInfos[0].stage.pName `main` entrypoint not found for stage VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI. The Vulkan spec states: pName must be the name of an OpEntryPoint in module with an execution model that matches stage (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPipelineShaderStageCreateInfo-pName-00707)

, but I used example-like code from Vulkan Spec (Example at the bottom of the page).

Expected behavior

There should be no error.

Where to start the search

I think you can start with the ExecutionModelToShaderStageFlagBits function (location: <repo>/layers/state_tracker/shader_module.cpp), which is a little bit wrong:

  • VK_HUAWEI_subpass_shading extend VkShaderStageFlagBits with VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI.
  • SPV_HUAWEI_subpass_shading do not provide new SPIR-V Execution Model and just add new Capability - SubpassShadingHUAWEI.
  • But ExecutionModelToShaderStageFlagBits function see only Execution Model and decide that if Execution Model is equal to GLCompute, then shader stage is VK_SHADER_STAGE_COMPUTE_BIT. But it's wrong. Function should also see Capabilities, because if Execution Model is GLCompute and Capability is SubpassShadingHUAWEI, then shader stage exactly is VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI:
    static uint32_t ExecutionModelToShaderStageFlagBits(uint32_t mode) {
        switch (mode) {
            ...
                return VK_SHADER_STAGE_FRAGMENT_BIT;
            case spv::ExecutionModelGLCompute:
                return VK_SHADER_STAGE_COMPUTE_BIT; // <------------ Problem here
            case spv::ExecutionModelRayGenerationKHR:
                return VK_SHADER_STAGE_RAYGEN_BIT_KHR;
            ...
        }
    }
    

Valid Usage IDs
VUID-VkComputePipelineCreateInfo-stage-00701
VUID-VkPipelineShaderStageCreateInfo-pName-00707

@spencer-lunarg
Copy link
Contributor

Thanks for reporting this (and the related spec issue KhronosGroup/Vulkan-Docs#2438) !

For Vendor extensions we rely on vendors to add validation themselves, I have never used/looked at VK_HUAWEI_subpass_shading and couldn't write a test for it (which is what we need as well)

Happy to take PRs, but with all the other backlogs we have, I will not be able to get to this anytime in the near future

@spencer-lunarg spencer-lunarg added the Bug Something isn't working label Sep 19, 2024
@spencer-lunarg
Copy link
Contributor

cc @PanGao-h

@spencer-lunarg spencer-lunarg self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants