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 {
uint32_t cbvSrvUavDescriptorIndex = 0;
uint32_t samplerDescriptorIndex = 0;
DescriptorHeapHandle cbvSrvUavCPUDescriptorHeap;
DescriptorHeapHandle samplerCPUDescriptorHeap;
DescriptorHeapHandle cbvSrvUavGPUDescriptorHeap;
DescriptorHeapHandle samplerGPUDescriptorHeap;
DescriptorHeapHandle cbvSrvUavCPUDescriptorHeap = {};
DescriptorHeapHandle samplerCPUDescriptorHeap = {};
DescriptorHeapHandle cbvSrvUavGPUDescriptorHeap = {};
DescriptorHeapHandle samplerGPUDescriptorHeap = {};
std::array<BindGroup*, kMaxBindGroups> bindGroups = {};
Device* device;

View File

@ -20,11 +20,12 @@
namespace backend {
namespace d3d12 {
DescriptorHeapHandle::DescriptorHeapHandle() {
DescriptorHeapHandle::DescriptorHeapHandle()
: descriptorHeap(nullptr), sizeIncrement(0), offset(0) {
}
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 {

View File

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

View File

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