Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
GrMtlOpsRenderPass Class Reference

#include <GrMtlOpsRenderPass.h>

Inheritance diagram for GrMtlOpsRenderPass:
GrOpsRenderPass

Public Member Functions

 GrMtlOpsRenderPass (GrMtlGpu *gpu, GrRenderTarget *rt, sk_sp< GrMtlFramebuffer >, GrSurfaceOrigin origin, const GrOpsRenderPass::LoadAndStoreInfo &colorInfo, const GrOpsRenderPass::StencilLoadAndStoreInfo &stencilInfo)
 
 ~GrMtlOpsRenderPass () override
 
void initRenderState (GrMtlRenderCommandEncoder *)
 
void inlineUpload (GrOpFlushState *state, GrDeferredTextureUploadFn &upload) override
 
void submit ()
 
- Public Member Functions inherited from GrOpsRenderPass
virtual ~GrOpsRenderPass ()
 
void begin ()
 
void end ()
 
void bindPipeline (const GrProgramInfo &, const SkRect &drawBounds)
 
void setScissorRect (const SkIRect &)
 
void bindTextures (const GrGeometryProcessor &, const GrSurfaceProxy *const geomProcTextures[], const GrPipeline &)
 
void bindBuffers (sk_sp< const GrBuffer > indexBuffer, sk_sp< const GrBuffer > instanceBuffer, sk_sp< const GrBuffer > vertexBuffer, GrPrimitiveRestart=GrPrimitiveRestart::kNo)
 
void draw (int vertexCount, int baseVertex)
 
void drawIndexed (int indexCount, int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue, int baseVertex)
 
void drawInstanced (int instanceCount, int baseInstance, int vertexCount, int baseVertex)
 
void drawIndexedInstanced (int indexCount, int baseIndex, int instanceCount, int baseInstance, int baseVertex)
 
void drawIndirect (const GrBuffer *drawIndirectBuffer, size_t bufferOffset, int drawCount)
 
void drawIndexedIndirect (const GrBuffer *drawIndirectBuffer, size_t bufferOffset, int drawCount)
 
void drawIndexPattern (int patternIndexCount, int patternRepeatCount, int maxPatternRepetitionsInIndexBuffer, int patternVertexCount, int baseVertex)
 
virtual void inlineUpload (GrOpFlushState *, GrDeferredTextureUploadFn &)=0
 
void clear (const GrScissorState &scissor, std::array< float, 4 > color)
 
void clearStencilClip (const GrScissorState &scissor, bool insideStencilMask)
 
void executeDrawable (std::unique_ptr< SkDrawable::GpuDrawHandler >)
 

Additional Inherited Members

- Protected Member Functions inherited from GrOpsRenderPass
 GrOpsRenderPass ()
 
 GrOpsRenderPass (GrRenderTarget *rt, GrSurfaceOrigin origin)
 
void set (GrRenderTarget *rt, GrSurfaceOrigin origin)
 
- Protected Attributes inherited from GrOpsRenderPass
GrSurfaceOrigin fOrigin
 
GrRenderTargetfRenderTarget
 
sk_sp< const GrBufferfActiveIndexBuffer
 
sk_sp< const GrBufferfActiveVertexBuffer
 
sk_sp< const GrBufferfActiveInstanceBuffer
 

Detailed Description

Definition at line 24 of file GrMtlOpsRenderPass.h.

Constructor & Destructor Documentation

◆ GrMtlOpsRenderPass()

GR_NORETAIN_BEGIN GrMtlOpsRenderPass::GrMtlOpsRenderPass ( GrMtlGpu gpu,
GrRenderTarget rt,
sk_sp< GrMtlFramebuffer framebuffer,
GrSurfaceOrigin  origin,
const GrOpsRenderPass::LoadAndStoreInfo colorInfo,
const GrOpsRenderPass::StencilLoadAndStoreInfo stencilInfo 
)

Definition at line 27 of file GrMtlOpsRenderPass.mm.

31 : INHERITED(rt, origin)
32 , fGpu(gpu)
33 , fFramebuffer(std::move(framebuffer)) {
34 this->setupRenderPass(colorInfo, stencilInfo);
35}

◆ ~GrMtlOpsRenderPass()

GrMtlOpsRenderPass::~GrMtlOpsRenderPass ( )
override

Definition at line 37 of file GrMtlOpsRenderPass.mm.

37 {
38}

Member Function Documentation

◆ initRenderState()

void GrMtlOpsRenderPass::initRenderState ( GrMtlRenderCommandEncoder encoder)

Definition at line 202 of file GrMtlOpsRenderPass.mm.

202 {
203 if (!encoder) {
204 return;
205 }
206#ifdef SK_ENABLE_MTL_DEBUG_INFO
207 encoder->pushDebugGroup(@"initRenderState");
208#endif
209 encoder->setFrontFacingWinding(MTLWindingCounterClockwise);
210 SkISize colorAttachmentDimensions = fFramebuffer->colorAttachment()->dimensions();
211 // Strictly speaking we shouldn't have to set this, as the default viewport is the size of
212 // the drawable used to generate the renderCommandEncoder -- but just in case.
213 MTLViewport viewport = { 0.0, 0.0,
214 (double) colorAttachmentDimensions.width(),
215 (double) colorAttachmentDimensions.height(),
216 0.0, 1.0 };
217 encoder->setViewport(viewport);
218#ifdef SK_ENABLE_MTL_DEBUG_INFO
219 encoder->popDebugGroup();
220#endif
221}
GrMtlAttachment * colorAttachment()
SkISize dimensions() const
Definition: GrSurface.h:27
Definition: SkSize.h:16
constexpr int32_t width() const
Definition: SkSize.h:36
constexpr int32_t height() const
Definition: SkSize.h:37

◆ inlineUpload()

void GrMtlOpsRenderPass::inlineUpload ( GrOpFlushState state,
GrDeferredTextureUploadFn upload 
)
overridevirtual

Implements GrOpsRenderPass.

Definition at line 189 of file GrMtlOpsRenderPass.mm.

189 {
190 state->doUpload(upload);
191
192 // If the previous renderCommandEncoder did a resolve without an MSAA store
193 // (e.g., if the color attachment is memoryless) we need to copy the contents of
194 // the resolve attachment to the MSAA attachment at this point.
195 if (!this->setupResolve()) {
196 // If setting up for the resolve didn't create an encoder, it's probably reasonable to
197 // create a new encoder at this point, though maybe not necessary.
198 this->setupRenderCommandEncoder(nullptr);
199 }
200}
AtkStateType state
Definition: upload.py:1

◆ submit()

void GrMtlOpsRenderPass::submit ( )

Definition at line 40 of file GrMtlOpsRenderPass.mm.

40 {
41 if (!fFramebuffer) {
42 return;
43 }
44 SkIRect iBounds;
45 fBounds.roundOut(&iBounds);
47 fActiveRenderCmdEncoder = nullptr;
48}
void submitIndirectCommandBuffer(GrSurface *surface, GrSurfaceOrigin origin, const SkIRect *bounds)
Definition: GrMtlGpu.h:113
GrSurfaceOrigin fOrigin
GrRenderTarget * fRenderTarget
Definition: SkRect.h:32
void roundOut(SkIRect *dst) const
Definition: SkRect.h:1241

The documentation for this class was generated from the following files: