* minimal backend support for compute - added api to dispatch a compute shader - added api to create and bind a ssbo - added api to read back a buffer Only implemented in the gl backend * Add a backend compute test suite * basic support for compute shaders in matc this is still very much work-in-progress. We're not supporting images nor ssbo for now. * rename UniformInterfaceBlock to BufferInterfaceBlock * augment BufferInterfaceBlock to support ssbo features - add support for std430 - add support for ssbo - add support for variable-size array - add support for memory qualifiers * reformat MaterialBuilder * material format: move subpasses outside of parameters subpasses now are their own json property instead of being a "parameter". * refactor parameter() methods to match Buffer/SamplerInterfaceBlock We're just shuffling the arguments. * add support for buffers in .mat files * filamat now generates buffer blocks (ssbo) * take feature level into consideration when optimizing shaders * don't store the 'uniform binding' chunk for level 2 materials this includes some refactoring/cleanups of MaterialParser * matinfo: fixes for compute - separate subpasses from parameters - don't attempt to print material properties
99 lines
3.8 KiB
CMake
99 lines
3.8 KiB
CMake
cmake_minimum_required(VERSION 3.19)
|
|
|
|
# ==================================================================================================
|
|
# Library
|
|
# ==================================================================================================
|
|
project(matlang)
|
|
set(TARGET matlang)
|
|
|
|
# ==================================================================================================
|
|
# Sources and headers
|
|
# ==================================================================================================
|
|
set(HDRS
|
|
src/matc/CommandlineConfig.h
|
|
src/matc/Compiler.h
|
|
src/matc/Config.h
|
|
src/matc/JsonishLexeme.h
|
|
src/matc/JsonishLexer.h
|
|
src/matc/JsonishParser.h
|
|
src/matc/Lexeme.h
|
|
src/matc/Lexer.h
|
|
src/matc/MaterialCompiler.h
|
|
src/matc/MaterialLexeme.h
|
|
src/matc/MaterialLexer.h
|
|
src/matc/ParametersProcessor.h
|
|
src/matc/DirIncluder.h
|
|
)
|
|
|
|
set(SRCS
|
|
src/matc/Compiler.cpp
|
|
src/matc/CommandlineConfig.cpp
|
|
src/matc/JsonishLexer.cpp
|
|
src/matc/JsonishParser.cpp
|
|
src/matc/MaterialCompiler.cpp
|
|
src/matc/MaterialLexer.cpp
|
|
src/matc/ParametersProcessor.cpp
|
|
src/matc/DirIncluder.cpp
|
|
)
|
|
|
|
# ==================================================================================================
|
|
# Target definitions
|
|
# ==================================================================================================
|
|
add_library(${TARGET} STATIC ${SRCS} ${HDRS})
|
|
|
|
target_include_directories(${TARGET} PUBLIC src)
|
|
target_include_directories(${TARGET} PRIVATE ${filamat_SOURCE_DIR}/src)
|
|
|
|
target_link_libraries(${TARGET} getopt filamat filabridge utils)
|
|
set_target_properties(${TARGET} PROPERTIES FOLDER Tools)
|
|
|
|
# =================================================================================================
|
|
# Licenses
|
|
# ==================================================================================================
|
|
set(MODULE_LICENSES getopt glslang spirv-cross spirv-tools smol-v)
|
|
set(GENERATION_ROOT ${CMAKE_CURRENT_BINARY_DIR}/generated)
|
|
list_licenses(${GENERATION_ROOT}/licenses/licenses.inc ${MODULE_LICENSES})
|
|
target_include_directories(${TARGET} PRIVATE ${GENERATION_ROOT})
|
|
|
|
# ==================================================================================================
|
|
# Binary
|
|
# ==================================================================================================
|
|
project(matc)
|
|
set(TARGET matc)
|
|
|
|
# ==================================================================================================
|
|
# Sources and headers
|
|
# ==================================================================================================
|
|
set(SRCS src/main.cpp)
|
|
|
|
# ==================================================================================================
|
|
# Target definitions
|
|
# ==================================================================================================
|
|
add_executable(${TARGET} ${SRCS} ${HDRS})
|
|
target_link_libraries(${TARGET} matlang)
|
|
set_target_properties(${TARGET} PROPERTIES FOLDER Tools)
|
|
|
|
# ==================================================================================================
|
|
# Installation
|
|
# ==================================================================================================
|
|
install(TARGETS ${TARGET} RUNTIME DESTINATION bin)
|
|
|
|
# ==================================================================================================
|
|
# Tests
|
|
# ==================================================================================================
|
|
project(test_matc)
|
|
set(TARGET test_matc)
|
|
set(SRCS
|
|
tests/test_matc.cpp
|
|
tests/test_includer.cpp
|
|
tests/TestMaterialCompiler.h
|
|
tests/test_compute_material.cpp
|
|
tests/MockConfig.cpp
|
|
tests/MockConfig.h)
|
|
|
|
add_executable(${TARGET} ${SRCS})
|
|
|
|
target_link_libraries(${TARGET} matlang gtest)
|
|
|
|
set_target_properties(test_matc PROPERTIES FOLDER Tests)
|