video_core/host_shaders: Add CMake integration for string shaders

Add the necessary CMake code to copy the contents in a string source
shader (GLSL or GLASM) to a header file then consumed by video_core
files.

This allows editting GLSL in its own files without having to maintain
them in source files.

For now, only OpenGL presentation shaders are moved, but we can add
GLASM presentation shaders and static SPIR-V generation through
glslangValidator in the future.
This commit is contained in:
ReinUsesLisp
2020-08-23 21:28:15 -03:00
parent 0eaf7e1daa
commit 91df2beee3
7 changed files with 106 additions and 42 deletions

View File

@ -0,0 +1,11 @@
set(SOURCE_FILE ${CMAKE_ARGV3})
set(HEADER_FILE ${CMAKE_ARGV4})
set(INPUT_FILE ${CMAKE_ARGV5})
get_filename_component(CONTENTS_NAME ${SOURCE_FILE} NAME)
string(REPLACE "." "_" CONTENTS_NAME ${CONTENTS_NAME})
string(TOUPPER ${CONTENTS_NAME} CONTENTS_NAME)
file(READ ${SOURCE_FILE} CONTENTS)
configure_file(${INPUT_FILE} ${HEADER_FILE} @ONLY)