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

[SPIR-V] Allow zero outputcontrolpoints #6190

Closed
wants to merge 1 commit into from

Conversation

sudonatalie
Copy link
Collaborator

It is valid HLSL for a Hull shader to have zero outputcontrolpoints or have the outputcontrolpoints attribute unset, based on the tests added here passing when compiling for DXIL. This change removes the checks in the SPIR-V backend that required a strictly positive number of control points and adds tests to verify the result.

Fixes #3733

It is valid HLSL for a Hull shader to have zero outputcontrolpoints or have
the outputcontrolpoints attribute unset, based on the tests added here
passing when compiling for DXIL. This change removes the checks in the
SPIR-V backend that required a strictly positive number of control
points and adds tests to verify the result.

Fixes microsoft#3733
@s-perron
Copy link
Collaborator

This is awkward. Vulkan does not allow a zero for the number of output vertices. See https://docs.vulkan.org/spec/latest/chapters/pipelines.html#VUID-VkPipelineShaderStageCreateInfo-stage-00713.

I can't tell of the code generated when there is no output vertices is correct. GLSL does not generate anything https://shader-playground.timjones.io/7f6252b21a9b099056aaccd511ec7046.

@sudonatalie
Copy link
Collaborator Author

Hm... upon closer review of the D3D documentation for Hull shaders it seems like it also shouldn't be allowed there: "The shader output is between 1 and 32 control points".

https://learn.microsoft.com/en-us/windows/win32/direct3d11/direct3d-11-advanced-stages-tessellation#hull-shader-stage

I'll look into whether disallowing it on the frontend is a reasonable option.

@sudonatalie sudonatalie closed this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants