Skip to content

Commit

Permalink
Changed the level 0 materials custom commands so that materials for a…
Browse files Browse the repository at this point in the history
…ll APIs are built.

This allows to turn off the OpenGL backend (using -DFILAMENT_SUPPORTS_OPENGL=OFF).
Previously, disabling the OpenGL backend was leading to a compilation error related to missing level 0 materials.
  • Loading branch information
mdagois authored and elizagamedev committed Dec 11, 2023
1 parent fdb90f2 commit 2f62978
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions filament/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ foreach (mat_src ${MATERIAL_SRCS})
list(APPEND MATERIAL_BINS ${output_path})
endforeach()

if (FILAMENT_ENABLE_FEATURE_LEVEL_0 AND FILAMENT_SUPPORTS_OPENGL)
if (FILAMENT_ENABLE_FEATURE_LEVEL_0)
foreach (mat_src ${MATERIAL_FL0_SRCS})
get_filename_component(localname "${mat_src}" NAME_WE)
get_filename_component(fullname "${mat_src}" ABSOLUTE)
set(output_path "${MATERIAL_DIR}/${localname}.filamat")

add_custom_command(
OUTPUT ${output_path}
COMMAND matc -a opengl -p ${MATC_TARGET} ${MATC_OPT_FLAGS} -o ${output_path} ${fullname}
COMMAND matc ${MATC_BASE_FLAGS} -o ${output_path} ${fullname}
MAIN_DEPENDENCY ${fullname}
DEPENDS matc
COMMENT "Compiling material ${mat_src} to ${output_path}"
Expand Down

0 comments on commit 2f62978

Please sign in to comment.