From dc9a4e784c8bb97fbb16a01624c7b8f0544977a4 Mon Sep 17 00:00:00 2001 From: azhirnov Date: Tue, 11 Aug 2020 22:48:23 +0300 Subject: Added mesh shader added mesh shader support to DX12 and Vulkan, added DXIL compiler for Shader Model 6.x --- BuildUtils.cmake | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'BuildUtils.cmake') diff --git a/BuildUtils.cmake b/BuildUtils.cmake index 25d482fa..ee583daa 100644 --- a/BuildUtils.cmake +++ b/BuildUtils.cmake @@ -24,17 +24,32 @@ if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS) "\"$\"") endforeach(DLL) - # Copy D3Dcompiler_47.dll + # Copy D3Dcompiler_47.dll and dxcompiler.dll if(MSVC) - if(WIN64) - set(D3D_COMPILER_PATH "\"$(VC_ExecutablePath_x64_x64)\\D3Dcompiler_47.dll\"") + if (${CMAKE_SIZEOF_VOID_P} EQUAL 8) + set(D3D_COMPILER_PATH "\"$(WindowsSdkDir)\\bin\\${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}\\x64\\D3Dcompiler_47.dll\"") + set(DXC_COMPILER_PATH "\"$(WindowsSdkDir)\\bin\\${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}\\x64\\dxcompiler.dll\"") + set(DXIL_PATH "\"$(WindowsSdkDir)\\bin\\${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}\\x64\\dxil.dll\"") else() - set(D3D_COMPILER_PATH "\"$(VC_ExecutablePath_x86_x86)\\D3Dcompiler_47.dll\"") + set(D3D_COMPILER_PATH "\"$(WindowsSdkDir)\\bin\\${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}\\x86\\D3Dcompiler_47.dll\"") + set(DXC_COMPILER_PATH "\"$(WindowsSdkDir)\\bin\\${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}\\x86\\dxcompiler.dll\"") + set(DXIL_PATH "\"$(WindowsSdkDir)\\bin\\${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}\\x86\\dxil.dll\"") endif() add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${D3D_COMPILER_PATH} "\"$\"") + + if (${HAS_DXIL_COMPILER}) + # For the compiler to sign the bytecode, you have to have a copy of dxil.dll in the same folder as the dxcompiler.dll at runtime. + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DXC_COMPILER_PATH} + "\"$\"" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DXIL_PATH} + "\"$\"") + endif () endif() endfunction() -- cgit v1.2.3