@@ -47,6 +47,8 @@ option(FILAMENT_ENABLE_MULTIVIEW "Enable multiview for Filament" OFF)
47
47
48
48
option (FILAMENT_SUPPORTS_OSMESA "Enable OSMesa (headless GL context) for Filament" OFF )
49
49
50
+ option (FILAMENT_ENABLE_FGVIEWER "Enable the frame graph viewer" OFF )
51
+
50
52
set (FILAMENT_NDK_VERSION "" CACHE STRING
51
53
"Android NDK version or version prefix to be used when building for Android."
52
54
)
@@ -517,6 +519,11 @@ if (FILAMENT_SUPPORTS_VULKAN)
517
519
add_definitions (-DFILAMENT_DRIVER_SUPPORTS_VULKAN)
518
520
endif ()
519
521
522
+ if (FILAMENT_SUPPORTS_WEBGPU)
523
+ message (AUTHOR_WARNING "WebGPU is in development stage and broken at this stage. Its support is very limited." )
524
+ add_definitions (-DFILAMENT_SUPPORTS_WEBGPU)
525
+ endif ()
526
+
520
527
# Build with Metal support on non-WebGL Apple platforms.
521
528
if (APPLE AND NOT WEBGL)
522
529
option (FILAMENT_SUPPORTS_METAL "Include the Metal backend" ON )
@@ -528,20 +535,17 @@ if (FILAMENT_SUPPORTS_METAL)
528
535
endif ()
529
536
530
537
# Building filamat increases build times and isn't required for web, so turn it off by default.
531
- if (NOT WEBGL)
538
+ if (NOT WEBGL AND NOT IOS )
532
539
option (FILAMENT_BUILD_FILAMAT "Build filamat and JNI buildings" ON )
533
540
else ()
534
541
option (FILAMENT_BUILD_FILAMAT "Build filamat and JNI buildings" OFF )
535
542
endif ()
536
543
537
- # By default, link in matdbg/fgviewer for Desktop + Debug only since it pulls in filamat and a web server.
544
+ # By default, link in matdbg for Desktop + Debug only since it pulls in filamat and a web server.
538
545
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND IS_HOST_PLATFORM)
539
546
option (FILAMENT_ENABLE_MATDBG "Enable the material debugger" ON )
540
- # TODO: Uncomment below when fgviewer is ready
541
- # option(FILAMENT_ENABLE_FGVIEWER "Enable the frame graph viewer" ON)
542
547
else ()
543
548
option (FILAMENT_ENABLE_MATDBG "Enable the material debugger" OFF )
544
- option (FILAMENT_ENABLE_FGVIEWER "Enable the frame graph viewer" OFF )
545
549
endif ()
546
550
547
551
# Only optimize materials in Release mode (so error message lines match the source code)
@@ -667,10 +671,6 @@ function(list_licenses OUTPUT MODULES)
667
671
endfunction ()
668
672
669
673
set (COMBINE_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR} /build/linux/combine-static-libs.sh" )
670
- if (WIN32 )
671
- set (COMBINE_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR} /build/windows/combine-static-libs.bat" )
672
- set (CMAKE_AR "lib.exe" )
673
- endif ()
674
674
675
675
# Add a custom command to TARGET that combines the static libraries in DEPS into a single archive.
676
676
function (combine_static_libs TARGET OUTPUT DEPS)
@@ -685,12 +685,22 @@ function(combine_static_libs TARGET OUTPUT DEPS)
685
685
endif ()
686
686
endforeach ()
687
687
688
- add_custom_command (
689
- TARGET ${TARGET} POST_BUILD
690
- COMMAND "${COMBINE_SCRIPT} " "${CMAKE_AR} " "${OUTPUT} " ${DEPS_FILES}
691
- COMMENT "Combining ${target} dependencies into single shared library"
692
- VERBATIM
693
- )
688
+ if (WIN32 )
689
+ add_custom_command (
690
+ TARGET ${TARGET} POST_BUILD
691
+ COMMAND lib.exe /nologo /out:temp.lib ${DEPS_FILES}
692
+ COMMAND "${CMAKE_COMMAND} " -E rename temp.lib ${OUTPUT}
693
+ COMMENT "Combining ${target} dependencies into single shared library"
694
+ VERBATIM
695
+ )
696
+ else ()
697
+ add_custom_command (
698
+ TARGET ${TARGET} POST_BUILD
699
+ COMMAND "${COMBINE_SCRIPT} " "${CMAKE_AR} " "${OUTPUT} " ${DEPS_FILES}
700
+ COMMENT "Combining ${target} dependencies into single shared library"
701
+ VERBATIM
702
+ )
703
+ endif ()
694
704
endfunction ()
695
705
696
706
# ==================================================================================================
@@ -759,8 +769,8 @@ add_subdirectory(${LIBRARIES}/mathio)
759
769
add_subdirectory (${LIBRARIES} /uberz)
760
770
add_subdirectory (${LIBRARIES} /utils)
761
771
add_subdirectory (${LIBRARIES} /viewer)
762
- add_subdirectory (${FILAMENT} /filament)
763
772
add_subdirectory (${FILAMENT} /shaders)
773
+ add_subdirectory (${EXTERNAL} /abseil/tnt)
764
774
add_subdirectory (${EXTERNAL} /basisu/tnt)
765
775
add_subdirectory (${EXTERNAL} /civetweb/tnt)
766
776
add_subdirectory (${EXTERNAL} /imgui/tnt)
@@ -781,6 +791,7 @@ add_subdirectory(${LIBRARIES}/geometry)
781
791
if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM)
782
792
# spirv-tools must come before filamat, as filamat relies on the presence of the
783
793
# spirv-tools_SOURCE_DIR variable.
794
+ set (SPIRV-Headers_SOURCE_DIR ${EXTERNAL} /spirv-headers)
784
795
add_subdirectory (${EXTERNAL} /spirv-tools)
785
796
add_subdirectory (${EXTERNAL} /glslang/tnt)
786
797
add_subdirectory (${EXTERNAL} /spirv-cross/tnt)
@@ -790,11 +801,10 @@ if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM)
790
801
if (FILAMENT_ENABLE_MATDBG OR IS_HOST_PLATFORM)
791
802
add_subdirectory (${LIBRARIES} /matdbg)
792
803
endif ()
804
+ endif ()
793
805
794
- # TODO: Uncomment below when fgviewer is ready
795
- # if (FILAMENT_ENABLE_FGVIEWER OR IS_HOST_PLATFORM)
796
- # add_subdirectory(${LIBRARIES}/fgviewer)
797
- # endif()
806
+ if (FILAMENT_ENABLE_FGVIEWER)
807
+ add_subdirectory (${LIBRARIES} /fgviewer)
798
808
endif ()
799
809
800
810
if (FILAMENT_SUPPORTS_VULKAN)
@@ -804,6 +814,13 @@ if (FILAMENT_SUPPORTS_VULKAN)
804
814
add_subdirectory (${EXTERNAL} /spirv-headers)
805
815
endif ()
806
816
817
+ if (FILAMENT_SUPPORTS_WEBGPU)
818
+ add_subdirectory (${EXTERNAL} /dawn/tnt/)
819
+ endif ()
820
+
821
+ # Add filament after dawn, since filament/backend depends on dawn targets.
822
+ add_subdirectory (${FILAMENT} /filament)
823
+
807
824
set (FILAMENT_SAMPLES_BINARY_DIR ${PROJECT_BINARY_DIR} /samples)
808
825
809
826
if (WEBGL)
0 commit comments