Skip to content

Commit

Permalink
Change NO_INVARIANCE to INVARIANCE option
Browse files Browse the repository at this point in the history
  • Loading branch information
solidpixel committed May 17, 2023
1 parent fdb5d40 commit 6a4e78d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ option(ASTCENC_SHAREDLIB "Enable astcenc builds with core library shared objects
option(ASTCENC_DIAGNOSTICS "Enable astcenc builds with diagnostic trace")
option(ASTCENC_ASAN "Enable astcenc builds with address sanitizer")
option(ASTCENC_UNITTEST "Enable astcenc builds with unit tests")
option(ASTCENC_NO_INVARIANCE "Enable astcenc builds without floating point invariance")
option(ASTCENC_INVARIANCE "Enable astcenc floating point invariance" ON)
option(ASTCENC_CLI "Enable build of astcenc command line tools" ON)

set(ASTCENC_UNIVERSAL_BUILD OFF)
Expand Down Expand Up @@ -204,9 +204,9 @@ printopt("NATIVE backend " ${ASTCENC_ISA_NATIVE})
if("${ASTCENC_MACOS_BUILD}")
printopt("Universal bin " ${ASTCENC_UNIVERSAL_BUILD})
endif()
printopt("Decompressor " ${ASTCENC_DECOMPRESSOR})
printopt("Invariance " ${ASTCENC_INVARIANCE})
printopt("Shared libs " ${ASTCENC_SHAREDLIB})
printopt("No invariance " ${ASTCENC_NO_INVARIANCE})
printopt("Decompressor " ${ASTCENC_DECOMPRESSOR})
printopt("Diagnostics " ${ASTCENC_DIAGNOSTICS})
printopt("ASAN " ${ASTCENC_ASAN})
printopt("Unit tests " ${ASTCENC_UNITTEST})
Expand Down
2 changes: 1 addition & 1 deletion Docs/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ will return the error `ASTCENC_ERR_NOT_IMPLEMENTED` during context creation.
All normal builds are designed to be invariant, so any build from the same git
revision will produce bit-identical results for all compilers and CPU
architectures. To achieve this we sacrifice some performance, so if this is
not required you can specify `-DASTCENC_NO_INVARIANCE=ON` to enable additional
not required you can specify `-DASTCENC_INVARIANCE=OFF` to enable additional
optimizations. This has most benefit for AVX2 builds where we are able to
enable use of the FMA instruction set extensions.

Expand Down
4 changes: 2 additions & 2 deletions Source/cmake_core.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_IS_VENEER)
$<$<CXX_COMPILER_ID:${CLANG_LIKE}>:-fsanitize=address>)
endif()

if(${ASTCENC_NO_INVARIANCE})
if(NOT ${ASTCENC_INVARIANCE})
target_compile_definitions(${ASTCENC_TARGET_NAME}
PRIVATE
ASTCENC_NO_INVARIANCE=1)
Expand Down Expand Up @@ -330,7 +330,7 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_IS_VENEER)
# which significantly improve performance. Note that this DOES reduce
# image quality by up to 0.2 dB (normally much less), but buys an
# average of 10-15% performance improvement ...
if(${ASTCENC_NO_INVARIANCE} AND NOT ${ASTCENC_IS_VENEER})
if((NOT ${ASTCENC_INVARIANCE}) AND (NOT ${ASTCENC_IS_VENEER}))
target_compile_options(${ASTCENC_TARGET_NAME}
PRIVATE
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-mfma>)
Expand Down

0 comments on commit 6a4e78d

Please sign in to comment.