2 * Copyright 2020 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef GrD3DOpsRenderPass_DEFINED
9 #define GrD3DOpsRenderPass_DEFINED
11 #include "src/gpu/ganesh/GrOpsRenderPass.h"
13 #include "include/gpu/GrTypes.h"
14 #include "include/private/gpu/ganesh/GrTypesPriv.h"
17 class GrD3DPipelineState;
19 class GrD3DOpsRenderPass : public GrOpsRenderPass {
21 GrD3DOpsRenderPass(GrD3DGpu*);
23 ~GrD3DOpsRenderPass() override;
25 void inlineUpload(GrOpFlushState* state, GrDeferredTextureUploadFn& upload) override;
27 void onExecuteDrawable(std::unique_ptr<SkDrawable::GpuDrawHandler>) override {}
29 bool set(GrRenderTarget*, GrSurfaceOrigin, const SkIRect& bounds,
30 const GrOpsRenderPass::LoadAndStoreInfo&,
31 const GrOpsRenderPass::StencilLoadAndStoreInfo&,
32 const SkTArray<GrSurfaceProxy*, true>& sampledProxies);
37 GrGpu* gpu() override;
39 void onBegin() override;
41 bool onBindPipeline(const GrProgramInfo&, const SkRect& drawBounds) override;
42 void onSetScissorRect(const SkIRect&) override;
43 bool onBindTextures(const GrGeometryProcessor&,
44 const GrSurfaceProxy* const geomProcTextures[],
45 const GrPipeline&) override;
46 void onBindBuffers(sk_sp<const GrBuffer> indexBuffer, sk_sp<const GrBuffer> instanceBuffer,
47 sk_sp<const GrBuffer> vertexBuffer, GrPrimitiveRestart) override;
48 void onDraw(int vertexCount, int baseVertex) override {
49 this->onDrawInstanced(1, 0, vertexCount, baseVertex);
51 void onDrawIndexed(int indexCount, int baseIndex, uint16_t minIndexValue,
52 uint16_t maxIndexValue, int baseVertex) override {
53 this->onDrawIndexedInstanced(indexCount, baseIndex, 1, 0, baseVertex);
55 void onDrawInstanced(int instanceCount, int baseInstance, int vertexCount,
56 int baseVertex) override;
57 void onDrawIndexedInstanced(int indexCount, int baseIndex, int instanceCount, int baseInstance,
58 int baseVertex) override;
59 void onDrawIndirect(const GrBuffer*, size_t offset, int drawCount) override;
60 void onDrawIndexedIndirect(const GrBuffer*, size_t offset, int drawCount) override;
62 void onClear(const GrScissorState& scissor, std::array<float, 4> color) override;
64 void onClearStencilClip(const GrScissorState& scissor, bool insideStencilMask) override;
68 GrD3DPipelineState* fCurrentPipelineState = nullptr;
71 SkIRect fCurrentPipelineBounds;
73 GrLoadOp fColorLoadOp;
74 std::array<float, 4> fClearColor;
75 GrLoadOp fStencilLoadOp;
77 using INHERITED = GrOpsRenderPass;