-
Notifications
You must be signed in to change notification settings - Fork 251
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
OpEntryPoint should list _all_ variable IDs referenced by the corresponding function. #35
Comments
Originally closed because I thought I made a mistake. If this is ever addressed, great! Otherwise, it looks like assumptions pursuant to this limitation might already have been baked into every driver in existence. Still, a discussion about the rationale - why uniforms aren't considered "input" - would be appreciated. |
I recall this was a deliberate choice but I can't remember why. I've asked the working group to review this. |
The interfaces are classified as:
It is understandable to view something in the uniform interface as an "input" (and sometimes also an "output"), but, the above terms are used to be clear which interface is being discussed. Using this terminology...
So, there are real differences between these interfaces. Having said that, Khronos is considering requiring future generators of SPIR-V to somehow also include the uniform interface more explicitly, if reflection tools etc. are not sufficient. Do you have a situation where a consumer of SPIR-V has to deduce an approximation to a uniform interface? Knowing use cases might help. |
In the case of simple stage-to-stage interface matching, my concerns can be boiled down to special-case handling of It would make the language (GLSL) easier to use if there was no such distinction between "in" streams within a fragment shader (they're all ultimately vec4 from the programmer's perspective), though I'm not certain of other implications of this at the moment. Note: This is all off the top of my head. I may come back to update this comment if it hasn't gone stale with too many references pointing into it. EDIT: It would not be a loss of generality to extend |
This functionality was added in version 1.4 of SPIR-V. |
It looks like listing global variables as interface of an |
The specification requires listing only inputs and outputs for
OpEntryPoint
. It should require listing all global variable IDs (including uniforms) that are referenced within the function's static call graph.In order to verify that two SPIR-V modules can be linked, and report meaningful errors, an application cannot rely on the ID list provided by
OpEntryPoint
.Listing only inputs and outputs is not sufficient to determine if linkage between stages from different modules (that share one or more uniforms by name or location) is valid. The locations, bindings, and types of shared uniforms must match between stages.
Unless the application assumes that all entry points in a module reference all uniforms declared therein, static analysis is still necessary to perform this very basic kind of validation.
Determining whether a referenced variable ID is an input or an output is easy, determining if a function actually uses a variable is time-consuming.
I am unable to find rationale for this limitation. If it is documented somewhere, I would appreciate a link.
The text was updated successfully, but these errors were encountered: