Skip to content

Commit

Permalink
Update Impeller to ToT
Browse files Browse the repository at this point in the history
  • Loading branch information
bdero committed Feb 22, 2024
1 parent cb40c8b commit 545686e
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 206 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/impeller_core.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/impeller_geometry.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/impeller_renderer.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/impeller_runtime_stage.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/impeller_image.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/impeller_tessellator.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/impeller_tools.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/impeller_typographer.cmake)
Expand Down
6 changes: 2 additions & 4 deletions cmake/flatbuffers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ add_subdirectory(third_party/flatbuffers)

set(FLATBUFFERS_INCLUDE_DIR ${THIRD_PARTY_DIR}/flatbuffers/include)

find_program(FLATBUFFERS_FLATC_EXECUTABLE flatc)
set(FLATBUFFERS_FLATC_EXECUTABLE "$<TARGET_FILE:flatc>" CACHE STRING "Location of the flatc executable to use for building flatbuffers. If not overridden, the built flatc will be used.")

# If the build environment has already provided a FLATC executable, use it.
if(NOT FLATBUFFERS_FLATC_EXECUTABLE)
if(FLATBUFFERS_FLATC_EXECUTABLE STREQUAL "$<TARGET_FILE:flatc>")
message(NOTICE "Using the project to build `flatc`, but this will not work during cross compilation.")
set(FLATBUFFERS_FLATC_EXECUTABLE "$<TARGET_FILE:flatc>")
endif()

# flatbuffers_schema(
Expand Down
1 change: 1 addition & 0 deletions cmake/impeller_aiks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(IMPELLER_AIKS_DIR ${FLUTTER_ENGINE_DIR}/impeller/aiks
file(GLOB AIKS_SOURCES ${IMPELLER_AIKS_DIR}/*.cc)
list(FILTER AIKS_SOURCES EXCLUDE REGEX ".*_unittests?\\.cc$")
list(FILTER AIKS_SOURCES EXCLUDE REGEX ".*_playground.*\\.cc$")
list(FILTER AIKS_SOURCES EXCLUDE REGEX ".*_benchmarks.*\\.cc$")

add_library(impeller_aiks STATIC ${AIKS_SOURCES})

Expand Down
248 changes: 101 additions & 147 deletions cmake/impeller_entity.cmake

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions cmake/impeller_image.cmake

This file was deleted.

13 changes: 12 additions & 1 deletion cmake/impeller_runtime_stage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

set(IMPELLER_RUNTIME_STAGE_DIR ${FLUTTER_ENGINE_DIR}/impeller/runtime_stage
CACHE STRING "Location of the Impeller runtime stage sources.")
set(IMPELLER_SHADER_BUNDLE_DIR ${FLUTTER_ENGINE_DIR}/impeller/shader_bundle
CACHE STRING "Location of the Impeller shader bundle sources.")

file(GLOB RUNTIME_STAGE_SOURCES
${IMPELLER_RUNTIME_STAGE_DIR}/*.cc)
Expand All @@ -17,6 +19,14 @@ flatbuffers_schema(
TARGET impeller_runtime_stage
INPUT ${IMPELLER_RUNTIME_STAGE_DIR}/runtime_stage.fbs
OUTPUT_DIR ${IMPELLER_GENERATED_DIR}/impeller/runtime_stage)
flatbuffers_schema(
TARGET impeller_runtime_stage
INPUT ${IMPELLER_RUNTIME_STAGE_DIR}/runtime_stage_types.fbs
OUTPUT_DIR ${IMPELLER_GENERATED_DIR}/impeller/runtime_stage)
flatbuffers_schema(
TARGET impeller_runtime_stage
INPUT ${IMPELLER_SHADER_BUNDLE_DIR}/shader_bundle.fbs
OUTPUT_DIR ${IMPELLER_GENERATED_DIR}/impeller/shader_bundle)

target_link_libraries(impeller_runtime_stage
PUBLIC
Expand All @@ -26,4 +36,5 @@ target_include_directories(impeller_runtime_stage
$<BUILD_INTERFACE:${FLUTTER_INCLUDE_DIR}> # For includes starting with "flutter/"
$<BUILD_INTERFACE:${FLUTTER_ENGINE_DIR}> # For includes starting with "impeller/"
$<BUILD_INTERFACE:${FLATBUFFERS_INCLUDE_DIR}> # For includes starting with "flatbuffers/"
$<BUILD_INTERFACE:${IMPELLER_GENERATED_DIR}>) # For generated flatbuffer schemas
$<BUILD_INTERFACE:${IMPELLER_GENERATED_DIR}> # For generated flatbuffer schemas
$<BUILD_INTERFACE:${IMPELLER_GENERATED_DIR}/impeller/runtime_stage>) # For generated flatbuffer schemas
4 changes: 2 additions & 2 deletions cmake/impeller_shader_archive.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ target_include_directories(impeller_shader_archive
$<BUILD_INTERFACE:${IMPELLER_GENERATED_DIR}>) # For generated flatbuffer schemas
target_link_libraries(impeller_shader_archive PUBLIC fml impeller_base)

find_program(IMPELLER_SHADER_ARCHIVE_EXECUTABLE shader_archive)
set(IMPELLER_SHADER_ARCHIVE_EXECUTABLE "$<TARGET_FILE:shader_archive>" CACHE STRING "Location of the shader_archive executable to use for building shader archives. If not overridden, shader_archive will be built.")

if(NOT IMPELLER_SHADER_ARCHIVE_EXECUTABLE)
if(IMPELLER_SHADER_ARCHIVE_EXECUTABLE STREQUAL "$<TARGET_FILE:shader_archive>")
message(NOTICE "Using the project to build `shader_archive`, but this will not work during cross compilation.")
add_executable(shader_archive "${IMPELLER_SHADER_ARCHIVE_DIR}/shader_archive_main.cc")
target_include_directories(shader_archive
Expand Down
3 changes: 3 additions & 0 deletions cmake/impeller_typographer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ add_library(stb_truetype
STATIC
${IMPELLER_CMAKE_SRC_DIR}/stb_truetype_impl.cc)

file(COPY ${THIRD_PARTY_DIR}/stb/stb_truetype.h
DESTINATION ${IMPELLER_GENERATED_DIR}/flutter/third_party/stb)

target_include_directories(stb_truetype
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) # For includes starting with "third_party/stb/"
Expand Down
54 changes: 26 additions & 28 deletions cmake/impellerc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,38 @@ file(GLOB COMPILER_SOURCES ${IMPELLER_COMPILER_DIR}/*.cc)
list(FILTER COMPILER_SOURCES EXCLUDE REGEX ".*_unittests?\\.cc$")
list(REMOVE_ITEM COMPILER_SOURCES "${IMPELLER_COMPILER_DIR}/compiler_test.cc")

find_program(IMPELLERC_EXECUTABLE impellerc)
set(IMPELLERC_EXECUTABLE "$<TARGET_FILE:impellerc>" CACHE STRING "Location of the impellerc executable to use for compiling shaders. If not overridden, impellerc will be built.")

if(NOT IMPELLERC_EXECUTABLE)
if(IMPELLERC_EXECUTABLE STREQUAL "$<TARGET_FILE:impellerc>")
message(NOTICE "Using the project to build `impellerc`, but this will not work during cross compilation.")
add_executable(impellerc
${COMPILER_SOURCES}
${IMPELLER_GENERATED_DIR}/impeller/runtime_stage/runtime_stage_flatbuffers.h)
set(IMPELLERC_EXECUTABLE "$<TARGET_FILE:impellerc>")


if(NOT IS_DIRECTORY ${SHADERC_DIR})
message(SEND_ERROR
"Unable to configure the impellerc target because the shaderc install "
"directory (SHADERC_DIR) couldn't be found:"
" ${SHADERC_DIR}\n"
"Run `deps.sh` to fetch dependencies.\n"
"Alternatively, the shaderc build artifacts can be downloaded here:"
" https://github.com/google/shaderc/blob/main/downloads.md")
return()
endif()

target_link_libraries(impellerc
PRIVATE
fml impeller_base impeller_geometry impeller_runtime_stage
spirv-cross-glsl spirv-cross-msl shaderc)
target_include_directories(impellerc
PRIVATE
$<BUILD_INTERFACE:${FLUTTER_ENGINE_DIR}> # For includes starting with "impeller/"
$<BUILD_INTERFACE:${THIRD_PARTY_DIR}/inja/include> # For "inja/inja.hpp"
$<BUILD_INTERFACE:${THIRD_PARTY_DIR}/json/include> # For "nlohmann/json.hpp"
$<BUILD_INTERFACE:${THIRD_PARTY_DIR}/shaderc/libshaderc/include> # For "shaderc/shaderc.hpp"
$<BUILD_INTERFACE:${THIRD_PARTY_DIR}/flatbuffers/include> # For includes starting with "flatbuffers/"
$<BUILD_INTERFACE:${FLUTTER_INCLUDE_DIR}> # For includes starting with "flutter/"
$<BUILD_INTERFACE:${IMPELLER_GENERATED_DIR}>) # For generated flatbuffer schemas
if(NOT IS_DIRECTORY ${SHADERC_DIR})
message(SEND_ERROR
"Unable to configure the impellerc target because the shaderc install "
"directory (SHADERC_DIR) couldn't be found:"
" ${SHADERC_DIR}\n"
"Run `deps.sh` to fetch dependencies.\n"
"Alternatively, the shaderc build artifacts can be downloaded here:"
" https://github.com/google/shaderc/blob/main/downloads.md")
return()
endif()

target_link_libraries(impellerc
PRIVATE
fml impeller_base impeller_geometry impeller_runtime_stage
spirv-cross-glsl spirv-cross-msl shaderc)
target_include_directories(impellerc
PRIVATE
$<BUILD_INTERFACE:${FLUTTER_ENGINE_DIR}> # For includes starting with "impeller/"
$<BUILD_INTERFACE:${THIRD_PARTY_DIR}/inja/include> # For "inja/inja.hpp"
$<BUILD_INTERFACE:${THIRD_PARTY_DIR}/json/include> # For "nlohmann/json.hpp"
$<BUILD_INTERFACE:${THIRD_PARTY_DIR}/shaderc/libshaderc/include> # For "shaderc/shaderc.hpp"
$<BUILD_INTERFACE:${THIRD_PARTY_DIR}/flatbuffers/include> # For includes starting with "flatbuffers/"
$<BUILD_INTERFACE:${FLUTTER_INCLUDE_DIR}> # For includes starting with "flutter/"
$<BUILD_INTERFACE:${IMPELLER_GENERATED_DIR}>) # For generated flatbuffer schemas
endif()

# add_gles_shader_library(
Expand Down
2 changes: 1 addition & 1 deletion third_party/flutter
Submodule flutter updated 2454 files
2 changes: 1 addition & 1 deletion third_party/shaderc
Submodule shaderc updated 62 files
+66 −0 .github/workflows/autoroll.yml
+2 −0 .gitignore
+20 −27 Android.mk
+60 −2 CHANGES
+9 −13 CMakeLists.txt
+11 −6 DEPS
+14 −32 README.md
+3 −1 android_test/jni/Application.mk
+0 −74 cmake/setup_build.cmake
+4 −45 cmake/utils.cmake
+4 −4 downloads.md
+2 −1 glslc/CMakeLists.txt
+13 −0 glslc/README.asciidoc
+10 −1 glslc/src/main.cc
+1 −1 glslc/test/assembly.py
+1 −1 glslc/test/expect.py
+11 −11 glslc/test/line.py
+17 −17 glslc/test/option_dash_D.py
+20 −20 glslc/test/option_dash_E.py
+2 −2 glslc/test/option_dash_M.py
+4 −3 glslc/test/option_dash_cap_O.py
+1 −1 glslc/test/option_dash_o.py
+46 −0 glslc/test/option_fhlsl_16bit_types.py
+243 −1 glslc/test/option_flimit.py
+70 −0 glslc/test/option_fpreserve_bindings.py
+25 −1 glslc/test/parameter_tests.py
+60 −0 kokoro/android-release/build-docker.sh
+23 −44 kokoro/android-release/build.sh
+0 −0 kokoro/android-release/build_arm.sh
+0 −0 kokoro/android-release/build_x86.sh
+3 −3 kokoro/linux/build-docker.sh
+1 −1 kokoro/linux/presubmit_mingw_release.cfg
+2 −2 kokoro/macos/build.sh
+71 −0 kokoro/ndk-build/build-docker.sh
+32 −40 kokoro/ndk-build/build.sh
+6 −6 kokoro/windows/build.bat
+2 −3 kokoro/windows/build_debug_2019.bat
+23 −0 kokoro/windows/build_release_2019.bat
+2 −2 kokoro/windows/continuous_debug_2019.cfg
+22 −0 kokoro/windows/continuous_release_2019.cfg
+2 −2 kokoro/windows/presubmit_debug_2019.cfg
+3 −3 kokoro/windows/presubmit_release_2019.cfg
+2 −2 libshaderc/Android.mk
+2 −14 libshaderc/CMakeLists.txt
+34 −0 libshaderc/include/shaderc/shaderc.h
+18 −0 libshaderc/include/shaderc/shaderc.hpp
+3 −3 libshaderc/src/common_shaders_for_test.h
+17 −0 libshaderc/src/shaderc.cc
+4 −3 libshaderc/src/shaderc_cpp_test.cc
+2 −2 libshaderc/src/shaderc_test.cc
+1 −1 libshaderc_util/Android.mk
+26 −0 libshaderc_util/include/libshaderc_util/compiler.h
+36 −0 libshaderc_util/include/libshaderc_util/resources.inc
+1 −0 libshaderc_util/include/libshaderc_util/spirv_tools_wrapper.h
+1 −1 libshaderc_util/include/libshaderc_util/string_piece.h
+37 −5 libshaderc_util/src/compiler.cc
+24 −0 libshaderc_util/src/compiler_test.cc
+9 −0 libshaderc_util/src/resources.cc
+7 −4 libshaderc_util/src/spirv_tools_wrapper.cc
+19 −1 third_party/CMakeLists.txt
+24 −20 utils/roll-deps
+1 −1 utils/update_build_version.py
2 changes: 1 addition & 1 deletion third_party/spirv_cross
Submodule spirv_cross updated 1134 files

0 comments on commit 545686e

Please sign in to comment.