-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add feature tags to signify engine float precision #69538
Conversation
b1624c5
to
778f78f
Compare
It's worth mentioning that this PR will be further complemented by #67906, which will make the engine prioritize the more specific entry in a [libraries]
linux.x86_64.double = "res://my-extension-double-precision-x64.so"
linux.x86_64 = "res://my-extension-single-precision-x64.so" It's also worth mentioning that this PR does not address the case where a [libraries]
linux.x86_64 = "res://my-extension-single-precision-x64.so" ... which would match both This could be partially addressed by also adding a [libraries]
linux.x86_64.single = "res://my-extension-single-precision-x64.so" Let me know if you think something like |
I think double_precision or float_64 would be clearer names |
double
as a feature tag to signify float=64
float=64
Fair point! Something like |
778f78f
to
ae184a9
Compare
float=64
There, I've renamed |
Hold on. #67399 has been approved (not merged as of the time writing this). So "double" may make more sense. |
Ah, yes, thank you for linking that PR. In that case I agree that something like I guess another thing to consider with regards to the naming is that the editor already adds Also, if I understand it correctly, when #67906 ends up being merged, extensions will be able to use their library filenames as feature tags, without specifying anything in their I'll leave it unchanged for now, for further discussion. |
ae184a9
to
7ee6079
Compare
Considering the |
3a8be01
to
8c10817
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having feature tags like this is a good idea, and the specific names proposed here are very good names.
Any chance of having this merged for 4.0? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. After this is merged, remember to update the Feature tags documentation as well (you can open a PR as draft right away).
|
Thanks! |
This adds
double
(edit: andsingle
) as a "feature tag" toOS::has_feature
to signify whether an engine was built with double-precision, also known asfloat=64
orREAL_T_IS_DOUBLE
.This allows, for example, the engine to load different extension libraries (see here) depending on if the engine was built with
float=32
orfloat=64
, allowing extension authors to bundle libraries for both precision types.Without this ability to differentiate between
float=32
andfloat=64
the engine will crash when loading an extension with a mismatching precision type.