-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added implementation for ID3D12FunctionReflection1::GetDesc1 #6827
base: main
Are you sure you want to change the base?
Added implementation for ID3D12FunctionReflection1::GetDesc1 #6827
Conversation
You can test this locally with the following command:git-clang-format --diff 9018970f265e4152a4313044afc06818aa635a2a e24d9888d62efe13028436da81b15100a32b9c4b -- include/dxc/Support/D3DReflection.h include/dxc/Support/Unicode.h include/dxc/Test/D3DReflectionDumper.h include/dxc/Test/D3DReflectionStrings.h include/dxc/WinAdapter.h lib/DxcSupport/Unicode.cpp lib/DxcSupport/dxcapi.use.cpp lib/DxilContainer/D3DReflectionDumper.cpp lib/DxilContainer/D3DReflectionStrings.cpp lib/HLSL/DxilContainerReflection.cpp projects/dxilconv/tools/dxbc2dxil/dxbc2dxil.cpp tools/clang/include/clang/AST/Attr.h tools/clang/tools/dxa/dxa.cpp tools/clang/tools/dxcvalidator/dxcvalidator.cpp tools/clang/tools/dxr/dxr.cpp tools/clang/unittests/HLSLExec/ExecutionTest.cpp tools/clang/unittests/HLSLTestLib/FileCheckerTest.cpp tools/dxexp/dxexp.cpp View the diff from clang-format here.diff --git a/lib/HLSL/DxilContainerReflection.cpp b/lib/HLSL/DxilContainerReflection.cpp
index d0573d829..08f150990 100644
--- a/lib/HLSL/DxilContainerReflection.cpp
+++ b/lib/HLSL/DxilContainerReflection.cpp
@@ -2876,7 +2876,7 @@ public:
// Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)
(INT ParameterIndex) { return &g_InvalidFunctionParameter; }
-
+
STDMETHOD_(UINT64, GetRequiresFlags)() { return m_FeatureFlags; }
};
|
…ed some missing node information to the implementation.:
…_NODE_OVERRIDES_TYPE to ..._LAUNCH_TYPE
Hi - thank you for all your effort here! I just want to set appropriate expectations - this is a pretty large change adding a lot of new API surface area that we'll need to consider, taking into account future evolution of the language and compiler. As you may know we're hard at work adding HLSL support to clang, and so we need to consider the implications of a change that essentially exposes some amount of implementation details that may not be stable in the long term. Also, as we're focusing on clang, this means we have limited bandwidth for reviews of this nature, especially as we're in the middle of summer vacation season. So, be warned, it may take a while for us to find time to look at this properly. In the meantime, I suggest you have a look at CONTRIBUTING.md to make sure that you have all your ducks in a row ready for a successful review. For example, I think some tests may be required. Thanks again!
|
Sounds reasonable, though I'm not sure if you're referring to unit tests or that the tests are failing on this PR. |
I'm referring to unit tests with the code. From CONTRIBUTING.md:
|
…not really possible to change things in DirectX-Headers without a Windows SDK update... Removed stupid hacks in dxexp.cpp, which were there because d3d12.h comes from the windows SDK. Now that DirectX-Headers is required, d3d12.h comes from the DirectX-Headers, meaning that the structs & enums that were hardcoded are now not needed anymore. It can now happily use the same headers without relying on specific windows SDKs :)
Will take a look at Wednesday. Unexpectedly failing on remote. Also adding implementation for the reflection writer to know about these structs and output it as disassembly, along with a few unit tests. |
…com/Oxsomi/DirectXShaderCompiler into feat_query_all_function_properties3
…irectx headers have their own way of handling with it
…nted it in QueryInterface
…com/Oxsomi/DirectXShaderCompiler into feat_query_all_function_properties3
…on shaders numthreads to dxa.
…e. Also don't like an include named winadapter.h in a file named WinAdapter.h
…rt. Added CLSID_D3D12SDKConfiguration for older Windows sdks
…iler into feat_query_all_function_properties3
…on info (where it makes sense). Only unit tests that provide unique scenarios have been touched. Fixed some misformatting in D3DReflectionDumper. Apparently m_pProps can be NULL, so made it S_OK instead of E_FAIL. Fixed problem with GetInputNode/GetOutputNode where it returned a string pointer of a C++ struct which implictly copied due to not being const&.
… else. Changed it to use ShaderReflection1 and LibraryReflection1
… in checks, same for ShaderReflection1. Also fixed the RDAT3 in wavesize-compute-node-rdat.hlsl
…s_as.hlsl is compiled as lib_6_8
This should now be ready for review. Unless support in the disassembler is required, though I'm not sure how useful it would be since dxa and the unit testing tool both provide this functionality through D3DReflectionDumper. |
Added an important function to ID3D12FunctionReflection1; which is GetRequiresFlags such as in ID3D12ShaderReflection. Without this, it is impossible to find out what features are being used by a lib file (I thought the desc Flags was used for this, but nope). This is especially important now that some GPUs don't always support the base featureset, so I use the following to check feature support of the underlying GPUs:
I use this reflection to know whether a shader is really using a feature. It's possible someone enables I64 to include something that requires it but never actually uses I64 in the final shader. This is then used to retroactively disable that feature to ensure we don't go checking features that aren't really relevant. |
Relates to microsoft/DirectX-Headers#135.
I have tested this version in my own project and it seems to work. Only thing is that this requires the DirectX-Headers dep to be updated to ensure D3D12_FUNCTION_DESC1 and co can be found.