summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-07-06 15:38:12 +0800
committerGitHub <noreply@github.com>2023-07-06 15:38:12 +0800
commitb9ac4ace1133b12161faa70e61139cbdfc55db83 (patch)
tree69368e04952daa7760c71cef8369435a604de28c
parent6c7120d684cc46caafbe348d658158c0060a7638 (diff)
Assert on some resource creation in render-test-main (#2957)
-rw-r--r--tools/render-test/render-test-main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index 89f7db3aa..c79f7be24 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -605,9 +605,11 @@ void RenderTestApp::_initializeRenderPass()
ITransientResourceHeap::Desc transientHeapDesc = {};
transientHeapDesc.constantBufferSize = 4096 * 1024;
m_transientHeap = m_device->createTransientResourceHeap(transientHeapDesc);
+ SLANG_ASSERT(m_transientHeap);
ICommandQueue::Desc queueDesc = {ICommandQueue::QueueType::Graphics};
m_queue = m_device->createCommandQueue(queueDesc);
+ SLANG_ASSERT(m_queue);
gfx::ITextureResource::Desc depthBufferDesc;
depthBufferDesc.type = IResource::Type::Texture2D;
@@ -621,6 +623,7 @@ void RenderTestApp::_initializeRenderPass()
ComPtr<gfx::ITextureResource> depthBufferResource =
m_device->createTextureResource(depthBufferDesc, nullptr);
+ SLANG_ASSERT(depthBufferResource);
gfx::ITextureResource::Desc colorBufferDesc;
colorBufferDesc.type = IResource::Type::Texture2D;
@@ -632,6 +635,7 @@ void RenderTestApp::_initializeRenderPass()
colorBufferDesc.defaultState = ResourceState::RenderTarget;
colorBufferDesc.allowedStates = ResourceState::RenderTarget;
m_colorBuffer = m_device->createTextureResource(colorBufferDesc, nullptr);
+ SLANG_ASSERT(m_colorBuffer);
gfx::IResourceView::Desc colorBufferViewDesc = {};
memset(&colorBufferViewDesc, 0, sizeof(colorBufferViewDesc));
@@ -640,6 +644,7 @@ void RenderTestApp::_initializeRenderPass()
colorBufferViewDesc.type = gfx::IResourceView::Type::RenderTarget;
ComPtr<gfx::IResourceView> rtv =
m_device->createTextureView(m_colorBuffer.get(), colorBufferViewDesc);
+ SLANG_ASSERT(rtv);
gfx::IResourceView::Desc depthBufferViewDesc = {};
memset(&depthBufferViewDesc, 0, sizeof(depthBufferViewDesc));
@@ -648,6 +653,7 @@ void RenderTestApp::_initializeRenderPass()
depthBufferViewDesc.type = gfx::IResourceView::Type::DepthStencil;
ComPtr<gfx::IResourceView> dsv =
m_device->createTextureView(depthBufferResource.get(), depthBufferViewDesc);
+ SLANG_ASSERT(dsv);
IFramebufferLayout::TargetLayout colorTarget = {gfx::Format::R8G8B8A8_UNORM, 1};
IFramebufferLayout::TargetLayout depthTarget = {gfx::Format::D32_FLOAT, 1};