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

[HLSL] Add concept expressions to validate StructuredBuffer element types #117406

Open
bob80905 opened this issue Nov 23, 2024 · 0 comments
Open
Assignees
Labels
HLSL HLSL Language Support

Comments

@bob80905
Copy link
Contributor

bob80905 commented Nov 23, 2024

Raw buffer resources, like StructuredBuffer, need concept decls so that their element types can be validated. The concepts need to use the negation of the is_intangible builtin, that should be a sufficient condition to impose on element types.
Tests need to be added. This issue is resolved when there are tests that show that raw buffers with invalid element types fail at compile time.
The infrastructure has all been added, all that's needed is another function, like constructTypedBufferConstraintExpr, but for raw buffers. It needs to be passed as an argument to the forward declarations of the relevant buffers, in the addSimpleTemplateParams function, just like constructTypedBufferConstraintExpr's return value was. The content should be just like constructTypedBufferConstraintExpr, except the constraint expression should, instead of using the typed element compatible builtin, use __is_intangible, and then add a Unary expression that negates the result.

Note: also consider the case where sizeof(T) == 0. This should be rejected!

@bob80905 bob80905 self-assigned this Nov 23, 2024
@EugeneZelenko EugeneZelenko added HLSL HLSL Language Support and removed new issue labels Nov 23, 2024
@bob80905 bob80905 moved this to Ready in HLSL Support Nov 25, 2024
@bob80905 bob80905 changed the title [HLSL] Add concepts to validate raw buffer element types [HLSL] Add concept expressions to validate raw buffer element types Nov 25, 2024
@damyanp damyanp moved this from Ready to Planning in HLSL Support Nov 25, 2024
@damyanp damyanp changed the title [HLSL] Add concept expressions to validate raw buffer element types [HLSL] Add concept expressions to validate StructuredBuffer element types Nov 26, 2024
@damyanp damyanp moved this from Planning to Active in HLSL Support Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HLSL HLSL Language Support
Projects
Status: Active
Development

No branches or pull requests

2 participants