Skip to content

Conversation

@MortenKristiansen
Copy link

This fixes a warning from the validation layer when the shaders are added. The warning was:

Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08740 ] | MessageID = 0x6e224e9
vkCreateShaderModule(): SPIR-V Capability DrawParameters was declared, but one of the following requirements is required (VkPhysicalDeviceVulkan11Features::shaderDrawParameters OR VK_KHR_shader_draw_parameters).
The Vulkan spec states: If pCode is a pointer to SPIR-V code, and pCode declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08740)

I've added the extension to all example code from that step forward as I expect it'll be required in them all.

… satisfy VUID-VkShaderModuleCreateInfo-pCode-08740
vk::PipelineShaderStageCreateInfo shaderStages[] = {vertShaderStageInfo, fragShaderStageInfo};
----

Finish by adding DrawParameters to the deviceExtensions. Otherwise the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not a good explanation. Can you rephrase this so people understand why this is required when using Slang?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Barely :-) I've just started learning Vulkan - working through the tutorial, fixing things here and there to get it working.
As far as I can understand the SPIR compiler sets a flag or something in the bytecode signaling it's using parameters (though I don't see any at the moment). This cause the validation layer to complain the vk::KHRShaderDrawParametersExtensionName must be added.

What I can offer is to do some more research and come up with a better explanation. However, I can't make it tonight.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to open issues for stuff like that instead. We'll then take a look and add a proper explanation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll cancel this PR.

vk::KHRSpirv14ExtensionName,
vk::KHRSynchronization2ExtensionName,
vk::KHRCreateRenderpass2ExtensionName};
vk::KHRCreateRenderpass2ExtensionName,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only VK_KHR_shader_draw_parameters should be required. I don't think we need renderpass2 as that's core since 1.2 and we use 1.4.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove it, however it was there originally. I'll test if the validation layer complains.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sry my bad. If it was there, just leave it in place. I'm addressing extensions in #260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants