Skip to content

Commit

Permalink
[D3D12] Fixed missing define in CMakeLists.txt script for DXC compiler.
Browse files Browse the repository at this point in the history
CMake function add_definitions() only adds defines for the current subdirectory.
LLGL_D3D12_ENABLE_DXCOMPILER is defined in LLGL_DXCommon build script, so it must be adopted in D3D12 backend explicitly.
  • Loading branch information
LukasBanana committed Jun 16, 2024
1 parent 769497c commit f22c4dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sources/Renderer/DXCommon/DXC/DXCInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ HRESULT DXCompileShaderToDxil(
if (FAILED(hr))
return hr;

return S_OK;
return compileResult;
}

HRESULT DXReflectDxilShader(
Expand Down
5 changes: 5 additions & 0 deletions sources/Renderer/Direct3D12/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ source_group("Include\\Platform" FILES ${FilesIncludeD3D12})
# === Projects ===

if(LLGL_BUILD_RENDERER_DIRECT3D12)
# Adopt define from LLGL_DXCommon lib
if(LLGL_D3D12_ENABLE_DXCOMPILER)
ADD_DEFINE(LLGL_D3D12_ENABLE_DXCOMPILER)
endif()

# Direct3D 12 Renderer
add_llgl_module(LLGL_Direct3D12 LLGL_BUILD_RENDERER_DIRECT3D12 "${FilesD3D12}")
target_link_libraries(LLGL_Direct3D12 LLGL LLGL_DXCommon d3d12 dxgi D3DCompiler)
Expand Down

0 comments on commit f22c4dc

Please sign in to comment.