Skip to content

Commit

Permalink
rename executeCommandBuffers -> submit
Browse files Browse the repository at this point in the history
  • Loading branch information
skallweitNV committed Oct 11, 2024
1 parent b58c00d commit 97ba8cf
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
| API | CPU | CUDA | D3D11 | D3D12 | Vulkan | Metal | WGPU |
|------------------------------|-----|------|-------|-------|--------|-------|------|
| `getDesc` | yes | yes | yes | yes | yes | yes | yes |
| `executeCommandBuffers` | yes | yes | yes | yes | yes | yes | yes |
| `submit` | yes | yes | yes | yes | yes | yes | yes |
| `getNativeHandle` | :x: | :x: | :x: | yes | yes | yes | yes |
| `waitOnHost` | yes | yes | yes | yes | yes | :x: | yes |
| `waitForFenceValuesOnDevice` | :x: | :x: | :x: | yes | yes | yes | :x: |
Expand Down
12 changes: 4 additions & 8 deletions include/slang-rhi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1937,20 +1937,16 @@ class ICommandQueue : public ISlangUnknown
public:
virtual SLANG_NO_THROW QueueType SLANG_MCALL getType() = 0;

virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers(
GfxCount count,
ICommandBuffer* const* commandBuffers,
IFence* fenceToSignal,
uint64_t newFenceValue
) = 0;
virtual SLANG_NO_THROW void SLANG_MCALL
submit(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fenceToSignal, uint64_t newFenceValue) = 0;

inline void executeCommandBuffer(
ICommandBuffer* commandBuffer,
IFence* fenceToSignal = nullptr,
uint64_t newFenceValue = 0
)
{
executeCommandBuffers(1, &commandBuffer, fenceToSignal, newFenceValue);
submit(1, &commandBuffer, fenceToSignal, newFenceValue);
}

virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(NativeHandle* outHandle) = 0;
Expand Down Expand Up @@ -1997,7 +1993,7 @@ class ITransientResourceHeap : public ISlangUnknown
virtual SLANG_NO_THROW Result SLANG_MCALL finish() = 0;

// Command buffers are one-time use. Once it is submitted to the queue via
// `executeCommandBuffers` a command buffer is no longer valid to be used any more. Command
// `submit` a command buffer is no longer valid to be used any more. Command
// buffers must be closed before submission. The current D3D12 implementation has a limitation
// that only one command buffer maybe recorded at a time. User must finish recording a command
// buffer before creating another command buffer.
Expand Down
2 changes: 1 addition & 1 deletion src/cuda/cuda-command-queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CommandQueueImpl::~CommandQueueImpl()
currentRootObject = nullptr;
}

void CommandQueueImpl::executeCommandBuffers(
void CommandQueueImpl::submit(
GfxCount count,
ICommandBuffer* const* commandBuffers,
IFence* fence,
Expand Down
3 changes: 1 addition & 2 deletions src/cuda/cuda-command-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class CommandQueueImpl : public CommandQueue<DeviceImpl>
~CommandQueueImpl();

virtual SLANG_NO_THROW void SLANG_MCALL
executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal)
override;
submit(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) override;

virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override;

Expand Down
2 changes: 1 addition & 1 deletion src/d3d12/d3d12-command-queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Result CommandQueueImpl::init(uint32_t queueIndex)
return SLANG_OK;
}

void CommandQueueImpl::executeCommandBuffers(
void CommandQueueImpl::submit(
GfxCount count,
ICommandBuffer* const* commandBuffers,
IFence* fence,
Expand Down
3 changes: 1 addition & 2 deletions src/d3d12/d3d12-command-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class CommandQueueImpl : public CommandQueue<DeviceImpl>
Result init(uint32_t queueIndex);

virtual SLANG_NO_THROW void SLANG_MCALL
executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal)
override;
submit(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) override;

virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override;

Expand Down
6 changes: 3 additions & 3 deletions src/debug-layer/debug-command-queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ QueueType DebugCommandQueue::getType()
return baseObject->getType();
}

void DebugCommandQueue::executeCommandBuffers(
void DebugCommandQueue::submit(
GfxCount count,
ICommandBuffer* const* commandBuffers,
IFence* fence,
Expand Down Expand Up @@ -42,13 +42,13 @@ void DebugCommandQueue::executeCommandBuffers(
if (cmdBufferImpl->m_transientHeap != getDebugObj(commandBuffers[0])->m_transientHeap)
{
RHI_VALIDATION_ERROR(
"Command buffers passed to a single executeCommandBuffers "
"Command buffers passed to a single submit "
"call must be allocated from the same transient heap."
);
}
}
}
baseObject->executeCommandBuffers(count, innerCommandBuffers.data(), getInnerObj(fence), valueToSignal);
baseObject->submit(count, innerCommandBuffers.data(), getInnerObj(fence), valueToSignal);
if (fence)
{
getDebugObj(fence)->maxValueToSignal = max(getDebugObj(fence)->maxValueToSignal, valueToSignal);
Expand Down
3 changes: 1 addition & 2 deletions src/debug-layer/debug-command-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class DebugCommandQueue : public DebugObject<ICommandQueue>
ICommandQueue* getInterface(const Guid& guid);
virtual SLANG_NO_THROW QueueType SLANG_MCALL getType() override;
virtual SLANG_NO_THROW void SLANG_MCALL
executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal)
override;
submit(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) override;
virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override;
virtual SLANG_NO_THROW Result SLANG_MCALL
waitForFenceValuesOnDevice(GfxCount fenceCount, IFence** fences, uint64_t* waitValues) override;
Expand Down
3 changes: 1 addition & 2 deletions src/immediate-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,7 @@ class CommandQueueImpl : public ImmediateCommandQueueBase
~CommandQueueImpl() {}

virtual SLANG_NO_THROW void SLANG_MCALL
executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal)
override
submit(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) override
{
// TODO: implement fence signal.
SLANG_RHI_ASSERT(fence == nullptr);
Expand Down
2 changes: 1 addition & 1 deletion src/metal/metal-command-queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void CommandQueueImpl::queueSubmitImpl(
}
}

void CommandQueueImpl::executeCommandBuffers(
void CommandQueueImpl::submit(
GfxCount count,
ICommandBuffer* const* commandBuffers,
IFence* fence,
Expand Down
3 changes: 1 addition & 2 deletions src/metal/metal-command-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class CommandQueueImpl : public CommandQueue<DeviceImpl>
void queueSubmitImpl(uint32_t count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal);

virtual SLANG_NO_THROW void SLANG_MCALL
executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal)
override;
submit(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) override;
};

} // namespace rhi::metal
2 changes: 1 addition & 1 deletion src/vulkan/vk-command-queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void CommandQueueImpl::queueSubmitImpl(
m_pendingWaitSemaphores[1] = VK_NULL_HANDLE;
}

void CommandQueueImpl::executeCommandBuffers(
void CommandQueueImpl::submit(
GfxCount count,
ICommandBuffer* const* commandBuffers,
IFence* fence,
Expand Down
3 changes: 1 addition & 2 deletions src/vulkan/vk-command-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class CommandQueueImpl : public CommandQueue<DeviceImpl>
void queueSubmitImpl(uint32_t count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal);

virtual SLANG_NO_THROW void SLANG_MCALL
executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal)
override;
submit(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) override;
};

} // namespace rhi::vk
2 changes: 1 addition & 1 deletion src/wgpu/wgpu-command-queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Result CommandQueueImpl::waitForFenceValuesOnDevice(GfxCount fenceCount, IFence*
return SLANG_OK;
}

void CommandQueueImpl::executeCommandBuffers(
void CommandQueueImpl::submit(
GfxCount count,
ICommandBuffer* const* commandBuffers,
IFence* fence,
Expand Down
3 changes: 1 addition & 2 deletions src/wgpu/wgpu-command-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class CommandQueueImpl : public CommandQueue<DeviceImpl>
virtual SLANG_NO_THROW Result SLANG_MCALL
waitForFenceValuesOnDevice(GfxCount fenceCount, IFence** fences, uint64_t* waitValues) override;
virtual SLANG_NO_THROW void SLANG_MCALL
executeCommandBuffers(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal)
override;
submit(GfxCount count, ICommandBuffer* const* commandBuffers, IFence* fence, uint64_t valueToSignal) override;
};

} // namespace rhi::wgpu

0 comments on commit 97ba8cf

Please sign in to comment.