Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into bc7-srgb-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
w23 committed Feb 23, 2024
2 parents 88fa8a4 + 0a45734 commit b912125
Show file tree
Hide file tree
Showing 788 changed files with 77,632 additions and 61,124 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.exr filter=lfs diff=lfs merge=lfs -text
runtime/images/*.exr filter=lfs diff=lfs merge=lfs -text
applications/_plugins/c3dmodel_viewers/gltf_dx12_ex/media/envmap/*.dds filter=lfs diff=lfs merge=lfs -text
external/brotlig/lib/*.lib filter=lfs diff=lfs merge=lfs -text
internal/tests/input/** filter=lfs diff=lfs merge=lfs -text
cmp_unittests/test_data/* filter=lfs diff=lfs merge=lfs -text
44 changes: 22 additions & 22 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,67 +64,67 @@ jobs:
uses: microsoft/setup-msbuild@v1.1

- name: Build Framework Release Win32
run: 'msbuild -target:build -property:Configuration=Release -property:Platform=Win32 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Release -property:Platform=Win32 -m build_sdk\cmp_framework.sln'

- name: Build Framework Debug Win32
run: 'msbuild -target:build -property:Configuration=Debug -property:Platform=Win32 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Debug -property:Platform=Win32 -m build_sdk\cmp_framework.sln'

- name: Build Framework Release x64
run: 'msbuild -target:build -property:Configuration=Release -property:Platform=x64 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Release -property:Platform=x64 -m build_sdk\cmp_framework.sln'

- name: Build Framework Debug x64
run: 'msbuild -target:build -property:Configuration=Debug -property:Platform=x64 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Debug -property:Platform=x64 -m build_sdk\cmp_framework.sln'

- name: Build Framework Release_MD Win32
run: 'msbuild -target:build -property:Configuration=Release_MD -property:Platform=Win32 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Release_MD -property:Platform=Win32 -m build_sdk\cmp_framework.sln'

- name: Build Framework Debug_MD Win32
run: 'msbuild -target:build -property:Configuration=Debug_MD -property:Platform=Win32 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Debug_MD -property:Platform=Win32 -m build_sdk\cmp_framework.sln'

- name: Build Framework Release_MD x64
run: 'msbuild -target:build -property:Configuration=Release_MD -property:Platform=x64 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Release_MD -property:Platform=x64 -m build_sdk\cmp_framework.sln'

- name: Build Framework Debug_MD x64
run: 'msbuild -target:build -property:Configuration=Debug_MD -property:Platform=x64 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Debug_MD -property:Platform=x64 -m build_sdk\cmp_framework.sln'

- name: Build Framework Release_DLL Win32
run: 'msbuild -target:build -property:Configuration=Release_DLL -property:Platform=Win32 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Release_DLL -property:Platform=Win32 -m build_sdk\cmp_framework.sln'

- name: Build Framework Debug_DLL Win32
run: 'msbuild -target:build -property:Configuration=Debug_DLL -property:Platform=Win32 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Debug_DLL -property:Platform=Win32 -m build_sdk\cmp_framework.sln'

- name: Build Framework Release_DLL x64
run: 'msbuild -target:build -property:Configuration=Release_DLL -property:Platform=x64 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Release_DLL -property:Platform=x64 -m build_sdk\cmp_framework.sln'

- name: Build Framework Debug_DLL x64
run: 'msbuild -target:build -property:Configuration=Debug_DLL -property:Platform=x64 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Debug_DLL -property:Platform=x64 -m build_sdk\cmp_framework.sln'

- name: Build Framework Release_MD_DLL Win32
run: 'msbuild -target:build -property:Configuration=Release_MD_DLL -property:Platform=Win32 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Release_MD_DLL -property:Platform=Win32 -m build_sdk\cmp_framework.sln'

- name: Build Framework Debug_MD_DLL Win32
run: 'msbuild -target:build -property:Configuration=Debug_MD_DLL -property:Platform=Win32 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Debug_MD_DLL -property:Platform=Win32 -m build_sdk\cmp_framework.sln'

- name: Build Framework Release_MD_DLL x64
run: 'msbuild -target:build -property:Configuration=Release_MD_DLL -property:Platform=x64 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Release_MD_DLL -property:Platform=x64 -m build_sdk\cmp_framework.sln'

- name: Build Framework Debug_MD_DLL x64
run: 'msbuild -target:build -property:Configuration=Debug_MD_DLL -property:Platform=x64 -m VS2019\cmp_framework.sln'
run: 'msbuild -target:build -property:Configuration=Debug_MD_DLL -property:Platform=x64 -m build_sdk\cmp_framework.sln'

- name: Create folder structure for build results
run: |
mkdir CompressonatorFramework_result\lib\encoders
mkdir CompressonatorFramework_result\include
mkdir CompressonatorFramework_result\lib\VS2019\x64
mkdir CompressonatorFramework_result\lib\VS2019\x86
mkdir CompressonatorFramework_result\lib\build_sdk\x64
mkdir CompressonatorFramework_result\lib\build_sdk\x86
- name: Copy files into build results directory
shell: bash
run: |
cp build/Release*/x64/{*.lib,*.dll} CompressonatorFramework_result/lib/VS2019/x64/
cp build/Release*/Win32/{*.lib,*.dll} CompressonatorFramework_result/lib/VS2019/x86/
cp build/Debug*/x64/{*.lib,*.dll} CompressonatorFramework_result/lib/VS2019/x64/
cp build/Debug*/Win32/{*.lib,*.dll} CompressonatorFramework_result/lib/VS2019/x86/
cp build/Release*/x64/{*.lib,*.dll} CompressonatorFramework_result/lib/build_sdk/x64/
cp build/Release*/Win32/{*.lib,*.dll} CompressonatorFramework_result/lib/build_sdk/x86/
cp build/Debug*/x64/{*.lib,*.dll} CompressonatorFramework_result/lib/build_sdk/x64/
cp build/Debug*/Win32/{*.lib,*.dll} CompressonatorFramework_result/lib/build_sdk/x86/
cp build/Release/x64/Plugins/Compute/{*.h,*.hlsl,*.cpp} CompressonatorFramework_result/lib/encoders/
cp cmp_compressonatorlib/compressonator.h CompressonatorFramework_result/include/
Expand Down
113 changes: 80 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (NOT CMP_VERSION_MAJOR)
endif()

if (NOT CMP_VERSION_MINOR)
set(CMP_VERSION_MINOR 4)
set(CMP_VERSION_MINOR 5)
endif()

if (NOT CMP_VERSION_BUILD_NUMBER)
Expand All @@ -41,6 +41,35 @@ message("Building Compressonator version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERS
include(cmake/helperfunctions.cmake)


# ------------------------------
# Common compiler options
# ------------------------------

if (CMP_HOST_WINDOWS)
add_compile_options(/W4 /wd4201)
# add_compile_options(/W4 /WX /wd4201)
elseif(CMP_HOST_LINUX)
add_compile_options(-Wall)
# add_compile_options(-Wall -Werror)
endif()

# ------------------------------------
# Visual Studio project folder names
# ------------------------------------

set(PROJECT_FOLDER_SDK "SDK")
set(PROJECT_FOLDER_SDK_LIBS "${PROJECT_FOLDER_SDK}/Libraries")
set(PROJECT_FOLDER_SDK_EXTERNAL "${PROJECT_FOLDER_SDK}/External Libraries")
set(PROJECT_FOLDER_SDK_PLUGIN_DYNAMIC "${PROJECT_FOLDER_SDK}/Plugins/Dynamic")
set(PROJECT_FOLDER_SDK_PLUGIN_STATIC "${PROJECT_FOLDER_SDK}/Plugins/Static")
set(PROJECT_FOLDER_SDK_EXAMPLES "${PROJECT_FOLDER_SDK}/Examples")

set(PROJECT_FOLDER_APPS "Applications")
set(PROJECT_FOLDER_APPS_LIBS "${PROJECT_FOLDER_APPS}/Libraries")
set(PROJECT_FOLDER_APPS_EXTERNAL "${PROJECT_FOLDER_APPS}/External Libraries")
set(PROJECT_FOLDER_APPS_PLUGIN_DYNAMIC "${PROJECT_FOLDER_APPS}/Plugins/Dynamic")
set(PROJECT_FOLDER_APPS_PLUGIN_STATIC "${PROJECT_FOLDER_APPS}/Plugins/Static")

#----------------------------------------
# Check compiler feature support levels
# For Apple (Mac) default to C++11
Expand All @@ -63,7 +92,6 @@ else()
set(COMPILER_SUPPORTS_CXX11 ON)
endif()


#---------------------------------------------------------------------------------
# Provide default values for each build option
#
Expand All @@ -76,10 +104,10 @@ endif()
#---------------------------------------------------------------------------------
option(OPTION_ENABLE_ALL_APPS "Enable all apps" ON) # TODO rename to OPTION_BUILD_ALL
option(OPTION_BUILD_CMP_SDK "Build Compressonator SDK" OFF)
option(OPTION_BUILD_APPS_CMP_CLI "Build Application: CLI" OFF)
option(OPTION_BUILD_APPS_CMP_GUI "Build Application: GUI" OFF)
option(OPTION_BUILD_APPS_CMP_UNITTESTS "Build Application: UnitTests" OFF)
option(OPTION_BUILD_APPS_CMP_EXAMPLES "Build Application: Examples" OFF)
option(OPTION_BUILD_APPS_CMP_CLI "Build Compressonator CLI" OFF)
option(OPTION_BUILD_APPS_CMP_GUI "Build Compressonator GUI" OFF)
option(OPTION_BUILD_APPS_CMP_UNITTESTS "Build Compressontor UnitTests" OFF)
option(OPTION_BUILD_APPS_CMP_EXAMPLES "Build Compressontor Examples" OFF)

#--------------------------------------------------------------------------
# Enable or Disable Specific Build Apps
Expand All @@ -90,9 +118,14 @@ if (OPTION_ENABLE_ALL_APPS)
set(OPTION_BUILD_APPS_CMP_GUI ON)
set(OPTION_BUILD_APPS_CMP_UNITTESTS ON)
set(OPTION_BUILD_APPS_CMP_EXAMPLES ON)
else()
option(OPTION_BUILD_APPS_CMP_CLI OFF)
option(OPTION_BUILD_APPS_CMP_GUI OFF)
option(OPTION_BUILD_CMP_SDK OFF)
option(OPTION_BUILD_APPS_CMP_UNITTESTS OFF)
option(OPTION_BUILD_APPS_CMP_EXAMPLES OFF)
endif()


# Minimum Lib Dependencies for CLI, GUI, and SDK (GUI has additional lib requirements added later in this cmake)
if (OPTION_BUILD_APPS_CMP_CLI OR OPTION_BUILD_APPS_CMP_GUI)
set(LIB_BUILD_COMPRESSONATOR_SDK ON)
Expand All @@ -112,16 +145,20 @@ elseif (OPTION_BUILD_CMP_SDK)
set(LIB_BUILD_GPUDECODE ON)
endif()

if (OPTION_BUILD_APPS_CMP_VISION)
set(LIB_BUILD_COMPRESSONATOR_SDK ON)
set(LIB_BUILD_FRAMEWORK_SDK ON)
endif()

# The following options that have been removed
set(LIB_BUILD_MESHCOMPRESSOR OFF)

set(PROJECT_EXTERNAL_LIBDIR ${PROJECT_SOURCE_DIR}/../common/lib/ext)


# ----------------------------------------------------------------------------
# GPUOpen Source Code build options : These options are been revised for v4.2
# ----------------------------------------------------------------------------
# OPTION DESCRIPTION DEFAULT REQUIREMENT
# OPTION DESCRIPTION REQUESTED VALUE REQUIREMENT
cmp_option(OPTION_BUILD_KTX2 "Build CLI KTX2 Support" ON CMAKE_VERSION VERSION_GREATER "3.14.0")
cmp_option(OPTION_BUILD_EXR "Build CLI EXR Support" ON CMP_HOST_WINDOWS OR CMP_HOST_LINUX)
cmp_option(OPTION_BUILD_GUI "Build the GUI Application" ON CMP_HOST_WINDOWS OR OPTION_BUILD_APPS_CMP_GUI)
Expand All @@ -134,14 +171,13 @@ cmp_option(OPTION_CMP_GTC "Use GTC Codec" OFF TRUE
cmp_option(OPTION_BUILD_BROTLIG "Use Brotli-G Codec for CLI" ON CMP_HOST_WINDOWS)
cmp_option(OPTION_BUILD_BROTLIG_GUI "Use Brotli-G Codec for GUI" OFF TRUE) # In development for v4.4
# Internal testing application
option(OPTION_BUILD_INTERNAL_CMP_TEST "Build Internal Application: cmp_test" OFF)
option(OPTION_BUILD_INTERNAL_CMP_TEST "Build Internal Application: cmp_test" ON)
# No longer supported
cmp_option(OPTION_BUILD_ASTC "Build ASTC Support" OFF FALSE)
cmp_option(OPTION_BUILD_DRACO "Build CLI Draco Support" OFF FALSE)
# this needs to be removed
cmp_option(NO_LEGACY_BEHAVIOR "Disables any legacy behavior (before CMake migration)" ON TRUE)


# -----------------------------------------------------------------------------------
# Code build definitions and features: These options are been revised for v4.2
# -----------------------------------------------------------------------------------
Expand Down Expand Up @@ -175,7 +211,6 @@ add_compile_definitions(
#USE_CMP_TRANSCODE # Future release:: Transcode BASIS/GTC to other compressed formats

# Possible future releases features
#ARGB_32_SUPPORT # Enables 32bit Float channel formats
#SUPPORT_ETC_ALPHA # for ATC_RGB output enable A
#SHOW_PROCESS_MEMORY # display available CPU process memory
#USE_BCN_IMAGE_DEBUG # Enables Combobox in Image View for low level BCn based block compression in debug mode
Expand Down Expand Up @@ -264,11 +299,12 @@ else()

# filesystem support for c++14
if (COMPILER_SUPPORTS_CXX14)
add_definitions(-std=c++14)
set(CMAKE_CXX_STANDARD 14)
#add_definitions(-std=c++14)
link_libraries(stdc++fs)
else()
if (CMP_HOST_LINUX)
add_definitions(-std=c++11)
set(CMAKE_CXX_STANDARD 11)
endif()
endif()

Expand Down Expand Up @@ -431,14 +467,18 @@ if (CMP_HOST_WINDOWS)

# Unit tests
if (OPTION_BUILD_APPS_CMP_UNITTESTS)
message("Build cmp unittests setup")
add_subdirectory(cmp_unittests)
message("Build cmp unittests setup")
add_subdirectory(cmp_unittests)
endif()

# CLI + GUI Automation testing
if (OPTION_BUILD_INTERNAL_CMP_TEST)
message("Build cmp test setup")
add_subdirectory(compressonator_internal/applications/cmp_test)
if (EXISTS ${PROJECT_SOURCE_DIR}/compressonator_internal/applications/cmp_test)
message("Building CMP Test")
add_subdirectory(compressonator_internal/applications/cmp_test)
else()
message("Skipping CMP Test build because the directory could not be found")
endif()
endif()

endif()
Expand Down Expand Up @@ -467,13 +507,15 @@ if (CMP_HOST_WINDOWS)
PATTERN "media" EXCLUDE
)

install(
DIRECTORY ${QT_LIB_DIR}/plugins/imageformats DESTINATION plugins
FILES_MATCHING
PATTERN "qjpeg.dll"
PATTERN "qtga.dll"
PATTERN "qtiff.dll"
)
if (OPTION_CMP_QT)
install(
DIRECTORY ${QT_LIB_DIR}/plugins/imageformats DESTINATION plugins
FILES_MATCHING
PATTERN "qjpeg.dll"
PATTERN "qtga.dll"
PATTERN "qtiff.dll"
)
endif()

install(
DIRECTORY ${WINDOWS_BIN_PREFIX}/plugins/compute DESTINATION "plugins/"
Expand All @@ -488,20 +530,25 @@ if (CMP_HOST_WINDOWS)
install(FILES ${WINDOWS_BIN_PREFIX}/texture.frag.spv ${WINDOWS_BIN_PREFIX}/texture.vert.spv DESTINATION ".")

elseif (CMP_HOST_LINUX)
install(DIRECTORY ${QT_LIB_DIR}/plugins/imageformats DESTINATION plugins)
if (OPTION_CMP_QT)
install(DIRECTORY ${QT_LIB_DIR}/plugins/imageformats DESTINATION plugins)
endif()

install(PROGRAMS scripts/compressonatorcli DESTINATION ".")

# Qt

set(QT_INSTALL_LIBS libQt5Core libQt5Gui libicui18n libicuuc libicudata)
if (OPTION_CMP_QT)
set(QT_INSTALL_LIBS libQt5Core)

foreach(QT_INSTALL_LIB ${QT_INSTALL_LIBS})
file(GLOB QT_LIB_VARIATIONS ${QT_LIB_DIR}/lib/${QT_INSTALL_LIB}.so*)
foreach(QT_INSTALL_LIB ${QT_INSTALL_LIBS})
file(GLOB QT_LIB_VARIATIONS ${QT_LIB_DIR}/lib/${QT_INSTALL_LIB}.so*)

foreach(QT_LIB_VARIATION ${QT_LIB_VARIATIONS})
install(FILES ${QT_LIB_VARIATION} DESTINATION qt)
foreach(QT_LIB_VARIATION ${QT_LIB_VARIATIONS})
install(FILES ${QT_LIB_VARIATION} DESTINATION qt)
endforeach()
endforeach()
endforeach()
endif()

# OpenCV, TBB, and extra

Expand Down Expand Up @@ -551,4 +598,4 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "AMD")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://gpuopen.com/compressonator/")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)

include(CPack)
include(CPack)
4 changes: 2 additions & 2 deletions applications/_libs/cmp_math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ target_link_libraries(CMP_Math PRIVATE
)

set_target_properties(CMP_Math PROPERTIES
FOLDER "Libs"
)
FOLDER ${PROJECT_FOLDER_SDK_LIBS}
)
Loading

0 comments on commit b912125

Please sign in to comment.