-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
astcenc: Update to 4.7.0 #80375
astcenc: Update to 4.7.0 #80375
Conversation
The cmake appears to be for msvc enable strict for older and precise for newer. There’s also a clang cl change. For floating point math. |
Yeah, and also for regular Clang and GCC:
( It's pretty fine grained, I'm not sure we want to reproduce all this exactly, but I'll see what can be done easily. |
Since I don’t have guidance, we can try reproducing the code. |
I slept on this. This is trying to make the exported ASTC conversions stable across different machines with respect to math. |
75a6889
to
07e7d3c
Compare
I added the same flags as upstream, aside from the ones for ClangCL as we don't officially support it yet, and the tooling we have in |
What's the state of this PR? There have been 3 releases since |
SConstruct
Outdated
cc_version_major = int(cc_version["major"] or -1) | ||
cc_version_minor = int(cc_version["minor"] or -1) | ||
cc_version_metadata1 = cc_version["metadata1"] or "" | ||
env.compiler_version = (int(cc_version["major"]), int(cc_version["minor"]), int(cc_version["patch"])) |
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.
Shouldn't this refactor be in a separate PR from the astcenc library update? Perhaps as a prerequisite?
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.
It is :D #80719
But I'm not finding the time to polish it properly.
I might update this PR and just drop the compiler-specific tweaks, to add later.
07e7d3c
to
8b0612e
Compare
modules/astcenc/SCsub
Outdated
if env.msvc: | ||
# FIXME: MSVC compiler version detection isn't well implemented yet. | ||
pass | ||
# if env.compiler_version >= (19, 30, 0): | ||
# env_thirdparty.AppendUnique(CCFLAGS=["/fp:precise"]) | ||
# else: | ||
# env_thirdparty.AppendUnique(CCFLAGS=["/fp:strict"]) |
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.
Will look into this later, but if someone can test on MSVC and confirm that astc encoding still seems to behave ok, I think this can be merged already.
8b0612e
to
82f20cd
Compare
Removed all the compiler flag stuff for now, here's the old code for future reference: # Compiler options to ensure invariant build.
# Sync with upstream `Source/cmake_core.cmake` options for ASTCENC_INVARIANCE.
if env.msvc:
pass
if env.compiler_version >= (19, 30, 0):
env_thirdparty.AppendUnique(CCFLAGS=["/fp:precise"])
else:
env_thirdparty.AppendUnique(CCFLAGS=["/fp:strict"])
else:
from methods import using_clang
if using_clang(env) and env.compiler_version >= (10, 0, 0):
env_thirdparty.AppendUnique(CCFLAGS=["-ffp-model=precise"])
env_thirdparty.AppendUnique(CCFLAGS=["-ffp-contract=off"]) |
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.
You only live once merge?
https://github.com/ARM-software/astc-encoder/releases/tag/4.5.0
Draft as we need to review the compile flags for the "invariant" mode, which seems to be what we use (since we don't define
ASTCENC_NO_INVARIANCE
:https://github.com/ARM-software/astc-encoder/blob/008d43f1e57944fd6c5cb663ef2c21c4884835dd/Source/cmake_core.cmake#L231-L244
See all the changelog lines talking about invariance. I'm assuming this is something we want to ensure if possible @fire? (IIRC, this means having reproducible encodings on different systems, at the cost of some performance.)