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

Allow DebugTypePointer BaseType argument substitution by DebugInfoNone #287

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bwlodarcz
Copy link

This update addresses the DebugTypePointer instruction, which represents pointer types in the SPIR-V NonSemantic.Shader.DebugInfo.100 standard. Currently, the instruction requires a defined Base Type argument to comply with the standard. This requirement complicates the implementation of pointers to abstract types, such as void * in C, which represents type erasure, since these types do not have an available or defined Base Type.

To accommodate such scenarios, the standard includes the DebugInfoNone instruction. This amendment allows for the substitution of the concrete Base Type argument in DebugTypePointer with DebugInfoNone, thereby simplifying the implementation process for abstract pointer types.

This update addresses the DebugTypePointer instruction, which represents pointer types in the SPIR-V NonSemantic.Shader.DebugInfo.100 standard.
Currently, the instruction requires a defined Base Type argument to comply with the standard.
This requirement complicates the implementation of pointers to abstract types,
such as void * in C, which represents type erasure, since these types do not have an available or defined Base Type.

To accommodate such scenarios, the standard includes the DebugInfoNone instruction.
This amendment allows for the substitution of the concrete Base Type argument in DebugTypePointer with DebugInfoNone,
thereby simplifying the implementation process for abstract pointer types.
@@ -614,7 +614,8 @@ Describe a pointer or reference data type. +
{result_type} +
+
'Base Type' is the '<id>' of a debugging instruction that represents the pointee
type. +
type. If the 'Base Type' is not defined or not available in source program,
this operand must refer to <<DebugInfoNone,*DebugInfoNone*>>. +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that's your picked solution that is also implemented in the SPIR-V backend but I'd like to understand how this is preferable to the DebugTypeBasic trick as suggested in the thread #280 (comment)

I think DebugTypeBasic with FlagUnknownPhysicalLayout could be a suitable solution.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Naghasan I believe that answer #280 (comment) addresses your question. I'm open to further discussion.

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