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

bool debug type not generated for non semantic debugging #3376

Closed
chaocNV opened this issue Oct 24, 2023 · 3 comments
Closed

bool debug type not generated for non semantic debugging #3376

chaocNV opened this issue Oct 24, 2023 · 3 comments

Comments

@chaocNV
Copy link
Contributor

chaocNV commented Oct 24, 2023

It appears that when we make bool type in SPIRV builder via Id Builder::makeBoolType(bool const compilerGenerated), it has a hidden argument of bool const compilerGenerated = true. And generating debug type for bool is always gated on that argument being false:

if (emitNonSemanticShaderDebugInfo && !compilerGenerated)
{
        auto const debugResultId = makeBoolDebugType(32);
        debugId[type->getResultId()] = debugResultId;
}

I believe this is redundant as there is no harm in creating a debug bool type regardless. It's a primitive type like int/float and those do not have this check. Currently all the usage of makeBoolType do not pass in a false argument and therefore bool debug type is never generated.

My suggested fix would be remove compilerGenerated from makeBoolType entirely. If you agree, I can create a PR for it.

To illustrate the problem, following shader would crash in glslang currently:


#version 460

uniform UBO {
    bvec2 uniform_bvec2;
};

buffer SSBO {
    bvec2 buffer_bvec2;
};



void main() {
    buffer_bvec2 = uniform_bvec2;
}

@arcady-lunarg
Copy link
Contributor

Yeah, I think the correct thing is to just always emit the boolean debug type and I would welcome a PR. Before you create the PR however, it would be a good idea to check that this works fine in renderdoc, since that is the ultimate consumer of this debug info.

@chaocNV
Copy link
Contributor Author

chaocNV commented Oct 25, 2023

PR created

Yeah, I think the correct thing is to just always emit the boolean debug type and I would welcome a PR. Before you create the PR however, it would be a good idea to check that this works fine in renderdoc, since that is the ultimate consumer of this debug info.

PR created. I'm not very familiar with renderDoc. Could you help give this a quick run on it if you have the setup?

@arcady-lunarg
Copy link
Contributor

This has been fixed by the linked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants