aboutsummaryrefslogtreecommitdiff
path: root/demo/d3d12/renderStateD3D12.h
diff options
context:
space:
mode:
authorMiles Macklin <[email protected]>2017-06-09 13:41:15 +1200
committerMiles Macklin <[email protected]>2017-06-09 13:41:15 +1200
commit688b5f42e9bfe498d7af7075d4d8f4429867f3a3 (patch)
tree7e0d0e7c95298f0418723abd92f61ac6e16b055e /demo/d3d12/renderStateD3D12.h
parentUpdate README.md (diff)
downloadflex-1.2.0.beta.1.tar.xz
flex-1.2.0.beta.1.zip
1.2.0.beta.11.2.0.beta.1
Diffstat (limited to 'demo/d3d12/renderStateD3D12.h')
-rw-r--r--demo/d3d12/renderStateD3D12.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/demo/d3d12/renderStateD3D12.h b/demo/d3d12/renderStateD3D12.h
new file mode 100644
index 0000000..1fb1f7d
--- /dev/null
+++ b/demo/d3d12/renderStateD3D12.h
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2008-2016, NVIDIA CORPORATION. All rights reserved.
+*
+* NVIDIA CORPORATION and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an express
+* license agreement from NVIDIA CORPORATION is strictly prohibited.
+*/
+
+#ifndef RENDER_STATE_D3D12_H
+#define RENDER_STATE_D3D12_H
+
+#include <NvCoDx12ResourceScopeManager.h>
+#include <NvCoDx12CircularResourceHeap.h>
+#include <NvCoDx12DescriptorHeap.h>
+#include "appD3D12Ctx.h"
+
+namespace NvCo = nvidia::Common;
+
+namespace FlexSample {
+using namespace nvidia;
+
+struct PipelineStateD3D12
+{
+ /// True if contents is all set and therefore 'valid'
+ inline bool isValid() const { return m_rootSignature && m_pipelineState; }
+
+ ComPtr<ID3D12RootSignature> m_rootSignature;
+ ComPtr<ID3D12PipelineState> m_pipelineState;
+};
+
+struct RenderStateD3D12
+{
+ AppGraphCtxD3D12* m_renderContext;
+
+ ID3D12Device* m_device;
+ ID3D12GraphicsCommandList* m_commandList;
+
+ NvCo::Dx12ResourceScopeManager* m_scopeManager; ///< Holds resources in scope
+ NvCo::Dx12DescriptorHeap* m_srvCbvUavDescriptorHeap; ///< Can hold cbv, srv, uavs
+ NvCo::Dx12DescriptorHeap* m_samplerDescriptorHeap; ///< Descriptor heap
+ NvCo::Dx12CircularResourceHeap* m_constantHeap; ///< Can hold transitory constant buffers, and vertex buffers
+ NvCo::Dx12CounterFence* m_fence; ///< Main fence to track lifetimes
+};
+
+struct RenderStateManagerD3D12
+{
+ RenderStateManagerD3D12():
+ m_renderContext(nullptr),
+ m_device(nullptr)
+ {}
+
+ int initialize(AppGraphCtxD3D12* renderContext, size_t maxHeapAlloc);
+
+ void onGpuWorkSubmitted(ID3D12CommandQueue* handle);
+ void updateCompleted();
+
+ /// Get the render state
+ RenderStateD3D12 getState();
+
+ AppGraphCtxD3D12* m_renderContext;
+ ID3D12Device* m_device;
+
+ NvCo::Dx12ResourceScopeManager m_scopeManager; ///< Holds resources in scope
+ NvCo::Dx12DescriptorHeap m_srvCbvUavDescriptorHeap; ///< Can hold cbv, srv, uavs
+ NvCo::Dx12DescriptorHeap m_samplerDescriptorHeap; ///< Holds sampler descriptions
+ NvCo::Dx12CircularResourceHeap m_constantHeap; ///< Can hold transitory constant buffers, and vertex buffers
+ NvCo::Dx12CounterFence m_fence; ///< Main fence to track lifetimes
+};
+
+} // namespace FlexSample
+
+#endif \ No newline at end of file