-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
198 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
diff --git a/src/openclon12/device.hpp b/src/openclon12/device.hpp | ||
index 05ce280..0600ace 100644 | ||
--- a/src/openclon12/device.hpp | ||
+++ b/src/openclon12/device.hpp | ||
@@ -7,7 +7,7 @@ | ||
#include <vector> | ||
#include <mutex> | ||
|
||
-#include "ImmediateContext.hpp" | ||
+#include <D3D12TranslationLayerIncludes.h> | ||
using ImmCtx = D3D12TranslationLayer::ImmediateContext; | ||
|
||
class Task; | ||
diff --git a/src/openclon12/platform.hpp b/src/openclon12/platform.hpp | ||
index d29c17a..56d5625 100644 | ||
--- a/src/openclon12/platform.hpp | ||
+++ b/src/openclon12/platform.hpp | ||
@@ -13,6 +13,14 @@ | ||
#define CL_TARGET_OPENCL_VERSION 300 | ||
#define CLON12_SUPPORT_3_0 1 | ||
|
||
+#include <atlbase.h> | ||
+#include <comdef.h> | ||
+#include <d3d11_3.h> | ||
+#include <dxgi1_4.h> | ||
+#include <d3d11on12.h> | ||
+#include <d3d12compatibility.h> | ||
+#include <d3dkmthk.h> | ||
+#include <d3d12video.h> | ||
#include <directx/d3dx12.h> | ||
#include <directx/dxcore.h> | ||
|
||
@@ -30,6 +38,13 @@ | ||
#include <atomic> | ||
#include <map> | ||
#include <algorithm> | ||
+#include <functional> | ||
+#include <mutex> | ||
+#include <bitset> | ||
+#include <deque> | ||
+#include <queue> | ||
+#include <optional> | ||
+#include <set> | ||
#ifndef assert | ||
#include <assert.h> | ||
#endif | ||
@@ -42,7 +57,7 @@ using Microsoft::WRL::ComPtr; | ||
|
||
#define WIL_ENABLE_EXCEPTIONS | ||
#include <wil/result_macros.h> | ||
-#include "XPlatHelpers.h" | ||
+#include <D3D12TranslationLayerIncludes.h> | ||
|
||
#include <scheduler.hpp> | ||
|
||
diff --git a/src/openclon12/gl_tasks.cpp b/src/openclon12/gl_tasks.cpp | ||
index 891bcd6..0d4b2a2 100644 | ||
--- a/src/openclon12/gl_tasks.cpp | ||
+++ b/src/openclon12/gl_tasks.cpp | ||
@@ -188,7 +188,6 @@ private: | ||
TransitionResource(res->GetActiveUnderlyingResource(), | ||
D3D12_RESOURCE_STATE_COMMON, | ||
D3D12TranslationLayer::SubresourceTransitionFlags::StateMatchExact | | ||
- D3D12TranslationLayer::SubresourceTransitionFlags::ForceWriteState | | ||
D3D12TranslationLayer::SubresourceTransitionFlags::NotUsedInCommandListIfNoStateChange); | ||
} | ||
ImmCtx.GetResourceStateManager().ApplyAllResourceTransitions(); | ||
diff --git a/src/openclon12/kernel_tasks.cpp b/src/openclon12/kernel_tasks.cpp | ||
index 7de0674..9134b96 100644 | ||
--- a/src/openclon12/kernel_tasks.cpp | ||
+++ b/src/openclon12/kernel_tasks.cpp | ||
@@ -653,8 +653,8 @@ void ExecuteKernel::RecordImpl() | ||
SrcDescriptors.reserve(std::max(NumViewDescriptors - 2, NumSamplerDescriptors)); | ||
|
||
ID3D12GraphicsCommandList *pCmdList = ImmCtx.GetGraphicsCommandList(); | ||
- pCmdList->SetComputeRootSignature(m_Specialized->m_RS->GetForUse()); | ||
- pCmdList->SetPipelineState(m_Specialized->m_PSO->GetForUse()); | ||
+ //pCmdList->SetComputeRootSignature(m_Specialized->m_RS->GetForUse()); | ||
+ //pCmdList->SetPipelineState(m_Specialized->m_PSO->GetForUse()); | ||
|
||
if (NumSamplerDescriptors) | ||
{ | ||
@@ -681,7 +681,7 @@ void ExecuteKernel::RecordImpl() | ||
} | ||
else | ||
{ | ||
- SrcDescriptors.push_back(ImmCtx.m_NullUAV); | ||
+ //SrcDescriptors.push_back(ImmCtx.m_NullUAV); | ||
} | ||
} | ||
for (auto &SrvRes : m_KernelArgSRVs) | ||
@@ -697,7 +697,7 @@ void ExecuteKernel::RecordImpl() | ||
else | ||
{ | ||
// CL doesn't provide defined behavior for accessing a null texture so it doesn't matter what this is. | ||
- SrcDescriptors.push_back(ImmCtx.m_NullUAV); | ||
+ //SrcDescriptors.push_back(ImmCtx.m_NullUAV); | ||
} | ||
} | ||
if (m_PrintfUAV.Get()) | ||
diff --git a/src/openclon12/platform.hpp b/src/openclon12/platform.hpp | ||
index 56d5625..fb2fc67 100644 | ||
--- a/src/openclon12/platform.hpp | ||
+++ b/src/openclon12/platform.hpp | ||
@@ -21,6 +21,7 @@ | ||
#include <d3d12compatibility.h> | ||
#include <d3dkmthk.h> | ||
#include <d3d12video.h> | ||
+#include <TraceLoggingProvider.h> | ||
#include <directx/d3dx12.h> | ||
#include <directx/dxcore.h> | ||
|
||
@@ -58,6 +59,7 @@ using Microsoft::WRL::ComPtr; | ||
#define WIL_ENABLE_EXCEPTIONS | ||
#include <wil/result_macros.h> | ||
#include <D3D12TranslationLayerIncludes.h> | ||
+#include <D3D12TranslationLayerDependencyIncludes.h> | ||
|
||
#include <scheduler.hpp> | ||
|
||
diff --git a/src/openclon12/task.cpp b/src/openclon12/task.cpp | ||
index d1cfd51..3db0e2d 100644 | ||
--- a/src/openclon12/task.cpp | ||
+++ b/src/openclon12/task.cpp | ||
@@ -401,8 +401,8 @@ void Task::Record() | ||
try | ||
{ | ||
// TODO: Maybe share a start timestamp with the end of the previous command? | ||
- m_StartTimestamp.reset(new D3D12TranslationLayer::TimestampQuery(pImmCtx)); | ||
- m_StopTimestamp.reset(new D3D12TranslationLayer::TimestampQuery(pImmCtx)); | ||
+ m_StartTimestamp.reset(new D3D12TranslationLayer::Query(pImmCtx, D3D12TranslationLayer::EQueryType::e_QUERY_TIMESTAMP, 0)); | ||
+ m_StopTimestamp.reset(new D3D12TranslationLayer::Query(pImmCtx, D3D12TranslationLayer::EQueryType::e_QUERY_TIMESTAMP, 0)); | ||
} | ||
catch(...) { /* Do nothing, just don't capture timestamps */ } | ||
} | ||
@@ -623,13 +623,13 @@ void Task::Complete(cl_int error, TaskPoolLock const& lock) | ||
UINT64 GPUTimestamp; | ||
if (m_StartTimestamp) | ||
{ | ||
- GPUTimestamp = m_StartTimestamp->GetData(); | ||
+ //GPUTimestamp = m_StartTimestamp->GetData(); | ||
GetTimestamp(CL_PROFILING_COMMAND_START) = | ||
TimestampToNanoseconds(GPUTimestamp, Frequency) + m_D3DDevice->GPUToQPCTimestampOffset(); | ||
} | ||
if (m_StopTimestamp) | ||
{ | ||
- GPUTimestamp = m_StopTimestamp->GetData(); | ||
+ //GPUTimestamp = m_StopTimestamp->GetData(); | ||
GetTimestamp(CL_PROFILING_COMMAND_END) = | ||
TimestampToNanoseconds(GPUTimestamp, Frequency) + m_D3DDevice->GPUToQPCTimestampOffset(); | ||
} | ||
diff --git a/src/openclon12/task.hpp b/src/openclon12/task.hpp | ||
index bf4674a..4b163e9 100644 | ||
--- a/src/openclon12/task.hpp | ||
+++ b/src/openclon12/task.hpp | ||
@@ -135,8 +135,8 @@ protected: | ||
std::promise<void> m_CompletionPromise; | ||
std::future<void> m_CompletionFuture{ m_CompletionPromise.get_future() }; | ||
|
||
- std::shared_ptr<D3D12TranslationLayer::TimestampQuery> m_StartTimestamp; | ||
- std::shared_ptr<D3D12TranslationLayer::TimestampQuery> m_StopTimestamp; | ||
+ std::shared_ptr<D3D12TranslationLayer::Query> m_StartTimestamp; | ||
+ std::shared_ptr<D3D12TranslationLayer::Query> m_StopTimestamp; | ||
}; | ||
|
||
class UserEvent : public Task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters