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

[mvk-error] VK_POLYGON_MODE_POINT is not supported for render pipelines. #1396

Open
Wah0airo opened this issue Jul 6, 2021 · 1 comment
Open
Labels
Answered A question was answered Question

Comments

@Wah0airo
Copy link

Wah0airo commented Jul 6, 2021

I'm trying to draw points using VK_PRIMITIVE_TOPOLOGY_POINT_LIST and VK_POLYGON_MODE_POINT but I get the following error:
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkPolygonMode value VK_POLYGON_MODE_POINT is not supported for render pipelines.
fillModeNonSolid is set to VK_TRUE and supported. Vulkaninfo show the fillModeNonSolid Device Feature as supported.
gl_PointSize is set in the vertex Shader
I'm missing something or is this a bug? I'm linking against the VulkanSDK 1.2.176.1 (using the vulkan.framework)
The following line inside the MVKPipeline.mm is for me not clear:
line 415:
if (pCreateInfo->pInputAssemblyState && !isRenderingPoints(pCreateInfo))
If you look into the function, this will return true if VK_PRIMITIVE_TOPOLOGY_POINT_LIST or VK_POLYGON_MODE_POINT are set.
Why is this function in line 415 than negated?

@cdavis5e
Copy link
Collaborator

cdavis5e commented Jul 7, 2021

Because Metal doesn't have a MTLTriangleFillModePoints. I guess Apple just figured you'd use MTLPrimitiveTypePoint if you wanted to draw points. Although, rendering triangles and lines as points gives subtly different results than just drawing points straight up, mostly around primitive culling behavior. That is, if the triangle is the wrong winding, the points shouldn't be drawn at all, but with MTLPrimitiveTypePoint, they will be. We can't work around this, because Metal also doesn't support shader-controlled culling (CullDistance built-in in SPIR-V). Also, it gives different results for PrimitiveId. But Metal only got that fairly recently (macOS 10.15, iOS 13).

We used to actually use MTLPrimitiveTypePoint for this case, but then @kvark pointed out those discrepancies, so we added a bit to VK_KHR_portability_subset (now public) which indicates support for VK_POLYGON_MODE_POINT, which MoltenVK does not enable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Answered A question was answered Question
Projects
None yet
Development

No branches or pull requests

3 participants