diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f7db99784..42a00e0c30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index a8b2638e3d..b56bc1d2ab 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -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 diff --git a/external/DirectX-Headers b/external/DirectX-Headers index 980971e835..dc27951f84 160000 --- a/external/DirectX-Headers +++ b/external/DirectX-Headers @@ -1 +1 @@ -Subproject commit 980971e835876dc0cde415e8f9bc646e64667bf7 +Subproject commit dc27951f840703d8edfe6e2907bfff6410fe68eb diff --git a/include/dxc/Support/D3DReflection.h b/include/dxc/Support/D3DReflection.h index aeb004c7bb..4e5c0684b3 100644 --- a/include/dxc/Support/D3DReflection.h +++ b/include/dxc/Support/D3DReflection.h @@ -22,5 +22,5 @@ #undef interface #pragma GCC diagnostic pop #else -#include +#include "d3d12shader.h" #endif diff --git a/include/dxc/Support/Unicode.h b/include/dxc/Support/Unicode.h index 64e3abccd8..3f9442c1cd 100644 --- a/include/dxc/Support/Unicode.h +++ b/include/dxc/Support/Unicode.h @@ -14,6 +14,7 @@ #include #ifdef _WIN32 +typedef int *LPBOOL; #include #else // MultiByteToWideChar which is a Windows-specific method. @@ -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 { @@ -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); diff --git a/include/dxc/Test/D3DReflectionDumper.h b/include/dxc/Test/D3DReflectionDumper.h index 9ecd7f5b62..5f86e18424 100644 --- a/include/dxc/Test/D3DReflectionDumper.h +++ b/include/dxc/Test/D3DReflectionDumper.h @@ -38,18 +38,32 @@ class D3DReflectionDumper : public DumpContext { void Dump(D3D12_SHADER_BUFFER_DESC &Desc); void Dump(D3D12_SHADER_INPUT_BIND_DESC &resDesc); void Dump(D3D12_SIGNATURE_PARAMETER_DESC &elDesc); + void Dump(D3D12_NODE_SHADER_DESC &Desc); + void Dump(D3D12_HULL_SHADER_DESC &Desc); + void Dump(D3D12_COMPUTE_SHADER_DESC &Desc); + void Dump(D3D12_MESH_SHADER_DESC &Desc); + void Dump(D3D12_GEOMETRY_SHADER_DESC &Desc); + void Dump(D3D12_DOMAIN_SHADER_DESC &Desc); + void Dump(D3D12_NODE_ID_DESC &Desc, const char *name); + void Dump(D3D12_NODE_DESC &Desc); void Dump(D3D12_SHADER_DESC &Desc); void Dump(D3D12_FUNCTION_DESC &Desc); void Dump(D3D12_LIBRARY_DESC &Desc); + void Dump(D3D12_FUNCTION_DESC1 &Desc); + void Dump(ID3D12ShaderReflectionType *pType); void Dump(ID3D12ShaderReflectionVariable *pVar); void Dump(ID3D12ShaderReflectionConstantBuffer *pCBReflection); - void Dump(ID3D12ShaderReflection *pShaderReflection); + void Dump(ID3D12ShaderReflection *pShaderReflection, + BOOL printHeader = false); + void Dump(ID3D12ShaderReflection1 *pShaderReflection); void Dump(ID3D12FunctionReflection *pFunctionReflection); + void Dump(ID3D12FunctionReflection1 *pFunctionReflection); void Dump(ID3D12LibraryReflection *pLibraryReflection); + void Dump(ID3D12LibraryReflection1 *pLibraryReflection); }; } // namespace dump diff --git a/include/dxc/Test/D3DReflectionStrings.h b/include/dxc/Test/D3DReflectionStrings.h index 5e97ac9f4f..4a60727eca 100644 --- a/include/dxc/Test/D3DReflectionStrings.h +++ b/include/dxc/Test/D3DReflectionStrings.h @@ -39,6 +39,8 @@ LPCSTR ToString(D3D_PARAMETER_FLAGS Flag); LPCSTR ToString(D3D_NAME Name); LPCSTR ToString(D3D_REGISTER_COMPONENT_TYPE CompTy); LPCSTR ToString(D3D_MIN_PRECISION MinPrec); +LPCSTR ToString(D3D12_NODE_LAUNCH_TYPE NodeLaunchType); +LPCSTR ToString(D3D12_DISPATCH_COMPONENT_TYPE DispatchComponentType); LPCSTR CompMaskToString(unsigned CompMask); // These macros declare the ToString functions for DXC types diff --git a/include/dxc/WinAdapter.h b/include/dxc/WinAdapter.h index b8c6646871..10796baec7 100644 --- a/include/dxc/WinAdapter.h +++ b/include/dxc/WinAdapter.h @@ -33,6 +33,8 @@ #include #endif // __cplusplus +#include "../winadapter.h" //To avoid duplicates, some things are defined by WSL, some by dxc + #define COM_NO_WINDOWS_H // needed to inform d3d headers that this isn't windows //===----------------------------------------------------------------------===// @@ -40,7 +42,6 @@ // Begin: Macro Definitions // //===----------------------------------------------------------------------===// -#define C_ASSERT(expr) static_assert((expr), "") #define ATLASSERT assert #define CoTaskMemAlloc malloc @@ -48,8 +49,6 @@ #define ARRAYSIZE(array) (sizeof(array) / sizeof(array[0])) -#define _countof(a) (sizeof(a) / sizeof(*(a))) - // If it is GCC, there is no UUID support and we must emulate it. #ifndef __clang__ #define __EMULATE_UUID 1 @@ -68,11 +67,6 @@ #define STDMETHODCALLTYPE #define STDMETHODIMP_(type) type STDMETHODCALLTYPE #define STDMETHODIMP STDMETHODIMP_(HRESULT) -#define STDMETHOD_(type, name) virtual STDMETHODIMP_(type) name -#define STDMETHOD(name) STDMETHOD_(HRESULT, name) -#define EXTERN_C extern "C" - -#define UNREFERENCED_PARAMETER(P) (void)(P) #define RtlEqualMemory(Destination, Source, Length) \ (!memcmp((Destination), (Source), (Length))) @@ -88,9 +82,6 @@ #define FillMemory RtlFillMemory #define ZeroMemory RtlZeroMemory -#define FALSE 0 -#define TRUE 1 - // We ignore the code page completely on Linux. #define GetConsoleOutputCP() 0 @@ -216,45 +207,23 @@ //===--------------------- HRESULT Related Macros -------------------------===// -#define S_OK ((HRESULT)0L) -#define S_FALSE ((HRESULT)1L) - -#define E_ABORT (HRESULT)0x80004004 -#define E_ACCESSDENIED (HRESULT)0x80070005 #define E_BOUNDS (HRESULT)0x8000000B -#define E_FAIL (HRESULT)0x80004005 -#define E_HANDLE (HRESULT)0x80070006 -#define E_INVALIDARG (HRESULT)0x80070057 -#define E_NOINTERFACE (HRESULT)0x80004002 -#define E_NOTIMPL (HRESULT)0x80004001 #define E_NOT_VALID_STATE (HRESULT)0x8007139F -#define E_OUTOFMEMORY (HRESULT)0x8007000E -#define E_POINTER (HRESULT)0x80004003 -#define E_UNEXPECTED (HRESULT)0x8000FFFF -#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) -#define FAILED(hr) (((HRESULT)(hr)) < 0) #define DXC_FAILED(hr) (((HRESULT)(hr)) < 0) #define HRESULT_FROM_WIN32(x) \ (HRESULT)(x) <= 0 ? (HRESULT)(x) \ : (HRESULT)(((x) & 0x0000FFFF) | (7 << 16) | 0x80000000) +#define DXC_FAILED(hr) (((HRESULT)(hr)) < 0) + //===----------------------------------------------------------------------===// // // Begin: Disable SAL Annotations // //===----------------------------------------------------------------------===// -#define _In_ -#define _In_z_ -#define _In_opt_ -#define _In_opt_count_(size) -#define _In_opt_z_ -#define _In_count_(size) -#define _In_bytecount_(size) - -#define _Out_ -#define _Out_opt_ + #define _Outptr_ #define _Outptr_opt_ #define _Outptr_result_z_ @@ -264,15 +233,6 @@ #define _Outptr_result_buffer_maybenull_(ptr) #define _Outptr_result_buffer_(ptr) -#define _COM_Outptr_ -#define _COM_Outptr_opt_ -#define _COM_Outptr_result_maybenull_ -#define _COM_Outptr_opt_result_maybenull_ - -#define THIS_ -#define THIS -#define PURE = 0 - #define _Maybenull_ #define __debugbreak() @@ -296,53 +256,64 @@ #ifdef __cplusplus -typedef unsigned char BYTE, UINT8; -typedef unsigned char *LPBYTE; - -typedef BYTE BOOLEAN; +// Note: using fixed-width here to match Windows widths +// Specifically this is different for 'long' vs 'LONG' +typedef uint8_t UINT8; +typedef int8_t INT8; +typedef uint16_t UINT16; +typedef int16_t INT16; +typedef uint32_t UINT32, UINT, ULONG, DWORD, WINBOOL, BOOL; +typedef int32_t INT32, INT, LONG; +typedef uint64_t UINT64, ULONG_PTR; +typedef int64_t INT64, LONG_PTR; +typedef void VOID, *HANDLE, *RPC_IF_HANDLE, *LPVOID; +typedef const void *LPCVOID; +typedef size_t SIZE_T; +typedef float FLOAT; +typedef double DOUBLE; +typedef unsigned char BYTE; +typedef int HWND; +typedef int PALETTEENTRY; +typedef int HDC; +typedef uint16_t WORD; +typedef void *PVOID; +typedef char BOOLEAN; +typedef uint64_t ULONGLONG; +typedef uint16_t USHORT, *PUSHORT; +typedef int64_t LONGLONG, *PLONGLONG; +typedef int64_t LONG_PTR, *PLONG_PTR; +typedef int64_t LONG64, *PLONG64; +typedef uint64_t ULONG64, *PULONG64; +typedef wchar_t WCHAR, *PWSTR; +typedef uint8_t UCHAR, *PUCHAR; +typedef uint64_t ULONG_PTR, *PULONG_PTR; +typedef uint64_t UINT_PTR, *PUINT_PTR; +typedef int64_t INT_PTR, *PINT_PTR; + +// Note: WCHAR is not the same between Windows and Linux, to enable +// string manipulation APIs to work with resulting strings. +// APIs to D3D/DXCore will work on Linux wchars, but beware with +// interactions directly with the Windows kernel. +typedef char CHAR, *PSTR, *LPSTR, TCHAR, *PTSTR; +typedef const char *LPCSTR, *PCSTR, *LPCTSTR, *PCTSTR; +typedef wchar_t WCHAR, *PWSTR, *LPWSTR, *PWCHAR; +typedef const wchar_t *LPCWSTR, *PCWSTR; + +typedef BYTE *LPBYTE; typedef BOOLEAN *PBOOLEAN; -typedef bool BOOL; typedef BOOL *LPBOOL; -typedef int INT; -typedef long LONG; -typedef unsigned int UINT; -typedef unsigned long ULONG; -typedef long long LONGLONG; -typedef long long LONG_PTR; -typedef unsigned long long ULONG_PTR; -typedef unsigned long long ULONGLONG; - -typedef uint16_t WORD; -typedef uint32_t DWORD; typedef DWORD *LPDWORD; -typedef uint32_t UINT32; -typedef uint64_t UINT64; - -typedef signed char INT8, *PINT8; -typedef signed int INT32, *PINT32; - -typedef size_t SIZE_T; -typedef const char *LPCSTR; -typedef const char *PCSTR; +typedef INT8 *PINT8; +typedef INT32 *PINT32; typedef int errno_t; -typedef wchar_t WCHAR; -typedef wchar_t *LPWSTR; -typedef wchar_t *PWCHAR; -typedef const wchar_t *LPCWSTR; -typedef const wchar_t *PCWSTR; - typedef WCHAR OLECHAR; typedef OLECHAR *BSTR; typedef OLECHAR *LPOLESTR; -typedef char *LPSTR; - -typedef void *LPVOID; -typedef const void *LPCVOID; typedef std::nullptr_t nullptr_t; @@ -350,9 +321,6 @@ typedef signed int HRESULT; //===--------------------- Handle Types -----------------------------------===// -typedef void *HANDLE; -typedef void *RPC_IF_HANDLE; - #define DECLARE_HANDLE(name) \ struct name##__ { \ int unused; \ @@ -368,45 +336,11 @@ typedef void *HMODULE; //===--------------------- ID Types and Macros for COM --------------------===// -#ifdef __EMULATE_UUID -struct GUID -#else // __EMULATE_UUID -// These specific definitions are required by clang -fms-extensions. -typedef struct _GUID -#endif // __EMULATE_UUID -{ - uint32_t Data1; - uint16_t Data2; - uint16_t Data3; - uint8_t Data4[8]; -} -#ifdef __EMULATE_UUID -; -#else // __EMULATE_UUID -GUID; -#endif // __EMULATE_UUID -typedef GUID CLSID; typedef const GUID &REFGUID; typedef const GUID &REFCLSID; -typedef GUID IID; typedef IID *LPIID; typedef const IID &REFIID; -inline bool IsEqualGUID(REFGUID rguid1, REFGUID rguid2) { - // Optimization: - if (&rguid1 == &rguid2) - return true; - - return !memcmp(&rguid1, &rguid2, sizeof(GUID)); -} - -inline bool operator==(REFGUID guidOne, REFGUID guidOther) { - return !!IsEqualGUID(guidOne, guidOther); -} - -inline bool operator!=(REFGUID guidOne, REFGUID guidOther) { - return !(guidOne == guidOther); -} inline bool IsEqualIID(REFIID riid1, REFIID riid2) { return IsEqualGUID(riid1, riid2); @@ -450,26 +384,6 @@ typedef struct _WIN32_FIND_DATAW { WCHAR cAlternateFileName[14]; } WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW; -typedef union _LARGE_INTEGER { - struct { - DWORD LowPart; - DWORD HighPart; - } u; - LONGLONG QuadPart; -} LARGE_INTEGER; - -typedef LARGE_INTEGER *PLARGE_INTEGER; - -typedef union _ULARGE_INTEGER { - struct { - DWORD LowPart; - DWORD HighPart; - } u; - ULONGLONG QuadPart; -} ULARGE_INTEGER; - -typedef ULARGE_INTEGER *PULARGE_INTEGER; - typedef struct tagSTATSTG { LPOLESTR pwcsName; DWORD type; @@ -492,8 +406,6 @@ enum tagSTATFLAG { //===--------------------- UUID Related Macros ----------------------------===// -#ifdef __EMULATE_UUID - // The following macros are defined to facilitate the lack of 'uuid' on Linux. constexpr uint8_t nybble_from_hex(char c) { @@ -530,56 +442,50 @@ constexpr GUID guid_from_string(const char str[37]) { byte_from_hexstr(str + 32), byte_from_hexstr(str + 34)}}; } -template inline GUID __emulated_uuidof(); +#ifdef __EMULATE_UUID + +template inline GUID __emulated_uuidof(); -#define CROSS_PLATFORM_UUIDOF(interface, spec) \ - struct interface; \ - template <> inline GUID __emulated_uuidof() { \ +#define CROSS_PLATFORM_UUIDOF(interfce, spec) \ + struct interfce; \ + template <> inline GUID __emulated_uuidof() { \ static const IID _IID = guid_from_string(spec); \ return _IID; \ + } \ + extern "C++" { \ + template <> inline const GUID &__wsl_stub_uuidof() { \ + static const IID _IID = guid_from_string(spec); \ + return _IID; \ + } \ + template <> inline const GUID &__wsl_stub_uuidof() { \ + return __wsl_stub_uuidof(); \ + } \ } -#define __uuidof(T) __emulated_uuidof::type>() - -#define IID_PPV_ARGS(ppType) \ - __uuidof(decltype(**(ppType))), reinterpret_cast(ppType) - #else // __EMULATE_UUID -#ifndef CROSS_PLATFORM_UUIDOF +#ifndef _WIN32 +#define CROSS_PLATFORM_UUIDOF(interfce, spec) \ + struct __declspec(uuid(spec)) interfce; \ + extern "C++" { \ + template <> inline const GUID &__wsl_stub_uuidof() { \ + static const IID _IID = guid_from_string(spec); \ + return _IID; \ + } \ + template <> inline const GUID &__wsl_stub_uuidof() { \ + return __wsl_stub_uuidof(); \ + } \ + } +#elif !defined(CROSS_PLATFORM_UUIDOF) // Warning: This macro exists in dxcapi.h as well -#define CROSS_PLATFORM_UUIDOF(interface, spec) \ - struct __declspec(uuid(spec)) interface; +#define CROSS_PLATFORM_UUIDOF(interfce, spec) \ + struct __declspec(uuid(spec)) interfce; #endif -template inline void **IID_PPV_ARGS_Helper(T **pp) { - return reinterpret_cast(pp); -} -#define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType) - #endif // __EMULATE_UUID -// Needed for d3d headers, but fail to create actual interfaces -#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - const GUID name = {l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}} -#define DECLSPEC_UUID(x) -#define MIDL_INTERFACE(x) struct DECLSPEC_UUID(x) -#define DECLARE_INTERFACE(iface) struct iface -#define DECLARE_INTERFACE_(iface, parent) DECLARE_INTERFACE(iface) : parent - //===--------------------- COM Interfaces ---------------------------------===// -CROSS_PLATFORM_UUIDOF(IUnknown, "00000000-0000-0000-C000-000000000046") -struct IUnknown { - IUnknown(){}; - virtual HRESULT QueryInterface(REFIID riid, void **ppvObject) = 0; - virtual ULONG AddRef() = 0; - virtual ULONG Release() = 0; - template HRESULT QueryInterface(Q **pp) { - return QueryInterface(__uuidof(Q), (void **)pp); - } -}; - CROSS_PLATFORM_UUIDOF(INoMarshal, "ECC8691B-C1DB-4DC0-855E-65F6C551AF49") struct INoMarshal : public IUnknown {}; @@ -627,8 +533,12 @@ struct IStream : public ISequentialStream { // They still need the __uuidof() though CROSS_PLATFORM_UUIDOF(ID3D12LibraryReflection, "8E349D19-54DB-4A56-9DC9-119D87BDB804") +CROSS_PLATFORM_UUIDOF(ID3D12LibraryReflection1, + "07692220-8721-4514-BFFE-969BB33196B6") CROSS_PLATFORM_UUIDOF(ID3D12ShaderReflection, "5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") +CROSS_PLATFORM_UUIDOF(ID3D12ShaderReflection1, + "9C886958-23F1-4126-B294-FCF3DA13E7C6") //===--------------------- COM Pointer Types ------------------------------===// diff --git a/lib/DxcSupport/Unicode.cpp b/lib/DxcSupport/Unicode.cpp index 1481ae27ff..be4bcfa005 100644 --- a/lib/DxcSupport/Unicode.cpp +++ b/lib/DxcSupport/Unicode.cpp @@ -79,7 +79,7 @@ int WideCharToMultiByte(uint32_t /*CodePage*/, uint32_t /*dwFlags*/, const wchar_t *lpWideCharStr, int cchWideChar, char *lpMultiByteStr, int cbMultiByte, const char * /*lpDefaultChar*/, - bool *lpUsedDefaultChar) { + LPBOOL lpUsedDefaultChar) { if (lpUsedDefaultChar) { *lpUsedDefaultChar = FALSE; } @@ -132,7 +132,7 @@ int WideCharToMultiByte(uint32_t /*CodePage*/, uint32_t /*dwFlags*/, namespace Unicode { bool WideToEncodedString(const wchar_t *text, size_t cWide, DWORD cp, - DWORD flags, std::string *pValue, bool *lossy) { + DWORD flags, std::string *pValue, LPBOOL lossy) { BOOL usedDefaultChar; LPBOOL pUsedDefaultChar = (lossy == nullptr) ? nullptr : &usedDefaultChar; if (lossy != nullptr) @@ -204,7 +204,7 @@ std::wstring UTF8ToWideStringOrThrow(const char *pUTF8) { } bool UTF8ToConsoleString(const char *text, size_t textLen, std::string *pValue, - bool *lossy) { + LPBOOL lossy) { DXASSERT_NOMSG(text != nullptr); DXASSERT_NOMSG(pValue != nullptr); std::wstring text16; @@ -216,12 +216,12 @@ bool UTF8ToConsoleString(const char *text, size_t textLen, std::string *pValue, return WideToConsoleString(text16.c_str(), text16.length(), pValue, lossy); } -bool UTF8ToConsoleString(const char *text, std::string *pValue, bool *lossy) { +bool UTF8ToConsoleString(const char *text, std::string *pValue, LPBOOL lossy) { return UTF8ToConsoleString(text, strlen(text), pValue, lossy); } bool WideToConsoleString(const wchar_t *text, size_t textLen, - std::string *pValue, bool *lossy) { + std::string *pValue, LPBOOL lossy) { DXASSERT_NOMSG(text != nullptr); DXASSERT_NOMSG(pValue != nullptr); UINT cp = GetConsoleOutputCP(); @@ -229,7 +229,7 @@ bool WideToConsoleString(const wchar_t *text, size_t textLen, } bool WideToConsoleString(const wchar_t *text, std::string *pValue, - bool *lossy) { + LPBOOL lossy) { return WideToConsoleString(text, wcslen(text), pValue, lossy); } diff --git a/lib/DxcSupport/dxcapi.use.cpp b/lib/DxcSupport/dxcapi.use.cpp index 399259ef87..7628b51f35 100644 --- a/lib/DxcSupport/dxcapi.use.cpp +++ b/lib/DxcSupport/dxcapi.use.cpp @@ -114,7 +114,7 @@ static void WriteWideNullTermToConsole(const wchar_t *pText, DWORD streamType) { return; } - bool lossy; // Note: even if there was loss, print anyway + BOOL lossy; // Note: even if there was loss, print anyway std::string consoleMessage; Unicode::WideToConsoleString(pText, &consoleMessage, &lossy); if (streamType == STD_OUTPUT_HANDLE) { diff --git a/lib/DxilContainer/D3DReflectionDumper.cpp b/lib/DxilContainer/D3DReflectionDumper.cpp index 1dc5dc4533..b73b965407 100644 --- a/lib/DxilContainer/D3DReflectionDumper.cpp +++ b/lib/DxilContainer/D3DReflectionDumper.cpp @@ -73,6 +73,9 @@ void D3DReflectionDumper::DumpShaderVersion(UINT Version) { case (UINT)hlsl::DXIL::ShaderKind::Amplification: szType = "Amplification"; break; + case (UINT)hlsl::DXIL::ShaderKind::Node: + szType = "Node"; + break; case (UINT)hlsl::DXIL::ShaderKind::Invalid: szType = "Invalid"; break; @@ -145,6 +148,116 @@ void D3DReflectionDumper::Dump(D3D12_SIGNATURE_PARAMETER_DESC &elDesc) { DumpEnum("MinPrecision", elDesc.MinPrecision); Dedent(); } +void D3DReflectionDumper::Dump(D3D12_NODE_SHADER_DESC &Desc) { + WriteLn("D3D12_NODE_SHADER_DESC:"); + Indent(); + Dump(Desc.ComputeDesc); + DumpEnum("LaunchType", Desc.LaunchType); + WriteLn("IsProgramEntry: ", Desc.IsProgramEntry ? "TRUE" : "FALSE"); + WriteLn("LocalRootArgumentsTableIndex: ", std::dec, + Desc.LocalRootArgumentsTableIndex); + WriteLn("DispatchGrid[0]: ", std::dec, Desc.DispatchGrid[0]); + WriteLn("DispatchGrid[1]: ", std::dec, Desc.DispatchGrid[1]); + WriteLn("DispatchGrid[2]: ", std::dec, Desc.DispatchGrid[2]); + WriteLn("MaxDispatchGrid[0]: ", std::dec, Desc.MaxDispatchGrid[0]); + WriteLn("MaxDispatchGrid[1]: ", std::dec, Desc.MaxDispatchGrid[1]); + WriteLn("MaxDispatchGrid[2]: ", std::dec, Desc.MaxDispatchGrid[2]); + WriteLn("MaxRecursionDepth: ", std::dec, Desc.MaxRecursionDepth); + Dump(Desc.ShaderId, "ShaderId"); + Dump(Desc.ShaderId, "ShaderSharedInput"); + WriteLn("InputNodes: ", std::dec, Desc.InputNodes); + WriteLn("OutputNodes: ", std::dec, Desc.OutputNodes); + Dedent(); +} +void D3DReflectionDumper::Dump(D3D12_HULL_SHADER_DESC &Desc) { + WriteLn("D3D12_HULL_SHADER_DESC:"); + Indent(); + DumpEnum("Domain", Desc.Domain); + DumpEnum("Partition", Desc.Partition); + DumpEnum("OutputPrimitive", Desc.OutputPrimitive); + WriteLn("InputControlPoints: ", std::dec, Desc.InputControlPoints); + WriteLn("OutputControlPoints: ", std::dec, Desc.OutputControlPoints); + WriteLn("MaxTessFactor: ", Desc.MaxTessFactor); + Dedent(); +} +void D3DReflectionDumper::Dump(D3D12_COMPUTE_SHADER_DESC &Desc) { + WriteLn("D3D12_COMPUTE_SHADER_DESC:"); + Indent(); + if (Desc.WaveSizeMin | Desc.WaveSizeMax | Desc.WaveSizePreferred) + WriteLn("WaveSize: min: ", std::dec, Desc.WaveSizeMin, + ", max: ", Desc.WaveSizeMax, + ", preferred: ", Desc.WaveSizePreferred); + WriteLn("NumThreads: ", std::dec, Desc.NumThreads[0], ", ", + Desc.NumThreads[1], ", ", Desc.NumThreads[2]); + Dedent(); +} +void D3DReflectionDumper::Dump(D3D12_MESH_SHADER_DESC &Desc) { + WriteLn("D3D12_MESH_SHADER_DESC:"); + Indent(); + WriteLn("PayloadSize: ", std::dec, Desc.PayloadSize); + WriteLn("MaxVertexCount: ", std::dec, Desc.MaxVertexCount); + WriteLn("MaxPrimitiveCount: ", std::dec, Desc.MaxPrimitiveCount); + WriteLn("OutputTopology: ", + Desc.OutputTopology == D3D12_MESH_OUTPUT_TOPOLOGY_LINE ? "Line" + : "Triangle"); + WriteLn("NumThreads: ", std::dec, Desc.NumThreads[0], ", ", + Desc.NumThreads[1], ", ", Desc.NumThreads[2]); + Dedent(); +} +void D3DReflectionDumper::Dump(D3D12_GEOMETRY_SHADER_DESC &Desc) { + WriteLn("D3D12_GEOMETRY_SHADER_DESC:"); + Indent(); + DumpEnum("InputPrimitive", Desc.InputPrimitive); + WriteLn("MaxVertexCount: ", std::dec, Desc.MaxVertexCount); + WriteLn("InstanceCount: ", std::dec, Desc.InstanceCount); + DumpEnum("StreamPrimitiveTopologies[0]", Desc.StreamPrimitiveTopologies[0]); + DumpEnum("StreamPrimitiveTopologies[1]", Desc.StreamPrimitiveTopologies[1]); + DumpEnum("StreamPrimitiveTopologies[2]", Desc.StreamPrimitiveTopologies[2]); + DumpEnum("StreamPrimitiveTopologies[3]", Desc.StreamPrimitiveTopologies[3]); + Dedent(); +} +void D3DReflectionDumper::Dump(D3D12_DOMAIN_SHADER_DESC &Desc) { + WriteLn("D3D12_DOMAIN_SHADER_DESC:"); + Indent(); + DumpEnum("Domain", Desc.Domain); + WriteLn("InputControlPoints: ", std::dec, Desc.InputControlPoints); + Dedent(); +} +void D3DReflectionDumper::Dump(D3D12_NODE_ID_DESC &Desc, const char *name) { + WriteLn("D3D12_NODE_ID_DESC: (", name, ")"); + Indent(); + WriteLn("Name: ", Desc.Name); + WriteLn("ID: ", std::dec, Desc.ID); + Dedent(); +} +void D3DReflectionDumper::Dump(D3D12_NODE_DESC &Desc) { + WriteLn("D3D12_NODE_DESC:"); + Indent(); + WriteLn("Flags: ", std::hex, std::showbase, Desc.Flags); + + WriteLn("Type:"); + Indent(); + WriteLn("Size: ", std::dec, Desc.Type.Size); + WriteLn("Alignment: ", std::dec, Desc.Type.Alignment); + + WriteLn("DispatchGrid:"); + Indent(); + WriteLn("ByteOffset: ", std::dec, Desc.Type.DispatchGrid.ByteOffset); + DumpEnum("ComponentType", Desc.Type.DispatchGrid.ComponentType); + WriteLn("NumComponents: ", std::dec, Desc.Type.DispatchGrid.NumComponents); + Dedent(); + + Dedent(); + + if (Desc.Flags & D3D12_NODE_IO_FLAGS_OUTPUT) + Dump(Desc.OutputID, "OutputID"); + + WriteLn("MaxRecords: ", std::dec, Desc.MaxRecords); + WriteLn("MaxRecordsSharedWith: ", std::dec, Desc.MaxRecordsSharedWith); + WriteLn("OutputArraySize: ", std::dec, Desc.OutputArraySize); + WriteLn("AllowSparseNodes: ", Desc.AllowSparseNodes ? "TRUE" : "FALSE"); + Dedent(); +} void D3DReflectionDumper::Dump(D3D12_SHADER_DESC &Desc) { WriteLn("D3D12_SHADER_DESC:"); Indent(); @@ -217,6 +330,52 @@ void D3DReflectionDumper::Dump(D3D12_FUNCTION_DESC &Desc) { WriteLn("HasReturn: ", Desc.HasReturn ? "TRUE" : "FALSE"); Dedent(); } +void D3DReflectionDumper::Dump(D3D12_FUNCTION_DESC1 &Desc) { + WriteLn("D3D12_FUNCTION_DESC1: "); + Indent(); + WriteLn("RootSignatureSize: ", std::dec, Desc.RootSignatureSize); + switch (Desc.ShaderType) { + case D3D12_SHVER_NODE_SHADER: + Dump(Desc.NodeShader); + break; + case D3D12_SHVER_HULL_SHADER: + Dump(Desc.HullShader); + break; + case D3D12_SHVER_COMPUTE_SHADER: + Dump(Desc.ComputeShader); + break; + case D3D12_SHVER_MESH_SHADER: + Dump(Desc.MeshShader); + break; + case D3D12_SHVER_GEOMETRY_SHADER: + Dump(Desc.GeometryShader); + break; + case D3D12_SHVER_DOMAIN_SHADER: + Dump(Desc.DomainShader); + break; + case D3D12_SHVER_AMPLIFICATION_SHADER: + WriteLn("PayloadSize: ", std::dec, Desc.AmplificationShader.PayloadSize); + WriteLn("NumThreads: ", std::dec, Desc.AmplificationShader.NumThreads[0], + ", ", Desc.AmplificationShader.NumThreads[1], ", ", + Desc.AmplificationShader.NumThreads[2]); + break; + case D3D12_SHVER_PIXEL_SHADER: + WriteLn("EarlyDepthStencil: ", + Desc.PixelShader.EarlyDepthStencil ? "TRUE" : "FALSE"); + break; + case D3D12_SHVER_CALLABLE_SHADER: + case D3D12_SHVER_INTERSECTION_SHADER: + case D3D12_SHVER_ANY_HIT_SHADER: + case D3D12_SHVER_CLOSEST_HIT_SHADER: + WriteLn("AttributeSize: ", std::dec, Desc.RaytracingShader.AttributeSize); + [[fallthrough]]; + case D3D12_SHVER_MISS_SHADER: + WriteLn("ParamPayloadSize: ", std::dec, + Desc.RaytracingShader.ParamPayloadSize); + break; + } + Dedent(); +} void D3DReflectionDumper::Dump(D3D12_LIBRARY_DESC &Desc) { WriteLn("D3D12_LIBRARY_DESC:"); Indent(); @@ -303,13 +462,20 @@ void D3DReflectionDumper::Dump( Dedent(); } -void D3DReflectionDumper::Dump(ID3D12ShaderReflection *pShaderReflection) { - WriteLn("ID3D12ShaderReflection:"); - Indent(); +void D3DReflectionDumper::Dump(ID3D12ShaderReflection *pShaderReflection, + BOOL printHeader) { + + if (printHeader) { + WriteLn("ID3D12ShaderReflection:"); + Indent(); + } + D3D12_SHADER_DESC Desc; if (!pShaderReflection || FAILED(pShaderReflection->GetDesc(&Desc))) { Failure("GetDesc"); - Dedent(); + if (printHeader) { + Dedent(); + } return; } Dump(Desc); @@ -406,6 +572,35 @@ void D3DReflectionDumper::Dump(ID3D12ShaderReflection *pShaderReflection) { Dedent(); } // TODO + if (printHeader) { + Dedent(); + } +} +void D3DReflectionDumper::Dump(ID3D12ShaderReflection1 *pShaderReflection) { + + ID3D12ShaderReflection *shaderRefl0 = nullptr; + if (FAILED(pShaderReflection->QueryInterface(IID_PPV_ARGS(&shaderRefl0)))) { + Failure("QueryInterface ID3D12ShaderReflection"); + return; + } + + WriteLn("ID3D12ShaderReflection1:"); + Indent(); + + Dump(shaderRefl0, false); + shaderRefl0->Release(); + + UINT waveSizePreferred = 0, waveSizeMin = 0, waveSizeMax = 0; + + if (!pShaderReflection->GetWaveSize(&waveSizePreferred, &waveSizeMin, + &waveSizeMax)) { + Dedent(); + return; + } + + WriteLn("WaveSizePreferred: ", waveSizePreferred); + WriteLn("WaveSizeMin: ", waveSizeMin); + WriteLn("WaveSizeMax: ", waveSizeMax); Dedent(); } @@ -468,6 +663,45 @@ void D3DReflectionDumper::Dump(ID3D12FunctionReflection *pFunctionReflection) { Dedent(); } +void D3DReflectionDumper::Dump(ID3D12FunctionReflection1 *pFunctionReflection) { + WriteLn("ID3D12FunctionReflection1:"); + Indent(); + D3D12_FUNCTION_DESC1 Desc; + if (!pFunctionReflection || FAILED(pFunctionReflection->GetDesc1(&Desc))) { + Failure("GetDesc1"); + Dedent(); + return; + } + Dump(Desc); + if (Desc.ShaderType == D3D12_SHVER_NODE_SHADER && + Desc.NodeShader.InputNodes) { + WriteLn("Input Nodes:"); + Indent(); + for (UINT i = 0; i < Desc.NodeShader.InputNodes; i++) { + D3D12_NODE_DESC pND{}; + if (FAILED(pFunctionReflection->GetInputNode(i, &pND))) + Failure("GetInputNode", m_LastName); + else + Dump(pND); + } + Dedent(); + } + if (Desc.ShaderType == D3D12_SHVER_NODE_SHADER && + Desc.NodeShader.OutputNodes) { + WriteLn("Output Nodes:"); + Indent(); + for (UINT i = 0; i < Desc.NodeShader.OutputNodes; i++) { + D3D12_NODE_DESC pND{}; + if (FAILED(pFunctionReflection->GetOutputNode(i, &pND))) + Failure("GetOutputNode", m_LastName); + else + Dump(pND); + } + Dedent(); + } + Dedent(); +} + void D3DReflectionDumper::Dump(ID3D12LibraryReflection *pLibraryReflection) { WriteLn("ID3D12LibraryReflection:"); Indent(); @@ -485,5 +719,24 @@ void D3DReflectionDumper::Dump(ID3D12LibraryReflection *pLibraryReflection) { Dedent(); } +void D3DReflectionDumper::Dump(ID3D12LibraryReflection1 *pLibraryReflection) { + WriteLn("ID3D12LibraryReflection1:"); + Indent(); + D3D12_LIBRARY_DESC Desc; + if (!pLibraryReflection || FAILED(pLibraryReflection->GetDesc(&Desc))) { + Failure("GetDesc"); + Dedent(); + return; + } + Dump(Desc); + if (Desc.FunctionCount) { + for (UINT uFunc = 0; uFunc < Desc.FunctionCount; uFunc++) { + Dump(pLibraryReflection->GetFunctionByIndex((INT)uFunc)); + Dump(pLibraryReflection->GetFunctionByIndex1((INT)uFunc)); + } + } + Dedent(); +} + } // namespace dump } // namespace hlsl diff --git a/lib/DxilContainer/D3DReflectionStrings.cpp b/lib/DxilContainer/D3DReflectionStrings.cpp index 03387b22ed..426cd7f136 100644 --- a/lib/DxilContainer/D3DReflectionStrings.cpp +++ b/lib/DxilContainer/D3DReflectionStrings.cpp @@ -674,6 +674,62 @@ LPCSTR ToString(D3D_MIN_PRECISION MinPrec) { return nullptr; } +LPCSTR ToString(D3D12_NODE_LAUNCH_TYPE NodeLaunchType) { + switch (NodeLaunchType) { + case D3D12_NODE_LAUNCH_TYPE_NONE: + return "D3D12_NODE_LAUNCH_TYPE_NONE"; + case D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH: + return "D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH"; + case D3D12_NODE_LAUNCH_TYPE_COALESCING_LAUNCH: + return "D3D12_NODE_LAUNCH_TYPE_COALESCING_LAUNCH"; + case D3D12_NODE_LAUNCH_TYPE_THREAD_LAUNCH: + return "D3D12_NODE_LAUNCH_TYPE_THREAD_LAUNCH"; + } + return nullptr; +} + +LPCSTR ToString(D3D12_DISPATCH_COMPONENT_TYPE DispatchComponentType) { + switch (DispatchComponentType) { + case D3D12_DISPATCH_COMPONENT_TYPE_I1: + return "D3D12_DISPATCH_COMPONENT_TYPE_I1"; + case D3D12_DISPATCH_COMPONENT_TYPE_I16: + return "D3D12_DISPATCH_COMPONENT_TYPE_I16"; + case D3D12_DISPATCH_COMPONENT_TYPE_U16: + return "D3D12_DISPATCH_COMPONENT_TYPE_U16"; + case D3D12_DISPATCH_COMPONENT_TYPE_I32: + return "D3D12_DISPATCH_COMPONENT_TYPE_I32"; + case D3D12_DISPATCH_COMPONENT_TYPE_U32: + return "D3D12_DISPATCH_COMPONENT_TYPE_U32"; + case D3D12_DISPATCH_COMPONENT_TYPE_I64: + return "D3D12_DISPATCH_COMPONENT_TYPE_I64"; + case D3D12_DISPATCH_COMPONENT_TYPE_U64: + return "D3D12_DISPATCH_COMPONENT_TYPE_U64"; + case D3D12_DISPATCH_COMPONENT_TYPE_F16: + return "D3D12_DISPATCH_COMPONENT_TYPE_F16"; + case D3D12_DISPATCH_COMPONENT_TYPE_F32: + return "D3D12_DISPATCH_COMPONENT_TYPE_F32"; + case D3D12_DISPATCH_COMPONENT_TYPE_F64: + return "D3D12_DISPATCH_COMPONENT_TYPE_F64"; + case D3D12_DISPATCH_COMPONENT_TYPE_SNORM_F16: + return "D3D12_DISPATCH_COMPONENT_TYPE_SNORM_F16"; + case D3D12_DISPATCH_COMPONENT_TYPE_UNORM_F16: + return "D3D12_DISPATCH_COMPONENT_TYPE_UNORM_F16"; + case D3D12_DISPATCH_COMPONENT_TYPE_SNORM_F32: + return "D3D12_DISPATCH_COMPONENT_TYPE_SNORM_F32"; + case D3D12_DISPATCH_COMPONENT_TYPE_UNORM_F32: + return "D3D12_DISPATCH_COMPONENT_TYPE_UNORM_F32"; + case D3D12_DISPATCH_COMPONENT_TYPE_SNORM_F64: + return "D3D12_DISPATCH_COMPONENT_TYPE_SNORM_F64"; + case D3D12_DISPATCH_COMPONENT_TYPE_UNORM_F64: + return "D3D12_DISPATCH_COMPONENT_TYPE_UNORM_F64"; + case D3D12_DISPATCH_COMPONENT_TYPE_PACKED_S8X32: + return "D3D12_DISPATCH_COMPONENT_TYPE_PACKED_S8X32"; + case D3D12_DISPATCH_COMPONENT_TYPE_PACKED_U8X32: + return "D3D12_DISPATCH_COMPONENT_TYPE_PACKED_U8X32"; + } + return nullptr; +} + LPCSTR CompMaskToString(unsigned CompMask) { static const LPCSTR masks[16] = { "----", "x---", "-y--", "xy--", "--z-", "x-z-", "-yz-", "xyz-", diff --git a/lib/HLSL/DxilContainerReflection.cpp b/lib/HLSL/DxilContainerReflection.cpp index 091d65c414..69b6ae3174 100644 --- a/lib/HLSL/DxilContainerReflection.cpp +++ b/lib/HLSL/DxilContainerReflection.cpp @@ -161,7 +161,7 @@ class DxilModuleReflection { }; class DxilShaderReflection : public DxilModuleReflection, - public ID3D12ShaderReflection { + public ID3D12ShaderReflection1 { private: DXC_MICROCOM_TM_REF_FIELDS() std::vector m_InputSignature; @@ -183,7 +183,8 @@ class DxilShaderReflection : public DxilModuleReflection, void SetPublicAPI(PublicAPI value) { m_PublicAPI = value; } static PublicAPI IIDToAPI(REFIID iid) { PublicAPI api = PublicAPI::Invalid; - if (IsEqualIID(__uuidof(ID3D12ShaderReflection), iid)) + if (IsEqualIID(__uuidof(ID3D12ShaderReflection), iid) || + IsEqualIID(__uuidof(ID3D12ShaderReflection1), iid)) api = PublicAPI::D3D12; else if (IsEqualIID(IID_ID3D11ShaderReflection_43, iid)) api = PublicAPI::D3D11_43; @@ -198,22 +199,31 @@ class DxilShaderReflection : public DxilModuleReflection, HRESULT hr = E_NOINTERFACE; // There is non-standard handling of QueryInterface: - // - although everything uses the same vtable as ID3D12ShaderReflection, + // - although d3d11 and older d3d12 use the same vtable as + // ID3D12ShaderReflection, // there are differences in behavior depending on the API version, and // there are 3 of these - it's not just d3d11 vs d3d12. + // - This changed in latest d3d12 when ID3D12ShaderReflection1 was + // introduced to be non-breaking. // - when the object is created the API version is fixed // - from that point on, this object can only be QI'd for the matching API // version. PublicAPI api = IIDToAPI(iid); - if (api == m_PublicAPI) { + + if (IsEqualIID(__uuidof(ID3D12ShaderReflection1), iid)) { + *ppvObject = static_cast(this); + hr = S_OK; + } else if (api == m_PublicAPI) { *ppvObject = static_cast(this); - this->AddRef(); hr = S_OK; } else if (IsEqualIID(__uuidof(IUnknown), iid)) { *ppvObject = static_cast(this); - this->AddRef(); hr = S_OK; } + + if (hr == S_OK) + this->AddRef(); + return hr; } @@ -264,12 +274,16 @@ class DxilShaderReflection : public DxilModuleReflection, GetThreadGroupSize(UINT *pSizeX, UINT *pSizeY, UINT *pSizeZ) noexcept override; + STDMETHODIMP_(BOOL) + GetWaveSize(UINT *pWavePreferred, UINT *pWaveMin, + UINT *pWaveMax) noexcept override; + STDMETHODIMP_(UINT64) GetRequiresFlags(THIS) noexcept override; }; class CFunctionReflection; class DxilLibraryReflection : public DxilModuleReflection, - public ID3D12LibraryReflection { + public ID3D12LibraryReflection1 { private: DXC_MICROCOM_TM_REF_FIELDS() @@ -289,7 +303,8 @@ class DxilLibraryReflection : public DxilModuleReflection, DXC_MICROCOM_TM_CTOR(DxilLibraryReflection) HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject) noexcept override { - return DoBasicQueryInterface(this, iid, ppvObject); + return DoBasicQueryInterface(this, iid, ppvObject); } HRESULT Load(const DxilProgramHeader *pProgramHeader, @@ -300,6 +315,9 @@ class DxilLibraryReflection : public DxilModuleReflection, STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex) (INT FunctionIndex) override; + + STDMETHOD_(ID3D12FunctionReflection1 *, GetFunctionByIndex1) + (INT FunctionIndex) override; }; namespace hlsl { @@ -332,6 +350,7 @@ HRESULT CreateDxilLibraryReflection(const DxilProgramHeader *pProgramHeader, if (!ppvObject) return E_INVALIDARG; if (!IsEqualIID(__uuidof(ID3D12LibraryReflection), iid) && + !IsEqualIID(__uuidof(ID3D12LibraryReflection1), iid) && !IsEqualIID(__uuidof(IUnknown), iid)) return E_NOINTERFACE; CComPtr pReflection = @@ -722,8 +741,12 @@ class CInvalidFunctionParameter final }; CInvalidFunctionParameter g_InvalidFunctionParameter; -class CInvalidFunction final : public ID3D12FunctionReflection { +class CInvalidFunction final : public ID3D12FunctionReflection1 { STDMETHOD(GetDesc)(D3D12_FUNCTION_DESC *pDesc) { return E_FAIL; } + STDMETHOD(GetDesc1)(D3D12_FUNCTION_DESC1 *pDesc) { return E_FAIL; } + + STDMETHOD(GetInputNode)(UINT i, D3D12_NODE_DESC *pDesc) { return E_FAIL; } + STDMETHOD(GetOutputNode)(UINT i, D3D12_NODE_DESC *pDesc) { return E_FAIL; } STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex) (UINT BufferIndex) { return &g_InvalidSRConstantBuffer; } @@ -2767,6 +2790,21 @@ UINT DxilShaderReflection::GetThreadGroupSize(UINT *pSizeX, UINT *pSizeY, return x * y * z; } +BOOL DxilShaderReflection::GetWaveSize(UINT *pWavePreferred, UINT *pWaveMin, + UINT *pWaveMax) noexcept { + if (!m_pDxilModule->GetShaderModel()->IsCS()) { + AssignToOutOpt(0u, pWavePreferred); + AssignToOutOpt(0u, pWaveMin); + AssignToOutOpt(0u, pWaveMax); + return false; + } + DxilWaveSize waveSize = m_pDxilModule->GetWaveSize(); + AssignToOutOpt(waveSize.Preferred, pWavePreferred); + AssignToOutOpt(waveSize.Min, pWaveMin); + AssignToOutOpt(waveSize.Max, pWaveMax); + return true; +} + UINT64 DxilShaderReflection::GetRequiresFlags() noexcept { UINT64 result = m_pDxilModule->m_ShaderFlags.GetFeatureInfo(); // FeatureInfo flags are identical, with the exception of a collision between: @@ -2781,7 +2819,7 @@ UINT64 DxilShaderReflection::GetRequiresFlags() noexcept { // ID3D12FunctionReflection -class CFunctionReflection final : public ID3D12FunctionReflection { +class CFunctionReflection final : public ID3D12FunctionReflection1 { protected: DxilLibraryReflection *m_pLibraryReflection = nullptr; const Function *m_pFunction; @@ -2814,6 +2852,10 @@ class CFunctionReflection final : public ID3D12FunctionReflection { // ID3D12FunctionReflection STDMETHOD(GetDesc)(D3D12_FUNCTION_DESC *pDesc); + STDMETHOD(GetDesc1)(D3D12_FUNCTION_DESC1 *pDesc); + + STDMETHOD(GetInputNode)(UINT i, D3D12_NODE_DESC *pDesc); + STDMETHOD(GetOutputNode)(UINT i, D3D12_NODE_DESC *pDesc); // BufferIndex relative to used constant buffers here STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex) @@ -2909,6 +2951,241 @@ HRESULT CFunctionReflection::GetDesc(D3D12_FUNCTION_DESC *pDesc) { return S_OK; } +HRESULT CFunctionReflection::GetDesc1(D3D12_FUNCTION_DESC1 *pDesc) { + DXASSERT_NOMSG(m_pLibraryReflection); + IFR(ZeroMemoryToOut(pDesc)); + + DXIL::ShaderKind kind = DXIL::ShaderKind::Library; + if (m_pProps) { + kind = m_pProps->shaderKind; + } + + else { + return S_OK; + } + + D3D12_COMPUTE_SHADER_DESC computeDesc = {m_pProps->WaveSize.Min, + m_pProps->WaveSize.Max, + m_pProps->WaveSize.Preferred, + {m_pProps->numThreads[0], + m_pProps->numThreads[1], + m_pProps->numThreads[2]}}; + + pDesc->RootSignatureSize = (UINT)m_pProps->serializedRootSignature.size(); + pDesc->RootSignaturePtr = m_pProps->serializedRootSignature.data(); + + switch (kind) { + + case ShaderKind::Pixel: + pDesc->ShaderType = D3D12_SHVER_PIXEL_SHADER; + pDesc->PixelShader.EarlyDepthStencil = + m_pProps->ShaderProps.PS.EarlyDepthStencil; + break; + + case ShaderKind::Vertex: + pDesc->ShaderType = D3D12_SHVER_VERTEX_SHADER; + break; + + case ShaderKind::Geometry: + pDesc->ShaderType = D3D12_SHVER_GEOMETRY_SHADER; + pDesc->GeometryShader = D3D12_GEOMETRY_SHADER_DESC{ + (D3D12_PRIMITIVE)m_pProps->ShaderProps.GS.inputPrimitive, + m_pProps->ShaderProps.GS.maxVertexCount, + m_pProps->ShaderProps.GS.instanceCount, + {(D3D12_PRIMITIVE_TOPOLOGY) + m_pProps->ShaderProps.GS.streamPrimitiveTopologies[0], + (D3D12_PRIMITIVE_TOPOLOGY) + m_pProps->ShaderProps.GS.streamPrimitiveTopologies[1], + (D3D12_PRIMITIVE_TOPOLOGY) + m_pProps->ShaderProps.GS.streamPrimitiveTopologies[2], + (D3D12_PRIMITIVE_TOPOLOGY) + m_pProps->ShaderProps.GS.streamPrimitiveTopologies[3]}}; + break; + + case ShaderKind::Hull: + pDesc->ShaderType = D3D12_SHVER_HULL_SHADER; + pDesc->HullShader = D3D12_HULL_SHADER_DESC{ + (D3D12_TESSELLATOR_DOMAIN)m_pProps->ShaderProps.HS.domain, + (D3D12_TESSELLATOR_PARTITIONING)m_pProps->ShaderProps.HS.partition, + (D3D12_TESSELLATOR_OUTPUT_PRIMITIVE) + m_pProps->ShaderProps.HS.outputPrimitive, + m_pProps->ShaderProps.HS.inputControlPoints, + m_pProps->ShaderProps.HS.outputControlPoints, + m_pProps->ShaderProps.HS.maxTessFactor}; + break; + + case ShaderKind::Domain: + pDesc->ShaderType = D3D12_SHVER_DOMAIN_SHADER; + pDesc->DomainShader = D3D12_DOMAIN_SHADER_DESC{ + (D3D12_TESSELLATOR_DOMAIN)m_pProps->ShaderProps.DS.domain, + m_pProps->ShaderProps.DS.inputControlPoints}; + break; + + case ShaderKind::Compute: + pDesc->ShaderType = D3D12_SHVER_COMPUTE_SHADER; + pDesc->ComputeShader = computeDesc; + break; + + case ShaderKind::RayGeneration: + pDesc->ShaderType = D3D12_SHVER_RAY_GENERATION_SHADER; + break; + + case ShaderKind::Intersection: + pDesc->ShaderType = D3D12_SHVER_INTERSECTION_SHADER; + pDesc->RaytracingShader = D3D12_RAYTRACING_SHADER_DESC{ + m_pProps->ShaderProps.Ray.paramSizeInBytes, + m_pProps->ShaderProps.Ray.attributeSizeInBytes}; + break; + + case ShaderKind::AnyHit: + pDesc->ShaderType = D3D12_SHVER_ANY_HIT_SHADER; + pDesc->RaytracingShader = D3D12_RAYTRACING_SHADER_DESC{ + m_pProps->ShaderProps.Ray.paramSizeInBytes, + m_pProps->ShaderProps.Ray.attributeSizeInBytes}; + break; + + case ShaderKind::ClosestHit: + pDesc->ShaderType = D3D12_SHVER_CLOSEST_HIT_SHADER; + pDesc->RaytracingShader = D3D12_RAYTRACING_SHADER_DESC{ + m_pProps->ShaderProps.Ray.paramSizeInBytes, + m_pProps->ShaderProps.Ray.attributeSizeInBytes}; + break; + + case ShaderKind::Miss: + pDesc->ShaderType = D3D12_SHVER_MISS_SHADER; + pDesc->RaytracingShader = D3D12_RAYTRACING_SHADER_DESC{ + m_pProps->ShaderProps.Ray.paramSizeInBytes, + m_pProps->ShaderProps.Ray.attributeSizeInBytes}; + break; + + case ShaderKind::Callable: + pDesc->ShaderType = D3D12_SHVER_CALLABLE_SHADER; + pDesc->RaytracingShader = D3D12_RAYTRACING_SHADER_DESC{ + m_pProps->ShaderProps.Ray.paramSizeInBytes, + m_pProps->ShaderProps.Ray.attributeSizeInBytes}; + break; + + case ShaderKind::Mesh: + pDesc->ShaderType = D3D12_SHVER_MESH_SHADER; + pDesc->MeshShader = D3D12_MESH_SHADER_DESC{ + m_pProps->ShaderProps.MS.payloadSizeInBytes, + m_pProps->ShaderProps.MS.maxVertexCount, + m_pProps->ShaderProps.MS.maxPrimitiveCount, + (D3D12_MESH_OUTPUT_TOPOLOGY)m_pProps->ShaderProps.MS.outputTopology, + {m_pProps->numThreads[0], m_pProps->numThreads[1], + m_pProps->numThreads[2]}}; + break; + + case ShaderKind::Amplification: + pDesc->ShaderType = D3D12_SHVER_AMPLIFICATION_SHADER; + pDesc->AmplificationShader = D3D12_AMPLIFICATION_SHADER_DESC{ + m_pProps->ShaderProps.AS.payloadSizeInBytes, + {m_pProps->numThreads[0], m_pProps->numThreads[1], + m_pProps->numThreads[2]}}; + break; + + case ShaderKind::Node: + pDesc->ShaderType = D3D12_SHVER_NODE_SHADER; + pDesc->NodeShader = D3D12_NODE_SHADER_DESC{ + computeDesc, + (D3D12_NODE_LAUNCH_TYPE)m_pProps->Node.LaunchType, + m_pProps->Node.IsProgramEntry, + m_pProps->Node.LocalRootArgumentsTableIndex, + { + m_pProps->Node.DispatchGrid[0], + m_pProps->Node.DispatchGrid[1], + m_pProps->Node.DispatchGrid[2], + }, + { + m_pProps->Node.MaxDispatchGrid[0], + m_pProps->Node.MaxDispatchGrid[1], + m_pProps->Node.MaxDispatchGrid[2], + }, + m_pProps->Node.MaxRecursionDepth, + D3D12_NODE_ID_DESC{m_pProps->NodeShaderID.Name.c_str(), + m_pProps->NodeShaderID.Index}, + D3D12_NODE_ID_DESC{m_pProps->NodeShaderSharedInput.Name.c_str(), + m_pProps->NodeShaderSharedInput.Index}, + (UINT)m_pProps->InputNodes.size(), + (UINT)m_pProps->OutputNodes.size()}; + break; + } + + return S_OK; +} + +HRESULT CFunctionReflection::GetInputNode(UINT i, D3D12_NODE_DESC *pDesc) { + DXASSERT_NOMSG(m_pLibraryReflection); + IFR(ZeroMemoryToOut(pDesc)); + + DXIL::ShaderKind kind = DXIL::ShaderKind::Library; + if (m_pProps) { + kind = m_pProps->shaderKind; + } + + if (kind != ShaderKind::Node) + return E_INVALIDARG; + + if (i >= m_pProps->InputNodes.size()) + return E_BOUNDS; + + const NodeIOProperties &prop = m_pProps->InputNodes[i]; + + *pDesc = D3D12_NODE_DESC{ + (D3D12_NODE_IO_FLAGS)(uint32_t)prop.Flags, + D3D12_NODE_RECORD_TYPE_DESC{ + prop.RecordType.size, prop.RecordType.alignment, + D3D12_DISPATCH_GRID_DESC{ + prop.RecordType.SV_DispatchGrid.ByteOffset, + (D3D12_DISPATCH_COMPONENT_TYPE) + prop.RecordType.SV_DispatchGrid.ComponentType, + prop.RecordType.SV_DispatchGrid.NumComponents, + }}, + D3D12_NODE_ID_DESC{prop.OutputID.Name.c_str(), prop.OutputID.Index}, + prop.MaxRecords, + prop.MaxRecordsSharedWith, + prop.OutputArraySize, + prop.AllowSparseNodes}; + + return S_OK; +} + +HRESULT CFunctionReflection::GetOutputNode(UINT i, D3D12_NODE_DESC *pDesc) { + DXASSERT_NOMSG(m_pLibraryReflection); + IFR(ZeroMemoryToOut(pDesc)); + + DXIL::ShaderKind kind = DXIL::ShaderKind::Library; + if (m_pProps) { + kind = m_pProps->shaderKind; + } + + if (kind != ShaderKind::Node) + return E_INVALIDARG; + + if (i >= m_pProps->OutputNodes.size()) + return E_BOUNDS; + + const NodeIOProperties &prop = m_pProps->OutputNodes[i]; + + *pDesc = D3D12_NODE_DESC{ + (D3D12_NODE_IO_FLAGS)(uint32_t)prop.Flags, + D3D12_NODE_RECORD_TYPE_DESC{ + prop.RecordType.size, prop.RecordType.alignment, + D3D12_DISPATCH_GRID_DESC{ + prop.RecordType.SV_DispatchGrid.ByteOffset, + (D3D12_DISPATCH_COMPONENT_TYPE) + prop.RecordType.SV_DispatchGrid.ComponentType, + prop.RecordType.SV_DispatchGrid.NumComponents, + }}, + D3D12_NODE_ID_DESC{prop.OutputID.Name.c_str(), prop.OutputID.Index}, + prop.MaxRecords, + prop.MaxRecordsSharedWith, + prop.OutputArraySize, + prop.AllowSparseNodes}; + + return S_OK; +} + // BufferIndex is relative to used constant buffers here ID3D12ShaderReflectionConstantBuffer * CFunctionReflection::GetConstantBufferByIndex(UINT BufferIndex) { @@ -3091,3 +3368,10 @@ DxilLibraryReflection::GetFunctionByIndex(INT FunctionIndex) { return &g_InvalidFunction; return m_FunctionVector[FunctionIndex]; } + +ID3D12FunctionReflection1 * +DxilLibraryReflection::GetFunctionByIndex1(INT FunctionIndex) { + if ((UINT)FunctionIndex >= m_FunctionVector.size()) + return &g_InvalidFunction; + return m_FunctionVector[FunctionIndex]; +} diff --git a/projects/dxilconv/tools/dxbc2dxil/dxbc2dxil.cpp b/projects/dxilconv/tools/dxbc2dxil/dxbc2dxil.cpp index c485709c57..ac50370052 100644 --- a/projects/dxilconv/tools/dxbc2dxil/dxbc2dxil.cpp +++ b/projects/dxilconv/tools/dxbc2dxil/dxbc2dxil.cpp @@ -373,7 +373,7 @@ int __cdecl wmain(int argc, wchar_t **argv) { } std::string textMessage; - bool lossy; + BOOL lossy; if (!Unicode::UTF8ToConsoleString(pMsg, &textMessage, &lossy) || lossy) { // Do a direct assignment as a last-ditch effort and print out as UTF-8. textMessage = pMsg; diff --git a/tools/clang/include/clang/AST/Attr.h b/tools/clang/include/clang/AST/Attr.h index 4e282d68b7..8abc524ba7 100644 --- a/tools/clang/include/clang/AST/Attr.h +++ b/tools/clang/include/clang/AST/Attr.h @@ -149,6 +149,7 @@ class InheritableParamAttr : public InheritableAttr { } }; +#undef interface #include "clang/AST/Attrs.inc" inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, diff --git a/tools/clang/test/DXC/dxa_tests.test b/tools/clang/test/DXC/dxa_tests.test index 655155941b..345a6af2c2 100644 --- a/tools/clang/test/DXC/dxa_tests.test +++ b/tools/clang/test/DXC/dxa_tests.test @@ -36,7 +36,7 @@ // REBUILD:define void @main() // RUN: %dxa %t.dxa.cso -dumpreflection | FileCheck %s --check-prefix=REFLECTION -// REFLECTION: ID3D12ShaderReflection: +// REFLECTION: ID3D12ShaderReflection1: // REFLECTION-NEXT: D3D12_SHADER_DESC: // REFLECTION-NEXT: Shader Version: Vertex 6.0 // REFLECTION-NEXT: Creator: dxc diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/ConstantBuffer-16bit.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/ConstantBuffer-16bit.hlsl index b990febaf8..b79e6287ed 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/ConstantBuffer-16bit.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/ConstantBuffer-16bit.hlsl @@ -39,7 +39,7 @@ float main(int i : A) : SV_TARGET return CBS.b + CBS.mf1 + CBS.h2.y + CBS.f16_3.z + (float)(CBS.d * CBS.i64 + CBS.u64) + CBS.u16 * CBS.i16.x; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK-NEXT: D3D12_SHADER_DESC: // CHECK-NEXT: Shader Version: Pixel // CHECK: Flags: 0 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/TextureBuffer-16bit.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/TextureBuffer-16bit.hlsl index 95fa345a2c..7fb6739eea 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/TextureBuffer-16bit.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/TextureBuffer-16bit.hlsl @@ -39,7 +39,7 @@ float main(int i : A) : SV_TARGET return TBS.b + TBS.mf1 + TBS.h2.y + TBS.f16_3.z + (float)(TBS.d * TBS.i64 + TBS.u64) + TBS.u16 * TBS.i16.x; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK-NEXT: D3D12_SHADER_DESC: // CHECK-NEXT: Shader Version: Pixel // CHECK: Flags: 0 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/amp-groupshared.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/amp-groupshared.hlsl index ce31f7f033..d9e1737a60 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/amp-groupshared.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/amp-groupshared.hlsl @@ -58,7 +58,7 @@ // CHECK: PayloadSizeInBytes: 16 // CHECK: } // CHECK: } -// CHECK:ID3D12LibraryReflection: +// CHECK:ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: Flags: 0 // CHECK: FunctionCount: 1 @@ -81,6 +81,11 @@ // CHECK: Dimension: D3D_SRV_DIMENSION_BUFFER // CHECK: NumSamples (or stride): 4294967295 // CHECK: uFlags: (D3D_SIF_TEXTURE_COMPONENT_0 | D3D_SIF_TEXTURE_COMPONENT_1) +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: PayloadSize: 16 +// CHECK: NumThreads: 4, 1, 1 struct MeshPayload { diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/anon_struct.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/anon_struct.hlsl index e6ffa5aade..c597d2a63c 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/anon_struct.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/anon_struct.hlsl @@ -9,7 +9,7 @@ float main(int N : A, int C : B) : SV_TARGET { return CB.X; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK: D3D12_SHADER_DESC: // CHECK: Shader Version: Pixel // CHECK: ConstantBuffers: 1 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/cb_array.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/cb_array.hlsl index b55b2196f1..84c2d54444 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/cb_array.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/cb_array.hlsl @@ -7,7 +7,7 @@ float main(int i : A) : SV_TARGET return A[i] + A[i+1] + A[i+2] ; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK: D3D12_SHADER_DESC: // CHECK: Shader Version: Pixel // CHECK: ConstantBuffers: 1 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/cbuf-usage-phi.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/cbuf-usage-phi.hlsl index 52863954a7..ac7de483c3 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/cbuf-usage-phi.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/cbuf-usage-phi.hlsl @@ -28,7 +28,7 @@ float4 main() : SV_Target { } // {{$}} is used to prevent match to 0x -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK: Flags: 0{{$}} // CHECK: ConstantBuffers: 2 // CHECK: BoundResources: 2 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer-16bit.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer-16bit.hlsl index 7c148970a9..c7d8d59250 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer-16bit.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer-16bit.hlsl @@ -37,7 +37,7 @@ float main(int i : A) : SV_TARGET return b + mf1 + h2.y + f16_3.z + (float)(d * i64 + u64) + u16 * i16.x; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK-NEXT: D3D12_SHADER_DESC: // CHECK-NEXT: Shader Version: Pixel // CHECK: Flags: 0 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer-struct-16bit.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer-struct-16bit.hlsl index ffd698e4b0..5966acba5d 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer-struct-16bit.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer-struct-16bit.hlsl @@ -42,7 +42,7 @@ float main(int i : A) : SV_TARGET return CBS.b + CBS.mf1 + CBS.h2.y + CBS.f16_3.z + (float)(CBS.d * CBS.i64 + CBS.u64) + CBS.u16 * CBS.i16.x; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK-NEXT: D3D12_SHADER_DESC: // CHECK-NEXT: Shader Version: Pixel // CHECK: Flags: 0 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer_default_val.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer_default_val.hlsl index d32427bd80..44311dba68 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer_default_val.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/cbuffer_default_val.hlsl @@ -9,7 +9,7 @@ float main() : SV_TARGET } // Default value unsupported for now: -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK: D3D12_SHADER_DESC: // CHECK: Shader Version: Pixel // CHECK: ConstantBuffers: 1 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/clip-dist-refl.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/clip-dist-refl.hlsl index 9b4b375b91..cf3fc37814 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/clip-dist-refl.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/clip-dist-refl.hlsl @@ -1,6 +1,6 @@ // RUN: %dxc -E MainVp -T vs_6_0 %s | %D3DReflect %s | FileCheck %s -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK: OutputParameters: 2 void MainVp (out float4 rw_sv_clipdistance : SV_ClipDistance, diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/comp-groupshared.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/comp-groupshared.hlsl index 8d17d3da83..69171bd3af 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/comp-groupshared.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/comp-groupshared.hlsl @@ -75,7 +75,7 @@ // CHECK: GroupSharedBytesUsed: 16 // CHECK: } // CHECK: } -// CHECK:ID3D12LibraryReflection: +// CHECK:ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: Creator: // CHECK: Flags: 0 @@ -110,6 +110,11 @@ // CHECK: Dimension: D3D_SRV_DIMENSION_BUFFER // CHECK: NumSamples (or stride): 4294967295 // CHECK: uFlags: 0 +// CHECK:ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: D3D12_COMPUTE_SHADER_DESC: +// CHECK: NumThreads: 64, 2, 2 struct Foo { int a[2]; diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/empty_broadcasting_nodes.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/empty_broadcasting_nodes.hlsl index 5889e69281..fbcc5a108f 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/empty_broadcasting_nodes.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/empty_broadcasting_nodes.hlsl @@ -289,14 +289,14 @@ // CHECK: } // CHECK: } // CHECK: } -// CHECK:ID3D12LibraryReflection: +// CHECK:ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: Creator: // CHECK: Flags: 0 // CHECK: FunctionCount: 1 // CHECK: ID3D12FunctionReflection: // CHECK: D3D12_FUNCTION_DESC: Name: depth18part0_wg_63_nodes_seed_255 -// CHECK: Shader Version: 6.8 +// CHECK: Shader Version: Node 6.8 // CHECK: Creator: // CHECK: Flags: 0 // CHECK: RequiredFeatureFlags: 0 @@ -304,6 +304,61 @@ // CHECK: BoundResources: 0 // CHECK: FunctionParameterCount: 0 // CHECK: HasReturn: FALSE +// CHECK:ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: D3D12_NODE_SHADER_DESC: +// CHECK: D3D12_COMPUTE_SHADER_DESC: +// CHECK: NumThreads: 25, 4, 1 +// CHECK: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +// CHECK: IsProgramEntry: FALSE +// CHECK: LocalRootArgumentsTableIndex: -1 +// CHECK: DispatchGrid[0]: 2 +// CHECK: DispatchGrid[1]: 8 +// CHECK: DispatchGrid[2]: 10 +// CHECK: MaxDispatchGrid[0]: 0 +// CHECK: MaxDispatchGrid[1]: 0 +// CHECK: MaxDispatchGrid[2]: 0 +// CHECK: MaxRecursionDepth: 0 +// CHECK: D3D12_NODE_ID_DESC: (ShaderId) +// CHECK: Name: depth18part0_wg_63_nodes_seed_255 +// CHECK: ID: 0 +// CHECK: D3D12_NODE_ID_DESC: (ShaderSharedInput) +// CHECK: Name: depth18part0_wg_63_nodes_seed_255 +// CHECK: ID: 0 +// CHECK: InputNodes: 1 +// CHECK: OutputNodes: 1 +// CHECK: Input Nodes: +// CHECK: D3D12_NODE_DESC: +// CHECK: Flags: 0x61 +// CHECK: Type: +// CHECK: Size: 8 +// CHECK: Alignment: 4 +// CHECK: DispatchGrid: +// CHECK: ByteOffset: 0 +// CHECK: ComponentType: +// CHECK: NumComponents: 0 +// CHECK: MaxRecords: 0 +// CHECK: MaxRecordsSharedWith: -1 +// CHECK: OutputArraySize: 0 +// CHECK: AllowSparseNodes: FALSE +// CHECK: Output Nodes: +// CHECK: D3D12_NODE_DESC: +// CHECK: Flags: 0x16 +// CHECK: Type: +// CHECK: Size: 20 +// CHECK: Alignment: 4 +// CHECK: DispatchGrid: +// CHECK: ByteOffset: 8 +// CHECK: ComponentType: D3D12_DISPATCH_COMPONENT_TYPE_U32 +// CHECK: NumComponents: 3 +// CHECK: D3D12_NODE_ID_DESC: (OutputID) +// CHECK: Name: OutputyMcOutputFace +// CHECK: ID: 0 +// CHECK: MaxRecords: 47 +// CHECK: MaxRecordsSharedWith: -1 +// CHECK: OutputArraySize: 2 +// CHECK: AllowSparseNodes: TRUE struct rec0 { diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/empty_struct2.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/empty_struct2.hlsl index 4de6434f9d..f8b25623bc 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/empty_struct2.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/empty_struct2.hlsl @@ -26,7 +26,7 @@ cbuffer Params_cbuffer2 : register(b1) { float4 main(float4 pos : POSITION) : SV_POSITION { return foo + bar; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK: D3D12_SHADER_DESC: // CHECK: Shader Version: Vertex // CHECK: ConstantBuffers: 2 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/empty_thread_nodes.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/empty_thread_nodes.hlsl index 00ce9f2f55..4d7148169d 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/empty_thread_nodes.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/empty_thread_nodes.hlsl @@ -321,7 +321,7 @@ // CHECK: } // CHECK: } // CHECK: } -// CHECK:ID3D12LibraryReflection: +// CHECK:ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // FIXME: Creator: // CHECK: Flags: 0 @@ -335,6 +335,77 @@ // CHECK: BoundResources: 0 // CHECK: FunctionParameterCount: 0 // CHECK: HasReturn: FALSE +// CHECK:ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: D3D12_NODE_SHADER_DESC: +// CHECK: D3D12_COMPUTE_SHADER_DESC: +// CHECK: NumThreads: 1, 1, 1 +// CHECK: LaunchType: D3D12_NODE_LAUNCH_TYPE_THREAD_LAUNCH +// CHECK: IsProgramEntry: FALSE +// CHECK: LocalRootArgumentsTableIndex: 2 +// CHECK: DispatchGrid[0]: 0 +// CHECK: DispatchGrid[1]: 0 +// CHECK: DispatchGrid[2]: 0 +// CHECK: MaxDispatchGrid[0]: 0 +// CHECK: MaxDispatchGrid[1]: 0 +// CHECK: MaxDispatchGrid[2]: 0 +// CHECK: MaxRecursionDepth: 0 +// CHECK: D3D12_NODE_ID_DESC: (ShaderId) +// CHECK: Name: Input2Output +// CHECK: ID: 0 +// CHECK: D3D12_NODE_ID_DESC: (ShaderSharedInput) +// CHECK: Name: Input2Output +// CHECK: ID: 0 +// CHECK: InputNodes: 1 +// CHECK: OutputNodes: 2 +// CHECK: Input Nodes: +// CHECK: D3D12_NODE_DESC: +// CHECK: Flags: 0x25 +// CHECK: Type: +// CHECK: Size: 8 +// CHECK: Alignment: 4 +// CHECK: DispatchGrid: +// CHECK: ByteOffset: 0 +// CHECK: ComponentType: +// CHECK: NumComponents: 0 +// CHECK: MaxRecords: 0 +// CHECK: MaxRecordsSharedWith: -1 +// CHECK: OutputArraySize: 0 +// CHECK: AllowSparseNodes: FALSE +// CHECK: Output Nodes: +// CHECK: D3D12_NODE_DESC: +// CHECK: Flags: 0x106 +// CHECK: Type: +// CHECK: Size: 8 +// CHECK: Alignment: 4 +// CHECK: DispatchGrid: +// CHECK: ByteOffset: 0 +// CHECK: ComponentType: +// CHECK: NumComponents: 0 +// CHECK: D3D12_NODE_ID_DESC: (OutputID) +// CHECK: Name: Output1 +// CHECK: ID: 0 +// CHECK: MaxRecords: 0 +// CHECK: MaxRecordsSharedWith: 1 +// CHECK: OutputArraySize: 0 +// CHECK: AllowSparseNodes: FALSE +// CHECK: D3D12_NODE_DESC: +// CHECK: Flags: 0x6 +// CHECK: Type: +// CHECK: Size: 8 +// CHECK: Alignment: 4 +// CHECK: DispatchGrid: +// CHECK: ByteOffset: 0 +// CHECK: ComponentType: +// CHECK: NumComponents: 0 +// CHECK: D3D12_NODE_ID_DESC: (OutputID) +// CHECK: Name: Output2ID +// CHECK: ID: 1 +// CHECK: MaxRecords: 5 +// CHECK: MaxRecordsSharedWith: -1 +// CHECK: OutputArraySize: 0 +// CHECK: AllowSparseNodes: FALSE struct rec0 { diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_cb_matrix_array.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_cb_matrix_array.hlsl index 664e3ee8c6..9568eebfd5 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_cb_matrix_array.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_cb_matrix_array.hlsl @@ -22,7 +22,7 @@ void RayGenShader() g_Output[LaunchIndex] = Color * m0[0][0] * m1[0][0] * VectorArray[1] * FloatArray[2]; } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: FunctionCount: 1 // CHECK-NEXT: ID3D12FunctionReflection: // CHECK-NEXT: D3D12_FUNCTION_DESC: Name: \01?RayGenShader{{[@$?.A-Za-z0-9_]+}} diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports1.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports1.hlsl index 920649748e..d41080e73a 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports1.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports1.hlsl @@ -149,7 +149,7 @@ float4 PSMain(int idx : INDEX) : SV_Target { // CHECK: } // CHECK: } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: FunctionCount: 3 // CHECK: ID3D12FunctionReflection: diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports2.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports2.hlsl index 81d8f35777..5c24aa4176 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports2.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports2.hlsl @@ -161,7 +161,7 @@ void RayGen() { // CHECK: } // CHECK: } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: FunctionCount: 4 // CHECK: ID3D12FunctionReflection: diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports3.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports3.hlsl index 4004e5ffd1..975494b0f6 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports3.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports3.hlsl @@ -202,7 +202,7 @@ float4 PSMain(int idx : INDEX) : SV_Target { // CHECK: } // CHECK: } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: FunctionCount: 6 // CHECK: ID3D12FunctionReflection: diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports4.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports4.hlsl index 05922ebf08..02a1d9c1bf 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports4.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports4.hlsl @@ -18,7 +18,7 @@ float4 PSMain(int idx : INDEX) : SV_Target { } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: FunctionCount: 4 // CHECK: ID3D12FunctionReflection: diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports_nocollision.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports_nocollision.hlsl index c3db7f12e1..f22aee81c0 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports_nocollision.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_exports_nocollision.hlsl @@ -32,7 +32,7 @@ void RayGen() { // No Collision here between differently mangled functions, or to non-exported functions. -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: FunctionCount: 4 // CHECK: ID3D12FunctionReflection: diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_global.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_global.hlsl index c4c2f9b034..82aec98ba2 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_global.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_global.hlsl @@ -7,7 +7,7 @@ // Make sure CB usage is correct. #if 0 -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK-NEXT: D3D12_LIBRARY_DESC: // CHECK: Flags: 0 // CHECK-NEXT: FunctionCount: 2 @@ -180,6 +180,10 @@ // CHECK-NEXT: Dimension: D3D_SRV_DIMENSION_BUFFER // CHECK-NEXT: NumSamples (or stride): 72 // CHECK-NEXT: uFlags: 0 +// CHECK-NEXT: ID3D12FunctionReflection1: +// CHECK-NEXT: D3D12_FUNCTION_DESC1: +// CHECK-NEXT: RootSignatureSize: 0 +// CHECK-NEXT: EarlyDepthStencil: FALSE // CHECK-NEXT: ID3D12FunctionReflection: // CHECK-NEXT: D3D12_FUNCTION_DESC: Name: test // CHECK-NEXT: Shader Version: Pixel @@ -369,6 +373,10 @@ // CHECK-NEXT: Dimension: D3D_SRV_DIMENSION_BUFFER // CHECK-NEXT: NumSamples (or stride): 72 // CHECK-NEXT: uFlags: 0 +// CHECK-NEXT: ID3D12FunctionReflection1: +// CHECK-NEXT: D3D12_FUNCTION_DESC1: +// CHECK-NEXT: RootSignatureSize: 0 +// CHECK-NEXT: EarlyDepthStencil: FALSE #endif Texture2D g_txDiffuse; diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_hs_export1.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_hs_export1.hlsl index 14d9eee2a1..c183872ced 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_hs_export1.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_hs_export1.hlsl @@ -1,9 +1,142 @@ // RUN: %dxc -auto-binding-space 13 -T lib_6_3 -exports HSMain1;HSMain2;HSMain3 %s | %D3DReflect %s | FileCheck %s // This version of HSPerPatchFunc1 should not be exported -// CHECK: ID3D12FunctionReflection: -// CHECK-NOT: D3D12_FUNCTION_DESC: Name: \01?HSPerPatchFunc1{{[@$?.A-Za-z0-9_]+InputPatch[@$?.A-Za-z0-9_]+}} -// CHECK-NOT: D3D_SRV_DIMENSION_BUFFER +// CHECK: ID3D12LibraryReflection1: +// CHECK: D3D12_LIBRARY_DESC: +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: FunctionCount: 8 +// CHECK: ID3D12FunctionReflection: +// CHECK: D3D12_FUNCTION_DESC: Name: \01?HSMain1@@YAXIV?$InputPatch@UPSSceneIn@@$02@@@Z +// CHECK: Shader Version: Library 6.3 +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: RequiredFeatureFlags: 0 +// CHECK: ConstantBuffers: 0 +// CHECK: BoundResources: 0 +// CHECK: FunctionParameterCount: 0 +// CHECK: HasReturn: FALSE +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: EarlyDepthStencil: FALSE +// CHECK: ID3D12FunctionReflection: +// CHECK: D3D12_FUNCTION_DESC: Name: \01?HSMain2@@YAXIV?$InputPatch@UPSSceneIn@@$03@@@Z +// CHECK: Shader Version: Library 6.3 +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: RequiredFeatureFlags: 0 +// CHECK: ConstantBuffers: 0 +// CHECK: BoundResources: 0 +// CHECK: FunctionParameterCount: 0 +// CHECK: HasReturn: FALSE +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: EarlyDepthStencil: FALSE +// CHECK: ID3D12FunctionReflection: +// CHECK: D3D12_FUNCTION_DESC: Name: \01?HSMain3@@YAXIV?$InputPatch@UPSSceneIn@@$02@@@Z +// CHECK: Shader Version: Library 6.3 +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: RequiredFeatureFlags: 0 +// CHECK: ConstantBuffers: 0 +// CHECK: BoundResources: 0 +// CHECK: FunctionParameterCount: 0 +// CHECK: HasReturn: FALSE +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: EarlyDepthStencil: FALSE +// CHECK: ID3D12FunctionReflection: +// CHECK: D3D12_FUNCTION_DESC: Name: \01?HSPerPatchFunc1@@YA?AUHSPerPatchData@@XZ +// CHECK: Shader Version: Library 6.3 +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: RequiredFeatureFlags: 0 +// CHECK: ConstantBuffers: 0 +// CHECK: BoundResources: 0 +// CHECK: FunctionParameterCount: 0 +// CHECK: HasReturn: FALSE +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: EarlyDepthStencil: FALSE +// CHECK: ID3D12FunctionReflection: +// CHECK: D3D12_FUNCTION_DESC: Name: \01?HSPerPatchFunc2@@YA?AUHSPerPatchDataQuad@@V?$InputPatch@UPSSceneIn@@$03@@@Z +// CHECK: Shader Version: Library 6.3 +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: RequiredFeatureFlags: 0 +// CHECK: ConstantBuffers: 0 +// CHECK: BoundResources: 0 +// CHECK: FunctionParameterCount: 0 +// CHECK: HasReturn: FALSE +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: EarlyDepthStencil: FALSE +// CHECK: ID3D12FunctionReflection: +// CHECK: D3D12_FUNCTION_DESC: Name: HSMain1 +// CHECK: Shader Version: Hull 6.3 +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: RequiredFeatureFlags: 0 +// CHECK: ConstantBuffers: 0 +// CHECK: BoundResources: 0 +// CHECK: FunctionParameterCount: 0 +// CHECK: HasReturn: FALSE +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: D3D12_HULL_SHADER_DESC: +// CHECK: Domain: D3D_TESSELLATOR_DOMAIN_TRI +// CHECK: Partition: D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD +// CHECK: OutputPrimitive: D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW +// CHECK: InputControlPoints: 3 +// CHECK: OutputControlPoints: 3 +// CHECK: MaxTessFactor: 64 +// CHECK: ID3D12FunctionReflection: +// CHECK: D3D12_FUNCTION_DESC: Name: HSMain2 +// CHECK: Shader Version: Hull 6.3 +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: RequiredFeatureFlags: 0 +// CHECK: ConstantBuffers: 0 +// CHECK: BoundResources: 0 +// CHECK: FunctionParameterCount: 0 +// CHECK: HasReturn: FALSE +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: D3D12_HULL_SHADER_DESC: +// CHECK: Domain: D3D_TESSELLATOR_DOMAIN_QUAD +// CHECK: Partition: D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD +// CHECK: OutputPrimitive: D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW +// CHECK: InputControlPoints: 4 +// CHECK: OutputControlPoints: 4 +// CHECK: MaxTessFactor: 64 +// CHECK: ID3D12FunctionReflection: +// CHECK: D3D12_FUNCTION_DESC: Name: HSMain3 +// CHECK: Shader Version: Hull 6.3 +// CHECK: Creator: +// CHECK: Flags: 0 +// CHECK: RequiredFeatureFlags: 0 +// CHECK: ConstantBuffers: 0 +// CHECK: BoundResources: 0 +// CHECK: FunctionParameterCount: 0 +// CHECK: HasReturn: FALSE +// CHECK: ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: D3D12_HULL_SHADER_DESC: +// CHECK: Domain: D3D_TESSELLATOR_DOMAIN_TRI +// CHECK: Partition: D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD +// CHECK: OutputPrimitive: D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW +// CHECK: InputControlPoints: 3 +// CHECK: OutputControlPoints: 3 +// CHECK: MaxTessFactor: 64 +// CHECK-NOT:ID3D12FunctionReflection: Buffer T_unused; diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_hs_export2.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_hs_export2.hlsl index 02cb75ec2b..a63ab33022 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_hs_export2.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_hs_export2.hlsl @@ -273,7 +273,7 @@ HSPerPatchData HSPerPatchFunc1() // CHECK: } // CHECK: } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: FunctionCount: 5 // CHECK: ID3D12FunctionReflection: diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_requires_flags.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_requires_flags.hlsl index 55bc780f65..d726b43d49 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/lib_requires_flags.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/lib_requires_flags.hlsl @@ -16,7 +16,7 @@ float4 PSMain(float4 In : IN, out float Depth : SV_Depth) : SV_Target { return In; } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: FunctionCount: 3 // CHECK-LABEL: D3D12_FUNCTION_DESC: Name: \01?DoubleMAD{{[@$?.A-Za-z0-9_]+}} // CHECK: RequiredFeatureFlags: 0x1 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/mesh-groupshared.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/mesh-groupshared.hlsl index adca28b6d6..328e233914 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/mesh-groupshared.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/mesh-groupshared.hlsl @@ -146,7 +146,7 @@ // CHECK: MeshOutputTopology: 2 // CHECK: } // CHECK: } -// CHECK:ID3D12LibraryReflection: +// CHECK:ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: Creator: // CHECK: Flags: 0 @@ -160,6 +160,15 @@ // CHECK: BoundResources: 0 // CHECK: FunctionParameterCount: 0 // CHECK: HasReturn: FALSE +// CHECK:ID3D12FunctionReflection1: +// CHECK: D3D12_FUNCTION_DESC1: +// CHECK: RootSignatureSize: 0 +// CHECK: D3D12_MESH_SHADER_DESC: +// CHECK: PayloadSize: 36 +// CHECK: MaxVertexCount: 32 +// CHECK: MaxPrimitiveCount: 16 +// CHECK: OutputTopology: Triangle +// CHECK: NumThreads: 32, 1, 1 #define MAX_VERT 32 #define MAX_PRIM 16 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/node-record-alignment-16bit.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/node-record-alignment-16bit.hlsl index dc092c8d2c..4a174234cd 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/node-record-alignment-16bit.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/node-record-alignment-16bit.hlsl @@ -42,3 +42,304 @@ TEST_TYPE(node_min16float, min16float) // RDAT-LABEL: UnmangledName: "node_min16int" // RDAT: RecordAlignmentInBytes: 2 TEST_TYPE(node_min16int, min16int) + +//RDAT:ID3D12LibraryReflection1: +//RDAT: D3D12_LIBRARY_DESC: +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: FunctionCount: 5 +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_float16 +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x40000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_float16 +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_float16 +//RDAT: ID: 0 +//RDAT: InputNodes: 1 +//RDAT: OutputNodes: 0 +//RDAT: Input Nodes: +//RDAT: D3D12_NODE_DESC: +//RDAT: Flags: 0x61 +//RDAT: Type: +//RDAT: Size: 6 +//RDAT: Alignment: 2 +//RDAT: DispatchGrid: +//RDAT: ByteOffset: 0 +//RDAT: ComponentType: +//RDAT: NumComponents: 0 +//RDAT: MaxRecords: 0 +//RDAT: MaxRecordsSharedWith: -1 +//RDAT: OutputArraySize: 0 +//RDAT: AllowSparseNodes: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_half +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x40000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_half +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_half +//RDAT: ID: 0 +//RDAT: InputNodes: 1 +//RDAT: OutputNodes: 0 +//RDAT: Input Nodes: +//RDAT: D3D12_NODE_DESC: +//RDAT: Flags: 0x61 +//RDAT: Type: +//RDAT: Size: 6 +//RDAT: Alignment: 2 +//RDAT: DispatchGrid: +//RDAT: ByteOffset: 0 +//RDAT: ComponentType: +//RDAT: NumComponents: 0 +//RDAT: MaxRecords: 0 +//RDAT: MaxRecordsSharedWith: -1 +//RDAT: OutputArraySize: 0 +//RDAT: AllowSparseNodes: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_int16 +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x40000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_int16 +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_int16 +//RDAT: ID: 0 +//RDAT: InputNodes: 1 +//RDAT: OutputNodes: 0 +//RDAT: Input Nodes: +//RDAT: D3D12_NODE_DESC: +//RDAT: Flags: 0x61 +//RDAT: Type: +//RDAT: Size: 6 +//RDAT: Alignment: 2 +//RDAT: DispatchGrid: +//RDAT: ByteOffset: 0 +//RDAT: ComponentType: +//RDAT: NumComponents: 0 +//RDAT: MaxRecords: 0 +//RDAT: MaxRecordsSharedWith: -1 +//RDAT: OutputArraySize: 0 +//RDAT: AllowSparseNodes: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_min16float +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x40000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_min16float +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_min16float +//RDAT: ID: 0 +//RDAT: InputNodes: 1 +//RDAT: OutputNodes: 0 +//RDAT: Input Nodes: +//RDAT: D3D12_NODE_DESC: +//RDAT: Flags: 0x61 +//RDAT: Type: +//RDAT: Size: 6 +//RDAT: Alignment: 2 +//RDAT: DispatchGrid: +//RDAT: ByteOffset: 0 +//RDAT: ComponentType: +//RDAT: NumComponents: 0 +//RDAT: MaxRecords: 0 +//RDAT: MaxRecordsSharedWith: -1 +//RDAT: OutputArraySize: 0 +//RDAT: AllowSparseNodes: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_min16int +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x40000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_min16int +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_min16int +//RDAT: ID: 0 +//RDAT: InputNodes: 1 +//RDAT: OutputNodes: 0 +//RDAT: Input Nodes: +//RDAT: D3D12_NODE_DESC: +//RDAT: Flags: 0x61 +//RDAT: Type: +//RDAT: Size: 6 +//RDAT: Alignment: 2 +//RDAT: DispatchGrid: +//RDAT: ByteOffset: 0 +//RDAT: ComponentType: +//RDAT: NumComponents: 0 +//RDAT: MaxRecords: 0 +//RDAT: MaxRecordsSharedWith: -1 +//RDAT: OutputArraySize: 0 +//RDAT: AllowSparseNodes: FALSE diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/raytracing_traceray.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/raytracing_traceray.hlsl index dd63e0b426..1bac11c2f4 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/raytracing_traceray.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/raytracing_traceray.hlsl @@ -24,7 +24,7 @@ float4 emit(inout float2 f2, RayDesc Ray:R, inout Payload p ) { -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: Flags: 0 // CHECK: FunctionCount: 1 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/raytracing_traceray_readback.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/raytracing_traceray_readback.hlsl index 47e1e3400f..d4ff7d3bf0 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/raytracing_traceray_readback.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/raytracing_traceray_readback.hlsl @@ -32,7 +32,7 @@ void RayGenTestMain() } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: Flags: 0 // CHECK: FunctionCount: 1 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm63_dxr.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm63_dxr.hlsl index 612cb85321..a9fc044827 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm63_dxr.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm63_dxr.hlsl @@ -94,3 +94,168 @@ void miss(inout MyPayload payload : SV_RayPayload) { void callable(inout MyPayload param) { BAB.Store(0, 0); } + +// RDAT: ID3D12LibraryReflection1: +// RDAT: D3D12_LIBRARY_DESC: +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: FunctionCount: 6 +// RDAT: ID3D12FunctionReflection: +// RDAT: D3D12_FUNCTION_DESC: Name: \01?anyhit@@YAXUMyPayload@@UBuiltInTriangleIntersectionAttributes@@@Z +// RDAT18: Shader Version: AnyHit 6.8 +// RDAT17: Shader Version: AnyHit 6.7 +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: RequiredFeatureFlags: 0 +// RDAT: ConstantBuffers: 0 +// RDAT: BoundResources: 1 +// RDAT: FunctionParameterCount: 0 +// RDAT: HasReturn: FALSE +// RDAT: Bound Resources: +// RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +// RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +// RDAT: uID: 0 +// RDAT: BindCount: 1 +// RDAT: BindPoint: 1 +// RDAT: Space: 0 +// RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +// RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +// RDAT: NumSamples (or stride): 0 +// RDAT: uFlags: 0 +// RDAT: ID3D12FunctionReflection1: +// RDAT: D3D12_FUNCTION_DESC1: +// RDAT: RootSignatureSize: 0 +// RDAT: AttributeSize: 8 +// RDAT: ParamPayloadSize: 8 +// RDAT: ID3D12FunctionReflection: +// RDAT: D3D12_FUNCTION_DESC: Name: \01?callable@@YAXUMyPayload@@@Z +// RDAT18: Shader Version: Callable 6.8 +// RDAT17: Shader Version: Callable 6.7 +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: RequiredFeatureFlags: 0 +// RDAT: ConstantBuffers: 0 +// RDAT: BoundResources: 1 +// RDAT: FunctionParameterCount: 0 +// RDAT: HasReturn: FALSE +// RDAT: Bound Resources: +// RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +// RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +// RDAT: uID: 0 +// RDAT: BindCount: 1 +// RDAT: BindPoint: 1 +// RDAT: Space: 0 +// RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +// RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +// RDAT: NumSamples (or stride): 0 +// RDAT: uFlags: 0 +// RDAT: ID3D12FunctionReflection1: +// RDAT: D3D12_FUNCTION_DESC1: +// RDAT: RootSignatureSize: 0 +// RDAT: AttributeSize: 0 +// RDAT: ParamPayloadSize: 8 +// RDAT: ID3D12FunctionReflection: +// RDAT: D3D12_FUNCTION_DESC: Name: \01?closesthit@@YAXUMyPayload@@UBuiltInTriangleIntersectionAttributes@@@Z +// RDAT18: Shader Version: ClosestHit 6.8 +// RDAT17: Shader Version: ClosestHit 6.7 +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: RequiredFeatureFlags: 0 +// RDAT: ConstantBuffers: 0 +// RDAT: BoundResources: 1 +// RDAT: FunctionParameterCount: 0 +// RDAT: HasReturn: FALSE +// RDAT: Bound Resources: +// RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +// RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +// RDAT: uID: 0 +// RDAT: BindCount: 1 +// RDAT: BindPoint: 1 +// RDAT: Space: 0 +// RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +// RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +// RDAT: NumSamples (or stride): 0 +// RDAT: uFlags: 0 +// RDAT: ID3D12FunctionReflection1: +// RDAT: D3D12_FUNCTION_DESC1: +// RDAT: RootSignatureSize: 0 +// RDAT: AttributeSize: 8 +// RDAT: ParamPayloadSize: 8 +// RDAT: ID3D12FunctionReflection: +// RDAT: D3D12_FUNCTION_DESC: Name: \01?intersection@@YAXXZ +// RDAT18: Shader Version: Intersection 6.8 +// RDAT17: Shader Version: Intersection 6.7 +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: RequiredFeatureFlags: 0 +// RDAT: ConstantBuffers: 0 +// RDAT: BoundResources: 1 +// RDAT: FunctionParameterCount: 0 +// RDAT: HasReturn: FALSE +// RDAT: Bound Resources: +// RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +// RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +// RDAT: uID: 0 +// RDAT: BindCount: 1 +// RDAT: BindPoint: 1 +// RDAT: Space: 0 +// RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +// RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +// RDAT: NumSamples (or stride): 0 +// RDAT: uFlags: 0 +// RDAT: ID3D12FunctionReflection1: +// RDAT: D3D12_FUNCTION_DESC1: +// RDAT: RootSignatureSize: 0 +// RDAT: AttributeSize: 0 +// RDAT: ParamPayloadSize: 0 +// RDAT: ID3D12FunctionReflection: +// RDAT: D3D12_FUNCTION_DESC: Name: \01?miss@@YAXUMyPayload@@@Z +// RDAT18: Shader Version: Miss 6.8 +// RDAT17: Shader Version: Miss 6.7 +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: RequiredFeatureFlags: 0 +// RDAT: ConstantBuffers: 0 +// RDAT: BoundResources: 1 +// RDAT: FunctionParameterCount: 0 +// RDAT: HasReturn: FALSE +// RDAT: Bound Resources: +// RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +// RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +// RDAT: uID: 0 +// RDAT: BindCount: 1 +// RDAT: BindPoint: 1 +// RDAT: Space: 0 +// RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +// RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +// RDAT: NumSamples (or stride): 0 +// RDAT: uFlags: 0 +// RDAT: ID3D12FunctionReflection1: +// RDAT: D3D12_FUNCTION_DESC1: +// RDAT: RootSignatureSize: 0 +// RDAT: ParamPayloadSize: 8 +// RDAT: ID3D12FunctionReflection: +// RDAT: D3D12_FUNCTION_DESC: Name: \01?raygen@@YAXXZ +// RDAT18: Shader Version: RayGeneration 6.8 +// RDAT17: Shader Version: RayGeneration 6.7 +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: RequiredFeatureFlags: 0 +// RDAT: ConstantBuffers: 0 +// RDAT: BoundResources: 1 +// RDAT: FunctionParameterCount: 0 +// RDAT: HasReturn: FALSE +// RDAT: Bound Resources: +// RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +// RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +// RDAT: uID: 0 +// RDAT: BindCount: 1 +// RDAT: BindPoint: 1 +// RDAT: Space: 0 +// RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +// RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +// RDAT: NumSamples (or stride): 0 +// RDAT: uFlags: 0 +// RDAT: ID3D12FunctionReflection1: +// RDAT: D3D12_FUNCTION_DESC1: +// RDAT: RootSignatureSize: 0 \ No newline at end of file diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm65_ms_as.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm65_ms_as.hlsl index d39ea55a9a..a913c43381 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm65_ms_as.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm65_ms_as.hlsl @@ -67,3 +67,57 @@ groupshared Vertex pld; void amplification(uint3 DTid : SV_DispatchThreadID) { DispatchMesh(1, 1, 1, pld); } + +// RDAT: ID3D12LibraryReflection1: +// RDAT: D3D12_LIBRARY_DESC: +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: FunctionCount: 2 +// RDAT: ID3D12FunctionReflection: +// RDAT: D3D12_FUNCTION_DESC: Name: amplification +// RDAT18: Shader Version: Amplification 6.8 +// RDAT17: Shader Version: Amplification 6.7 +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT18: RequiredFeatureFlags: 0x20000000000 +// RDAT17: RequiredFeatureFlags: 0 +// RDAT: ConstantBuffers: 0 +// RDAT: BoundResources: 0 +// RDAT: FunctionParameterCount: 0 +// RDAT: HasReturn: FALSE +// RDAT: ID3D12FunctionReflection1: +// RDAT: D3D12_FUNCTION_DESC1: +// RDAT: RootSignatureSize: 0 +// RDAT: PayloadSize: 16 +// RDAT: NumThreads: 8, 8, 1 +// RDAT: ID3D12FunctionReflection: +// RDAT: D3D12_FUNCTION_DESC: Name: mesh +// RDAT18: Shader Version: Mesh 6.8 +// RDAT17: Shader Version: Mesh 6.7 +// RDAT: Creator: +// RDAT: Flags: 0 +// RDAT: RequiredFeatureFlags: 0 +// RDAT: ConstantBuffers: 0 +// RDAT: BoundResources: 1 +// RDAT: FunctionParameterCount: 0 +// RDAT: HasReturn: FALSE +// RDAT: Bound Resources: +// RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +// RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +// RDAT: uID: 0 +// RDAT: BindCount: 1 +// RDAT: BindPoint: 1 +// RDAT: Space: 0 +// RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +// RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +// RDAT: NumSamples (or stride): 0 +// RDAT: uFlags: 0 +// RDAT: ID3D12FunctionReflection1: +// RDAT: D3D12_FUNCTION_DESC1: +// RDAT: RootSignatureSize: 0 +// RDAT: D3D12_MESH_SHADER_DESC: +// RDAT: PayloadSize: 0 +// RDAT: MaxVertexCount: 0 +// RDAT: MaxPrimitiveCount: 0 +// RDAT: OutputTopology: Triangle +// RDAT: NumThreads: 1, 1, 1 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives.hlsl index 253989af8f..d5a3361285 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives.hlsl @@ -125,7 +125,7 @@ void deriv_in_pixel(float2 uv : TEXCOORD) { // Make sure function-level derivative flag isn't in RequiredFeatureFlags, // and make sure mesh shader sets required flag. -// RDAT-LABEL: ID3D12LibraryReflection: +// RDAT-LABEL: ID3D12LibraryReflection1: // RDAT-LABEL: D3D12_FUNCTION_DESC: Name: // RDAT-SAME: deriv_in_func diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_6.ll b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_6.ll index bc29a4d81b..6874e36a2e 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_6.ll +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_6.ll @@ -185,7 +185,7 @@ attributes #3 = { nounwind readonly } ; Make sure function-level derivative flag isn't in RequiredFeatureFlags, ; and make sure mesh shader sets required flag. -; RDAT-LABEL: ID3D12LibraryReflection: +; RDAT-LABEL: ID3D12LibraryReflection1: ; RDAT-LABEL: D3D12_FUNCTION_DESC: Name: ; RDAT-SAME: deriv_in_func diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_6_decl_intrin_first.ll b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_6_decl_intrin_first.ll index dfea24ddef..b683b22cc4 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_6_decl_intrin_first.ll +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_6_decl_intrin_first.ll @@ -189,7 +189,7 @@ attributes #3 = { nounwind readonly } ; Make sure function-level derivative flag isn't in RequiredFeatureFlags, ; and make sure mesh shader sets required flag. -; RDAT-LABEL: ID3D12LibraryReflection: +; RDAT-LABEL: ID3D12LibraryReflection1: ; RDAT-LABEL: D3D12_FUNCTION_DESC: Name: ; RDAT-SAME: deriv_in_func diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_7.ll b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_7.ll index 8905307336..0c42db4459 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_7.ll +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_7.ll @@ -185,7 +185,7 @@ attributes #3 = { nounwind readonly } ; Make sure function-level derivative flag isn't in RequiredFeatureFlags, ; and make sure mesh shader sets required flag. -; RDAT-LABEL: ID3D12LibraryReflection: +; RDAT-LABEL: ID3D12LibraryReflection1: ; RDAT-LABEL: D3D12_FUNCTION_DESC: Name: ; RDAT-SAME: deriv_in_func diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_7_decl_intrin_first.ll b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_7_decl_intrin_first.ll index 2395bffec3..7e350140e6 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_7_decl_intrin_first.ll +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_7_decl_intrin_first.ll @@ -189,7 +189,7 @@ attributes #3 = { nounwind readonly } ; Make sure function-level derivative flag isn't in RequiredFeatureFlags, ; and make sure mesh shader sets required flag. -; RDAT-LABEL: ID3D12LibraryReflection: +; RDAT-LABEL: ID3D12LibraryReflection1: ; RDAT-LABEL: D3D12_FUNCTION_DESC: Name: ; RDAT-SAME: deriv_in_func diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_8.ll b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_8.ll index 9b38694ac3..0e0baed68f 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_8.ll +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_8.ll @@ -185,7 +185,7 @@ attributes #3 = { nounwind readonly } ; Make sure function-level derivative flag isn't in RequiredFeatureFlags, ; and make sure mesh shader sets required flag. -; RDAT-LABEL: ID3D12LibraryReflection: +; RDAT-LABEL: ID3D12LibraryReflection1: ; RDAT-LABEL: D3D12_FUNCTION_DESC: Name: ; RDAT-SAME: deriv_in_func diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_8_decl_intrin_first.ll b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_8_decl_intrin_first.ll index 01ab7229e3..c9d389adbc 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_8_decl_intrin_first.ll +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm66_derivatives_lib_6_8_decl_intrin_first.ll @@ -189,7 +189,7 @@ attributes #3 = { nounwind readonly } ; Make sure function-level derivative flag isn't in RequiredFeatureFlags, ; and make sure mesh shader sets required flag. -; RDAT-LABEL: ID3D12LibraryReflection: +; RDAT-LABEL: ID3D12LibraryReflection1: ; RDAT-LABEL: D3D12_FUNCTION_DESC: Name: ; RDAT-SAME: deriv_in_func diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm68_barriers.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm68_barriers.hlsl index 35c5e81c83..29d7750d52 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm68_barriers.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/rdat_mintarget/sm68_barriers.hlsl @@ -132,3 +132,295 @@ void node_barrier_node_group_in_call() { fn_barrier_node_group1(); BAB.Store(0, 0); } + +//RDAT:ID3D12LibraryReflection1: +//RDAT: D3D12_LIBRARY_DESC: +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: FunctionCount: 10 +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: \01?fn_barrier_device1@@YAXXZ +//RDAT: Shader Version: Library 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 0 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: EarlyDepthStencil: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: \01?fn_barrier_device2@@YAXXZ +//RDAT: Shader Version: Library 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: EarlyDepthStencil: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: \01?fn_barrier_group1@@YAXXZ +//RDAT: Shader Version: Library 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x20000000000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 0 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: EarlyDepthStencil: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: \01?fn_barrier_group2@@YAXXZ +//RDAT: Shader Version: Library 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x20000000000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: EarlyDepthStencil: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: \01?fn_barrier_node1@@YAXXZ +//RDAT: Shader Version: Library 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 0 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: EarlyDepthStencil: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: \01?fn_barrier_node_group1@@YAXXZ +//RDAT: Shader Version: Library 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x20000000000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 0 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: EarlyDepthStencil: FALSE +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_barrier +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x20000000000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_barrier +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_barrier +//RDAT: ID: 0 +//RDAT: InputNodes: 0 +//RDAT: OutputNodes: 0 +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_barrier_device_in_call +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_barrier_device_in_call +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_barrier_device_in_call +//RDAT: ID: 0 +//RDAT: InputNodes: 0 +//RDAT: OutputNodes: 0 +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_barrier_node_group_in_call +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0x20000000000 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_barrier_node_group_in_call +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_barrier_node_group_in_call +//RDAT: ID: 0 +//RDAT: InputNodes: 0 +//RDAT: OutputNodes: 0 +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node_barrier_node_in_call +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 1 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: Bound Resources: +//RDAT: D3D12_SHADER_INPUT_BIND_DESC: Name: BAB +//RDAT: Type: D3D_SIT_UAV_RWBYTEADDRESS +//RDAT: uID: 0 +//RDAT: BindCount: 1 +//RDAT: BindPoint: 1 +//RDAT: Space: 0 +//RDAT: ReturnType: D3D_RETURN_TYPE_MIXED +//RDAT: Dimension: D3D_SRV_DIMENSION_BUFFER +//RDAT: NumSamples (or stride): 0 +//RDAT: uFlags: 0 +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT: NumThreads: 1, 1, 1 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node_barrier_node_in_call +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node_barrier_node_in_call +//RDAT: ID: 0 +//RDAT: InputNodes: 0 +//RDAT: OutputNodes: 0 \ No newline at end of file diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/reflect-lib-1.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/reflect-lib-1.hlsl index f09ad71082..bcc90422d3 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/reflect-lib-1.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/reflect-lib-1.hlsl @@ -15,7 +15,7 @@ float function1(float x, min12int i) { float4 function2(float4 x : POSITION) : SV_Position { return x + cbval1 + cbval3.x; } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: FunctionCount: 3 // CHECK: ID3D12FunctionReflection: diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/sig-array.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/sig-array.hlsl index f457de8985..28283c4cc9 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/sig-array.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/sig-array.hlsl @@ -1,6 +1,6 @@ // RUN: %dxc -E VSMain -T vs_6_0 %s | %D3DReflect %s | FileCheck %s -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK: D3D12_SHADER_DESC: // CHECK: Shader Version: Vertex 6.0 // CHECK: ConstantBuffers: 0 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/structured_buffer_getdim_stride.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/structured_buffer_getdim_stride.hlsl index 205b00a5ef..7a8ebf89d0 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/structured_buffer_getdim_stride.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/structured_buffer_getdim_stride.hlsl @@ -12,7 +12,7 @@ uint UseBuf(int2 idx) { return g_buffer[idx.x][idx.y].b; } -// CHECK: ID3D12LibraryReflection: +// CHECK: ID3D12LibraryReflection1: // CHECK: D3D12_LIBRARY_DESC: // CHECK: FunctionCount: 1 // CHECK: ID3D12FunctionReflection: diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer-16bit.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer-16bit.hlsl index f1a46d2d61..0abaee4a05 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer-16bit.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer-16bit.hlsl @@ -50,7 +50,7 @@ float main(int i : A) : SV_TARGET return b + mf1 + h2.y + f16_3.z + (float)(d * i64 + u64) + u16 * i16.x + f16c + fused; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK-NEXT: D3D12_SHADER_DESC: // CHECK-NEXT: Shader Version: Pixel // CHECK: Flags: 0 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer-struct-16bit.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer-struct-16bit.hlsl index f0180490ea..f46925012d 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer-struct-16bit.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer-struct-16bit.hlsl @@ -42,7 +42,7 @@ float main(int i : A) : SV_TARGET return TBS.b + TBS.mf1 + TBS.h2.y + TBS.f16_3.z + (float)(TBS.d * TBS.i64 + TBS.u64) + TBS.u16 * TBS.i16.x; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK-NEXT: D3D12_SHADER_DESC: // CHECK-NEXT: Shader Version: Pixel // CHECK: Flags: 0 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer.hlsl index 8854387251..be7f77d211 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/tbuffer.hlsl @@ -47,7 +47,7 @@ float main(int i : A) : SV_TARGET return b + mi.y + a + mf * mu; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK-NEXT: D3D12_SHADER_DESC: // CHECK-NEXT: Shader Version: Pixel // CHECK: Flags: 0 diff --git a/tools/clang/test/HLSLFileCheck/d3dreflect/texture2dms.hlsl b/tools/clang/test/HLSLFileCheck/d3dreflect/texture2dms.hlsl index 016bdb23b2..4358e341cb 100644 --- a/tools/clang/test/HLSLFileCheck/d3dreflect/texture2dms.hlsl +++ b/tools/clang/test/HLSLFileCheck/d3dreflect/texture2dms.hlsl @@ -22,7 +22,7 @@ float4 main(uint4 color : COLOR) : SV_TARGET ; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK: Bound Resources: // CHECK: D3D12_SHADER_INPUT_BIND_DESC: Name: msTexture // CHECK-NEXT: Type: D3D_SIT_TEXTURE diff --git a/tools/clang/test/HLSLFileCheck/hlsl/entry/attributes/wavesize-compute-node-rdat.hlsl b/tools/clang/test/HLSLFileCheck/hlsl/entry/attributes/wavesize-compute-node-rdat.hlsl index 7b265f909c..3f740ffb7c 100644 --- a/tools/clang/test/HLSLFileCheck/hlsl/entry/attributes/wavesize-compute-node-rdat.hlsl +++ b/tools/clang/test/HLSLFileCheck/hlsl/entry/attributes/wavesize-compute-node-rdat.hlsl @@ -1,6 +1,6 @@ // RUN: %dxc -T lib_6_8 -DNODE %s | %D3DReflect %s | FileCheck %s -check-prefixes=RDAT,RDAT1 // RUN: %dxc -T lib_6_8 -DNODE -DRANGE=,64 %s | %D3DReflect %s | FileCheck %s -check-prefixes=RDAT,RDAT2 -// RUN: %dxc -T lib_6_8 -DNODE -DRANGE=,64,32 %s | %D3DReflect %s | FileCheck %s -check-prefixes=RDAT,RDAT2 +// RUN: %dxc -T lib_6_8 -DNODE -DRANGE=,64,32 %s | %D3DReflect %s | FileCheck %s -check-prefixes=RDAT,RDAT3 // RDAT has no min/max wave count until SM 6.8 @@ -9,12 +9,14 @@ // RDAT: MinimumExpectedWaveLaneCount: 16 // RDAT1: MaximumExpectedWaveLaneCount: 16 // RDAT2: MaximumExpectedWaveLaneCount: 64 +// RDAT3: MaximumExpectedWaveLaneCount: 64 // RDAT-LABEL: <1:RuntimeDataFunctionInfo{{.}}> = { // RDAT: Name: "node" // RDAT: MinimumExpectedWaveLaneCount: 16 // RDAT1: MaximumExpectedWaveLaneCount: 16 // RDAT2: MaximumExpectedWaveLaneCount: 64 +// RDAT3: MaximumExpectedWaveLaneCount: 64 #ifndef RANGE #define RANGE @@ -33,4 +35,65 @@ void main() { [NodeDispatchGrid(1,1,1)] [WaveSize(16 RANGE)] void node() { } -#endif \ No newline at end of file +#endif + +//RDAT:ID3D12LibraryReflection1: +//RDAT: D3D12_LIBRARY_DESC: +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: FunctionCount: 2 +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: main +//RDAT: Shader Version: Compute 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 0 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT1: WaveSize: min: 16, max: 0, preferred: 0 +//RDAT2: WaveSize: min: 16, max: 64, preferred: 0 +//RDAT3: WaveSize: min: 16, max: 64, preferred: 32 +//RDAT: NumThreads: 1, 1, 8 +//RDAT: ID3D12FunctionReflection: +//RDAT: D3D12_FUNCTION_DESC: Name: node +//RDAT: Shader Version: Node 6.8 +//RDAT: Creator: +//RDAT: Flags: 0 +//RDAT: RequiredFeatureFlags: 0 +//RDAT: ConstantBuffers: 0 +//RDAT: BoundResources: 0 +//RDAT: FunctionParameterCount: 0 +//RDAT: HasReturn: FALSE +//RDAT: ID3D12FunctionReflection1: +//RDAT: D3D12_FUNCTION_DESC1: +//RDAT: RootSignatureSize: 0 +//RDAT: D3D12_NODE_SHADER_DESC: +//RDAT: D3D12_COMPUTE_SHADER_DESC: +//RDAT1: WaveSize: min: 16, max: 0, preferred: 0 +//RDAT2: WaveSize: min: 16, max: 64, preferred: 0 +//RDAT3: WaveSize: min: 16, max: 64, preferred: 32 +//RDAT: NumThreads: 1, 1, 8 +//RDAT: LaunchType: D3D12_NODE_LAUNCH_TYPE_BROADCASTING_LAUNCH +//RDAT: IsProgramEntry: FALSE +//RDAT: LocalRootArgumentsTableIndex: -1 +//RDAT: DispatchGrid[0]: 1 +//RDAT: DispatchGrid[1]: 1 +//RDAT: DispatchGrid[2]: 1 +//RDAT: MaxDispatchGrid[0]: 0 +//RDAT: MaxDispatchGrid[1]: 0 +//RDAT: MaxDispatchGrid[2]: 0 +//RDAT: MaxRecursionDepth: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderId) +//RDAT: Name: node +//RDAT: ID: 0 +//RDAT: D3D12_NODE_ID_DESC: (ShaderSharedInput) +//RDAT: Name: node +//RDAT: ID: 0 +//RDAT: InputNodes: 0 +//RDAT: OutputNodes: 0 \ No newline at end of file diff --git a/tools/clang/test/HLSLFileCheck/hlsl/objects/FeedbackTexture/feedback-reflect.hlsl b/tools/clang/test/HLSLFileCheck/hlsl/objects/FeedbackTexture/feedback-reflect.hlsl index 27334a3dfb..e41ce6d33e 100644 --- a/tools/clang/test/HLSLFileCheck/hlsl/objects/FeedbackTexture/feedback-reflect.hlsl +++ b/tools/clang/test/HLSLFileCheck/hlsl/objects/FeedbackTexture/feedback-reflect.hlsl @@ -30,7 +30,7 @@ float main() : SV_Target return 0; } -// CHECK: ID3D12ShaderReflection: +// CHECK: ID3D12ShaderReflection1: // CHECK-NEXT: D3D12_SHADER_DESC: // CHECK-NEXT: Shader Version: Pixel 6.5 // CHECK: Flags: 0 diff --git a/tools/clang/tools/dxa/dxa.cpp b/tools/clang/tools/dxa/dxa.cpp index db6d1e9b88..7977411fed 100644 --- a/tools/clang/tools/dxa/dxa.cpp +++ b/tools/clang/tools/dxa/dxa.cpp @@ -422,8 +422,8 @@ void DxaContext::DumpReflection() { std::ostringstream ss; hlsl::dump::D3DReflectionDumper dumper(ss); - CComPtr pShaderReflection; - CComPtr pLibraryReflection; + CComPtr pShaderReflection; + CComPtr pLibraryReflection; for (uint32_t i = 0; i < partCount; ++i) { uint32_t kind; IFT(pReflection->GetPartKind(i, &kind)); diff --git a/tools/clang/tools/dxcvalidator/dxcvalidator.cpp b/tools/clang/tools/dxcvalidator/dxcvalidator.cpp index b8b71ece62..c7975c9c8f 100644 --- a/tools/clang/tools/dxcvalidator/dxcvalidator.cpp +++ b/tools/clang/tools/dxcvalidator/dxcvalidator.cpp @@ -52,7 +52,7 @@ static void HashAndUpdateOrCopy(uint32_t Flags, IDxcBlob *Shader, } else { CComPtr HashedBlobStream; IFT(CreateMemoryStream(DxcGetThreadMallocNoRef(), &HashedBlobStream)); - unsigned long CB; + ULONG CB; IFT(HashedBlobStream->Write(Shader->GetBufferPointer(), Shader->GetBufferSize(), &CB)); HashAndUpdate((DxilContainerHeader *)HashedBlobStream->GetPtr()); diff --git a/tools/clang/tools/dxr/dxr.cpp b/tools/clang/tools/dxr/dxr.cpp index e64a050ffc..3268864a43 100644 --- a/tools/clang/tools/dxr/dxr.cpp +++ b/tools/clang/tools/dxr/dxr.cpp @@ -171,7 +171,7 @@ int main(int argc, const char **argv) { } std::string textMessage; - bool lossy; + BOOL lossy; if (!Unicode::UTF8ToConsoleString(msg, &textMessage, &lossy) || lossy) { // Do a direct assignment as a last-ditch effort and print out as UTF-8. textMessage = msg; diff --git a/tools/clang/unittests/HLSLExec/ExecutionTest.cpp b/tools/clang/unittests/HLSLExec/ExecutionTest.cpp index f22e99e467..af0f40d659 100644 --- a/tools/clang/unittests/HLSLExec/ExecutionTest.cpp +++ b/tools/clang/unittests/HLSLExec/ExecutionTest.cpp @@ -106,6 +106,12 @@ ID3D12SDKConfiguration : public IUnknown { virtual HRESULT STDMETHODCALLTYPE SetSDKVersion(UINT SDKVersion, LPCSTR SDKPath) = 0; }; +#elif defined(_WIN32) +EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_D3D12SDKConfiguration = { + 0x7cda6aca, + 0xa03e, + 0x49c8, + {0x94, 0x58, 0x03, 0x34, 0xd2, 0x0e, 0x07, 0xce}}; #endif /* __ID3D12SDKConfiguration_INTERFACE_DEFINED__ */ using namespace DirectX; diff --git a/tools/clang/unittests/HLSLTestLib/FileCheckerTest.cpp b/tools/clang/unittests/HLSLTestLib/FileCheckerTest.cpp index 2c75d45e5e..c24accde53 100644 --- a/tools/clang/unittests/HLSLTestLib/FileCheckerTest.cpp +++ b/tools/clang/unittests/HLSLTestLib/FileCheckerTest.cpp @@ -790,8 +790,8 @@ FileRunCommandPart::RunD3DReflect(dxc::DxcDllSupport &DllSupport, CComPtr pSource; CComPtr pAssembler; CComPtr pResult; - CComPtr pShaderReflection; - CComPtr pLibraryReflection; + CComPtr pShaderReflection; + CComPtr pLibraryReflection; CComPtr containerReflection; uint32_t partCount; CComPtr pContainerBlob; diff --git a/tools/dxexp/dxexp.cpp b/tools/dxexp/dxexp.cpp index 4787200318..5ae24fbde9 100644 --- a/tools/dxexp/dxexp.cpp +++ b/tools/dxexp/dxexp.cpp @@ -42,150 +42,6 @@ static HRESULT AtlCheck(HRESULT hr) { return hr; } -// Not defined in Creators Update version of d3d12.h: -#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS2 -#define D3D12_FEATURE_D3D12_OPTIONS3 ((D3D12_FEATURE)21) -typedef enum D3D12_COMMAND_LIST_SUPPORT_FLAGS { - D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE = 0, - D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT = - (1 << D3D12_COMMAND_LIST_TYPE_DIRECT), - D3D12_COMMAND_LIST_SUPPORT_FLAG_BUNDLE = - (1 << D3D12_COMMAND_LIST_TYPE_BUNDLE), - D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE = - (1 << D3D12_COMMAND_LIST_TYPE_COMPUTE), - D3D12_COMMAND_LIST_SUPPORT_FLAG_COPY = (1 << D3D12_COMMAND_LIST_TYPE_COPY), - D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_DECODE = (1 << 4), - D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_PROCESS = (1 << 5) -} D3D12_COMMAND_LIST_SUPPORT_FLAGS; - -typedef enum D3D12_VIEW_INSTANCING_TIER { - D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED = 0, - D3D12_VIEW_INSTANCING_TIER_1 = 1, - D3D12_VIEW_INSTANCING_TIER_2 = 2, - D3D12_VIEW_INSTANCING_TIER_3 = 3 -} D3D12_VIEW_INSTANCING_TIER; - -typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3 { - BOOL CopyQueueTimestampQueriesSupported; - BOOL CastingFullyTypedFormatSupported; - DWORD WriteBufferImmediateSupportFlags; - D3D12_VIEW_INSTANCING_TIER ViewInstancingTier; - BOOL BarycentricsSupported; -} D3D12_FEATURE_DATA_D3D12_OPTIONS3; -#endif - -#ifndef NTDDI_WIN10_RS3 -#define NTDDI_WIN10_RS3 0x0A000004 -#endif - -#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS3 -#define D3D12_FEATURE_D3D12_OPTIONS4 ((D3D12_FEATURE)23) -typedef enum D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER { - D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0, - D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1, -} D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER; - -typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS4 { - BOOL ReservedBufferPlacementSupported; - D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier; - BOOL Native16BitShaderOpsSupported; -} D3D12_FEATURE_DATA_D3D12_OPTIONS4; -#endif - -#ifndef NTDDI_WIN10_RS4 -#define NTDDI_WIN10_RS4 0x0A000005 -#endif - -#if WDK_NTDDI_VERSION <= NTDDI_WIN10_RS4 -#define D3D12_FEATURE_D3D12_OPTIONS5 ((D3D12_FEATURE)27) -typedef enum D3D12_RENDER_PASS_TIER { - D3D12_RENDER_PASS_TIER_0 = 0, - D3D12_RENDER_PASS_TIER_1 = 1, - D3D12_RENDER_PASS_TIER_2 = 2 -} D3D12_RENDER_PASS_TIER; - -typedef enum D3D12_RAYTRACING_TIER { - D3D12_RAYTRACING_TIER_NOT_SUPPORTED = 0, - D3D12_RAYTRACING_TIER_1_0 = 10 D3D12_RAYTRACING_TIER_1_1 = 11 -} D3D12_RAYTRACING_TIER; - -typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS5 { - BOOL SRVOnlyTiledResourceTier3; - D3D12_RENDER_PASS_TIER RenderPassesTier; - D3D12_RAYTRACING_TIER RaytracingTier; -} D3D12_FEATURE_DATA_D3D12_OPTIONS5; -#endif - -#ifndef NTDDI_WIN10_VB -#define NTDDI_WIN10_VB 0x0A000008 -#endif - -#if WDK_NTDDI_VERSION < NTDDI_WIN10_VB -#define D3D12_FEATURE_D3D12_OPTIONS7 ((D3D12_FEATURE)32) - -typedef enum D3D12_MESH_SHADER_TIER { - D3D12_MESH_SHADER_TIER_NOT_SUPPORTED = 0, - D3D12_MESH_SHADER_TIER_1 = 10 -} D3D12_MESH_SHADER_TIER; - -typedef enum D3D12_SAMPLER_FEEDBACK_TIER { - D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED = 0, - D3D12_SAMPLER_FEEDBACK_TIER_0_9 = 90, - D3D12_SAMPLER_FEEDBACK_TIER_1_0 = 100 -} D3D12_SAMPLER_FEEDBACK_TIER; - -typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS7 { - D3D12_MESH_SHADER_TIER MeshShaderTier; - D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier; -} D3D12_FEATURE_DATA_D3D12_OPTIONS7; -#endif - -#ifndef NTDDI_WIN10_FE -#define NTDDI_WIN10_FE 0x0A00000A -#endif - -#if WDK_NTDDI_VERSION < NTDDI_WIN10_FE -#define D3D12_FEATURE_D3D12_OPTIONS9 ((D3D12_FEATURE)37) - -typedef enum D3D12_WAVE_MMA_TIER { - D3D12_WAVE_MMA_TIER_NOT_SUPPORTED = 0, - D3D12_WAVE_MMA_TIER_1_0 = 10 -} D3D12_WAVE_MMA_TIER; - -typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS9 { - BOOL MeshShaderPipelineStatsSupported; - BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex; - BOOL AtomicInt64OnTypedResourceSupported; - BOOL AtomicInt64OnGroupSharedSupported; - BOOL DerivativesInMeshAndAmplificationShadersSupported; - D3D12_WAVE_MMA_TIER WaveMMATier; -} D3D12_FEATURE_DATA_D3D12_OPTIONS9; -#endif - -#ifndef NTDDI_WIN10_NI -#define NTDDI_WIN10_NI 0x0A00000C -#endif - -#if WDK_NTDDI_VERSION <= NTDDI_WIN10_NI -#define D3D12_FEATURE_D3D12_OPTIONS14 ((D3D12_FEATURE)43) -typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS14 { - BOOL AdvancedTextureOpsSupported; - BOOL WriteableMSAATexturesSupported; - BOOL IndependentFrontAndBackStencilRefMaskSupported; -} D3D12_FEATURE_DATA_D3D12_OPTIONS14; -#endif - -#pragma warning(disable : 4063) -#define D3D12_RAYTRACING_TIER_1_1 ((D3D12_RAYTRACING_TIER)11) -#define D3D_SHADER_MODEL_6_1 ((D3D_SHADER_MODEL)0x61) -#define D3D_SHADER_MODEL_6_2 ((D3D_SHADER_MODEL)0x62) -#define D3D_SHADER_MODEL_6_3 ((D3D_SHADER_MODEL)0x63) -#define D3D_SHADER_MODEL_6_4 ((D3D_SHADER_MODEL)0x64) -#define D3D_SHADER_MODEL_6_5 ((D3D_SHADER_MODEL)0x65) -#define D3D_SHADER_MODEL_6_6 ((D3D_SHADER_MODEL)0x66) -#define D3D_SHADER_MODEL_6_7 ((D3D_SHADER_MODEL)0x67) -#define D3D_SHADER_MODEL_6_8 ((D3D_SHADER_MODEL)0x68) - #define DXEXP_HIGHEST_SHADER_MODEL D3D_SHADER_MODEL_6_8 static const char *BoolToStrJson(bool value) {