예제 #1
0
void Work::Bound::RecordIndirect(vk::CommandBuffer commandBuffer,
                                 IndirectBuffer<DispatchParams>& dispatchParams)
{
  PushConstantOffset(commandBuffer, 0, mComputeSize.DomainSize.x);
  if (mComputeSize.DomainSize.y != 1)
  {
    PushConstantOffset(commandBuffer, 4, mComputeSize.DomainSize.y);
  }
  commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eCompute, mLayout, 0, {*mDescriptor}, {});
  commandBuffer.bindPipeline(vk::PipelineBindPoint::eCompute, mPipeline);

  commandBuffer.dispatchIndirect(dispatchParams.Handle(), 0);
}
예제 #2
0
void Work::Bound::Record(vk::CommandBuffer commandBuffer)
{
  PushConstantOffset(commandBuffer, 0, mComputeSize.DomainSize.x);
  if (mComputeSize.DomainSize.y != 1)
  {
    PushConstantOffset(commandBuffer, 4, mComputeSize.DomainSize.y);
  }

  commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eCompute, mLayout, 0, {*mDescriptor}, {});
  commandBuffer.bindPipeline(vk::PipelineBindPoint::eCompute, mPipeline);

  commandBuffer.dispatch(mComputeSize.WorkSize.x, mComputeSize.WorkSize.y, 1);
}