Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enable D3D12 experimental feature to use coopvec #6290

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/render-test/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ static rhi::DeviceType _toRenderType(Slang::RenderApiType apiType)
{
outOptions.enableBackendValidation = true;
}
else if (argValue == "-dx12-experimental")
{
outOptions.dx12Experimental = true;
}
else
{
// Lookup
Expand Down
2 changes: 2 additions & 0 deletions tools/render-test/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ struct Options

bool enableBackendValidation = false;

bool dx12Experimental = false;

Options() { downstreamArgs.addName("slang"); }

static SlangResult parse(
Expand Down
18 changes: 18 additions & 0 deletions tools/render-test/render-test-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#include "slang-support.h"
#include "window.h"

#if defined(_WIN32)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this include needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is needed for the type UUID.

#include <d3d12.h>
#endif

#include <slang-rhi.h>
#include <slang-rhi/acceleration-structure-utils.h>
#include <slang-rhi/shader-cursor.h>
Expand Down Expand Up @@ -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");
Expand Down
Loading