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:
parent
0eaf7e1daa
commit
91df2beee3
7 changed files with 106 additions and 42 deletions
11
src/video_core/host_shaders/StringShaderHeader.cmake
Normal file
11
src/video_core/host_shaders/StringShaderHeader.cmake
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue