GPU: Shader: Make info files generated

This is the first step of moving the create infos
back inside shader sources.

All info files are now treated as source files.
However, they are not considered in the include tree
yet. This will come in another following PR.

Each shader source file now generate a `.info` file
containing only the create info declarations.

This renames all info files so that they do not
conflict with their previous versions that were
copied (non-generated).

Pull Request: https://projects.blender.org/blender/blender/pulls/146676
This commit is contained in:
Clément Foucault
2025-09-25 10:57:02 +02:00
committed by Clément Foucault
parent e655243825
commit fe213f80a4
569 changed files with 1195 additions and 764 deletions

View File

@@ -1061,6 +1061,7 @@ function(glsl_to_c
get_filename_component(_file_from ${CMAKE_CURRENT_SOURCE_DIR}/${file_from} REALPATH)
get_filename_component(_file_tmp ${CMAKE_CURRENT_BINARY_DIR}/${file_from} REALPATH)
get_filename_component(_file_meta ${CMAKE_CURRENT_BINARY_DIR}/${file_from}.hh REALPATH)
get_filename_component(_file_info ${CMAKE_CURRENT_BINARY_DIR}/${file_from}.info REALPATH)
get_filename_component(_file_to ${CMAKE_CURRENT_BINARY_DIR}/${file_from}.c REALPATH)
list(APPEND ${list_to_add} ${_file_to})
@@ -1071,14 +1072,15 @@ function(glsl_to_c
get_filename_component(_file_to_path ${_file_to} PATH)
add_custom_command(
OUTPUT ${_file_to} ${_file_meta}
COMMAND "$<TARGET_FILE:glsl_preprocess>" ${_file_from} ${_file_tmp} ${_file_meta}
OUTPUT ${_file_to} ${_file_meta} ${_file_info}
COMMAND "$<TARGET_FILE:glsl_preprocess>" ${_file_from} ${_file_tmp} ${_file_meta} ${_file_info}
COMMAND "$<TARGET_FILE:datatoc>" ${_file_tmp} ${_file_to}
DEPENDS ${_file_from} datatoc glsl_preprocess)
set_source_files_properties(${_file_tmp} PROPERTIES GENERATED TRUE)
set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE)
set_source_files_properties(${_file_meta} PROPERTIES GENERATED TRUE)
set_source_files_properties(${_file_info} PROPERTIES GENERATED TRUE)
endfunction()