Skip to content

Commit

Permalink
Merge pull request #17104 from hrydgard/uastc-support
Browse files Browse the repository at this point in the history
basis_universal support (WIP)
  • Loading branch information
hrydgard authored Mar 13, 2023
2 parents 7df51c3 + 32e8ab3 commit 09a3bca
Show file tree
Hide file tree
Showing 24 changed files with 26,937 additions and 1 deletion.
24 changes: 23 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,28 @@ else()
include_directories(ext/libpng17)
endif()

add_library(basis_universal STATIC
ext/basis_universal/basisu.h
ext/basis_universal/basisu_containers.h
ext/basis_universal/basisu_containers_impl.h
ext/basis_universal/basisu_file_headers.h
ext/basis_universal/basisu_transcoder.cpp
ext/basis_universal/basisu_transcoder.h
ext/basis_universal/basisu_transcoder_internal.h
ext/basis_universal/basisu_transcoder_tables_astc.inc
ext/basis_universal/basisu_transcoder_tables_astc_0_255.inc
ext/basis_universal/basisu_transcoder_tables_atc_55.inc
ext/basis_universal/basisu_transcoder_tables_atc_56.inc
ext/basis_universal/basisu_transcoder_tables_bc7_m5_alpha.inc
ext/basis_universal/basisu_transcoder_tables_bc7_m5_color.inc
ext/basis_universal/basisu_transcoder_tables_dxt1_5.inc
ext/basis_universal/basisu_transcoder_tables_dxt1_6.inc
ext/basis_universal/basisu_transcoder_tables_pvrtc2_45.inc
ext/basis_universal/basisu_transcoder_tables_pvrtc2_alpha_33.inc
ext/basis_universal/basisu_transcoder_uastc.h
)
set(BASISU_LIBRARIES basis_universal)

set(nativeExtra)
set(nativeExtraLibs)

Expand Down Expand Up @@ -1362,7 +1384,7 @@ if(ANDROID OR (LINUX AND ARM_DEVICE) OR (LINUX AND RISCV64))
set(ATOMIC_LIB atomic)
endif()

target_link_libraries(native ${LIBZIP_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARY} vma gason udis86 ${RT_LIB} ${nativeExtraLibs} ${ATOMIC_LIB} Common)
target_link_libraries(native ${LIBZIP_LIBRARY} ${PNG_LIBRARIES} ${BASISU_LIBRARIES} ${ZLIB_LIBRARY} vma gason udis86 ${RT_LIB} ${nativeExtraLibs} ${ATOMIC_LIB} Common)
if(TARGET Ext::GLEW)
target_link_libraries(native Ext::GLEW)
endif()
Expand Down
20 changes: 20 additions & 0 deletions Common/Common.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\ext\basis_universal\basisu.h" />
<ClInclude Include="..\ext\basis_universal\basisu_containers.h" />
<ClInclude Include="..\ext\basis_universal\basisu_containers_impl.h" />
<ClInclude Include="..\ext\basis_universal\basisu_file_headers.h" />
<ClInclude Include="..\ext\basis_universal\basisu_transcoder.h" />
<ClInclude Include="..\ext\basis_universal\basisu_transcoder_internal.h" />
<ClInclude Include="..\ext\basis_universal\basisu_transcoder_uastc.h" />
<ClInclude Include="..\ext\libpng17\png.h" />
<ClInclude Include="..\ext\libpng17\pngconf.h" />
<ClInclude Include="..\ext\libpng17\pngdebug.h" />
Expand Down Expand Up @@ -577,6 +584,7 @@
<ClInclude Include="x64Emitter.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\ext\basis_universal\basisu_transcoder.cpp" />
<ClCompile Include="..\ext\libpng17\png.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
Expand Down Expand Up @@ -1034,6 +1042,18 @@
<Project>{f761046e-6c38-4428-a5f1-38391a37bb34}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_astc.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_astc_0_255.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_atc_55.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_atc_56.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_bc7_m5_alpha.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_bc7_m5_color.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_dxt1_5.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_dxt1_6.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_pvrtc2_45.inc" />
<None Include="..\ext\basis_universal\basisu_transcoder_tables_pvrtc2_alpha_33.inc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
59 changes: 59 additions & 0 deletions Common/Common.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,27 @@
<ClInclude Include="Data\Format\DDSLoad.h">
<Filter>Data\Format</Filter>
</ClInclude>
<ClInclude Include="..\ext\basis_universal\basisu.h">
<Filter>ext\basis_universal</Filter>
</ClInclude>
<ClInclude Include="..\ext\basis_universal\basisu_containers.h">
<Filter>ext\basis_universal</Filter>
</ClInclude>
<ClInclude Include="..\ext\basis_universal\basisu_containers_impl.h">
<Filter>ext\basis_universal</Filter>
</ClInclude>
<ClInclude Include="..\ext\basis_universal\basisu_file_headers.h">
<Filter>ext\basis_universal</Filter>
</ClInclude>
<ClInclude Include="..\ext\basis_universal\basisu_transcoder.h">
<Filter>ext\basis_universal</Filter>
</ClInclude>
<ClInclude Include="..\ext\basis_universal\basisu_transcoder_internal.h">
<Filter>ext\basis_universal</Filter>
</ClInclude>
<ClInclude Include="..\ext\basis_universal\basisu_transcoder_uastc.h">
<Filter>ext\basis_universal</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ABI.cpp" />
Expand Down Expand Up @@ -896,6 +917,9 @@
<ClCompile Include="Data\Format\DDSLoad.cpp">
<Filter>Data\Format</Filter>
</ClCompile>
<ClCompile Include="..\ext\basis_universal\basisu_transcoder.cpp">
<Filter>ext\basis_universal</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Crypto">
Expand Down Expand Up @@ -1003,10 +1027,45 @@
<Filter Include="VR">
<UniqueIdentifier>{9d1c29fd-8ac7-4475-8ea6-c8c759b695fe}</UniqueIdentifier>
</Filter>
<Filter Include="ext\basis_universal">
<UniqueIdentifier>{d6d5f6e0-1c72-496b-af11-6d52d5123033}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="..\ext\libpng17\CMakeLists.txt">
<Filter>ext\libpng17</Filter>
</Text>
</ItemGroup>
<ItemGroup>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_astc.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_astc_0_255.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_atc_55.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_atc_56.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_bc7_m5_alpha.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_bc7_m5_color.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_dxt1_5.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_dxt1_6.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_pvrtc2_45.inc">
<Filter>ext\basis_universal</Filter>
</None>
<None Include="..\ext\basis_universal\basisu_transcoder_tables_pvrtc2_alpha_33.inc">
<Filter>ext\basis_universal</Filter>
</None>
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions GPU/Common/ReplacedTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include <png.h>

#include "ext/basis_universal/basisu_transcoder.h"

#include "GPU/Common/ReplacedTexture.h"
#include "GPU/Common/TextureReplacer.h"

Expand Down
1 change: 1 addition & 0 deletions android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ EXT_FILES := \
$(SRC)/ext/libpng17/pngwrite.c \
$(SRC)/ext/libpng17/pngwtran.c \
$(SRC)/ext/libpng17/pngwutil.c \
$(SRC)/ext/basis_universal/basisu_transcoder.cpp \
$(SRC)/ext/jpge/jpgd.cpp \
$(SRC)/ext/jpge/jpge.cpp \
$(SRC)/ext/sha1/sha1.cpp \
Expand Down
Loading

0 comments on commit 09a3bca

Please sign in to comment.