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

Incorrect validation of DebugTypePointer: non-trivial base types are not allowed #5436

Open
RodrigoCastiel opened this issue Oct 10, 2023 · 0 comments

Comments

@RodrigoCastiel
Copy link

When validating DebugTypePointer instructions, the base type is checked to be a trivial type defined by DebugTypeBasic. This means that pointers to vectors or matrices are considered invalid, which prevents variables such as vec4 fragColor (GLSL) to have debug info emitted.

case CommonDebugInfoDebugTypePointer: {
auto validate_base_type =
ValidateOperandBaseType(_, inst, 5, ext_inst_name);
if (validate_base_type != SPV_SUCCESS) return validate_base_type;
CHECK_CONST_UINT_OPERAND("Storage Class", 6);
CHECK_CONST_UINT_OPERAND("Flags", 7);
break;
}

This validation rule is not present in the NonSemantic.Shader.DebugInfo.100 specification. Potential solutions:
(1) Check that Base Type in DebugTypePointer could be any debug type instruction.
(2) Simply remove the validation - ValidateOperandBaseType(_, inst, 5, ext_inst_name)
(3) Update the specification to reflect the intended behaviour in case pointers to non-trivial types are not allowed

Thanks for reading and checking that!

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

4 participants
@RodrigoCastiel @s-perron @alan-baker and others