Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
d4ee0ce
Add astc cli options
wasimabbas-arm May 19, 2021
8781b60
Add swizzle option, remove redundant astc enum from ktx.h
wasimabbas-arm May 20, 2021
3f248a2
Add astc compression support
wasimabbas-arm May 21, 2021
c01d05d
Fix review comments for astc support
wasimabbas-arm May 23, 2021
2bf7bc6
Fix review comments for astc support part 2
wasimabbas-arm May 24, 2021
e30fb44
Change bcmp command line options to etc1s in tests
wasimabbas-arm May 24, 2021
a806477
Add back deprecated options --bcmp and --uastc
wasimabbas-arm May 24, 2021
d56a6e9
Update patch up code in ktxTexture_CompressAstcEx to use a prototype …
wasimabbas-arm May 24, 2021
99e0a72
Remove further redundant code, Since we are now using prototype textu…
wasimabbas-arm May 24, 2021
bf19acd
Remove redundant loop over the levels of the image
wasimabbas-arm May 24, 2021
0ac3ab1
Fix CI by adding ISA_NONE to astcenc options
wasimabbas-arm May 24, 2021
ecee952
Fix linux ci build
wasimabbas-arm May 24, 2021
18af498
Fix review comments
wasimabbas-arm May 25, 2021
d440dd1
Add combined normal mode
wasimabbas-arm May 25, 2021
8374a69
Minor typo fixes and ensures numLevels never less than 1
wasimabbas-arm May 26, 2021
d535c09
Minor typo fix
wasimabbas-arm May 26, 2021
eb3bcfa
Change build system to prefer ISA_NONE if defined
wasimabbas-arm May 26, 2021
155f3d3
Fix CI build issues for android and iOS, one has to specify -DARCH=aa…
wasimabbas-arm May 28, 2021
e1a5270
Add ci fix for android aarch32
wasimabbas-arm May 31, 2021
6913d17
Merge branch 'master' into astc_support
wasimabbas-arm May 31, 2021
59329b4
Add ci fix for android aarch32
wasimabbas-arm May 31, 2021
e68bfaf
Merge branch 'astc_support' of https://github.com/wasimabbas-arm/KTX-…
wasimabbas-arm May 31, 2021
98ff1c6
Add ci fix for android x86/x86_64
wasimabbas-arm Jun 1, 2021
0d4e473
Fix rescale argument, add a 3 valued enum
wasimabbas-arm Jun 2, 2021
d65be83
Add warnings if input is > 8 bit while LDR option is chosen, either e…
wasimabbas-arm Jun 2, 2021
f99d33c
Add updated html docs for scaap
wasimabbas-arm Jun 2, 2021
49f793b
Fix minor language
wasimabbas-arm Jun 9, 2021
8860912
Add default options when no astc mode is specified
wasimabbas-arm Jun 10, 2021
a6e3138
Re-Add only 8bit format limiations untill full HDR support is added
wasimabbas-arm Jun 10, 2021
4c440be
Add tests for astc support
wasimabbas-arm Jun 11, 2021
e6fa213
Modify astc test images
wasimabbas-arm Jun 11, 2021
46e8522
Add --test option to astc tests
wasimabbas-arm Jun 11, 2021
56ecbdc
Fix cpu architecture detection
wasimabbas-arm Jun 14, 2021
24f7e87
Merge branch 'KhronosGroup:master' into astc_support
wasimabbas-arm Jun 21, 2021
1dc4540
Add MSVC_RUNTIME_LIBRARY setting for ktx-software targets
wasimabbas-arm Jun 21, 2021
f71b09e
Add MSVC_RUNTIME_LIBRARY setting for ktx-software targets
wasimabbas-arm Jun 21, 2021
b7bc5a2
Update cputypetest.cmake to master branch
wasimabbas-arm Jun 22, 2021
ecdcd9d
Merge branch 'KhronosGroup:master' into astc_support
wasimabbas-arm Jun 22, 2021
31023ed
Update astc encoder build options
wasimabbas-arm Jun 25, 2021
52da83a
Update main.yml
wasimabbas-arm Jun 25, 2021
a4215bb
Merge branch 'master' into astc_support
wasimabbas-arm Jun 25, 2021
ae193dc
Reset SSE support for mac os
wasimabbas-arm Jun 25, 2021
8fbb954
Merge branch 'KhronosGroup:master' into astc_support
wasimabbas-arm Jun 27, 2021
aff59ed
Fix link errors for Visual studio 16
wasimabbas-arm Jun 28, 2021
b382950
Add max replacement for Visual studio
wasimabbas-arm Jun 28, 2021
d775d06
Linux ci fixes
wasimabbas-arm Jun 28, 2021
18abe5f
Documentation fixes
wasimabbas-arm Jun 28, 2021
019cbb4
Fix dfd.h include
wasimabbas-arm Jun 28, 2021
bd69070
Fix emscription include issue
wasimabbas-arm Jun 28, 2021
e2125c5
Fix universal build for mac os
wasimabbas-arm Jun 28, 2021
65286c8
Simply universal build option
wasimabbas-arm Jun 28, 2021
9114627
Remove astcencoder optimisation options and disable CLI
wasimabbas-arm Jun 29, 2021
e21f230
Travis download of broken tests
wasimabbas-arm Jun 30, 2021
02c6e93
Merge branch 'KhronosGroup:master' into astc_support
wasimabbas-arm Jul 1, 2021
3f95e4f
Add code to upload travis failed tests
wasimabbas-arm Jul 1, 2021
adf3b76
Fix tests
wasimabbas-arm Jul 2, 2021
22b2241
Fix tests
wasimabbas-arm Jul 2, 2021
85ced68
Testing travis CI system
wasimabbas-arm Jul 5, 2021
fb7f3d7
Test files size
wasimabbas-arm Jul 5, 2021
9ed028c
Enable verbose test output
wasimabbas-arm Jul 6, 2021
fa0a663
Fix travis mac os SSE tests
wasimabbas-arm Jul 13, 2021
9e2d753
Bump up iphone SDK version to force 64bit builds only
wasimabbas-arm Jul 13, 2021
8d0f156
Add astcenc shared library to install targets when built as static li…
wasimabbas-arm Jul 13, 2021
0ec690d
Reset travis linux build
wasimabbas-arm Jul 13, 2021
0103bb3
Remove debug code
wasimabbas-arm Jul 14, 2021
572c8df
Enable cubemap test
wasimabbas-arm Jul 14, 2021
9aafbcd
Reset verbose ctest output
wasimabbas-arm Jul 15, 2021
db2d803
Merge branch 'master' into astc_support
wasimabbas-arm Jul 21, 2021
1d955d5
Add reuse exclusion for astc example readme
wasimabbas-arm Jul 21, 2021
1d75eeb
Fix indentation
wasimabbas-arm Jul 27, 2021
8f42128
Docs fix and inputSwizzle size fix
wasimabbas-arm Jul 27, 2021
625b5ea
Remove ktxint.h dependency from scapp.h
wasimabbas-arm Jul 28, 2021
e273eff
Add VS fix for std::max
wasimabbas-arm Jul 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ jobs:
env:
ANDROID_ABI: arm64-v8a
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
ASTC_ISA: "ISA_NEON=ON"

- name: android_arm64-v8a
run: ./ci_scripts/build_android.sh
env:
ANDROID_ABI: arm64-v8a
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
ASTC_ISA: "ISA_NEON=ON"

- name: android_armeabi-v7a
run: ./ci_scripts/build_android.sh
Expand Down
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Files: */*.json
Copyright: 2017-2020 Mark Callow
License: Apache-2.0

Files: lib/astc-encoder/Docs/* lib/astc-encoder/Test/* lib/astc-encoder/jenkins/* lib/astc-encoder/.gitattributes lib/astc-encoder/.gitignore lib/astc-encoder/.gitmodules lib/astc-encoder/.pylintrc lib/astc-encoder/README.md
Files: lib/astc-encoder/Docs/* lib/astc-encoder/Test/* lib/astc-encoder/jenkins/* lib/astc-encoder/.gitattributes lib/astc-encoder/.gitignore lib/astc-encoder/.gitmodules lib/astc-encoder/.pylintrc lib/astc-encoder/README.md lib/astc-encoder/Utils/Example/README.md
Copyright: 2020-2021 Arm Limited
License: Apache-2.0

Expand Down
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
# Phase 3: Install cache components - Currently not using a cache
# then the following phases:
before_install:
- echo "Running on the following travis CI runner"
- uname -a
- echo "CMake version on the runner is"
- cmake --version
- eval "${MATRIX_EVAL}"
- echo -e "machine github.com\n login $GITHUB_TOKEN" >> ~/.netrc # Prevent rate limiting on Git LFS.
- cat ~/.netrc
Expand Down Expand Up @@ -103,6 +107,12 @@ script:
after_script:
- sleep 10

# after_failure:
# - echo "Now uploading the failed tests"
# - ls -alsh ./tests/testimages/toktx*
# - tar -cvf failed-tests.tar ./tests/testimages/toktx*
# - curl --upload-file failed-tests.tar https://transfer.sh/toktx-failed-tests.tar

# Errors in something run in after_success: don't cause the build to fail so don't use.

before_deploy:
Expand Down
57 changes: 53 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif()
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "macOS Deployment Target")
if(IOS)
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "10.0" CACHE STRING "iOS Deployment Target")
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "11.0" CACHE STRING "iOS Deployment Target")
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH NO)
endif()
endif()
Expand Down Expand Up @@ -446,6 +446,7 @@ target_sources(
ktx
PRIVATE
lib/basis_encode.cpp
lib/astc_encode.cpp
${BASISU_ENCODER_C_SRC}
${BASISU_ENCODER_CXX_SRC}
lib/writer1.c
Expand Down Expand Up @@ -639,6 +640,49 @@ PUBLIC

add_subdirectory(interface/basisu_c_binding)

# Only one architecture is supported at once, if neither of
# ISA_SSE41 and ISA_SSE2 are defined ISA_AVX2 is chosen.
# If ISA_AVX2 fails to compile user must chose other x86 options.
# On arm based systems ISA_NEON is default

list(FIND CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" ASTC_BUILD_UNIVERSAL)

if(${ASTC_BUILD_UNIVERSAL} EQUAL -1)
if (${ISA_NONE})
set(ASTC_LIB_NAME astcenc-none-static)
else()
if(CPU_ARCHITECTURE STREQUAL x86_64 OR CPU_ARCHITECTURE STREQUAL x86)
if (${ISA_SSE41})
set(ASTC_LIB_NAME astcenc-sse4.1-static)
elseif (${ISA_SSE2})
set(ASTC_LIB_NAME astcenc-sse2-static)
else()
set(ISA_AVX2 ON)
set(ASTC_LIB_NAME astcenc-avx2-static)
endif()
if(CPU_ARCHITECTURE STREQUAL x86)
set(ISA_NONE ON)
set(ISA_AVX2 OFF)
set(ASTCENC_POPCNT 0)
set(ASTC_LIB_NAME astcenc-none-static)
endif()
elseif(CPU_ARCHITECTURE STREQUAL armv8 OR CPU_ARCHITECTURE STREQUAL arm64)
set(ASTC_LIB_NAME astcenc-neon-static)
else()
message(STATUS "Unsupported ISA for ${CPU_ARCHITECTURE} arch, using ISA_NONE.")
set(ISA_NONE ON)
endif()
endif()
else()
set(ASTC_LIB_NAME astcenc-static)
endif()

# astcenc
set(CLI OFF) # Only build as library not the CLI astcencoder
add_subdirectory(lib/astc-encoder)
set_property(TARGET ${ASTC_LIB_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(ktx PRIVATE ${ASTC_LIB_NAME})

# Tools
if(KTX_FEATURE_TOOLS)
add_subdirectory(tools)
Expand All @@ -652,13 +696,18 @@ if(KTX_FEATURE_DOC)
include(cmake/docs.cmake)
endif()

set(KTX_INSTALL_TARGETS ktx)

if(KTX_FEATURE_STATIC_LIBRARY)
list(APPEND KTX_INSTALL_TARGETS ${ASTC_LIB_NAME})
endif()

# Install

if(APPLE OR LINUX)
# Have library's name links as separate component
set(KTX_NAMELINKS ON)
install(TARGETS ktx
install(TARGETS ${KTX_INSTALL_TARGETS}
EXPORT KTXTargets
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand All @@ -668,7 +717,7 @@ if(APPLE OR LINUX)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT dev
)
install(TARGETS ktx
install(TARGETS ${KTX_INSTALL_TARGETS}
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT library
Expand All @@ -677,7 +726,7 @@ if(APPLE OR LINUX)
else()
# No name links on Windows
set(KTX_NAMELINKS OFF)
install(TARGETS ktx
install(TARGETS ${KTX_INSTALL_TARGETS}
EXPORT KTXTargets
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
6 changes: 4 additions & 2 deletions ci_scripts/build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ set -e

# Fallback to arm64-v8a
ANDROID_ABI=${ANDROID_ABI:-'arm64-v8a'}
ASTC_ISA=${ASTC_ISA:-'ISA_NONE=ON'}

# You need to set the following environment variables first
# ANDROID_NDK= <Path to Android NDK>
# ANDROID_NDK= <Path to Android NDK>

echo "Configure KTX-Software (Android $ANDROID_ABI Release)"
cmake . -G Ninja -B "build-android-$ANDROID_ABI" \
Expand All @@ -17,7 +18,8 @@ cmake . -G Ninja -B "build-android-$ANDROID_ABI" \
-DANDROID_NDK="$ANDROID_NDK" \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-DBASISU_SUPPORT_SSE=OFF
-DBASISU_SUPPORT_SSE=OFF \
-D${ASTC_ISA}

pushd "build-android-$ANDROID_ABI"

Expand Down
6 changes: 4 additions & 2 deletions ci_scripts/build_android_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ set -e

# Fallback to arm64-v8a
ANDROID_ABI=${ANDROID_ABI:-'arm64-v8a'}
ASTC_ISA=${ASTC_ISA:-'ISA_NONE=ON'}

# You need to set the following environment variables first
# ANDROID_NDK= <Path to Android NDK>
# ANDROID_NDK= <Path to Android NDK>

echo "Configure KTX-Software (Android $ANDROID_ABI Debug)"
cmake . -G Ninja -B "build-android-$ANDROID_ABI-debug" \
Expand All @@ -17,7 +18,8 @@ cmake . -G Ninja -B "build-android-$ANDROID_ABI-debug" \
-DANDROID_NDK="$ANDROID_NDK" \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake" \
-DCMAKE_BUILD_TYPE=Debug \
-DBASISU_SUPPORT_SSE=OFF
-DBASISU_SUPPORT_SSE=OFF \
-D${ASTC_ISA}

pushd "build-android-$ANDROID_ABI-debug"

Expand Down
6 changes: 3 additions & 3 deletions ci_scripts/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ echo "Configure KTX-Software (macOS x86_64) with SSE support"
cmake -GXcode -Bbuild-macos-sse \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DKTX_FEATURE_LOADTEST_APPS=ON \
-DBASISU_SUPPORT_SSE=ON

-DBASISU_SUPPORT_SSE=ON \
-DISA_SSE41=ON

# Cause the build pipes below to set the exit to the exit code of the
# last program to exit non-zero.
Expand Down Expand Up @@ -117,7 +117,7 @@ popd
#

echo "Configure KTX-Software (iOS)"
cmake -GXcode -Bbuild-ios -DCMAKE_SYSTEM_NAME=iOS -DKTX_FEATURE_LOADTEST_APPS=ON -DKTX_FEATURE_DOC=OFF
cmake -GXcode -Bbuild-ios -DISA_NEON=ON -DCMAKE_SYSTEM_NAME=iOS -DKTX_FEATURE_LOADTEST_APPS=ON -DKTX_FEATURE_DOC=OFF
pushd build-ios
echo "Build KTX-Software (iOS Debug)"
cmake --build . --config Debug -- -sdk iphoneos CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO | handle_compiler_output
Expand Down
130 changes: 129 additions & 1 deletion include/ktx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,137 @@ typedef enum ktx_pack_uastc_flag_bits_e {
} ktx_pack_uastc_flag_bits_e;
typedef ktx_uint32_t ktx_pack_uastc_flags;

/**
* @~English
* @brief Options specifiying ASTC encoding quality levels.
*/
typedef enum ktx_pack_astc_quality_levels_e {
KTX_PACK_ASTC_QUALITY_LEVEL_FASTEST = 0,
/*!< Fastest compression. */
KTX_PACK_ASTC_QUALITY_LEVEL_FAST = 10,
/*!< Fast compression. */
KTX_PACK_ASTC_QUALITY_LEVEL_MEDIUM = 60,
/*!< Medium compression. */
KTX_PACK_ASTC_QUALITY_LEVEL_THOROUGH = 98,
/*!< Slower compression. */
KTX_PACK_ASTC_QUALITY_LEVEL_EXHAUSTIVE = 100,
/*!< Very slow compression. */
KTX_PACK_ASTC_QUALITY_LEVEL_MAX = KTX_PACK_ASTC_QUALITY_LEVEL_EXHAUSTIVE,
/*!< Maximum supported quality level. */
} ktx_pack_astc_quality_levels_e;

/**
* @~English
* @brief Options specifiying ASTC encoding block dimensions
*/
typedef enum ktx_pack_astc_block_dimension_e {
// 2D formats
KTX_PACK_ASTC_BLOCK_DIMENSION_4x4, //: 8.00 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_5x4, //: 6.40 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_5x5, //: 5.12 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_6x5, //: 4.27 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_6x6, //: 3.56 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_8x5, //: 3.20 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_8x6, //: 2.67 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_10x5, //: 2.56 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_10x6, //: 2.13 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_8x8, //: 2.00 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_10x8, //: 1.60 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_10x10, //: 1.28 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_12x10, //: 1.07 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_12x12, //: 0.89 bpp
// 3D formats
KTX_PACK_ASTC_BLOCK_DIMENSION_3x3x3, //: 4.74 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_4x3x3, //: 3.56 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_4x4x3, //: 2.67 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_4x4x4, //: 2.00 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_5x4x4, //: 1.60 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_5x5x4, //: 1.28 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_5x5x5, //: 1.02 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_6x5x5, //: 0.85 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_6x6x5, //: 0.71 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_6x6x6, //: 0.59 bpp
KTX_PACK_ASTC_BLOCK_DIMENSION_MAX = KTX_PACK_ASTC_BLOCK_DIMENSION_6x6x6
/*!< Maximum supported blocks. */
} ktx_pack_astc_block_dimension_e;

/**
* @~English
* @brief Options specifiying ASTC encoder profile function
*/
typedef enum ktx_pack_astc_encoder_function_e {
KTX_PACK_ASTC_ENCODER_FUNCTION_UNKNOWN,
KTX_PACK_ASTC_ENCODER_FUNCTION_SRGB,
KTX_PACK_ASTC_ENCODER_FUNCTION_LINEAR,
KTX_PACK_ASTC_ENCODER_FUNCTION_MAX = KTX_PACK_ASTC_ENCODER_FUNCTION_LINEAR
} ktx_pack_astc_encoder_function_e;

/**
* @~English
* @brief Options specifying ASTC encoder profile mode
* This and function is used later to derive the profile.
*/
typedef enum ktx_pack_astc_encoder_mode_e {
KTX_PACK_ASTC_ENCODER_MODE_DEFAULT,
KTX_PACK_ASTC_ENCODER_MODE_LDR,
KTX_PACK_ASTC_ENCODER_MODE_HDR,
KTX_PACK_ASTC_ENCODER_MODE_MAX = KTX_PACK_ASTC_ENCODER_MODE_HDR
} ktx_pack_astc_encoder_mode_e;

extern KTX_API const ktx_uint32_t KTX_ETC1S_DEFAULT_COMPRESSION_LEVEL;

/**
* @memberof ktxTexture
* @~English
* @brief Structure for passing extended parameters to
* ktxTexture_CompressAstc.
*
* Passing a struct initialized to 0 (e.g. " = {};") will use the default
* values. Only those settings to be modified need be non-zero.
*/
typedef struct ktxAstcParams {
ktx_uint32_t structSize;
/*!< Size of this struct. Used so library can tell which version
of struct is being passed.
*/
ktx_bool_t verbose;
/*!< If true, prints Astc encoder operation details to
@c stdout. Not recommended for GUI apps.
*/
ktx_uint32_t threadCount;
/*!< Number of threads used for compression. Default is 1. */

/* astcenc params */
ktx_uint32_t blockDimension;
/*!< Combinations of block dimensions that astcenc supports
i.e. 6x6, 8x8, 6x5 etc*/

ktx_uint32_t function;
/*!< Can be {linear/srgb} from astcenc*/

ktx_uint32_t mode;
/*!< Can be {ldr/hdr} from astcenc*/

ktx_uint32_t qualityLevel;
/*!< astcenc supports -fastest, -fast, -medium, -thorough, -exhaustive*/

ktx_bool_t normalMap;
/*!< Tunes codec parameters for better quality on normal maps
In this mode normals are compressed to X,Y components
Discarding Z component, reader will need to generate Z
component in shaders.
*/
char inputSwizzle[4];
/*!< A swizzle to provide as input to astcenc. It must match the regular
expression /^[rgba01]{4}$/.*/
} ktxAstcParams;

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture_CompressAstcEx(ktxTexture* This, ktxAstcParams* params);

KTX_API KTX_error_code KTX_APIENTRY
ktxTexture_CompressAstc(ktxTexture* This, ktx_uint32_t quality);

/**
* @memberof ktxTexture2
* @~English
Expand Down Expand Up @@ -1648,4 +1777,3 @@ Initial release.
*/

#endif /* KTX_H_A55A6F00956F42F3A137C11929827FE1 */

Loading