summaryrefslogtreecommitdiffstats
path: root/tools/gfx/cuda
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-11-04 09:40:56 -0700
committerGitHub <noreply@github.com>2021-11-04 09:40:56 -0700
commit8fe3f9cd7d664fc98e33cf276427390b42b9b468 (patch)
tree2e920085fc82f45befef0c438357596e3d159e82 /tools/gfx/cuda
parentaf0f26d54ce39b6d7203646abd6e970b8113584c (diff)
Add interface for new gfx features. (#2003)
* Add interface for new gfx features. * Add cuda implementation. * Code review fixes. * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/cuda')
-rw-r--r--tools/gfx/cuda/render-cuda.cpp55
1 files changed, 53 insertions, 2 deletions
diff --git a/tools/gfx/cuda/render-cuda.cpp b/tools/gfx/cuda/render-cuda.cpp
index 47c309d34..c7b16fc66 100644
--- a/tools/gfx/cuda/render-cuda.cpp
+++ b/tools/gfx/cuda/render-cuda.cpp
@@ -946,6 +946,13 @@ public:
return SLANG_OK;
}
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ bindPipelineAndRootObject(IPipelineState* state, IShaderObject* rootObject) override
+ {
+ SLANG_UNIMPLEMENTED_X("bindPipelineAndRootObject");
+ return SLANG_E_NOT_AVAILABLE;
+ }
+
virtual SLANG_NO_THROW void SLANG_MCALL dispatchCompute(int x, int y, int z) override
{
m_writer->bindRootShaderObject(m_rootObject);
@@ -956,6 +963,12 @@ public:
{
m_writer->writeTimestamp(pool, index);
}
+
+ virtual SLANG_NO_THROW void SLANG_MCALL
+ dispatchComputeIndirect(IBufferResource* argBuffer, uint64_t offset) override
+ {
+ SLANG_UNIMPLEMENTED_X("dispatchComputeIndirect");
+ }
};
ComputeCommandEncoderImpl m_computeCommandEncoder;
@@ -1014,6 +1027,42 @@ public:
{
m_writer->writeTimestamp(pool, index);
}
+
+ virtual SLANG_NO_THROW void SLANG_MCALL copyTexture(
+ ITextureResource* dst,
+ ITextureResource::SubresourceRange dstSubresource,
+ ITextureResource::Offset3D dstOffset,
+ ITextureResource* src,
+ ITextureResource::SubresourceRange srcSubresource,
+ ITextureResource::Offset3D srcOffset,
+ ITextureResource::Size extent) override
+ {
+ SLANG_UNUSED(dst);
+ SLANG_UNUSED(dstSubresource);
+ SLANG_UNUSED(dstOffset);
+ SLANG_UNUSED(src);
+ SLANG_UNUSED(srcSubresource);
+ SLANG_UNUSED(srcOffset);
+ SLANG_UNUSED(extent);
+ SLANG_UNIMPLEMENTED_X("copyTexture");
+ }
+
+ virtual SLANG_NO_THROW void SLANG_MCALL uploadTextureData(
+ ITextureResource* dst,
+ ITextureResource::SubresourceRange subResourceRange,
+ ITextureResource::Offset3D offset,
+ ITextureResource::Offset3D extent,
+ ITextureResource::SubresourceData* subResourceData,
+ size_t subResourceDataCount) override
+ {
+ SLANG_UNUSED(dst);
+ SLANG_UNUSED(subResourceRange);
+ SLANG_UNUSED(offset);
+ SLANG_UNUSED(extent);
+ SLANG_UNUSED(subResourceData);
+ SLANG_UNUSED(subResourceDataCount);
+ SLANG_UNIMPLEMENTED_X("uploadTextureData");
+ }
};
ResourceCommandEncoderImpl m_resourceCommandEncoder;
@@ -1081,9 +1130,11 @@ public:
return m_desc;
}
- virtual SLANG_NO_THROW void SLANG_MCALL
- executeCommandBuffers(uint32_t count, ICommandBuffer* const* commandBuffers) override
+ virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers(
+ uint32_t count, ICommandBuffer* const* commandBuffers, IFence* fence) override
{
+ // TODO: implement fence.
+ assert(fence == nullptr);
for (uint32_t i = 0; i < count; i++)
{
execute(static_cast<CommandBufferImpl*>(commandBuffers[i]));