You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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
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
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 theaddSimpleTemplateParams
function, just likeconstructTypedBufferConstraintExpr
's return value was. The content should be just likeconstructTypedBufferConstraintExpr
, 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.The text was updated successfully, but these errors were encountered: