-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[filament] add Filament port #41916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
[filament] add Filament port #41916
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
2d2288f
[filament] add Filament port
aminya d0cb3c2
[filament] add patch to disable tests/benchmarks
aminya 7fc0879
[filament] prefer external packages
aminya b0fc840
[filament] fix basisu includes/property name
aminya ea0de73
[filament] fix miktspace include
aminya df47aa6
[filament] fix glslang includes
aminya ad875c0
[glslang] allow installation of private headers
aminya 15dc7d6
[filament] install private glslang headers
aminya ad1f764
[filament] do not list licenses for external packages
aminya bf691f9
[glslang] install all the private headers
aminya bd8f078
[filament] fix all glslang includes
aminya 446b387
[filament] do not use libc++
aminya 241e314
[filament] fix finding of external libraries/licenses
aminya c72090b
[filament] use the built-in cross-platform getopt
aminya 83196e2
[filament] fix the basisu alias names
aminya 5d562bf
[filament] enable rtti for glslang
aminya 17ee0f1
[filament] link machine independent to glslang
aminya 28ed94d
[filament] support gcc compiler
aminya 1a77821
[civetweb] add missing target in the usage
aminya eba0444
[filament] fix civetweb-cpp linkage
aminya 31cc4f0
[filament] fix SPVRemapper linkage
aminya 67eb16b
[filament] fix spirv-cross-msl linkage
aminya 2f7c2a2
[filament] fix const qualifier for remote server
aminya c28574d
[filament] fix std::memcpy
aminya 8714922
[filament] fix snprintf include
aminya 870e58f
[filament] add zstd dependency
aminya 871fd73
[filament] fix public includes for the targets
aminya 56e1202
[filament] fix macos needing gtest
aminya e8f2cd1
[filament] support find_package filament
aminya cae6a10
[filament] fix gcc compilation errors
aminya 8eec0f5
[filament] require clang on Linux due to numerous compiler errors
aminya 26413ee
[filament] require C++-17
aminya 98a84cb
[unofficial-filament] Fix PR issues for vcpkg integration (#1)
eclipse0922 3104dd2
[filament, glslang] update vcpkg versions
aminya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| civetweb provides CMake targets: | ||
|
|
||
| find_package(civetweb CONFIG REQUIRED) | ||
| target_link_libraries(main PRIVATE civetweb::civetweb) | ||
| target_link_libraries(main PRIVATE civetweb::civetweb civetweb::civetweb-cpp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt | ||
| index 47925d8d..47a14adf 100644 | ||
| --- a/glslang/CMakeLists.txt | ||
| +++ b/glslang/CMakeLists.txt | ||
| @@ -266,6 +266,15 @@ if(GLSLANG_ENABLE_INSTALL) | ||
| Include/visibility.h | ||
| MachineIndependent/Versions.h) | ||
|
|
||
| + option(INSTALL_PRIVATE_HEADERS "Install private headers" OFF) | ||
| + if(INSTALL_PRIVATE_HEADERS) | ||
| + foreach(PUBLIC_HEADER IN LISTS GLSLANG_HEADERS GENERICCODEGEN_HEADERS OSDEPENDENT_HEADERS MACHINEINDEPENDENT_HEADERS SPIRV_HEADERS) | ||
| + get_filename_component(PUBLIC_HEADER "${PUBLIC_HEADER}" ABSOLUTE) | ||
| + file(RELATIVE_PATH PUBLIC_HEADER "${CMAKE_CURRENT_LIST_DIR}" "${PUBLIC_HEADER}") | ||
| + list(APPEND PUBLIC_HEADERS "${PUBLIC_HEADER}") | ||
| + endforeach() | ||
| + endif() | ||
| + | ||
| foreach(file ${PUBLIC_HEADERS}) | ||
| get_filename_component(dir ${file} DIRECTORY) | ||
| install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir}) | ||
| -- | ||
| 2.45.2 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 5180bdfb6..471ce49ed 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -264,6 +264,9 @@ set(TOOLS ${CMAKE_CURRENT_SOURCE_DIR}/tools) | ||
| # ================================================================================================== | ||
| # Compiler check | ||
| # ================================================================================================== | ||
| +option(FILAMENT_ALLOW_ANY_COMPILER "Allow building with any compiler" TRUE) | ||
| + | ||
| +if(NOT FILAMENT_ALLOW_ANY_COMPILER) | ||
| set(MIN_CLANG_VERSION "6.0") | ||
|
|
||
| if (CMAKE_C_COMPILER_ID MATCHES "Clang") | ||
| @@ -288,6 +291,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | ||
| message(FATAL_ERROR "Building with Clang on Windows is no longer supported. Use MSVC 2019 instead.") | ||
| endif() | ||
| endif() | ||
| +endif() | ||
|
|
||
| # ================================================================================================== | ||
| # Link time optimizations (LTO) | ||
| @@ -306,16 +310,16 @@ endif() | ||
| # ================================================================================================== | ||
| # General compiler flags | ||
| # ================================================================================================== | ||
| -set(CXX_STANDARD "-std=c++17") | ||
| -if (WIN32) | ||
| - set(CXX_STANDARD "/std:c++17") | ||
| -endif() | ||
| +set(CMAKE_CXX_STANDARD 17) | ||
|
|
||
| if (MSVC) | ||
| set(CXX_STANDARD "/std:c++latest") | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STANDARD} /W0 /Zc:__cplusplus") | ||
| else() | ||
| - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STANDARD} -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations") | ||
| + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations") | ||
| + if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) | ||
| + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstrict-aliasing") | ||
| + endif() | ||
| endif() | ||
|
|
||
| if (FILAMENT_USE_EXTERNAL_GLES3) | ||
| @@ -361,10 +365,18 @@ if (MSVC) | ||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE") | ||
| endif() | ||
|
|
||
| -# Add colors to ninja builds | ||
| -if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") | ||
| - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics") | ||
| - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics") | ||
| +# Enhance error reporting and compiler messages | ||
| +if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") | ||
| + add_compile_options( | ||
| + $<$<COMPILE_LANGUAGE:C>:-fcolor-diagnostics> $<$<COMPILE_LANGUAGE:CXX>:-fcolor-diagnostics> | ||
| + ) | ||
| +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
| + add_compile_options( | ||
| + $<$<COMPILE_LANGUAGE:C>:-fdiagnostics-color=always> | ||
| + $<$<COMPILE_LANGUAGE:CXX>:-fdiagnostics-color=always> | ||
| + ) | ||
| +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION GREATER 1900) | ||
| + add_compile_options(/diagnostics:column) | ||
| endif() | ||
|
|
||
| # Use hidden by default and expose what we need. | ||
| diff --git a/filament/CMakeLists.txt b/filament/CMakeLists.txt | ||
| index a68d1f915..b2a398c8f 100644 | ||
| --- a/filament/CMakeLists.txt | ||
| +++ b/filament/CMakeLists.txt | ||
| @@ -604,12 +604,16 @@ if (MSVC) | ||
| else() | ||
| set(FILAMENT_WARNINGS | ||
| -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers | ||
| - -Wextra-semi -Wnewline-eof -Wdeprecated -Wundef | ||
| + -Wextra-semi -Wdeprecated -Wundef | ||
| + -Wnon-virtual-dtor -Wimplicit-fallthrough | ||
| + ) | ||
| + if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) | ||
| + list(APPEND FILAMENT_WARNINGS | ||
| + -Wnewline-eof -Wweak-vtables -Wclass-varargs -Wover-aligned | ||
| -Wgnu-conditional-omitted-operand | ||
| - -Wweak-vtables -Wnon-virtual-dtor -Wclass-varargs -Wimplicit-fallthrough | ||
| - -Wover-aligned | ||
| -Werror | ||
| - ) | ||
| + ) | ||
| + endif() | ||
| endif() | ||
|
|
||
| target_compile_options(${TARGET} PRIVATE | ||
| diff --git a/filament/backend/CMakeLists.txt b/filament/backend/CMakeLists.txt | ||
| index 28fc07941..3a2d827ff 100644 | ||
| --- a/filament/backend/CMakeLists.txt | ||
| +++ b/filament/backend/CMakeLists.txt | ||
| @@ -377,12 +377,16 @@ if (MSVC) | ||
| else() | ||
| set(FILAMENT_WARNINGS | ||
| -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers | ||
| - -Wextra-semi -Wnewline-eof -Wdeprecated -Wundef | ||
| + -Wextra-semi -Wdeprecated -Wundef | ||
| + -Wnon-virtual-dtor -Wimplicit-fallthrough | ||
| + ) | ||
| + if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) | ||
| + list(APPEND FILAMENT_WARNINGS | ||
| + -Wnewline-eof -Wweak-vtables -Wclass-varargs -Wover-aligned | ||
| -Wgnu-conditional-omitted-operand | ||
| - -Wweak-vtables -Wnon-virtual-dtor -Wclass-varargs -Wimplicit-fallthrough | ||
| - -Wover-aligned | ||
| -Werror | ||
| - ) | ||
| + ) | ||
| + endif() | ||
| endif() | ||
|
|
||
| if (APPLE) | ||
| diff --git a/filament/backend/src/vulkan/VulkanPipelineCache.cpp b/filament/backend/src/vulkan/VulkanPipelineCache.cpp | ||
| index 4c440a008..b8e3bf5c7 100644 | ||
| --- a/filament/backend/src/vulkan/VulkanPipelineCache.cpp | ||
| +++ b/filament/backend/src/vulkan/VulkanPipelineCache.cpp | ||
| @@ -280,8 +280,8 @@ void VulkanPipelineCache::bindVertexArray(VkVertexInputAttributeDescription cons | ||
| mPipelineRequirements.vertexAttributes[i] = attribDesc[i]; | ||
| mPipelineRequirements.vertexBuffers[i] = bufferDesc[i]; | ||
| } else { | ||
| - mPipelineRequirements.vertexAttributes[i] = {}; | ||
| - mPipelineRequirements.vertexBuffers[i] = {}; | ||
| + mPipelineRequirements.vertexAttributes[i] = VertexInputAttributeDescription{}; | ||
| + mPipelineRequirements.vertexBuffers[i] = VertexInputBindingDescription{}; | ||
| } | ||
| } | ||
| } | ||
| diff --git a/filament/backend/src/vulkan/VulkanStagePool.cpp b/filament/backend/src/vulkan/VulkanStagePool.cpp | ||
| index 067b16afd..f74ea2cb3 100644 | ||
| --- a/filament/backend/src/vulkan/VulkanStagePool.cpp | ||
| +++ b/filament/backend/src/vulkan/VulkanStagePool.cpp | ||
| @@ -105,7 +105,7 @@ VulkanStageImage const* VulkanStagePool::acquireImage(PixelDataFormat format, Pi | ||
| .usage = VMA_MEMORY_USAGE_CPU_TO_GPU | ||
| }; | ||
|
|
||
| - const UTILS_UNUSED VkResult result = vmaCreateImage(mAllocator, &imageInfo, &allocInfo, | ||
| + UTILS_UNUSED const VkResult result = vmaCreateImage(mAllocator, &imageInfo, &allocInfo, | ||
| &image->image, &image->memory, nullptr); | ||
|
|
||
| assert_invariant(result == VK_SUCCESS); | ||
| diff --git a/tools/cso-lut/src/main.cpp b/tools/cso-lut/src/main.cpp | ||
| index b45a60702..e8a7c2bb7 100644 | ||
| --- a/tools/cso-lut/src/main.cpp | ||
| +++ b/tools/cso-lut/src/main.cpp | ||
| @@ -164,7 +164,7 @@ static float sq(float x) { return x * x; } | ||
|
|
||
| constexpr float PI_F = 3.141592653589793238f; | ||
|
|
||
| -static UTILS_UNUSED float sphericalCapsIntersection(float cosCap1, float cosCap2, float cosDistance) { | ||
| +UTILS_UNUSED static float sphericalCapsIntersection(float cosCap1, float cosCap2, float cosDistance) { | ||
| // Oat and Sander 2007, "Ambient Aperture Lighting" | ||
| float r1 = std::acos(cosCap1); | ||
| float r2 = std::acos(cosCap2); | ||
| -- | ||
| 2.45.2 | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why we are adding a feature that does not exist upstream? The correct headers to install shouldn't be something an end user needs to pick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Google vendors its dependencies and uses private headers not exposed by the vcpkg version of glslang. That's why this is needed.