Skip to content

Commit f6f0b9a

Browse files
committed
Update ASTC encoder to 5.3.0 (#1036)
5.3.0 is a minor maintenance release. git subrepo commit (merge) external/astc-encoder subrepo: subdir: "external/astc-encoder" merged: "1c5233bf0" upstream: origin: "https://github.com/ARM-software/astc-encoder.git" branch: "5.3.0" commit: "30aabb3f4" git-subrepo: version: "0.4.9" origin: "https://github.com/MarkCallow/git-subrepo.git" commit: "4f60dd7"
1 parent f9c7338 commit f6f0b9a

26 files changed

+568
-416
lines changed

external/astc-encoder/.github/workflows/build_test.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ jobs:
1717
with:
1818
submodules: 'true'
1919

20+
- name: Update apt packages
21+
run: sudo apt-get update
22+
2023
- name: Install ImageMagick
21-
run: sudo apt install imagemagick
24+
run: sudo apt-get install imagemagick
2225

2326
- name: Build release
2427
run: |
@@ -55,18 +58,16 @@ jobs:
5558
pip install numpy Pillow
5659
5760
- name: Run system tests
58-
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
61+
# Disable SVE for now
5962
run: |
6063
python ./Test/astc_test_functional.py --encoder none
6164
python ./Test/astc_test_functional.py --encoder neon
62-
python ./Test/astc_test_functional.py --encoder sve_128
6365
python ./Test/astc_test_image.py --encoder none --test-set Small
6466
python ./Test/astc_test_image.py --encoder neon --test-set Small
65-
python ./Test/astc_test_image.py --encoder sve_128 --test-set Small
6667
6768
- name: Run unit tests
68-
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
69-
run: ctest -E test-unit-sve_256 --rerun-failed --output-on-failure
69+
# Disable SVE for now
70+
run: ctest -E "test-unit-sve_128|test-unit-sve_256" --rerun-failed --output-on-failure
7071
working-directory: build_rel
7172

7273
build-ubuntu-arm64-gcc:
@@ -78,13 +79,14 @@ jobs:
7879
with:
7980
submodules: 'true'
8081

82+
- name: Update apt packages
83+
run: sudo apt-get update
84+
8185
- name: Install ImageMagick
82-
run: sudo apt install imagemagick
86+
run: sudo apt-get install imagemagick
8387

8488
- name: Install GCC 14
85-
run: |
86-
sudo apt-get update
87-
sudo apt-get install -y gcc-14
89+
run: sudo apt-get install -y gcc-14
8890

8991
- name: Build release
9092
run: |
@@ -113,18 +115,16 @@ jobs:
113115
pip install numpy Pillow
114116
115117
- name: Run system tests
116-
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
118+
# Disable SVE for now
117119
run: |
118120
python ./Test/astc_test_functional.py --encoder none
119121
python ./Test/astc_test_functional.py --encoder neon
120-
python ./Test/astc_test_functional.py --encoder sve_128
121122
python ./Test/astc_test_image.py --encoder none --test-set Small
122123
python ./Test/astc_test_image.py --encoder neon --test-set Small
123-
python ./Test/astc_test_image.py --encoder sve_128 --test-set Small
124124
125125
- name: Run unit tests
126-
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
127-
run: ctest -E test-unit-sve_256 --rerun-failed --output-on-failure
126+
# Disable SVE for now
127+
run: ctest -E "test-unit-sve_128|test-unit-sve_256" --rerun-failed --output-on-failure
128128
working-directory: build_rel
129129

130130
build-ubuntu-x64-clang:

external/astc-encoder/.github/workflows/post_weekly_release.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ jobs:
7171
with:
7272
submodules: 'true'
7373

74+
- name: Update apt packages
75+
run: sudo apt-get update
76+
7477
- name: Install ImageMagick
75-
run: sudo apt install imagemagick
78+
run: sudo apt-get install imagemagick
7679

7780
- name: Build release
7881
run: |
@@ -101,12 +104,10 @@ jobs:
101104
pip install numpy Pillow
102105
103106
- name: Run system tests
104-
# GitHub is using Cobalt-100, which has 128-bit SVE so we cannot test sve_256 here
107+
# Disable SVE testing for now
105108
run: |
106109
python ./Test/astc_test_functional.py --encoder neon
107-
python ./Test/astc_test_functional.py --encoder sve_128
108110
python ./Test/astc_test_image.py --encoder neon --test-set Small
109-
python ./Test/astc_test_image.py --encoder sve_128 --test-set Small
110111
111112
build-ubuntu-x64:
112113
name: Ubuntu x64

external/astc-encoder/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Editor and engineering scratch files
2+
.cache
23
.vs
34
.vscode
45
.DS_Store

external/astc-encoder/.gitrepo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
;
66
[subrepo]
77
remote = https://github.com/ARM-software/astc-encoder.git
8-
branch = 5.2.0
9-
commit = 2319d9c4d4af53a7fc7c52985e264ce6e8a02a9b
10-
parent = 7475bc1bc0411e672a0a833e19f1f53bde30b588
8+
branch = 5.3.0
9+
commit = 30aabb3f42406df45a910d8496f9bee17eeba9bb
10+
parent = f9c73388a58de9b83f260f11008b043d8f7c0954
1111
method = merge
12-
cmdver = 0.4.3
12+
cmdver = 0.4.9

external/astc-encoder/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(MSVC)
2525
add_compile_options("/wd4324")
2626
endif()
2727

28-
project(astcencoder VERSION 5.2.0)
28+
project(astcencoder VERSION 5.3.0)
2929

3030
set(CMAKE_CXX_STANDARD 14)
3131
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -45,13 +45,15 @@ option(ASTCENC_ISA_NONE "Enable astcenc builds for no SIMD")
4545
option(ASTCENC_ISA_NATIVE "Enable astcenc builds for native SIMD")
4646
option(ASTCENC_DECOMPRESSOR "Enable astcenc builds for decompression only")
4747
option(ASTCENC_SHAREDLIB "Enable astcenc builds with core library shared objects")
48+
option(ASTCENC_BIG_ENDIAN "Enable astcenc big-endian support")
4849
option(ASTCENC_DIAGNOSTICS "Enable astcenc builds with diagnostic trace")
4950
option(ASTCENC_ASAN "Enable astcenc builds with address sanitizer")
5051
option(ASTCENC_UBSAN "Enable astcenc builds with undefined behavior sanitizer")
5152
option(ASTCENC_UNITTEST "Enable astcenc builds with unit tests")
5253
option(ASTCENC_INVARIANCE "Enable astcenc floating point invariance" ON)
5354
option(ASTCENC_CLI "Enable build of astcenc command line tools" ON)
5455
option(ASTCENC_X86_GATHERS "Enable use of native x86 gathers" ON)
56+
option(ASTCENC_WERROR "Force builds to treat warnings as errors" ON)
5557

5658
# Preflight for some macOS-specific build options
5759
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
@@ -137,6 +139,9 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
137139
printopt("Universal bin " ${ASTCENC_UNIVERSAL_BUILD})
138140
endif()
139141
printopt("Invariance " ${ASTCENC_INVARIANCE})
142+
if(${ASTCENC_BIG_ENDIAN})
143+
printopt("Big endian " ${ASTCENC_BIG_ENDIAN})
144+
endif()
140145
printopt("Shared libs " ${ASTCENC_SHAREDLIB})
141146
printopt("Decompressor " ${ASTCENC_DECOMPRESSOR})
142147
message(STATUS "Developer options")

external/astc-encoder/Docs/ChangeLog-5x.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ release of the 5.x series.
66
All performance data on this page is measured on an Intel Core i5-9600K
77
clocked at 4.2 GHz, running `astcenc` using AVX2 and 6 threads.
88

9+
<!-- ---------------------------------------------------------------------- -->
10+
## 5.3.0
11+
12+
**Status:** March 2025
13+
14+
The 5.3.0 release is a minor maintenance release.
15+
16+
* **General:**
17+
* **Feature:** Reference C builds (`ASTCENC_ISA_NONE`) now support compiling
18+
for big-endian CPUs. Compile with `-DASTCENC_BIG_ENDIAN=ON` when compiling
19+
for a big-endian target; it is not auto-detected.
20+
* **Improvement:** Builds using GCC now specify `-flto=auto` to allow
21+
parallel link steps, and remove the log warnings about not setting a CPU
22+
count parameter value.
23+
* **Bug fix:** Builds using MSVC `cl.exe` that do not specify an explicit
24+
ISA using the preprocessor configuration defines will now correctly
25+
default to the SSE2 backend on x86-64 and the NEON backend on Arm64. Previously they would have defaulted to the reference C implementation,
26+
which is around 3.25 times slower.
27+
28+
929
<!-- ---------------------------------------------------------------------- -->
1030
## 5.2.0
1131

external/astc-encoder/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,16 @@ The x86-64 SSE2 builds will work on all x86-64 machines, but it is the slowest
7777
of the three. The other two require extended CPU instruction set support which
7878
is not universally available, but each step gains ~15% more performance.
7979

80-
For Arm, if binaries are available, we provide:
80+
For Arm we provide, in order of increasing performance:
8181

82+
* `astcenc-sve_256` - uses 256-bit SVE
83+
* `astcenc-sve_128` - uses 128-bit SVE
8284
* `astcenc-neon` - uses NEON
8385

86+
Note: The Arm Scalable Vector Extensions (SVE) allow CPUs to have a variable
87+
vector length. The astcenc implementation is not written in a length-agnostic
88+
style and requires the binary to match the vector length on the host CPU.
89+
8490
## macOS
8591

8692
For macOS devices we provide a single universal binary `astcenc`, which allows
@@ -235,10 +241,10 @@ or general mobile graphics development or technology please submit them on the
235241

236242
- - -
237243

238-
_Copyright © 2013-2024, Arm Limited and contributors. All rights reserved._
244+
_Copyright © 2013-2025, Arm Limited and contributors. All rights reserved._
239245

240246
[1]: ./Docs/FormatOverview.md
241-
[2]: https://www.khronos.org/registry/DataFormat/specs/1.3/dataformat.1.3.html#ASTC
247+
[2]: https://www.khronos.org/registry/DataFormat/specs/1.4/dataformat.1.4.html#ASTC
242248
[3]: https://github.com/ARM-software/astc-encoder/releases
243249
[4]: https://community.arm.com/support-forums/f/graphics-gaming-and-vr-forum/
244250
[5]: https://developer.arm.com/documentation/102162/latest/?lang=en

external/astc-encoder/Source/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717

1818
# Overwrite the LTO flags to force fat LTO; worth 3-4% performance
1919
# See https://gitlab.kitware.com/cmake/cmake/-/issues/16808
20-
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND ${ASTCENC_CLI})
20+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ${ASTCENC_CLI})
2121
set(CMAKE_CXX_COMPILE_OPTIONS_IPO "-flto")
2222
endif()
2323

24+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND ${ASTCENC_CLI})
25+
set(CMAKE_CXX_COMPILE_OPTIONS_IPO "-flto=auto")
26+
endif()
27+
2428
if(${ASTCENC_DECOMPRESSOR})
2529
set(ASTCENC_CODEC dec)
2630
else()

external/astc-encoder/Source/UnitTest/cmake_core.cmake

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@
1515
# under the License.
1616
# ----------------------------------------------------------------------------
1717

18+
include(../cmake_compiler.cmake)
19+
1820
set(ASTCENC_TEST test-unit-${ASTCENC_ISA_SIMD})
1921

2022
add_executable(${ASTCENC_TEST})
2123

24+
set_property(TARGET ${ASTCENC_TEST}
25+
PROPERTY
26+
CXX_STANDARD 17)
27+
2228
# Enable LTO under the conditions where the codec library will use LTO.
2329
# The library link will fail if the settings don't match
2430
if(${ASTCENC_CLI})
@@ -32,6 +38,7 @@ set_property(TARGET ${ASTCENC_TEST}
3238
PROPERTY
3339
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
3440

41+
3542
target_sources(${ASTCENC_TEST}
3643
PRIVATE
3744
test_simd.cpp
@@ -52,27 +59,34 @@ target_compile_options(${ASTCENC_TEST}
5259
$<$<PLATFORM_ID:Linux,Darwin>:-pthread>
5360

5461
# MSVC compiler defines
55-
$<$<CXX_COMPILER_ID:MSVC>:/EHsc>
62+
$<${is_msvc_fe}:/EHsc>
63+
$<$<AND:$<BOOL:${ASTCENC_WERROR}>,${is_msvc_fe}>:/WX>
64+
$<${is_msvccl}:/wd4324>
5665

5766
# G++ and Clang++ compiler defines
58-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall>
59-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wextra>
60-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wpedantic>
61-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Werror>
62-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wshadow>
63-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-compat-pedantic>
64-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-c++11-compat-pedantic>
65-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-float-equal>
66-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-overriding-option>
67-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unsafe-buffer-usage>
68-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-switch-default>
67+
$<${is_gnu_fe}:-Wall>
68+
$<${is_gnu_fe}:-Wextra>
69+
$<${is_gnu_fe}:-Wpedantic>
70+
$<$<AND:$<BOOL:${ASTCENC_WERROR}>,${is_gnu_fe}>:-Werror>
71+
$<${is_gnu_fe}:-Wshadow>
72+
$<${is_gnu_fe}:-Wdouble-promotion>
73+
$<${is_clang}:-Wdocumentation>
74+
75+
# Hide noise thrown up by Clang 10 and clang-cl
76+
$<${is_gnu_fe}:-Wno-unknown-warning-option>
77+
$<${is_gnu_fe}:-Wno-c++98-compat-pedantic>
78+
$<${is_gnu_fe}:-Wno-c++98-c++11-compat-pedantic>
79+
$<${is_gnu_fe}:-Wno-float-equal>
80+
$<${is_gnu_fe}:-Wno-overriding-option>
81+
$<${is_gnu_fe}:-Wno-unsafe-buffer-usage>
82+
$<${is_clang}:-Wno-switch-default>
6983

7084
# Ignore things that the googletest build triggers
71-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unknown-warning-option>
72-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-double-promotion>
73-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-undef>
74-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-reserved-identifier>
75-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-global-constructors>)
85+
$<${is_gnu_fe}:-Wno-unknown-warning-option>
86+
$<${is_gnu_fe}:-Wno-double-promotion>
87+
$<${is_gnu_fe}:-Wno-undef>
88+
$<${is_gnu_fe}:-Wno-reserved-identifier>
89+
$<${is_gnu_fe}:-Wno-global-constructors>)
7690

7791
# Set up configuration for SIMD ISA builds
7892
if(${ASTCENC_ISA_SIMD} MATCHES "none")
@@ -85,6 +99,12 @@ if(${ASTCENC_ISA_SIMD} MATCHES "none")
8599
ASTCENC_POPCNT=0
86100
ASTCENC_F16C=0)
87101

102+
if(${ASTCENC_BIG_ENDIAN})
103+
target_compile_definitions(${ASTCENC_TEST}
104+
PRIVATE
105+
ASTCENC_BIG_ENDIAN=1)
106+
endif()
107+
88108
elseif(${ASTCENC_ISA_SIMD} MATCHES "neon")
89109
target_compile_definitions(${ASTCENC_TEST}
90110
PRIVATE

0 commit comments

Comments
 (0)