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

Generate debug name matching the source language for opaque types #3646

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

qingyuanzNV
Copy link
Contributor

This patch improves the non-semantic debug name of opaque (sampler) types. Instead of using a generic name of "type.sampler" or something alike, we generate a name that matches the GLSL source language. So OpTypeImage would have debug name of "imageXXX" or "textureXXX". OpTypeSampler would have debug name of "sampler" or "samplerShadow". OpTypeSampledImage would have debug name of "samplerXXX".

Also, as a minor tweak, TSampler::getString() now should returns a std::string. This avoids memory for type names piling up in the pool when the function is called repetitively.

Question: need we retain the existing behavior for HLSL source? It seems other names for debug types are GLSL centric, but when a HLSL source program is compiled, it would look weird to have type names not exist in the language.

@arcady-lunarg
Copy link
Contributor

I think ideally for HLSL we should either keep the names as they are now (at least that won't break compatibility) or else use proper HLSL names, I don't think it makes sense to switch to GLSL-based names.

@qingyuanzNV
Copy link
Contributor Author

Thanks for comment! Let me restore the old names for HLSL path.

@qingyuanzNV
Copy link
Contributor Author

I noticed today that DXC is also generating the same name for opaque types like "type.2d.image". It would be great if this could be a written convention in the non-semantic debug spec. Then we could associate the linkage name of an opaque type with the actual SPIR-V type and we could easily identify opaque types across different languages. The SPIR-V generator like GLSLANG could only update the display name in DebugTypeComposite to the name in the source language and still use the linkage name like "@type.2d.image"

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.

2 participants