Files
XCEngine/docs/api/XCEngine/RHI/Vulkan/VulkanCommandList/Dispatch.md
2026-03-29 01:36:53 +08:00

774 B
Raw Blame History

VulkanCommandList::Dispatch

void Dispatch(uint32_t x, uint32_t y, uint32_t z) override;

作用

发起一次 compute dispatch。

前置条件

  • 当前 pipeline state 已设置
  • pipeline state 持有有效 compute shader
  • 需要的 descriptor set 已绑定

当前实现行为

  • 会先结束活跃 render pass
  • 如果当前 pipeline 没有 compute shader直接返回
  • 会调用 m_currentPipelineState->EnsureValid()
  • 如果 compute pipeline 尚未创建,可能在这里延迟创建
  • 最终绑定 compute pipeline 并调用 vkCmdDispatch(...)

相关文档