8#ifndef skgpu_graphite_DawnCommandBuffer_DEFINED
9#define skgpu_graphite_DawnCommandBuffer_DEFINED
18#include "webgpu/webgpu_cpp.h"
23class DawnComputePipeline;
24class DawnQueueManager;
25class DawnResourceProvider;
26class DawnSharedContext;
42 void onResetCommandBuffer()
override;
43 bool setNewCommandBufferResources()
override;
48 const Texture* depthStencilTexture,
57 const Texture* depthStencilTexture);
58 bool loadMSAAFromResolveAndBeginRenderPassEncoder(
60 const wgpu::RenderPassDescriptor& wgpuRenderPassDesc,
62 bool doBlitWithDraw(
const wgpu::RenderPassEncoder& renderEncoder,
64 const wgpu::TextureView& sourceTextureView,
72 void setBlendConstants(
float* blendConstants);
80 void bindTextureAndSamplers(
const DrawPass& drawPass,
81 const DrawPassCommands::BindTexturesAndSamplers&
command);
83 void setScissor(
unsigned int left,
unsigned int top,
unsigned int width,
unsigned int height);
84 void preprocessViewport(
const SkRect& viewport);
85 void setViewport(
const SkRect& viewport);
89 unsigned int baseIndex,
90 unsigned int indexCount,
91 unsigned int baseVertex);
93 unsigned int baseVertex,
94 unsigned int vertexCount,
95 unsigned int baseInstance,
96 unsigned int instanceCount);
98 unsigned int baseIndex,
99 unsigned int indexCount,
100 unsigned int baseVertex,
101 unsigned int baseInstance,
102 unsigned int instanceCount);
107 void beginComputePass();
111 void dispatchWorkgroupsIndirect(
const Buffer* indirectBuffer,
size_t indirectBufferOffset);
112 void endComputePass();
115 bool onCopyBufferToBuffer(
const Buffer* srcBuffer,
119 size_t size)
override;
120 bool onCopyTextureToBuffer(
const Texture*,
124 size_t bufferRowBytes)
override;
125 bool onCopyBufferToTexture(
const Buffer*,
129 bool onCopyTextureToTexture(
const Texture*
src,
133 int mipLevel)
override;
134 bool onSynchronizeBufferToCpu(
const Buffer*,
bool* outDidResultInWork)
override;
138 void syncUniformBuffers();
140 bool fBoundUniformBuffersDirty =
false;
142 std::array<const DawnBuffer*, DawnGraphicsPipeline::kNumUniformBuffers> fBoundUniformBuffers;
143 std::array<uint32_t, DawnGraphicsPipeline::kNumUniformBuffers> fBoundUniformBufferOffsets;
144 std::array<uint32_t, DawnGraphicsPipeline::kNumUniformBuffers> fBoundUniformBufferSizes;
146 wgpu::CommandEncoder fCommandEncoder;
147 wgpu::RenderPassEncoder fActiveRenderPassEncoder;
148 wgpu::ComputePassEncoder fActiveComputePassEncoder;
150 wgpu::Buffer fCurrentIndirectBuffer;
151 size_t fCurrentIndirectBufferOffset = 0;
154 int fIntrinsicConstantBufferSlotsUsed = 0;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
wgpu::CommandBuffer finishEncoding()
static std::unique_ptr< DawnCommandBuffer > Make(const DawnSharedContext *, DawnResourceProvider *)
~DawnCommandBuffer() override
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size