Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update directx headers to facilitate future updates #6856

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,15 @@ if(LLVM_INCLUDE_TESTS AND WIN32)
add_definitions(/DMSFT_SUPPORTS_CHILD_PROCESSES)
endif()

if(EXISTS "${LLVM_MAIN_SRC_DIR}/external")
add_subdirectory(external) # SPIRV change
endif()
if(WIN32)
include_directories(${DIRECTX_HEADER_INCLUDE_DIR}/directx)
else()
include_directories(AFTER ${DIRECTX_HEADER_INCLUDE_DIR}/wsl/stubs ${DIRECTX_HEADER_INCLUDE_DIR}/directx)
endif()

# Put this before tblgen. Else we have a circular dependence.
add_subdirectory(lib/Support)
add_subdirectory(lib/MSSupport) # HLSL Change
Expand All @@ -686,11 +695,6 @@ add_subdirectory(include/dxc)
# really depend on anything else in the build it is safe.
list(APPEND LLVM_COMMON_DEPENDS HCTGen)

if(EXISTS "${LLVM_MAIN_SRC_DIR}/external")
add_subdirectory(external) # SPIRV change
endif()
include_directories(AFTER ${DIRECTX_HEADER_INCLUDE_DIR}/directx ${DIRECTX_HEADER_INCLUDE_DIR}/wsl/stubs)

# HLSL - Change End

add_subdirectory(lib)
Expand Down
12 changes: 5 additions & 7 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ endif (NOT HLSL_ENABLE_DEBUG_ITERATORS)

# Need DirectX-Headers module if not on windows
if (NOT DIRECTX_HEADER_INCLUDE_DIR)
if (NOT WIN32)
if (IS_DIRECTORY "${DXC_EXTERNAL_ROOT_DIR}/DirectX-Headers")
set(DIRECTX_HEADER_INCLUDE_DIR ${DXC_EXTERNAL_ROOT_DIR}/DirectX-Headers/include PARENT_SCOPE)
else()
message(FATAL_ERROR "DirectX-Headers was not found - required for reflection support on *nix see https://github.com/microsoft/DirectX-Headers")
endif()
endif (NOT WIN32)
if (IS_DIRECTORY "${DXC_EXTERNAL_ROOT_DIR}/DirectX-Headers")
set(DIRECTX_HEADER_INCLUDE_DIR ${DXC_EXTERNAL_ROOT_DIR}/DirectX-Headers/include PARENT_SCOPE)
else()
message(FATAL_ERROR "DirectX-Headers was not found - required for reflection support on *nix see https://github.com/microsoft/DirectX-Headers")
endif()
endif(NOT DIRECTX_HEADER_INCLUDE_DIR)

# Enabling SPIR-V codegen requires SPIRV-Headers for spirv.hpp and
Expand Down
2 changes: 1 addition & 1 deletion external/DirectX-Headers
Submodule DirectX-Headers updated 56 files
+23 −0 .gitignore
+43 −17 CMakeLists.txt
+187 −0 CMakePresets.json
+10 −0 CODE_OF_CONDUCT.md
+41 −41 SECURITY.md
+10 −0 cmake/DirectX-Headers.pc.in
+23 −0 cmake/JoinPaths.cmake
+32 −2 googletest/CMakeLists.txt
+184 −137 googletest/MockDevice.hpp
+2 −0 googletest/feature_support_test.cpp
+13 −0 googletest/meson.build
+2,634 −0 include/directx/D3D12TokenizedProgramFormat.hpp
+2,651 −0 include/directx/DirectML.h
+16,396 −6,705 include/directx/d3d12.h
+946 −103 include/directx/d3d12.idl
+167 −7 include/directx/d3d12compatibility.h
+11 −3 include/directx/d3d12compatibility.idl
+467 −18 include/directx/d3d12sdklayers.h
+136 −4 include/directx/d3d12sdklayers.idl
+7 −0 include/directx/d3d12shader.h
+934 −68 include/directx/d3d12video.h
+750 −68 include/directx/d3d12video.idl
+64 −4 include/directx/d3dcommon.h
+78 −4 include/directx/d3dcommon.idl
+13 −5,039 include/directx/d3dx12.h
+192 −0 include/directx/d3dx12_barriers.h
+1,138 −0 include/directx/d3dx12_check_feature_support.h
+1,537 −0 include/directx/d3dx12_core.h
+12 −0 include/directx/d3dx12_default.h
+1,497 −0 include/directx/d3dx12_pipeline_state_stream.h
+124 −0 include/directx/d3dx12_property_format_table.h
+105 −0 include/directx/d3dx12_render_pass.h
+602 −0 include/directx/d3dx12_resource_helpers.h
+1,227 −0 include/directx/d3dx12_root_signature.h
+2,210 −0 include/directx/d3dx12_state_object.h
+184 −3 include/directx/dxcore_interface.h
+1 −0 include/directx/dxgicommon.idl
+2 −0 include/directx/dxgiformat.h
+2 −0 include/directx/dxgiformat.idl
+77 −6 include/dxguids/dxguids.h
+400 −0 include/wsl/stubs/basetsd.h
+0 −0 include/wsl/stubs/oaidl.h
+0 −0 include/wsl/stubs/ocidl.h
+1 −1 include/wsl/stubs/rpc.h
+73 −1 include/wsl/stubs/rpcndr.h
+3 −0 include/wsl/stubs/unknwn.h
+124 −0 include/wsl/stubs/unknwnbase.h
+1 −400 include/wsl/winadapter.h
+7 −7 include/wsl/wrladapter.h
+33 −4 meson.build
+2,445 −0 src/d3dx12_property_format_table.cpp
+2 −3 src/dxguids.cpp
+48 −4 test/CMakeLists.txt
+98 −6 test/feature_check_test.cpp
+11 −5 test/meson.build
+16 −3 test/test.cpp
2 changes: 1 addition & 1 deletion include/dxc/Support/D3DReflection.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
#undef interface
#pragma GCC diagnostic pop
#else
#include <d3d12shader.h>
#include "d3d12shader.h"
#endif
12 changes: 7 additions & 5 deletions include/dxc/Support/Unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <string>

#ifdef _WIN32
typedef int *LPBOOL;
#include <specstrings.h>
#else
// MultiByteToWideChar which is a Windows-specific method.
Expand All @@ -30,7 +31,7 @@ int WideCharToMultiByte(uint32_t CodePage, uint32_t dwFlags,
const wchar_t *lpWideCharStr, int cchWideChar,
char *lpMultiByteStr, int cbMultiByte,
const char *lpDefaultChar = nullptr,
bool *lpUsedDefaultChar = nullptr);
LPBOOL lpUsedDefaultChar = nullptr);
#endif // _WIN32

namespace Unicode {
Expand All @@ -54,14 +55,15 @@ typedef char acp_char;
typedef char ccp_char;

bool UTF8ToConsoleString(const char *text, size_t textLen, std::string *pValue,
bool *lossy);
LPBOOL lossy);

bool UTF8ToConsoleString(const char *text, std::string *pValue, bool *lossy);
bool UTF8ToConsoleString(const char *text, std::string *pValue, LPBOOL lossy);

bool WideToConsoleString(const wchar_t *text, size_t textLen,
std::string *pValue, bool *lossy);
std::string *pValue, LPBOOL lossy);

bool WideToConsoleString(const wchar_t *text, std::string *pValue, bool *lossy);
bool WideToConsoleString(const wchar_t *text, std::string *pValue,
LPBOOL lossy);

bool UTF8ToWideString(const char *pUTF8, std::wstring *pWide);

Expand Down
Loading
Loading