Default-initialize descriptor heaps to null (#82)

This commit is contained in:
Kai Ninomiya 2017-07-17 15:14:01 -04:00 committed by GitHub
parent 55ebc25c0f
commit 00349e6e36
4 changed files with 10 additions and 10 deletions

View File

@ -47,10 +47,10 @@ namespace d3d12 {
struct BindGroupStateTracker { struct BindGroupStateTracker {
uint32_t cbvSrvUavDescriptorIndex = 0; uint32_t cbvSrvUavDescriptorIndex = 0;
uint32_t samplerDescriptorIndex = 0; uint32_t samplerDescriptorIndex = 0;
DescriptorHeapHandle cbvSrvUavCPUDescriptorHeap; DescriptorHeapHandle cbvSrvUavCPUDescriptorHeap = {};
DescriptorHeapHandle samplerCPUDescriptorHeap; DescriptorHeapHandle samplerCPUDescriptorHeap = {};
DescriptorHeapHandle cbvSrvUavGPUDescriptorHeap; DescriptorHeapHandle cbvSrvUavGPUDescriptorHeap = {};
DescriptorHeapHandle samplerGPUDescriptorHeap; DescriptorHeapHandle samplerGPUDescriptorHeap = {};
std::array<BindGroup*, kMaxBindGroups> bindGroups = {}; std::array<BindGroup*, kMaxBindGroups> bindGroups = {};
Device* device; Device* device;

View File

@ -20,11 +20,12 @@
namespace backend { namespace backend {
namespace d3d12 { namespace d3d12 {
DescriptorHeapHandle::DescriptorHeapHandle() { DescriptorHeapHandle::DescriptorHeapHandle()
: descriptorHeap(nullptr), sizeIncrement(0), offset(0) {
} }
DescriptorHeapHandle::DescriptorHeapHandle(ComPtr<ID3D12DescriptorHeap> descriptorHeap, uint32_t sizeIncrement, uint32_t offset) DescriptorHeapHandle::DescriptorHeapHandle(ComPtr<ID3D12DescriptorHeap> descriptorHeap, uint32_t sizeIncrement, uint32_t offset)
: device(device), descriptorHeap(descriptorHeap), sizeIncrement(sizeIncrement), offset(offset) { : descriptorHeap(descriptorHeap), sizeIncrement(sizeIncrement), offset(offset) {
} }
ID3D12DescriptorHeap* DescriptorHeapHandle::Get() const { ID3D12DescriptorHeap* DescriptorHeapHandle::Get() const {

View File

@ -37,7 +37,6 @@ namespace d3d12 {
D3D12_GPU_DESCRIPTOR_HANDLE GetGPUHandle(uint32_t index) const; D3D12_GPU_DESCRIPTOR_HANDLE GetGPUHandle(uint32_t index) const;
private: private:
Device* device;
ComPtr<ID3D12DescriptorHeap> descriptorHeap; ComPtr<ID3D12DescriptorHeap> descriptorHeap;
uint32_t sizeIncrement; uint32_t sizeIncrement;
uint32_t offset; uint32_t offset;

View File

@ -40,9 +40,9 @@ namespace d3d12 {
OMSetRenderTargetArgs GetSubpassOMSetRenderTargetArgs(uint32_t subpassIndex); OMSetRenderTargetArgs GetSubpassOMSetRenderTargetArgs(uint32_t subpassIndex);
private: private:
Device* device; Device* device = nullptr;
DescriptorHeapHandle rtvHeap; DescriptorHeapHandle rtvHeap = {};
DescriptorHeapHandle dsvHeap; DescriptorHeapHandle dsvHeap = {};
// Indices into either the RTV or DSV heap, depending on texture format. // Indices into either the RTV or DSV heap, depending on texture format.
std::vector<uint32_t> attachmentHeapIndices; std::vector<uint32_t> attachmentHeapIndices;