|
@@ -86,24 +86,6 @@ static bool contains(InputIterator b, InputIterator e, const T &val) {
|
|
|
return e != std::find(b, e, val);
|
|
|
}
|
|
|
|
|
|
-static HRESULT EnableExperimentalShaderModels() {
|
|
|
- HMODULE hRuntime = LoadLibraryW(L"d3d12.dll");
|
|
|
- if (hRuntime == NULL) {
|
|
|
- return HRESULT_FROM_WIN32(GetLastError());
|
|
|
- }
|
|
|
-
|
|
|
- D3D12EnableExperimentalFeaturesFn pD3D12EnableExperimentalFeatures =
|
|
|
- (D3D12EnableExperimentalFeaturesFn)GetProcAddress(hRuntime, "D3D12EnableExperimentalFeatures");
|
|
|
- if (pD3D12EnableExperimentalFeatures == nullptr) {
|
|
|
- FreeLibrary(hRuntime);
|
|
|
- return HRESULT_FROM_WIN32(GetLastError());
|
|
|
- }
|
|
|
-
|
|
|
- HRESULT hr = pD3D12EnableExperimentalFeatures(1, &D3D12ExperimentalShaderModelsID, nullptr, nullptr);
|
|
|
- FreeLibrary(hRuntime);
|
|
|
- return hr;
|
|
|
-}
|
|
|
-
|
|
|
static HRESULT ReportLiveObjects() {
|
|
|
CComPtr<IDXGIDebug1> pDebug;
|
|
|
IFR(DXGIGetDebugInterface1(0, IID_PPV_ARGS(&pDebug)));
|
|
@@ -461,6 +443,29 @@ public:
|
|
|
|
|
|
const float ClearColor[4] = { 0.0f, 0.2f, 0.4f, 1.0f };
|
|
|
|
|
|
+ bool DivergentClassSetup() {
|
|
|
+ HRESULT hr;
|
|
|
+ hr = EnableExperimentalMode();
|
|
|
+ if (FAILED(hr)) {
|
|
|
+ LogCommentFmt(L"Unable to enable shader experimental mode - 0x%08x.", hr);
|
|
|
+ } else if (hr == S_FALSE) {
|
|
|
+ LogCommentFmt(L"Experimental mode not enabled.");
|
|
|
+ } else {
|
|
|
+ LogCommentFmt(L"Experimental mode enabled.");
|
|
|
+ }
|
|
|
+
|
|
|
+ hr = EnableDebugLayer();
|
|
|
+ if (FAILED(hr)) {
|
|
|
+ LogCommentFmt(L"Unable to enable debug layer - 0x%08x.", hr);
|
|
|
+ } else if (hr == S_FALSE) {
|
|
|
+ LogCommentFmt(L"Debug layer not enabled.");
|
|
|
+ } else {
|
|
|
+ LogCommentFmt(L"Debug layer enabled.");
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
// Do not remove the following line - it is used by TranslateExecutionTest.py
|
|
|
// MARKER: ExecutionTest/DxilConf Shared Implementation Start
|
|
|
|
|
@@ -1280,7 +1285,26 @@ public:
|
|
|
return hr;
|
|
|
}
|
|
|
|
|
|
-#ifndef _HLK_CONF
|
|
|
+ static HRESULT EnableExperimentalShaderModels() {
|
|
|
+ HMODULE hRuntime = LoadLibraryW(L"d3d12.dll");
|
|
|
+ if (hRuntime == NULL) {
|
|
|
+ return HRESULT_FROM_WIN32(GetLastError());
|
|
|
+ }
|
|
|
+
|
|
|
+ D3D12EnableExperimentalFeaturesFn pD3D12EnableExperimentalFeatures =
|
|
|
+ (D3D12EnableExperimentalFeaturesFn)GetProcAddress(
|
|
|
+ hRuntime, "D3D12EnableExperimentalFeatures");
|
|
|
+ if (pD3D12EnableExperimentalFeatures == nullptr) {
|
|
|
+ FreeLibrary(hRuntime);
|
|
|
+ return HRESULT_FROM_WIN32(GetLastError());
|
|
|
+ }
|
|
|
+
|
|
|
+ HRESULT hr = pD3D12EnableExperimentalFeatures(
|
|
|
+ 1, &D3D12ExperimentalShaderModelsID, nullptr, nullptr);
|
|
|
+ FreeLibrary(hRuntime);
|
|
|
+ return hr;
|
|
|
+ }
|
|
|
+
|
|
|
HRESULT EnableExperimentalMode() {
|
|
|
if (m_ExperimentalModeEnabled) {
|
|
|
return S_OK;
|
|
@@ -1294,7 +1318,6 @@ public:
|
|
|
}
|
|
|
return hr;
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
struct FenceObj {
|
|
|
HANDLE m_fenceEvent = NULL;
|
|
@@ -1432,35 +1455,7 @@ static void SetupComputeValuePattern(std::vector<uint32_t> &values,
|
|
|
}
|
|
|
|
|
|
bool ExecutionTest::ExecutionTestClassSetup() {
|
|
|
-#ifdef _HLK_CONF
|
|
|
-// TODO: Enabling the D3D driver verifier. Check out the logic in the D3DConf_12_Core test.
|
|
|
- VERIFY_SUCCEEDED(m_support.Initialize());
|
|
|
- m_UseWarp = hlsl_test::GetTestParamUseWARP(false);
|
|
|
- m_EnableDebugLayer = hlsl_test::GetTestParamBool(L"DebugLayer");
|
|
|
- if (m_EnableDebugLayer) {
|
|
|
- EnableDebugLayer();
|
|
|
- }
|
|
|
- return true;
|
|
|
-#else
|
|
|
- HRESULT hr = EnableExperimentalMode();
|
|
|
- if (FAILED(hr)) {
|
|
|
- LogCommentFmt(L"Unable to enable shader experimental mode - 0x%08x.", hr);
|
|
|
- }
|
|
|
- else if (hr == S_FALSE) {
|
|
|
- LogCommentFmt(L"Experimental mode not enabled.");
|
|
|
- }
|
|
|
- else {
|
|
|
- LogCommentFmt(L"Experimental mode enabled.");
|
|
|
- }
|
|
|
- hr = EnableDebugLayer();
|
|
|
- if (FAILED(hr)) {
|
|
|
- LogCommentFmt(L"Unable to enable debug layer - 0x%08x.", hr);
|
|
|
- }
|
|
|
- else {
|
|
|
- LogCommentFmt(L"Debug layer enabled.");
|
|
|
- }
|
|
|
- return true;
|
|
|
-#endif
|
|
|
+ return DivergentClassSetup();
|
|
|
}
|
|
|
|
|
|
void ExecutionTest::RunRWByteBufferComputeTest(ID3D12Device *pDevice, LPCSTR pShader, std::vector<uint32_t> &values) {
|
|
@@ -9570,7 +9565,7 @@ static void WriteReadBackDump(st::ShaderOp *pShaderOp, st::ShaderOpTest *pTest,
|
|
|
// It's exclusive with the use of the DLL as a TAEF target.
|
|
|
extern "C" {
|
|
|
__declspec(dllexport) HRESULT WINAPI InitializeOpTests(void *pStrCtx, st::OutputStringFn pOutputStrFn) {
|
|
|
- HRESULT hr = EnableExperimentalShaderModels();
|
|
|
+ HRESULT hr = ExecutionTest::EnableExperimentalShaderModels();
|
|
|
if (FAILED(hr)) {
|
|
|
pOutputStrFn(pStrCtx, L"Unable to enable experimental shader models.\r\n.");
|
|
|
}
|