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

Add analyzers for shader types being less accessible than internal #631

Merged
merged 5 commits into from
Oct 19, 2023

Conversation

Sergio0694
Copy link
Owner

Description

As part of the work to centralize the generation logic (so that it becomes reasonable to add more complicated logic as well, such as support for primary constructor, support for fields that are not publicly visible, etc.), all constant buffer marshalling logic will be shared across the D2D1 and D3D12 generator, and specifically it will also go into a new ConstantBufferMarshaller generated type, which will reference the shader type and the constant buffer. For this to work (as well as for the ability to interact with all fields as well), the shader types must have at least internal accessibility, or the generated code would be invalid.

This PR adds a new analyzer to emit an error when that is not the case (for both the D3D12 and D2D1 generators). Additionally, it disable the generator if the annotated type is not accessible. As precedent, the COM interop generator does exactly the same.

@Sergio0694 Sergio0694 added the breaking change 💣 A change that is either binary or source breaking label Oct 19, 2023
@Sergio0694 Sergio0694 merged commit fd67179 into main Oct 19, 2023
28 checks passed
@Sergio0694 Sergio0694 deleted the dev/internal-accessibility-analyzer branch October 19, 2023 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change 💣 A change that is either binary or source breaking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant