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

Add VK_EXT_shader_object sample #717

Merged

Conversation

daniel-story
Copy link
Contributor

This PR adds a new sample named shader_object which demonstrates common use cases of the VK_EXT_shader_object extension:

  • Linked graphics shaders
  • Unlinked graphics shaders
  • Passthrough geometry shaders
  • Arbitrarily changing state
  • Arbitrarily changing render target formats
  • Interoperability with pipelines
  • Emulation layer integration

The PR also updates the "vulkan" submodule to the sdk-1.3.250.1 tag, which is required for VK_EXT_shader_object support in the Vulkan headers.

@CLAassistant
Copy link

CLAassistant commented Jun 14, 2023

CLA assistant check
All committers have signed the CLA.

@tomadamatkinson
Copy link
Collaborator

Hey @daniel-story, I have updated the copyright check to work with Copyright YYYY. The test now fails on a json file

If you add .json to https://github.com/KhronosGroup/Vulkan-Samples/blob/main/.copyrightignore this should resolve this issue. Feel free to ping me if you need any further help with this check :)

@SaschaWillems SaschaWillems self-requested a review June 16, 2023 15:48
Copy link
Collaborator

@SaschaWillems SaschaWillems left a comment

Choose a reason for hiding this comment

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

Thank you very much for this sample. It's a great sample and much more than I could imagine :)

The only problem I noticed while testing is that sample crashes when I try to resize it (not sure if this is actually the samples' fault or something we need to fix in the framework)

Other than that everything worked as expected on my RTX 2060 in Win11. Code looks fine too and the readme is very well written.

@gary-sweet
Copy link
Contributor

I tried to test this, as agreed at the samples meeting. Unfortunately, the sample uses geometry shaders, which we don't currently support, so I can't actually test it I'm afraid.

@daniel-story
Copy link
Contributor Author

Thank you for the review, and for pointing out the resizing bug. Both comments should be addressed now, along with a few minor grammar and clarity edits to the documentation.

SaschaWillems
SaschaWillems previously approved these changes Jun 27, 2023
gpx1000
gpx1000 previously approved these changes Jun 29, 2023
Copy link
Contributor

@asuessenbach asuessenbach left a comment

Choose a reason for hiding this comment

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

And the Oscar goes to... @daniel-story!
Great Cinema!!

Just a couple of mostly minor issues and questions :)
And I get some validation layer messages, that should be resolved!

Besides that, we might think about introducing a real basic sample on the shader_objects. One with less eye-candy, that shows how to use them on a very reduced and minimal level.
And, on the other end, we might think about introducing an even bigger sample, that also includes the same functionality using the good old pipelines (driving the pipeline cache nuts!) and shows performance or memory footprint differences. Or maybe that could even be added to this one.

samples/extensions/shader_object/shader_object.cpp Outdated Show resolved Hide resolved
samples/extensions/shader_object/shader_object.cpp Outdated Show resolved Hide resolved
samples/extensions/shader_object/shader_object.cpp Outdated Show resolved Hide resolved
samples/extensions/shader_object/shader_object.h Outdated Show resolved Hide resolved
samples/extensions/shader_object/shader_object.h Outdated Show resolved Hide resolved
samples/extensions/shader_object/shader_object.h Outdated Show resolved Hide resolved
samples/extensions/shader_object/shader_object.h Outdated Show resolved Hide resolved
samples/extensions/shader_object/shader_object.h Outdated Show resolved Hide resolved
@daniel-story daniel-story marked this pull request as draft August 3, 2023 23:44
@daniel-story daniel-story marked this pull request as ready for review August 15, 2023 17:24
Copy link
Collaborator

@SaschaWillems SaschaWillems left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you (again) for this great sample :)

@gpx1000
Copy link
Collaborator

gpx1000 commented Aug 16, 2023

This will require some additional work beyond the scope of this PR. MoltenVK currently doesn't have support for this extension and the sample crashes on account of it. Resizing windows also seems to be a problem but that likely can be better fixed elsewhere.
Thanks for the heroic effort in getting us this sample Daniel! I'm approving this PR as is.

Copy link
Collaborator

@gpx1000 gpx1000 left a comment

Choose a reason for hiding this comment

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

Sorry I need to put a request changes on this.

I'm getting a crash in Linux with the latest. The error happens saying the following:

[error] [framework/core/instance.cpp:88] Validation Layer VK_LAYER_KHRONOS_shader_object not found

If necessary I'm happy to fix it and submit changes to this PR but we definitely need to ensure that it runs successfully. We can address any minor changes in a future PR.

@gpx1000
Copy link
Collaborator

gpx1000 commented Aug 17, 2023

I made a suggested PR targeting your PR with suggested fixes. With the suggested fixes, Linux Windows and Android seem to work. I also fixed 3 validation layer issues on sample destruction. Please consider my suggested edits as public domain, accept or reject as necessary. Please note, I didn't bother with checking if the copyright years are updated or if the style requirements will be accepted by CI. Let me know if that would be helpful.

Copy link
Contributor

@asuessenbach asuessenbach left a comment

Choose a reason for hiding this comment

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

LGTM!

@marty-johnson59 marty-johnson59 merged commit 4d0eb95 into KhronosGroup:main Aug 17, 2023
23 checks passed
tomadamatkinson pushed a commit to tomadamatkinson/Vulkan-Samples that referenced this pull request Aug 22, 2023
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.

8 participants