diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-02-05 21:00:12 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-05 21:00:12 -0800 |
| commit | 3527f0975f671a693a0b7c59d80c6749c385b841 (patch) | |
| tree | e02b26d4f380f6c6e43541d7a59f55c40876895a /tools/render-test | |
| parent | d8a8559a5baebb81361b15cf86d28c9e8019b177 (diff) | |
Enable D3D12 experimental feature to use coopvec (#6290)
This commit enables "D3D12-experimenta-feature" in render-test.
This is required to use CoopVec feature with dxcompiler.dll.
But it is enabled only when "-dx12-experimental" is used, because it appears that DX12 becomes unstable when the experimental feature is enabled, which causes bunch of tests randomly failing.
Diffstat (limited to 'tools/render-test')
| -rw-r--r-- | tools/render-test/options.cpp | 4 | ||||
| -rw-r--r-- | tools/render-test/options.h | 2 | ||||
| -rw-r--r-- | tools/render-test/render-test-main.cpp | 18 |
3 files changed, 24 insertions, 0 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp index ce438046a..11b291c68 100644 --- a/tools/render-test/options.cpp +++ b/tools/render-test/options.cpp @@ -253,6 +253,10 @@ static rhi::DeviceType _toRenderType(Slang::RenderApiType apiType) { outOptions.enableBackendValidation = true; } + else if (argValue == "-dx12-experimental") + { + outOptions.dx12Experimental = true; + } else { // Lookup diff --git a/tools/render-test/options.h b/tools/render-test/options.h index 9a30030f7..c95edee21 100644 --- a/tools/render-test/options.h +++ b/tools/render-test/options.h @@ -89,6 +89,8 @@ struct Options bool enableBackendValidation = false; + bool dx12Experimental = false; + Options() { downstreamArgs.addName("slang"); } static SlangResult parse( diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index a8bd00bd4..a167a4a27 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -13,6 +13,10 @@ #include "slang-support.h" #include "window.h" +#if defined(_WIN32) +#include <d3d12.h> +#endif + #include <slang-rhi.h> #include <slang-rhi/acceleration-structure-utils.h> #include <slang-rhi/shader-cursor.h> @@ -1391,6 +1395,20 @@ static SlangResult _innerMain( desc.requiredFeatures = requiredFeatureList.getBuffer(); desc.requiredFeatureCount = (int)requiredFeatureList.getCount(); +#if defined(_WIN32) + // When the experimental feature is enabled, things become unstable. + // It is enabled only when requested. + D3D12ExperimentalFeaturesDesc experimentalFD = {}; + UUID features[1] = {D3D12ExperimentalShaderModels}; + experimentalFD.featureCount = 1; + experimentalFD.featureIIDs = features; + experimentalFD.configurationStructs = nullptr; + experimentalFD.configurationStructSizes = nullptr; + + if (options.dx12Experimental) + desc.next = &experimentalFD; +#endif + // Look for args going to slang { const auto& args = options.downstreamArgs.getArgsByName("slang"); |
