citra/src/video_core/generate_shaders.cmake
Marshall Mohror a7d3489dc9
video_core: add texture filtering (#5017)
video_core: add texture filtering
2020-03-16 09:42:05 -05:00

16 lines
578 B
CMake

function(GetShaderHeaderFile shader_file_name)
set(shader_header_file ${CMAKE_CURRENT_BINARY_DIR}/shaders/${shader_file_name} PARENT_SCOPE)
endfunction()
foreach(shader_file ${SHADER_FILES})
file(READ ${shader_file} shader)
get_filename_component(shader_file_name ${shader_file} NAME)
string(REPLACE . _ shader_name ${shader_file_name})
GetShaderHeaderFile(${shader_file_name})
file(WRITE ${shader_header_file}
"#pragma once\n"
"constexpr std::string_view ${shader_name} = R\"(\n"
"${shader}"
")\";\n"
)
endforeach()