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

#include <GrMtlRenderCommandEncoder.h>

Public Member Functions

void setLabel (NSString *label)
 
void pushDebugGroup (NSString *string)
 
void popDebugGroup ()
 
void insertDebugSignpost (NSString *string)
 
void setRenderPipelineState (id< MTLRenderPipelineState > pso)
 
void setTriangleFillMode (MTLTriangleFillMode fillMode)
 
void setFrontFacingWinding (MTLWinding winding)
 
void setViewport (const MTLViewport &viewport)
 
void setVertexBuffer (id< MTLBuffer > buffer, NSUInteger offset, NSUInteger index)
 
void setVertexBufferOffset (NSUInteger offset, NSUInteger index) SK_API_AVAILABLE(macos(10.11)
 
void ios (8.3)
 
void tvos (9.0))
 
void setFragmentBuffer (id< MTLBuffer > buffer, NSUInteger offset, NSUInteger index)
 
void setFragmentBufferOffset (NSUInteger offset, NSUInteger index) SK_API_AVAILABLE(macos(10.11)
 
void ios (8.3)
 
void tvos (9.0))
 
void setVertexBytes (const void *bytes, NSUInteger length, NSUInteger index) SK_API_AVAILABLE(macos(10.11)
 
void ios (8.3)
 
void tvos (9.0))
 
void setFragmentBytes (const void *bytes, NSUInteger length, NSUInteger index) SK_API_AVAILABLE(macos(10.11)
 
void ios (8.3)
 
void tvos (9.0))
 
void setFragmentTexture (id< MTLTexture > texture, NSUInteger index)
 
void setFragmentSamplerState (GrMtlSampler *sampler, NSUInteger index)
 
void setBlendColor (SkPMColor4f blendConst)
 
void setStencilFrontBackReferenceValues (uint32_t frontReferenceValue, uint32_t backReferenceValue) SK_API_AVAILABLE(macos(10.11)
 
void ios (9.0)
 
void tvos (9.0))
 
void setStencilReferenceValue (uint32_t referenceValue)
 
void setDepthStencilState (id< MTLDepthStencilState > depthStencilState)
 
void setScissorRect (const MTLScissorRect &scissorRect)
 
void drawPrimitives (MTLPrimitiveType primitiveType, NSUInteger vertexStart, NSUInteger vertexCount)
 
void drawPrimitives (MTLPrimitiveType primitiveType, NSUInteger vertexStart, NSUInteger vertexCount, NSUInteger instanceCount, NSUInteger baseInstance) SK_API_AVAILABLE(macos(10.11)
 
void ios (9.0)
 
void tvos (9.0))
 
void drawPrimitives (MTLPrimitiveType primitiveType, id< MTLBuffer > indirectBuffer, NSUInteger indirectBufferOffset) SK_API_AVAILABLE(macos(10.11)
 
void ios (9.0)
 
void tvos (9.0))
 
void drawIndexedPrimitives (MTLPrimitiveType primitiveType, NSUInteger indexCount, MTLIndexType indexType, id< MTLBuffer > indexBuffer, NSUInteger indexBufferOffset)
 
void drawIndexedPrimitives (MTLPrimitiveType primitiveType, NSUInteger indexCount, MTLIndexType indexType, id< MTLBuffer > indexBuffer, NSUInteger indexBufferOffset, NSUInteger instanceCount, NSInteger baseVertex, NSUInteger baseInstance) SK_API_AVAILABLE(macos(10.11)
 
void ios (9.0)
 
void tvos (9.0))
 
void drawIndexedPrimitives (MTLPrimitiveType primitiveType, MTLIndexType indexType, id< MTLBuffer > indexBuffer, NSUInteger indexBufferOffset, id< MTLBuffer > indirectBuffer, NSUInteger indirectBufferOffset) SK_API_AVAILABLE(macos(10.11)
 
void ios (9.0)
 
void tvos (9.0))
 
void endEncoding ()
 

Static Public Member Functions

static std::unique_ptr< GrMtlRenderCommandEncoderMake (id< MTLRenderCommandEncoder > encoder)
 

Detailed Description

Wraps a MTLRenderCommandEncoder object and associated tracked state

Definition at line 28 of file GrMtlRenderCommandEncoder.h.

Member Function Documentation

◆ drawIndexedPrimitives() [1/3]

void GrMtlRenderCommandEncoder::drawIndexedPrimitives ( MTLPrimitiveType  primitiveType,
MTLIndexType  indexType,
id< MTLBuffer >  indexBuffer,
NSUInteger  indexBufferOffset,
id< MTLBuffer >  indirectBuffer,
NSUInteger  indirectBufferOffset 
)

◆ drawIndexedPrimitives() [2/3]

void GrMtlRenderCommandEncoder::drawIndexedPrimitives ( MTLPrimitiveType  primitiveType,
NSUInteger  indexCount,
MTLIndexType  indexType,
id< MTLBuffer >  indexBuffer,
NSUInteger  indexBufferOffset 
)
inline

Definition at line 206 of file GrMtlRenderCommandEncoder.h.

208 {
209 [fCommandEncoder drawIndexedPrimitives:primitiveType
210 indexCount:indexCount
211 indexType:indexType
212 indexBuffer:indexBuffer
213 indexBufferOffset:indexBufferOffset];
214 }
void drawIndexedPrimitives(MTLPrimitiveType primitiveType, NSUInteger indexCount, MTLIndexType indexType, id< MTLBuffer > indexBuffer, NSUInteger indexBufferOffset)

◆ drawIndexedPrimitives() [3/3]

void GrMtlRenderCommandEncoder::drawIndexedPrimitives ( MTLPrimitiveType  primitiveType,
NSUInteger  indexCount,
MTLIndexType  indexType,
id< MTLBuffer >  indexBuffer,
NSUInteger  indexBufferOffset,
NSUInteger  instanceCount,
NSInteger  baseVertex,
NSUInteger  baseInstance 
)

◆ drawPrimitives() [1/3]

void GrMtlRenderCommandEncoder::drawPrimitives ( MTLPrimitiveType  primitiveType,
id< MTLBuffer >  indirectBuffer,
NSUInteger  indirectBufferOffset 
)

◆ drawPrimitives() [2/3]

void GrMtlRenderCommandEncoder::drawPrimitives ( MTLPrimitiveType  primitiveType,
NSUInteger  vertexStart,
NSUInteger  vertexCount 
)
inline

Definition at line 182 of file GrMtlRenderCommandEncoder.h.

183 {
184 [fCommandEncoder drawPrimitives:primitiveType
185 vertexStart:vertexStart
186 vertexCount:vertexCount];
187 }
void drawPrimitives(MTLPrimitiveType primitiveType, NSUInteger vertexStart, NSUInteger vertexCount)

◆ drawPrimitives() [3/3]

void GrMtlRenderCommandEncoder::drawPrimitives ( MTLPrimitiveType  primitiveType,
NSUInteger  vertexStart,
NSUInteger  vertexCount,
NSUInteger  instanceCount,
NSUInteger  baseInstance 
)

◆ endEncoding()

void GrMtlRenderCommandEncoder::endEncoding ( )
inline

Definition at line 244 of file GrMtlRenderCommandEncoder.h.

244 {
245 [fCommandEncoder endEncoding];
246 }

◆ insertDebugSignpost()

void GrMtlRenderCommandEncoder::insertDebugSignpost ( NSString *  string)
inline

Definition at line 44 of file GrMtlRenderCommandEncoder.h.

44 {
45 [fCommandEncoder insertDebugSignpost:string];
46 }
void insertDebugSignpost(NSString *string)

◆ ios() [1/9]

void GrMtlRenderCommandEncoder::ios ( 8.  3)

◆ ios() [2/9]

void GrMtlRenderCommandEncoder::ios ( 8.  3)

◆ ios() [3/9]

void GrMtlRenderCommandEncoder::ios ( 8.  3)

◆ ios() [4/9]

void GrMtlRenderCommandEncoder::ios ( 8.  3)

◆ ios() [5/9]

void GrMtlRenderCommandEncoder::ios ( 9.  0)

◆ ios() [6/9]

void GrMtlRenderCommandEncoder::ios ( 9.  0)

◆ ios() [7/9]

void GrMtlRenderCommandEncoder::ios ( 9.  0)

◆ ios() [8/9]

void GrMtlRenderCommandEncoder::ios ( 9.  0)

◆ ios() [9/9]

void GrMtlRenderCommandEncoder::ios ( 9.  0)

◆ Make()

static std::unique_ptr< GrMtlRenderCommandEncoder > GrMtlRenderCommandEncoder::Make ( id< MTLRenderCommandEncoder >  encoder)
inlinestatic

Definition at line 30 of file GrMtlRenderCommandEncoder.h.

30 {
31 return std::unique_ptr<GrMtlRenderCommandEncoder>(new GrMtlRenderCommandEncoder(encoder));
32 }

◆ popDebugGroup()

void GrMtlRenderCommandEncoder::popDebugGroup ( )
inline

Definition at line 41 of file GrMtlRenderCommandEncoder.h.

41 {
42 [fCommandEncoder popDebugGroup];
43 }

◆ pushDebugGroup()

void GrMtlRenderCommandEncoder::pushDebugGroup ( NSString *  string)
inline

Definition at line 38 of file GrMtlRenderCommandEncoder.h.

38 {
39 [fCommandEncoder pushDebugGroup:string];
40 }
void pushDebugGroup(NSString *string)

◆ setBlendColor()

void GrMtlRenderCommandEncoder::setBlendColor ( SkPMColor4f  blendConst)
inline

Definition at line 148 of file GrMtlRenderCommandEncoder.h.

148 {
149 [fCommandEncoder setBlendColorRed: blendConst.fR
150 green: blendConst.fG
151 blue: blendConst.fB
152 alpha: blendConst.fA];
153 }
float fB
blue component
Definition: SkColor.h:265
float fR
red component
Definition: SkColor.h:263
float fG
green component
Definition: SkColor.h:264
float fA
alpha component
Definition: SkColor.h:266

◆ setDepthStencilState()

void GrMtlRenderCommandEncoder::setDepthStencilState ( id< MTLDepthStencilState >  depthStencilState)
inline

Definition at line 165 of file GrMtlRenderCommandEncoder.h.

165 {
166 if (depthStencilState != fCurrentDepthStencilState) {
167 [fCommandEncoder setDepthStencilState:depthStencilState];
168 fCurrentDepthStencilState = depthStencilState;
169 }
170 }
void setDepthStencilState(id< MTLDepthStencilState > depthStencilState)

◆ setFragmentBuffer()

void GrMtlRenderCommandEncoder::setFragmentBuffer ( id< MTLBuffer >  buffer,
NSUInteger  offset,
NSUInteger  index 
)
inline

Definition at line 94 of file GrMtlRenderCommandEncoder.h.

94 {
95 if (@available(macOS 10.11, iOS 8.3, tvOS 9.0, *)) {
96 if (fCurrentFragmentBuffer[index] == buffer) {
97 this->setFragmentBufferOffset(offset, index);
98 return;
99 }
100 }
101 if (fCurrentFragmentBuffer[index] != buffer || fCurrentFragmentOffset[index] != offset) {
102 [fCommandEncoder setFragmentBuffer:buffer
104 atIndex:index];
105 fCurrentFragmentBuffer[index] = buffer;
106 fCurrentFragmentOffset[index] = offset;
107 }
108 }
void setFragmentBufferOffset(NSUInteger offset, NSUInteger index) SK_API_AVAILABLE(macos(10.11)
void setFragmentBuffer(id< MTLBuffer > buffer, NSUInteger offset, NSUInteger index)
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
Definition: switches.h:126
SeparatedVector2 offset

◆ setFragmentBufferOffset()

void GrMtlRenderCommandEncoder::setFragmentBufferOffset ( NSUInteger  offset,
NSUInteger  index 
)

◆ setFragmentBytes()

void GrMtlRenderCommandEncoder::setFragmentBytes ( const void *  bytes,
NSUInteger  length,
NSUInteger  index 
)

◆ setFragmentSamplerState()

void GrMtlRenderCommandEncoder::setFragmentSamplerState ( GrMtlSampler sampler,
NSUInteger  index 
)
inline

Definition at line 139 of file GrMtlRenderCommandEncoder.h.

139 {
140 SkASSERT(index < kMaxSamplers);
141 if (fCurrentSampler[index] != sampler) {
142 [fCommandEncoder setFragmentSamplerState: sampler->mtlSampler()
143 atIndex: index];
144 fCurrentSampler[index] = sampler;
145 }
146 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
void setFragmentSamplerState(GrMtlSampler *sampler, NSUInteger index)
id< MTLSamplerState > mtlSampler() const
Definition: GrMtlSampler.h:26

◆ setFragmentTexture()

void GrMtlRenderCommandEncoder::setFragmentTexture ( id< MTLTexture >  texture,
NSUInteger  index 
)
inline

Definition at line 131 of file GrMtlRenderCommandEncoder.h.

131 {
132 SkASSERT(index < kMaxTextures);
133 if (fCurrentTexture[index] != texture) {
134 [fCommandEncoder setFragmentTexture:texture
135 atIndex:index];
136 fCurrentTexture[index] = texture;
137 }
138 }
void setFragmentTexture(id< MTLTexture > texture, NSUInteger index)
FlTexture * texture

◆ setFrontFacingWinding()

void GrMtlRenderCommandEncoder::setFrontFacingWinding ( MTLWinding  winding)
inline

Definition at line 62 of file GrMtlRenderCommandEncoder.h.

62 {
63 [fCommandEncoder setFrontFacingWinding:winding];
64 }
void setFrontFacingWinding(MTLWinding winding)

◆ setLabel()

void GrMtlRenderCommandEncoder::setLabel ( NSString *  label)
inline

Definition at line 34 of file GrMtlRenderCommandEncoder.h.

34 {
35 [fCommandEncoder setLabel:label];
36 }

◆ setRenderPipelineState()

void GrMtlRenderCommandEncoder::setRenderPipelineState ( id< MTLRenderPipelineState >  pso)
inline

Definition at line 48 of file GrMtlRenderCommandEncoder.h.

48 {
49 if (fCurrentRenderPipelineState != pso) {
50 [fCommandEncoder setRenderPipelineState:pso];
51 fCurrentRenderPipelineState = pso;
52 }
53 }
void setRenderPipelineState(id< MTLRenderPipelineState > pso)

◆ setScissorRect()

void GrMtlRenderCommandEncoder::setScissorRect ( const MTLScissorRect &  scissorRect)
inline

Definition at line 172 of file GrMtlRenderCommandEncoder.h.

172 {
173 if (fCurrentScissorRect.x != scissorRect.x ||
174 fCurrentScissorRect.y != scissorRect.y ||
175 fCurrentScissorRect.width != scissorRect.width ||
176 fCurrentScissorRect.height != scissorRect.height) {
177 [fCommandEncoder setScissorRect:scissorRect];
178 fCurrentScissorRect = scissorRect;
179 }
180 }
void setScissorRect(const MTLScissorRect &scissorRect)

◆ setStencilFrontBackReferenceValues()

void GrMtlRenderCommandEncoder::setStencilFrontBackReferenceValues ( uint32_t  frontReferenceValue,
uint32_t  backReferenceValue 
)

◆ setStencilReferenceValue()

void GrMtlRenderCommandEncoder::setStencilReferenceValue ( uint32_t  referenceValue)
inline

Definition at line 162 of file GrMtlRenderCommandEncoder.h.

162 {
163 [fCommandEncoder setStencilReferenceValue:referenceValue];
164 }
void setStencilReferenceValue(uint32_t referenceValue)

◆ setTriangleFillMode()

void GrMtlRenderCommandEncoder::setTriangleFillMode ( MTLTriangleFillMode  fillMode)
inline

Definition at line 55 of file GrMtlRenderCommandEncoder.h.

55 {
56 if (fCurrentTriangleFillMode != fillMode) {
57 [fCommandEncoder setTriangleFillMode:fillMode];
58 fCurrentTriangleFillMode = fillMode;
59 }
60 }
void setTriangleFillMode(MTLTriangleFillMode fillMode)

◆ setVertexBuffer()

void GrMtlRenderCommandEncoder::setVertexBuffer ( id< MTLBuffer >  buffer,
NSUInteger  offset,
NSUInteger  index 
)
inline

Definition at line 70 of file GrMtlRenderCommandEncoder.h.

70 {
71 if (@available(macOS 10.11, iOS 8.3, tvOS 9.0, *)) {
72 if (fCurrentVertexBuffer[index] == buffer) {
73 this->setVertexBufferOffset(offset, index);
74 return;
75 }
76 }
77 if (fCurrentVertexBuffer[index] != buffer || fCurrentVertexOffset[index] != offset) {
78 [fCommandEncoder setVertexBuffer:buffer
80 atIndex:index];
81 fCurrentVertexBuffer[index] = buffer;
82 fCurrentVertexOffset[index] = offset;
83 }
84 }
void setVertexBufferOffset(NSUInteger offset, NSUInteger index) SK_API_AVAILABLE(macos(10.11)
void setVertexBuffer(id< MTLBuffer > buffer, NSUInteger offset, NSUInteger index)

◆ setVertexBufferOffset()

void GrMtlRenderCommandEncoder::setVertexBufferOffset ( NSUInteger  offset,
NSUInteger  index 
)

◆ setVertexBytes()

void GrMtlRenderCommandEncoder::setVertexBytes ( const void *  bytes,
NSUInteger  length,
NSUInteger  index 
)

◆ setViewport()

void GrMtlRenderCommandEncoder::setViewport ( const MTLViewport &  viewport)
inline

Definition at line 66 of file GrMtlRenderCommandEncoder.h.

66 {
67 [fCommandEncoder setViewport:viewport];
68 }
void setViewport(const MTLViewport &viewport)

◆ tvos() [1/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 86 of file GrMtlRenderCommandEncoder.h.

86 {
87 if (fCurrentVertexOffset[index] != offset) {
88 [fCommandEncoder setVertexBufferOffset:offset
89 atIndex:index];
90 fCurrentVertexOffset[index] = offset;
91 }
92 }

◆ tvos() [2/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 110 of file GrMtlRenderCommandEncoder.h.

110 {
111 if (fCurrentFragmentOffset[index] != offset) {
112 [fCommandEncoder setFragmentBufferOffset:offset
113 atIndex:index];
114 fCurrentFragmentOffset[index] = offset;
115 }
116 }

◆ tvos() [3/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 119 of file GrMtlRenderCommandEncoder.h.

119 {
120 [fCommandEncoder setVertexBytes:bytes
122 atIndex:index];
123 }
void setVertexBytes(const void *bytes, NSUInteger length, NSUInteger index) SK_API_AVAILABLE(macos(10.11)
size_t length

◆ tvos() [4/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 125 of file GrMtlRenderCommandEncoder.h.

125 {
126 [fCommandEncoder setFragmentBytes:bytes
128 atIndex:index];
129 }
void setFragmentBytes(const void *bytes, NSUInteger length, NSUInteger index) SK_API_AVAILABLE(macos(10.11)

◆ tvos() [5/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 157 of file GrMtlRenderCommandEncoder.h.

157 {
158 [fCommandEncoder
159 setStencilFrontReferenceValue:frontReferenceValue
160 backReferenceValue:backReferenceValue];
161 }

◆ tvos() [6/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 191 of file GrMtlRenderCommandEncoder.h.

191 {
192 [fCommandEncoder drawPrimitives:primitiveType
193 vertexStart:vertexStart
194 vertexCount:vertexCount
195 instanceCount:instanceCount
196 baseInstance:baseInstance];
197 }

◆ tvos() [7/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 200 of file GrMtlRenderCommandEncoder.h.

200 {
201 [fCommandEncoder drawPrimitives:primitiveType
202 indirectBuffer:indirectBuffer
203 indirectBufferOffset:indirectBufferOffset];
204 }

◆ tvos() [8/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 221 of file GrMtlRenderCommandEncoder.h.

221 {
222 [fCommandEncoder drawIndexedPrimitives:primitiveType
223 indexCount:indexCount
224 indexType:indexType
225 indexBuffer:indexBuffer
226 indexBufferOffset:indexBufferOffset
227 instanceCount:instanceCount
228 baseVertex:baseVertex
229 baseInstance:baseInstance];
230 }

◆ tvos() [9/9]

void GrMtlRenderCommandEncoder::tvos ( 9.  0)
inline

Definition at line 235 of file GrMtlRenderCommandEncoder.h.

235 {
236 [fCommandEncoder drawIndexedPrimitives:primitiveType
237 indexType:indexType
238 indexBuffer:indexBuffer
239 indexBufferOffset:indexBufferOffset
240 indirectBuffer:indirectBuffer
241 indirectBufferOffset:indirectBufferOffset];
242 }

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