summaryrefslogtreecommitdiffstats
path: root/tools/gfx/immediate-renderer-base.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-12-13 09:57:56 -0800
committerGitHub <noreply@github.com>2021-12-13 09:57:56 -0800
commit3359313620cd57b8404f95cfe7b07cce514eff71 (patch)
tree8f7edee5b23ca0345ce7ac62b54a9726c84752bf /tools/gfx/immediate-renderer-base.cpp
parentc1064a263350ee6042625bf368a97f7fe94dcd39 (diff)
gfx: use uint32_t in draw calls and implement current size query. (#2055)
* gfx: Implement remaining resource commands on D3D12. Includes: `textureBarrier`, `copyTexture`, `uploadTextureData`, `copyTextureToBuffer`, and `textureSubresourceBarrier`. * gfx: Implement `CurrentSize` query. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/immediate-renderer-base.cpp')
-rw-r--r--tools/gfx/immediate-renderer-base.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/tools/gfx/immediate-renderer-base.cpp b/tools/gfx/immediate-renderer-base.cpp
index df46cc200..f302a1d89 100644
--- a/tools/gfx/immediate-renderer-base.cpp
+++ b/tools/gfx/immediate-renderer-base.cpp
@@ -116,29 +116,30 @@ public:
m_writer->setPrimitiveTopology(topology);
}
virtual SLANG_NO_THROW void SLANG_MCALL setVertexBuffers(
- UInt startSlot,
- UInt slotCount,
+ uint32_t startSlot,
+ uint32_t slotCount,
IBufferResource* const* buffers,
- const UInt* strides,
- const UInt* offsets) override
+ const uint32_t* strides,
+ const uint32_t* offsets) override
{
m_writer->setVertexBuffers(startSlot, slotCount, buffers, strides, offsets);
}
virtual SLANG_NO_THROW void SLANG_MCALL
- setIndexBuffer(IBufferResource* buffer, Format indexFormat, UInt offset) override
+ setIndexBuffer(IBufferResource* buffer, Format indexFormat, uint32_t offset) override
{
m_writer->setIndexBuffer(buffer, indexFormat, offset);
}
- virtual SLANG_NO_THROW void SLANG_MCALL draw(UInt vertexCount, UInt startVertex) override
+ virtual SLANG_NO_THROW void SLANG_MCALL
+ draw(uint32_t vertexCount, uint32_t startVertex) override
{
m_writer->bindRootShaderObject(m_commandBuffer->m_rootShaderObject);
m_writer->draw(vertexCount, startVertex);
}
virtual SLANG_NO_THROW void SLANG_MCALL
- drawIndexed(UInt indexCount, UInt startIndex, UInt baseVertex) override
+ drawIndexed(uint32_t indexCount, uint32_t startIndex, uint32_t baseVertex) override
{
m_writer->bindRootShaderObject(m_commandBuffer->m_rootShaderObject);
m_writer->drawIndexed(indexCount, startIndex, baseVertex);
@@ -196,10 +197,10 @@ public:
}
virtual SLANG_NO_THROW void SLANG_MCALL drawInstanced(
- UInt vertexCount,
- UInt instanceCount,
- UInt startVertex,
- UInt startInstanceLocation) override
+ uint32_t vertexCount,
+ uint32_t instanceCount,
+ uint32_t startVertex,
+ uint32_t startInstanceLocation) override
{
SLANG_UNUSED(vertexCount);
SLANG_UNUSED(instanceCount);
@@ -496,11 +497,11 @@ public:
m_writer.getObject<BufferResource>(cmd.operands[2] + i));
}
m_renderer->setVertexBuffers(
- (UInt)cmd.operands[0],
- (UInt)cmd.operands[1],
+ cmd.operands[0],
+ cmd.operands[1],
bufferResources.getArrayView().getBuffer(),
- m_writer.getData<UInt>(cmd.operands[3]),
- m_writer.getData<UInt>(cmd.operands[4]));
+ m_writer.getData<uint32_t>(cmd.operands[3]),
+ m_writer.getData<uint32_t>(cmd.operands[4]));
}
break;
case CommandName::SetIndexBuffer:
@@ -510,11 +511,11 @@ public:
(UInt)cmd.operands[2]);
break;
case CommandName::Draw:
- m_renderer->draw((UInt)cmd.operands[0], (UInt)cmd.operands[1]);
+ m_renderer->draw(cmd.operands[0], cmd.operands[1]);
break;
case CommandName::DrawIndexed:
m_renderer->drawIndexed(
- (UInt)cmd.operands[0], (UInt)cmd.operands[1], (UInt)cmd.operands[2]);
+ cmd.operands[0], cmd.operands[1], cmd.operands[2]);
break;
case CommandName::SetStencilReference:
m_renderer->setStencilReference(cmd.operands[0]);