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

OpCopyLogical should do bool<->uint8_t conversions #181

Open
seanbaxter opened this issue Nov 16, 2020 · 2 comments
Open

OpCopyLogical should do bool<->uint8_t conversions #181

seanbaxter opened this issue Nov 16, 2020 · 2 comments

Comments

@seanbaxter
Copy link

The purpose of OpCopyLogical is to convert between layout OpTypeStructs (eg for Uniform and StorageBuffer storage classes) and non-layout OpTypeStructs (eg for Function and Private storage classes). Since OpTypeBool isn't a layout type, layouts need to store these as uint8_t and OpINotEqual to get a bool back out. This should be a supported operation of OpCopyLogical, because without it, it won't actually perform layout<->non-layout conversions in a general way.

@johnkslang
Copy link
Member

But, it is not formalized in SPIR-V what the physical representation of a Boolean is. E.g., Vulkan uses 32-bit int for storage buffers. I think something needs to remain abstracted here. Or, possibly parameterized, to avoid resorting to member-wise copy when boolean conversions are involved.

@seanbaxter
Copy link
Author

OpCopyLogical should do bool<->any integral type. Both types involved in the conversion are explicit, so there's no chance of the operator favoring one boolean representation over another.

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

No branches or pull requests

2 participants