Skip to content

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"

@dnovillo dnovillo self-requested a review June 26, 2025 20:44
@dnovillo
Copy link
Collaborator

@qingyuanzNV is this still relevant?

@dnovillo dnovillo self-assigned this Jun 26, 2025
@dnovillo dnovillo removed their assignment Aug 27, 2025
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.

3 participants