-
Notifications
You must be signed in to change notification settings - Fork 238
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
Implement 'half' floating point precision #262
Merged
Merged
Conversation
This file contains 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
HlmsDiskCache now accounts for some misc flags for invalidation
Add support for relaxed precision mode, not just forced half16
At least RADV (possibly others) assume input data is already in ushort16 if the input is declared as half. If declared as float, it will autoconvert. This is consistent with the behavior of uint, so it's possibly not a driver bug but rather by spec.
Add RSC_SHADER_RELAXED_FLOAT Disable relaxed mode in D3D11. It's buggy Support D3D11 unit tests from within Linux/Wine
Default to Full32
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.
This PR adds
Hlms::setPrecisionMode
with the following options:PrecisionFull32
midf
datatype maps to float (i.e. 32-bit)PrecisionMidf16
midf
datatype maps to float16_t (i.e. forced 16-bit)RSC_SHADER_FLOAT16
PrecisionRelaxed
PrecisionFull32
PrecisionRelaxed
midf
datatype maps to mediump float / min16floatRSC_SHADER_RELAXED_FLOAT
PrecisionMidf16
PrecisionFull32
We use the keyword "midf" because "half" is already taken on Metal.
The default is
PrecisionFull32
which always works and ensures no quality problems.PrecisionMidf16
&PrecisionRelaxed
may need more testing but may help with either performance or battery usage in mobile.PrecisionRelaxed
is supported by D3D11 however it's force-disabled because of fxc bugs.Only Vulkan and Metal can currently take advantage of these settings and is likely to stay that way.
Support is very new: I've encountered various bugs (in drivers, in spirv-reflect, in fxc, in RenderDoc) so users are advised to test this option thoroughly before deploying it.
Metal is likely the API with best half 16-bit support at the moment.