mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-11 14:39:13 +00:00
Vulkan: Implement compute CommandBuffer operations
This commit is contained in:
parent
186a5cba87
commit
46d5441557
@ -17,6 +17,7 @@
|
|||||||
#include "backend/Commands.h"
|
#include "backend/Commands.h"
|
||||||
#include "backend/vulkan/BindGroupVk.h"
|
#include "backend/vulkan/BindGroupVk.h"
|
||||||
#include "backend/vulkan/BufferVk.h"
|
#include "backend/vulkan/BufferVk.h"
|
||||||
|
#include "backend/vulkan/ComputePipelineVk.h"
|
||||||
#include "backend/vulkan/FramebufferVk.h"
|
#include "backend/vulkan/FramebufferVk.h"
|
||||||
#include "backend/vulkan/PipelineLayoutVk.h"
|
#include "backend/vulkan/PipelineLayoutVk.h"
|
||||||
#include "backend/vulkan/RenderPassVk.h"
|
#include "backend/vulkan/RenderPassVk.h"
|
||||||
@ -289,6 +290,21 @@ namespace backend { namespace vulkan {
|
|||||||
// Do nothing because the single subpass is ended in vkEndRenderPass
|
// Do nothing because the single subpass is ended in vkEndRenderPass
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case Command::BeginComputePass: {
|
||||||
|
mCommands.NextCommand<BeginComputePassCmd>();
|
||||||
|
descriptorSets.OnBeginPass();
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Command::EndComputePass: {
|
||||||
|
mCommands.NextCommand<EndComputePassCmd>();
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Command::Dispatch: {
|
||||||
|
DispatchCmd* dispatch = mCommands.NextCommand<DispatchCmd>();
|
||||||
|
descriptorSets.Flush(device, commands, VK_PIPELINE_BIND_POINT_COMPUTE);
|
||||||
|
device->fn.CmdDispatch(commands, dispatch->x, dispatch->y, dispatch->z);
|
||||||
|
} break;
|
||||||
|
|
||||||
case Command::SetBindGroup: {
|
case Command::SetBindGroup: {
|
||||||
SetBindGroupCmd* cmd = mCommands.NextCommand<SetBindGroupCmd>();
|
SetBindGroupCmd* cmd = mCommands.NextCommand<SetBindGroupCmd>();
|
||||||
VkDescriptorSet set = ToBackend(cmd->group.Get())->GetHandle();
|
VkDescriptorSet set = ToBackend(cmd->group.Get())->GetHandle();
|
||||||
@ -319,6 +335,15 @@ namespace backend { namespace vulkan {
|
|||||||
commands, indexBuffer, static_cast<VkDeviceSize>(cmd->offset), indexType);
|
commands, indexBuffer, static_cast<VkDeviceSize>(cmd->offset), indexType);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case Command::SetComputePipeline: {
|
||||||
|
SetComputePipelineCmd* cmd = mCommands.NextCommand<SetComputePipelineCmd>();
|
||||||
|
ComputePipeline* pipeline = ToBackend(cmd->pipeline).Get();
|
||||||
|
|
||||||
|
device->fn.CmdBindPipeline(commands, VK_PIPELINE_BIND_POINT_COMPUTE,
|
||||||
|
pipeline->GetHandle());
|
||||||
|
descriptorSets.OnPipelineLayoutChange(ToBackend(pipeline->GetLayout()));
|
||||||
|
} break;
|
||||||
|
|
||||||
case Command::SetRenderPipeline: {
|
case Command::SetRenderPipeline: {
|
||||||
SetRenderPipelineCmd* cmd = mCommands.NextCommand<SetRenderPipelineCmd>();
|
SetRenderPipelineCmd* cmd = mCommands.NextCommand<SetRenderPipelineCmd>();
|
||||||
RenderPipeline* pipeline = ToBackend(cmd->pipeline).Get();
|
RenderPipeline* pipeline = ToBackend(cmd->pipeline).Get();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user