17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-04 00:42:05 +01:00

add shader compilation pipeline using dxc compiler

This commit is contained in:
WLs50
2025-04-05 13:30:13 +02:00
parent 85435c74bf
commit 900133089b
8 changed files with 447 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.24)
set(CMAKE_CXX_STANDARD 17)
project(MaShaderCompiler)
file(GLOB_RECURSE src "src/*.cpp" "src/*.hpp")
find_package(directx-dxc CONFIG REQUIRED)
add_executable(MaShaderCompiler ${src})
target_link_libraries(MaShaderCompiler nvrhi yaml-cpp Microsoft::DirectXShaderCompiler Microsoft::DXIL)
if (WIN32)
target_link_libraries(MaShaderCompiler delayimp)
target_link_options(MaShaderCompiler PRIVATE "/DELAYLOAD:dxcompiler.dll")
endif ()
# We later pass the DXIL.dll parent directory as first argument to MaShaderCompiler so that it can sign DX12 shaders
get_target_property(dxil_dll_path Microsoft::DXIL IMPORTED_LOCATION)
get_filename_component(dxil_dll_path ${dxil_dll_path} DIRECTORY)
set_target_properties(MaShaderCompiler PROPERTIES dxil_path "${dxil_dll_path}")