[0011] Clarify behavior of SpirvType parameters and add SpirvOpaqueType#150
Merged
s-perron merged 1 commit intomicrosoft:mainfrom Jan 18, 2024
Merged
[0011] Clarify behavior of SpirvType parameters and add SpirvOpaqueType#150s-perron merged 1 commit intomicrosoft:mainfrom
s-perron merged 1 commit intomicrosoft:mainfrom
Conversation
Contributor
Author
75e6baf to
7f72eef
Compare
7f72eef to
908292b
Compare
s-perron
approved these changes
Jan 9, 2024
Collaborator
|
This is a pretty big change to the original proposal, but necessary to do what we need to do. |
llvm-beanz
approved these changes
Jan 16, 2024
Collaborator
llvm-beanz
left a comment
There was a problem hiding this comment.
I think this LGTM. I wonder if there is some alignment we should aim for between this proposal and #154.
Contributor
Author
|
I'd considered using For example typedef alignas(8) vk::SpirvType</* OpTypeInt */ 21, /* size */ 8, vk::ext_literal(8), vk::ext_literal(false)> uint8_t;or typedef vk::SpirvType</* OpTypeInt */ 21, /* size */ 8, vk::ext_literal(8), vk::ext_literal(false)> alignas(8) uint8_t;would not be valid syntax. |
Collaborator
|
Right... because That said, we might be able to implement this feature in terms of template<int Align, int Size>
struct alignas(Align) OpaqueType
{
_BitInt(Size) V;
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SpirvTypenow takes size and alignment as parameters, and a new templateSpirvOpaqueTypeis added that does not. Also lets users specify whether a parameter for the type-declaration instruction should take an id or an immediate literal value.Fixes #128.