You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To my understanding glslang presently supports for selecting an alternative entrypoints. While working with multiple compute shaders, I wondered what the correct way is to specifcy the workgroup size when their parameters differ for the respective entrypoints.
This would roughly be mapped like this, but also illustrates the problem. Most glsl snippets the local size is uniformly specified in global scope disassociated from the effective entrypoint so this causes double declaration problem.
One of the question I have is what is the official approach to this behavior without invoking/relying on preprocessor directives. After some quick tests I noticed this declaration statement can be inside the function body scope, that behavior seems conform the documented grammer outlined in "Ch 9. Shading Language Grammer" of "OpenGL Shading Language, Version 4.60.8".
In specific the "layout_qualifier" is reachable from the "function_definition" however lack of clear documented cases makes me question if it's actually a case of valid or undefined behavior, and/or if I can rely on traditional compiler optimisations e.g. function call elimination to negate the potentional double declaration.
This sounds more like a GLSL spec question, perhaps something that can be added via a GLSL extension and thus perhaps it is something best discussed in the GLSL repository. If you would like, I can transfer this issue there for discussion of an extension spec, which would be needed before any glslang implementation could be accepted.
To my understanding glslang presently supports for selecting an alternative entrypoints. While working with multiple compute shaders, I wondered what the correct way is to specifcy the workgroup size when their parameters differ for the respective entrypoints.
Consider the following example:
This would roughly be mapped like this, but also illustrates the problem. Most glsl snippets the local size is uniformly specified in global scope disassociated from the effective entrypoint so this causes double declaration problem.
One of the question I have is what is the official approach to this behavior without invoking/relying on preprocessor directives. After some quick tests I noticed this declaration statement can be inside the function body scope, that behavior seems conform the documented grammer outlined in "Ch 9. Shading Language Grammer" of "OpenGL Shading Language, Version 4.60.8".
In specific the "layout_qualifier" is reachable from the "function_definition" however lack of clear documented cases makes me question if it's actually a case of valid or undefined behavior, and/or if I can rely on traditional compiler optimisations e.g. function call elimination to negate the potentional double declaration.
Related to:
The text was updated successfully, but these errors were encountered: