-
Notifications
You must be signed in to change notification settings - Fork 37
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
[202y] Should 16-bit types be enabled by default? #365
Comments
Since Vulkan 1.1, float16 is core for both variables and buffers, but the feature doesn't have to be supported, just understood.
Is this size change only for local variables, or also for interfaces/uniforms/buffers? |
Just to align terminology: from the language specification the object representation is how it is stored in memory, and the value representation is how it might be stored in registers. The object representation can vary by memory space, which accounts for HLSL's different packing rules for constant buffers vs other memory spaces. Generally Ideally the object representation of fundamental data types does not change based on where it is stored or how the data is declared (i.e. the object representation of Today
That tracks with my expectation. I think most hardware these days supports float16. Technically storage is probably the only thing that really matters because the operations can be emulated at higher precision and still meet the precision minimums of float16.
This would be changing the object representation to 16-bits. The more I think about this I don't think we should do it. We really want an 8-bit bool to align with C++. There are things we could do to emulate 8-bit bools (and maybe we should think about those), but changing the size of bool will be disruptive so we should probably only do it once when we can align with C++ on 8-bits. |
That's my main concern for either Float16 or Bool8/Bool1/Bool16, if somebody writes a It looks like Vulkan supports for VK_FORMAT_R8_UINT (1 component, 8-bit, unsigned) and R16_SFLOAT (1 component, 16-bit, float) support is quite common as long as atomics are not involved. |
one word of warning, |
Is your feature request related to a problem? Please describe.
16 bit type support is pretty common these days. Should we enable 16-bit types by default in HLSL 202y?
Describe the solution you'd like
We should consider the pros and cons of enabling 16-bit types by default, and if there are other changes we should make along with 16bit types. One question that comes to mind is should we adjust the size of
bool
to be 16-bits rather than 32 when 16-bit types are supported?The text was updated successfully, but these errors were encountered: