Support for multiple SPIRV entrypoints#56
Merged
chaoticbob merged 5 commits intoKhronosGroup:masterfrom Jul 26, 2018
Merged
Conversation
56957a9 to
70a4ee2
Compare
Contributor
Author
apazylbe
reviewed
Jul 16, 2018
spirv_reflect.c
Outdated
|
|
||
| *res = NULL; | ||
| if (*res_size > 0) { | ||
| *res = (uint32_t*)calloc(*res_size, sizeof(*res)); |
Contributor
There was a problem hiding this comment.
Shouldn't this be sizeof(**res)?
sean-purcell
added a commit
to sean-purcell/gapid
that referenced
this pull request
Jul 18, 2018
SPIRV-Reflect offers tools to analyze the interface exposed by a spirv module. It's used here to parse the descriptor sets that a given entry point of a module uses. NOTE: Upstream is currently iburinoc/SPIRV-Reflect, this should be switched to chaoticbob/SPIRV-Reflect once KhronosGroup/SPIRV-Reflect#56 and KhronosGroup/SPIRV-Reflect#58 are merged.
apazylbe
reviewed
Jul 23, 2018
spirv_reflect.h
Outdated
| @return | ||
| */ | ||
| inline const char* ShaderModule::GetEntryPointName(uint32_t index) const { | ||
| return m_module.entry_points[0].name; |
Contributor
There was a problem hiding this comment.
shouldn't this use index?
apazylbe
reviewed
Jul 23, 2018
spirv_reflect.h
Outdated
| @param entry_point | ||
| @param count | ||
| @param p_binding_numbers | ||
| @param p_set_numbers |
Contributor
There was a problem hiding this comment.
same for the functions below: are the parameter names right?
Contributor
Author
There was a problem hiding this comment.
Good point, the documentation for the original functions I copied from is also wrong, I'll fix those too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for handling multiple entry points in a single module and walking the static call tree of each to determine which descriptor sets/bindings, interface variables, and push constant blocks are actually used by each. The interface is a little awkward in places as I didn't want to change behaviour of the single-entry point mode. Apologies for the large PR, a lot of it is fluff due to essentially creating an extra copy of everything function in the interface.
The tests for the multiple entrypoints are a bit awkward to set up, as glslc and glslang don't support multiple entrypoints, so I set it up as a glsl file with a patch to apply to the disassembled spirv.
Ignore the first commit here, this PR depends on #55, so it should disappear when thats merged.