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

OpWritePackedPrimitiveIndices4x8NV and OpEntryPoint interface #104

Open
cmarcelo opened this issue Mar 25, 2021 · 2 comments
Open

OpWritePackedPrimitiveIndices4x8NV and OpEntryPoint interface #104

cmarcelo opened this issue Mar 25, 2021 · 2 comments

Comments

@cmarcelo
Copy link
Contributor

OpWritePackedPrimitiveIndices4x8NV implicitly refer to "output variable decorated with the PrimitiveIndicesNV BuiltIn" instead of using an explicit ID. The OpEntryPoint interface is defined as

The set of Interface must be equal to or a superset of the global OpVariable Result referenced by the entry point’s static call tree, within the interface’s storage classes.

Glslang (Version: 10:11.0.0) doesn't include the variable in the interfaces if only OpWritePackedPrimitiveIndices4x8NV is used but no other explicit references. I think either:

  • This is (effectively) expected behavior, and we could add a note to SPV_NV_mesh_shader clarifiying this;
  • This is a bug in GLSLang, implicit reference should count for the interfaces, the spec should change either the definition of OpEntryPoint or OpWritePackedPrimitiveIndices4x8NV.
@cmarcelo
Copy link
Contributor Author

Actually it seems GLSLang is not even creating the variable in the case only the write packed refers to it.

@kholtnv
Copy link

kholtnv commented Jun 29, 2021

There is an implied write to gl_PrimitiveIndicesNV and perhaps glslang should mark this as an output variable on the OpEntryPoint, though, as you note, glslang would need to "synthesize" some declaration and use of gl_PrimitiveIndicesNV. In that sense it seems more reasonable to just note this in the SPV_NV_mesh_shader ext (option 1).

Presumably one could work around this by doing the assigns to gl_PrimitiveIndicesNV manually (in that case glslang does record the use in OpEntryPoint).

Is there a tool/app that is failing because of this?

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

No branches or pull requests

2 participants