-
Notifications
You must be signed in to change notification settings - Fork 654
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
Add dynamic primitive clipping example #902
Add dynamic primitive clipping example #902
Conversation
There's one error present in this example: when I switch primitive clipping off in a GUI and subsequently code calls I modified I also consulted my friend from Vulkan CTS group and we established that For me it looks like I plan to create an issue in Vulkan CTS project, so that |
Thank you very much for this sample. New samples are always very much appreciated :) Right now CI fails due to outdated copyrights and problems with clang format. Once those are fixed, we'll start reviewing it. If you need any assistance, feel free to ping. |
This seems to work fine for me. If I uncheck "use clipping", it looks like this on my 4070 with recent Vulkan developer drivers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me so far.
I only have a few very minor remarks added as comments.
Thanks for adding this new sample :)
samples/extensions/dynamic_primitive_clipping/dynamic_primitive_clipping.h
Show resolved
Hide resolved
samples/extensions/dynamic_primitive_clipping/dynamic_primitive_clipping.h
Show resolved
Hide resolved
samples/extensions/dynamic_primitive_clipping/dynamic_primitive_clipping.h
Show resolved
Hide resolved
samples/extensions/dynamic_primitive_clipping/dynamic_primitive_clipping.h
Show resolved
Hide resolved
In that case we should see the whole Utah teapot as "blue". But it looks like a call to I could hide "use clipping" checkbox in order to disguise the error (at least temporarily), but I think this sample may be a good place for field testing by driver developers. |
This oddly still fails with CI checks. @tomadamatkinson: Any idea? It seems to fail at files not even part of this PR |
That's why I didn't fix it yet. I am afraid of avalanche of another wrong copyright checks. |
samples/extensions/dynamic_primitive_clipping/dynamic_primitive_clipping.cpp
Outdated
Show resolved
Hide resolved
Reading the comments in this PR it makes me wonder if ClipDistance is being confused with depth clipping, which are different steps in the primitive clipping part of the pipeline. User defined clip distances are enabled/disable by the presence of ClipDistance decorated outputs in the shader, and are independent to the depth clamp and depth clip pipeline states. In other words, setting vkCmdSetDepthClipEnableEXT(VK_FALSE) or vkCmdSetDepthClipEnableEXT(VK_TRUE) won't have any affect on any ClipDistance specified in the shader and their operation. |
I'm surprised this even ran for me since we don't support some of the features being used here. I suspect you may be missing some checks. See https://vulkan.gpuinfo.org/displayreport.php?id=27052 for the full set of device support on the board I'm using. I also see some validation errors which are likely related:
|
Added primitive clipping using half-spaces. Updated documentation to contain latest changes.
You are right @pdaniell-nv . I mixed up these two steps. I was looking for some external switch that may cause I decoupled these two features in my sample and now it presents both of them. I also described both of these features in README.adoc and I specifically emphasized that these two are distinct features. I hope this helps to solve potential user confusion.
I added additional check: if @SaschaWillems: I fixed these two strange copyright checks in a code that I did not touch and now I see that there is some conflict to resolve. Great... |
@tomadamatkinson: can you take a look at this? Having to change copyrights on files not actually touched by a PR is something we shouldn't require people to do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and works fine for me on Win11 and an RTX4070
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is, what VVL tells me:
Attempting to enable extension VK_EXT_depth_clip_enable, but this extension is intended to support D3D emulation layers, and applications ported from D3D, by adding functionality specific to D3D and it is strongly recommended that it be otherwise avoided.
Is that valid? Does anybody know, why it should not be used?
samples/extensions/dynamic_primitive_clipping/dynamic_primitive_clipping.cpp
Show resolved
Hide resolved
@SaschaWillems @asuessenbach Can I request for your reviews for current state of this sample? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine for me on Windows 11 with an NVIDIA RTX 4070.
This is a really nice example. Thank you very much 👍🏻
ccd208e
*Extension*: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_shader_non_semantic_info.html[`VK_KHR_shader_non_semantic_info`] | ||
|
||
Demonstrates how to use https://en.wikipedia.org/wiki/Printf[Printf] statements in a shader to output per-invocation values. This can help find issues with shaders in combination with graphics debugging tools. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this text part of a different PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this is weird. As you see I didn't change any letter even line is the same. After that line I added new line with dynamic primitive clipping. To be more elegant I can fix that to doesn't have that line in git diff.
Merging - 3 approvals |
Description
This example demonstrates how to use primitive clipping through dynamic pipeline state.
Dynamic properties required to implement this example are defined in VK_EXT_extended_dynamic_state3 extension and in chapter 27.4 of the Vulkan specification ( "Primitive Clipping" ).
General Checklist:
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including:
Sample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: