8#ifndef GrD3DCommandList_DEFINED
9#define GrD3DCommandList_DEFINED
23class GrD3DConstantRingBuffer;
56 const D3D12_RESOURCE_TRANSITION_BARRIER* barriers);
59 ID3D12Resource* uavResource);
62 ID3D12Resource* beforeResource,
64 ID3D12Resource* afterResource);
71 uint32_t subresourceCount,
72 D3D12_PLACED_SUBRESOURCE_FOOTPRINT* bufferFootprints,
76 const D3D12_TEXTURE_COPY_LOCATION* dstLocation,
79 const D3D12_TEXTURE_COPY_LOCATION* srcLocation,
80 const D3D12_BOX* srcBox);
83 const D3D12_TEXTURE_COPY_LOCATION* dstLocation,
87 const D3D12_TEXTURE_COPY_LOCATION* srcLocation,
88 const D3D12_BOX* srcBox);
92 UINT subresourceIndex = -1);
97 ID3D12Resource* srcBuffer, uint64_t srcOffset,
117 static const int kInitialTrackedResourcesCount = 32;
146 bool fHasWork =
false;
149 void callFinishedCallbacks() { fFinishedCallbacks.
clear(); }
160 static std::unique_ptr<GrD3DDirectCommandList>
Make(
GrD3DGpu* gpu);
170 void setViewports(
unsigned int numViewports,
const D3D12_VIEWPORT* viewports);
177 void drawInstanced(
unsigned int vertexCount,
unsigned int instanceCount,
178 unsigned int startVertex,
unsigned int startInstance);
180 unsigned int startIndex,
unsigned int baseVertex,
181 unsigned int startInstance);
183 const GrD3DBuffer* argumentBuffer,
size_t argumentBufferOffset);
184 void dispatch(
unsigned int threadGroupCountX,
unsigned int threadGroupCountY,
185 unsigned int threadGroupCountZ = 1);
188 std::array<float, 4>
color,
189 const D3D12_RECT*
rect);
191 uint8_t stencilClearValue,
192 const D3D12_RECT*
rect);
195 unsigned int dstX,
unsigned int dstY,
197 D3D12_RECT* srcRect);
200 D3D12_GPU_VIRTUAL_ADDRESS bufferLocation);
202 D3D12_GPU_DESCRIPTOR_HANDLE bufferLocation);
204 D3D12_GPU_VIRTUAL_ADDRESS bufferLocation);
206 D3D12_GPU_DESCRIPTOR_HANDLE bufferLocation);
208 ID3D12DescriptorHeap* samplerDescriptorHeap);
215 bool resolveSubregionSupported);
217 void onReset()
override;
222 const GrBuffer* fCurrentVertexBuffer =
nullptr;
223 size_t fCurrentVertexStride = 0;
224 const GrBuffer* fCurrentInstanceBuffer =
nullptr;
225 size_t fCurrentInstanceStride = 0;
226 const GrBuffer* fCurrentIndexBuffer =
nullptr;
228 D3D12_GPU_VIRTUAL_ADDRESS fCurrentGraphicsConstantBufferAddress = 0;
229 D3D12_GPU_VIRTUAL_ADDRESS fCurrentComputeConstantBufferAddress = 0;
232 const ID3D12DescriptorHeap* fCurrentSRVCRVDescriptorHeap =
nullptr;
233 const ID3D12DescriptorHeap* fCurrentSamplerDescriptorHeap =
nullptr;
235 bool fResolveSubregionSupported;
240 static std::unique_ptr<GrD3DCopyCommandList>
Make(
GrD3DGpu* gpu);
static SkString resource(SkPDFResourceType type, int index)
static bool left(const SkPoint &p0, const SkPoint &p1)
void addGrBuffer(sk_sp< const GrBuffer > buffer)
SkDEBUGCODE(bool fIsActive=true;) bool fHasWork
gr_cp< ID3D12GraphicsCommandList > fCommandList
TrackedResourceArray< sk_sp< const GrBuffer > > fTrackedGpuBuffers
void aliasingBarrier(sk_sp< GrManagedResource > beforeManagedResource, ID3D12Resource *beforeResource, sk_sp< GrManagedResource > afterManagedResource, ID3D12Resource *afterResource)
void addRecycledResource(sk_sp< GrRecycledResource > resource)
void copyTextureToTexture(const GrD3DTexture *dst, const GrD3DTexture *src, UINT subresourceIndex=-1)
void resourceBarrier(sk_sp< GrManagedResource > managedResource, int numBarriers, const D3D12_RESOURCE_TRANSITION_BARRIER *barriers)
SubmitResult submit(ID3D12CommandQueue *queue)
GrD3DCommandList(gr_cp< ID3D12CommandAllocator > allocator, gr_cp< ID3D12GraphicsCommandList > commandList)
void copyTextureRegionToTexture(sk_sp< GrManagedResource > dst, const D3D12_TEXTURE_COPY_LOCATION *dstLocation, UINT dstX, UINT dstY, sk_sp< GrManagedResource > src, const D3D12_TEXTURE_COPY_LOCATION *srcLocation, const D3D12_BOX *srcBox)
void submitResourceBarriers()
void uavBarrier(sk_sp< GrManagedResource > managedResource, ID3D12Resource *uavResource)
void copyBufferToTexture(ID3D12Resource *srcBuffer, const GrD3DTextureResource *dstTexture, uint32_t subresourceCount, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *bufferFootprints, int left, int top)
void copyTextureRegionToBuffer(sk_sp< const GrBuffer > dst, const D3D12_TEXTURE_COPY_LOCATION *dstLocation, UINT dstX, UINT dstY, sk_sp< GrManagedResource > src, const D3D12_TEXTURE_COPY_LOCATION *srcLocation, const D3D12_BOX *srcBox)
void addResource(sk_sp< GrManagedResource > resource)
void copyBufferToBuffer(sk_sp< GrD3DBuffer > dstBuffer, uint64_t dstOffset, ID3D12Resource *srcBuffer, uint64_t srcOffset, uint64_t numBytes)
virtual ~GrD3DCommandList()
TrackedResourceArray< sk_sp< GrRecycledResource > > fTrackedRecycledResources
TrackedResourceArray< sk_sp< GrManagedResource > > fTrackedResources
void addFinishedCallback(sk_sp< skgpu::RefCntedCallback > callback)
static std::unique_ptr< GrD3DCopyCommandList > Make(GrD3DGpu *gpu)
void clearRenderTargetView(const GrD3DRenderTarget *renderTarget, std::array< float, 4 > color, const D3D12_RECT *rect)
void executeIndirect(const sk_sp< GrD3DCommandSignature > commandSig, unsigned int maxCommandCnt, const GrD3DBuffer *argumentBuffer, size_t argumentBufferOffset)
void setComputeRootConstantBufferView(unsigned int rootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS bufferLocation)
void addSampledTextureRef(GrD3DTexture *)
void setComputeRootDescriptorTable(unsigned int rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE bufferLocation)
void setGraphicsRootSignature(const sk_sp< GrD3DRootSignature > &rootSignature)
void setStencilRef(unsigned int stencilRef)
void setPrimitiveTopology(D3D12_PRIMITIVE_TOPOLOGY primitiveTopology)
void setGraphicsRootConstantBufferView(unsigned int rootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS bufferLocation)
void setVertexBuffers(unsigned int startSlot, sk_sp< const GrBuffer > vertexBuffer, size_t vertexStride, sk_sp< const GrBuffer > instanceBuffer, size_t instanceStride)
void setDescriptorHeaps(ID3D12DescriptorHeap *srvDescriptorHeap, ID3D12DescriptorHeap *samplerDescriptorHeap)
static std::unique_ptr< GrD3DDirectCommandList > Make(GrD3DGpu *gpu)
void setRenderTarget(const GrD3DRenderTarget *renderTarget)
void setBlendFactor(const float blendFactor[4])
void resolveSubresourceRegion(const GrD3DTextureResource *dstTexture, unsigned int dstX, unsigned int dstY, const GrD3DTextureResource *srcTexture, D3D12_RECT *srcRect)
void setViewports(unsigned int numViewports, const D3D12_VIEWPORT *viewports)
~GrD3DDirectCommandList() override=default
void clearDepthStencilView(const GrD3DAttachment *, uint8_t stencilClearValue, const D3D12_RECT *rect)
void setIndexBuffer(sk_sp< const GrBuffer > indexBuffer)
void setPipelineState(const sk_sp< GrD3DPipeline > &pipeline)
void setScissorRects(unsigned int numRects, const D3D12_RECT *rects)
void dispatch(unsigned int threadGroupCountX, unsigned int threadGroupCountY, unsigned int threadGroupCountZ=1)
void setComputeRootSignature(const sk_sp< GrD3DRootSignature > &rootSignature)
void drawInstanced(unsigned int vertexCount, unsigned int instanceCount, unsigned int startVertex, unsigned int startInstance)
void setGraphicsRootDescriptorTable(unsigned int rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE bufferLocation)
void drawIndexedInstanced(unsigned int indexCount, unsigned int instanceCount, unsigned int startIndex, unsigned int baseVertex, unsigned int startInstance)
static constexpr unsigned int kParamIndexCount
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
sk_sp< SkBlender > blender SkRect rect
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer