-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
opengl: add support for 16hf formats #265
Conversation
6be6b6c
to
48a0670
Compare
Note: We don't currently have a conceivable use case for half float vertex data. It may make sense to reduce the check to just color renderable half float textures (and drop the corresponding V capability), which will also make it a bit less redundant with the existing Looks good either way. |
|
Oh, I see. That sounds like unintended behavior. Give me a moment to prepare a patch |
Capabilities like vertex, texel buffer support or readback shouldn't influence the sorting, because this requirement will typically be explicitly filtered for when searching for such formats. This capability sorting only exists to allow prioritizing formats that have the optional ability to leverage more performant code paths, e.g. by allowing blits, linear sampling or texture storage. And in either case, we wouldn't want to pick a worse rendering format just for some minor side benefit from having it be compute-dispatchable when blending or some other obscure edge case like that. (And lastly, there is also the user friendliness consideration of wanting "primitive" texture formats near the top of the list)
It is a GLES 2.0 extension, and we do not enable 16f formats with GLES 2.0 at present.
It seems that NaNs do not survive an upload/download round-trip on my end. They get consistently written back as 0xFE00. We could probably modify our test suite to not generate these NaNs in the first place, but given the fact that it works for "native" formats like 32-bit floats, as well as 16-bit floats on Vulkan, I rather suspect that the issue here is that the 16hf code path on my GL driver is actually emulated internally. Should we mark them as emulated?
Full log: testlog.txt |
It is implementation-dependent. e.g. iris fails the test while swrast passes it. According to OpenGL spec (ver 4.6, sec 2.3.4), passing NaN to GL commands is an UB, despite 16hf or 32f:
IMO we should not assume the result of an UB in tests. |
Okay, then we have no choice but to make our test framework smarter when generating/testing floating point values. I'll write a patch for it. |
BTW it is also an UB in Vulkan. https://registry.khronos.org/vulkan/specs/1.3/html/chap3.html#fundamentals-general |
Rebased + merged this manually, thanks |
Fixes #263.