As the title suggests, I am enabling the depth checking on my PSO, which for some reason that I cannot figure out, nothing draws to the screen. If depth is false, I am able to see everything drawn to the screen, albeit, with behind data showing through.
Here is my code related to my depth buffer.
D3D12_RESOURCE_DESC desc{ .Dimension = D3D12_RESOURCE_DIMENSION::D3D12_RESOURCE_DIMENSION_TEXTURE2D,
.Alignment = 0,
.Width = m_width,
.Height = m_height,
.DepthOrArraySize = 1,
.MipLevels = 1,
.Format = DXGI_FORMAT::DXGI_FORMAT_D24_UNORM_S8_UINT,
.SampleDesc = { .Count = 1, .Quality = 0 },
.Layout = D3D12_TEXTURE_LAYOUT::D3D12_TEXTURE_LAYOUT_UNKNOWN,
.Flags = D3D12_RESOURCE_FLAGS::D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL };
D3D12_CLEAR_VALUE clearValue{ .Format = DXGI_FORMAT::DXGI_FORMAT_D24_UNORM_S8_UINT, .DepthStencil = { .Depth = 1.f, .Stencil = 0 } };
dxAssertResult(m_device->CreateCommittedResource(&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT),
D3D12_HEAP_FLAG_NONE,
&desc,
D3D12_RESOURCE_STATE_DEPTH_WRITE,
&clearValue,
TNT_IID_PPV_ARGS(m_depthBuffer.GetAddressOf())));
m_depthBuffer->SetName(L"MainDepthBuffer");
// Returns a handle that contains one descriptor.
m_dsvHandleManager = CPUDXDescriptorHeap::allocateDescriptors(m_device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_DSV, 1);
// m_dsvHandleManager.getHandle().CPUHandle returns the same handle every time it is called
m_device->CreateDepthStencilView(m_depthBuffer.Get(), nullptr, m_dsvHandleManager.getHandle().CPUHandle);
m_commandList->ClearDepthStencilView(m_dsvHandleManager.getHandle().CPUHandle, D3D12_CLEAR_FLAG_DEPTH, 1.f, 0, 0, nullptr);
m_commandList->OMSetRenderTargets(1, &renderTargetView, false, &depthStencilView);