diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-09-13 15:59:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-13 15:59:15 -0400 |
| commit | c2e5d2468ad6a38cdb8a067da0678302f6cc6066 (patch) | |
| tree | 97c448d28e54068d84c422e9f172996b7a95f1ed /tools/gfx/descriptor-heap-d3d12.cpp | |
| parent | 0b6321b3f08c48e37e6b8256d420f05d9727fb5a (diff) | |
Refactor render-test to make cross platform (#1053)
* First pass of render-test refactor.
* Make window construction a function that can choose an implementation.
* Remove OpenGL as currently has windows dependency.
* Disable Vulkan as Renderer impl has dependency on windows.
* Pass Window in as parameter of 'update'.
* Add win-window.cpp as was missing.
* Fix warning on windows about signs during comparison.
Diffstat (limited to 'tools/gfx/descriptor-heap-d3d12.cpp')
| -rw-r--r-- | tools/gfx/descriptor-heap-d3d12.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/tools/gfx/descriptor-heap-d3d12.cpp b/tools/gfx/descriptor-heap-d3d12.cpp deleted file mode 100644 index 382fc3219..000000000 --- a/tools/gfx/descriptor-heap-d3d12.cpp +++ /dev/null @@ -1,47 +0,0 @@ - -#include "descriptor-heap-d3d12.h" - -namespace gfx { -using namespace Slang; - -D3D12DescriptorHeap::D3D12DescriptorHeap(): - m_totalSize(0), - m_currentIndex(0), - m_descriptorSize(0) -{ -} - -Result D3D12DescriptorHeap::init(ID3D12Device* device, int size, D3D12_DESCRIPTOR_HEAP_TYPE type, D3D12_DESCRIPTOR_HEAP_FLAGS flags) -{ - D3D12_DESCRIPTOR_HEAP_DESC srvHeapDesc = {}; - srvHeapDesc.NumDescriptors = size; - srvHeapDesc.Flags = flags; - srvHeapDesc.Type = type; - SLANG_RETURN_ON_FAIL(device->CreateDescriptorHeap(&srvHeapDesc, IID_PPV_ARGS(m_heap.writeRef()))); - - m_descriptorSize = device->GetDescriptorHandleIncrementSize(type); - m_totalSize = size; - - return SLANG_OK; -} - -Result D3D12DescriptorHeap::init(ID3D12Device* device, const D3D12_CPU_DESCRIPTOR_HANDLE* handles, int numHandles, D3D12_DESCRIPTOR_HEAP_TYPE type, D3D12_DESCRIPTOR_HEAP_FLAGS flags) -{ - SLANG_RETURN_ON_FAIL(init(device, numHandles, type, flags)); - D3D12_CPU_DESCRIPTOR_HANDLE dst = m_heap->GetCPUDescriptorHandleForHeapStart(); - - // Copy them all - for (int i = 0; i < numHandles; i++, dst.ptr += m_descriptorSize) - { - D3D12_CPU_DESCRIPTOR_HANDLE src = handles[i]; - if (src.ptr != 0) - { - device->CopyDescriptorsSimple(1, dst, src, type); - } - } - - return SLANG_OK; -} - -} // namespace gfx - |
