Skip to content

Commit

Permalink
- make master branch work with current anyfxcompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
kaffeewolf committed Feb 24, 2024
1 parent 9e6db1a commit 90d6ea1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fips-files/include.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ macro(add_shaders_intern)
cmake_path(RELATIVE_PATH shd_path BASE_DIRECTORY ${base_path} OUTPUT_VARIABLE rel_path)
cmake_path(GET rel_path STEM basename)
cmake_path(GET rel_path PARENT_PATH foldername)

set(binaryOutput ${EXPORT_DIR}/shaders/${foldername}/${basename}.fxb)
set(headerOutput ${CMAKE_BINARY_DIR}/shaders/${CurTargetName}/${foldername}/${basename}.h)

# first calculate dependencies
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/shaders)
Expand All @@ -208,7 +211,7 @@ macro(add_shaders_intern)
# create it the first time by force, after that with dependencies
# since custom command does not want to play ball atm, we just generate it every time
if(NOT EXISTS ${depoutput} OR ${shd} IS_NEWER_THAN ${depoutput})
execute_process(COMMAND ${SHADERC} -M -i ${shd} -I ${NROOT}/syswork/shaders/vk -I ${foldername} -r ${base_path} -o ${CMAKE_BINARY_DIR} -h ${CMAKE_BINARY_DIR}/shaders/${CurTargetName} -t shader)
execute_process(COMMAND ${SHADERC} -M -i ${shd} -I ${NROOT}/syswork/shaders/vk -I ${foldername} -r ${base_path} -o ${depoutput} -h ${headerOutput} -t shader)
endif()

# sadly this doesnt work for some reason
Expand All @@ -225,7 +228,7 @@ macro(add_shaders_intern)

set(output ${EXPORT_DIR}/shaders/${foldername}/${basename}.fxb)
add_custom_command(OUTPUT ${output}
COMMAND ${SHADERC} -i ${shd} -I ${NROOT}/syswork/shaders/vk -I ${foldername} -r ${base_path} -o ${EXPORT_DIR} -h ${CMAKE_BINARY_DIR}/shaders/${CurTargetName} -t shader ${shader_debug}
COMMAND ${SHADERC} -i ${shd} -I ${NROOT}/syswork/shaders/vk -I ${foldername} -r ${base_path} -o ${binaryOutput} -h ${headerOutput} -t shader ${shader_debug}
MAIN_DEPENDENCY ${shd}
DEPENDS ${SHADERC} ${deps}
WORKING_DIRECTORY ${FIPS_PROJECT_DIR}
Expand All @@ -237,7 +240,7 @@ macro(add_shaders_intern)
SOURCE_GROUP(TREE "${base_path}" PREFIX "res\\shaders" FILES ${shd})
if(N_ENABLE_SHADER_COMMAND_GENERATION)
# create compile flags file for live shader compile
file(WRITE ${FIPS_PROJECT_DEPLOY_DIR}/shaders/${basename}.txt "${SHADERC} -i ${shd} -I ${NROOT}/syswork/shaders/vk -I ${foldername} -o ${EXPORT_DIR} -h ${CMAKE_BINARY_DIR}/shaders/${CurTargetName} -t shader ${shader_debug}")
file(WRITE ${FIPS_PROJECT_DEPLOY_DIR}/shaders/${basename}.txt "${SHADERC} -i ${shd} -I ${NROOT}/syswork/shaders/vk -I ${foldername} -o ${binaryOutput} -h ${headerOutput} -t shader ${shader_debug}")
endif()
endif()
endmacro()
Expand Down

0 comments on commit 90d6ea1

Please sign in to comment.