Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrCaps.h
Go to the documentation of this file.
1
2/*
3 * Copyright 2013 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8#ifndef GrCaps_DEFINED
9#define GrCaps_DEFINED
10
15#include "include/gpu/GrTypes.h"
18#include "src/gpu/Blend.h"
19#include "src/gpu/Swizzle.h"
23
24#include <algorithm>
25#include <cstddef>
26#include <cstdint>
27#include <memory>
28#include <string>
29#include <string_view>
30#include <tuple>
31#include <vector>
32
33class GrBackendFormat;
35class GrProgramDesc;
36class GrProgramInfo;
37class GrRenderTarget;
39class GrSurface;
40class SkJSONWriter;
42struct GrContextOptions;
43struct SkIRect;
44struct SkISize;
45
46namespace skgpu {
47 class KeyBuilder;
48 enum class Mipmapped : bool;
49}
50namespace GrTest {
51 struct TestFormatColorTypeCombination;
52}
53
54/**
55 * Represents the capabilities of a GrContext.
56 */
57class GrCaps : public SkCapabilities {
58public:
60
61 void dumpJSON(SkJSONWriter*) const;
62
63 const GrShaderCaps* shaderCaps() const { return fShaderCaps.get(); }
64
65#if defined(GR_TEST_UTILS)
66 std::string_view deviceName() const { return fDeviceName; }
67#endif
68
70 /** To avoid as-yet-unnecessary complexity we don't allow any partial support of MIP Maps (e.g.
71 only for POT textures) */
72 bool mipmapSupport() const { return fMipmapSupport; }
73 /** Is anisotropic filtering supported. */
74 bool anisoSupport() const { return fAnisoSupport; }
75
76 bool gpuTracingSupport() const { return fGpuTracingSupport; }
81 // Is there hardware support for indirect draws? (Ganesh always supports indirect draws as long
82 // as it can polyfill them with instanced calls, but this cap tells us if they are supported
83 // natively.)
86#ifdef SK_DEBUG
88 // We might implement indirect draws with a polyfill, so the commands need to reside in
89 // CPU memory.
91 }
92#endif
94 }
96 bool wireframeSupport() const { return fWireframeSupport; }
97 // This flag indicates that we never have to resolve MSAA. In practice, it means that we have
98 // an MSAA-render-to-texture extension: Any render target we create internally will use the
99 // extension, and any wrapped render target is the client's responsibility.
101 // If true then when doing MSAA draws, we will prefer to discard the msaa attachment on load
102 // and stores. The use of this feature for specific draws depends on the render target having a
103 // resolve attachment, and if we need to load previous data the resolve attachment must be
104 // usable as an input attachment/texture. Otherwise we will just write out and store the msaa
105 // attachment like normal.
106 // This flag is similar to enabling gl render to texture for msaa rendering.
109
110 // Primitive restart functionality is core in ES 3.0, but using it will cause slowdowns on some
111 // systems. This cap is only set if primitive restart will improve performance.
113
115
116 // On tilers, an initial fullscreen clear is an OPTIMIZATION. It allows the hardware to
117 // initialize each tile with a constant value rather than loading each pixel from memory.
119
120 // Should we discard stencil values after a render pass? (Tilers get better performance if we
121 // always load stencil buffers with a "clear" op, and then discard the content when finished.)
123 // b/160958008
124 return false;
125#if 0
126 // This method is actually just a duplicate of preferFullscreenClears(), with a descriptive
127 // name for the sake of readability.
128 return this->preferFullscreenClears();
129#endif
130 }
131
132 // D3D does not allow the refs or masks to differ on a two-sided stencil draw.
136
138
140
142
143 // glDrawElementsIndirect fails GrMeshTest on every Win10 Intel bot.
145
146 /**
147 * Indicates the capabilities of the fixed function blend unit.
148 */
150 kBasic_BlendEquationSupport, //<! Support to select the operator that
151 // combines src and dst terms.
152 kAdvanced_BlendEquationSupport, //<! Additional fixed function support for specific
153 // SVG/PDF blend modes. Requires blend barriers.
154 kAdvancedCoherent_BlendEquationSupport, //<! Advanced blend equation support that does not
155 // require blend barriers, and permits overlap.
156
158 };
159
161
165
169
173 return SkToBool(fAdvBlendEqDisableFlags & (1 << static_cast<int>(equation)));
174 }
175
176 // On some GPUs it is a performance win to disable blending instead of doing src-over with a src
177 // alpha equal to 1. To disable blending we collapse src-over to src and the backends will
178 // handle the disabling of blending.
182
183 // When abandoning the GrDirectContext do we need to sync the GPU before we start abandoning
184 // resources.
187 }
188
189 // Shortcut for shaderCaps()->fReducedShaderMode.
190 bool reducedShaderMode() const { return this->shaderCaps()->fReducedShaderMode; }
191
192 /**
193 * Indicates whether GPU->CPU memory mapping for GPU resources such as vertex buffers and
194 * textures allows partial mappings or full mappings.
195 */
196 enum MapFlags {
197 kNone_MapFlags = 0x0, //<! Cannot map the resource.
198
199 kCanMap_MapFlag = 0x1, //<! The resource can be mapped. Must be set for any of
200 // the other flags to have meaning.
201 kSubset_MapFlag = 0x2, //<! The resource can be partially mapped.
202 kAsyncRead_MapFlag = 0x4, //<! Are maps for reading asynchronous WRT GrOpsRenderPass
203 // submitted to GrGpu.
204 };
205
206 // This returns the general mapping support for the GPU. However, even if this returns a flag
207 // that says buffers can be mapped, it does NOT mean that every buffer will be mappable. Thus
208 // calls of map should still check to see if a valid pointer was returned from the map call and
209 // handle fallbacks appropriately. If this does return kNone_MapFlags then all calls to map() on
210 // any buffer will fail.
211 uint32_t mapBufferFlags() const { return fMapBufferFlags; }
212
213 // Scratch textures not being reused means that those scratch textures
214 // that we upload to (i.e., don't have a render target) will not be
215 // recycled in the texture cache. This is to prevent ghosting by drivers
216 // (in particular for deferred architectures).
219
220 /// maximum number of attribute values per vertex
222
224
225 /** This is the largest render target size that can be used without incurring extra perfomance
226 cost. It is usually the max RT size, unless larger render targets are known to be slower. */
228
229 int maxTextureSize() const { return fMaxTextureSize; }
230
232
233 // Returns whether window rectangles are supported for the given backend render target.
237
238 uint32_t maxPushConstantsSize() const { return fMaxPushConstantsSize; }
239
240 // Alignment requirement for row bytes in buffer<->texture transfers.
242
243 // Alignment requirement for offsets and size in buffer->buffer transfers.
247
248 // Alignment requirement for offset and size passed to in GrGpuBuffer::updateData when the
249 // preserve param is true.
253
254 virtual bool isFormatSRGB(const GrBackendFormat&) const = 0;
255
256 bool isFormatCompressed(const GrBackendFormat& format) const;
257
258 // Can a texture be made with the GrBackendFormat and texture type, and then be bound and
259 // sampled in a shader.
260 virtual bool isFormatTexturable(const GrBackendFormat&, GrTextureType) const = 0;
261
262 // Returns whether a texture of the given format can be copied to a texture of the same format.
263 virtual bool isFormatCopyable(const GrBackendFormat&) const = 0;
264
265 // Returns the maximum supported sample count for a format. 0 means the format is not renderable
266 // 1 means the format is renderable but doesn't support MSAA.
267 virtual int maxRenderTargetSampleCount(const GrBackendFormat&) const = 0;
268
269 // Returns the number of samples to use when performing draws to the given config with internal
270 // MSAA. If 0, Ganesh should not attempt to use internal multisampling.
272 return std::min(fInternalMultisampleCount, this->maxRenderTargetSampleCount(format));
273 }
274
276 int sampleCount = 1) const = 0;
277
278 virtual bool isFormatRenderable(const GrBackendFormat& format, int sampleCount) const = 0;
279
280 // Find a sample count greater than or equal to the requested count which is supported for a
281 // render target of the given format or 0 if no such sample count is supported. If the requested
282 // sample count is 1 then 1 will be returned if non-MSAA rendering is supported, otherwise 0.
283 // For historical reasons requestedCount==0 is handled identically to requestedCount==1.
284 virtual int getRenderTargetSampleCount(int requestedCount, const GrBackendFormat&) const = 0;
285
286 /**
287 * Backends may have restrictions on what types of surfaces support GrGpu::writePixels().
288 * If this returns false then the caller should implement a fallback where a temporary texture
289 * is created, pixels are written to it, and then that is copied or drawn into the the surface.
290 */
291 bool surfaceSupportsWritePixels(const GrSurface*) const;
292
293 /**
294 * Indicates whether surface supports GrGpu::readPixels, must be copied, or cannot be read.
295 */
297 /** GrGpu::readPixels is supported by the surface. */
299 /**
300 * GrGpu::readPixels is not supported by this surface but this surface can be drawn
301 * or copied to a Ganesh-created GrTextureType::kTexture2D and then that surface will be
302 * readable.
303 */
305 /**
306 * Not supported
307 */
309 };
310 /**
311 * Backends may have restrictions on what types of surfaces support GrGpu::readPixels(). We may
312 * either be able to read directly from the surface, read from a copy of the surface, or not
313 * read at all.
314 */
316
319 // If the write is occurring using GrGpu::transferPixelsTo then this provides the
320 // minimum alignment of the offset into the transfer buffer.
322 };
323
324 /**
325 * Given a dst pixel config and a src color type what color type must the caller coax the
326 * the data into in order to use GrGpu::writePixels().
327 */
329 const GrBackendFormat& surfaceFormat,
330 GrColorType srcColorType) const = 0;
331
334 // If the read is occurring using GrGpu::transferPixelsFrom then this provides the
335 // minimum alignment of the offset into the transfer buffer.
337 };
338
339 /**
340 * Given a src surface's color type and its backend format as well as a color type the caller
341 * would like read into, this provides a legal color type that the caller may pass to
342 * GrGpu::readPixels(). The returned color type may differ from the passed dstColorType, in
343 * which case the caller must convert the read pixel data (see GrConvertPixels). When converting
344 * to dstColorType the swizzle in the returned struct should be applied. The caller must check
345 * the returned color type for kUnknown.
346 */
348 const GrBackendFormat& srcFormat,
349 GrColorType dstColorType) const;
350
351 /**
352 * Does GrGpu::writePixels() support a src buffer where the row bytes is not equal to bpp * w?
353 */
355
356 /**
357 * Does GrGpu::transferPixelsTo() support a src buffer where the row bytes is not equal to
358 * bpp * w?
359 */
361
362 /**
363 * Does GrGpu::readPixels() support a dst buffer where the row bytes is not equal to bpp * w?
364 */
366
370
371 bool suppressPrints() const { return fSuppressPrints; }
372
373 size_t bufferMapThreshold() const {
375 return static_cast<size_t>(fBufferMapThreshold);
376 }
377
378 /** True in environments that will issue errors if memory uploaded to buffers
379 is not initialized (even if not read by draw calls). */
381
382 /** For some environments, there is a performance or safety concern to not
383 initializing textures. For example, with WebGL and Firefox, there is a large
384 performance hit to not doing it.
385 */
387
388 /**
389 * When a new GrGpuBuffer is created is it known to contain all zero bytes?
390 */
392
393 /** Returns true if the given backend supports importing AHardwareBuffers via the
394 * GrAHardwarebufferImageGenerator. This will only ever be supported on Android devices with API
395 * level >= 26.
396 * */
398
399 bool wireframeMode() const { return fWireframeMode; }
400
401 /** Supports using GrSemaphores. */
402 bool semaphoreSupport() const { return fSemaphoreSupport; }
403
404 /** Supports using GrBackendSemaphore as "signal" semaphores or for waiting. See also
405 * GrFlushInfo and GrDirectContext. */
407
408 /** Supports async callback for finishedProcs */
410
412 /**
413 * Returns whether or not we will be able to do a copy given the passed in params
414 */
415 bool canCopySurface(const GrSurfaceProxy* dst, const SkIRect& dstRect,
416 const GrSurfaceProxy* src, const SkIRect& srcRect) const;
417
421
423
424 // Not all backends support clearing with a scissor test (e.g. Metal), this will always
425 // return true if performColorClearsAsDraws() returns true.
429
430 // Many drivers have issues with color clears.
432
434
435 /// Adreno 4xx devices experience an issue when there are a large number of stencil clip bit
436 /// clears. The minimal repro steps are not precisely known but drawing a rect with a stencil
437 /// op instead of using glClear seems to resolve the issue.
439
440 // Should we disable TessellationPathRenderer due to a faulty driver?
442
443 // Returns how to sample the dst values for the passed in GrRenderTargetProxy.
444 GrDstSampleFlags getDstSampleFlagsForProxy(const GrRenderTargetProxy*, bool drawUsesMSAA) const;
445
446 /**
447 * This is used to try to ensure a successful copy a dst in order to perform shader-based
448 * blending.
449 *
450 * fRectsMustMatch will be set to true if the copy operation must ensure that the src and dest
451 * rects are identical.
452 *
453 * fMustCopyWholeSrc will be set to true if copy rect must equal src's bounds.
454 *
455 * Caller will detect cases when copy cannot succeed and try copy-as-draw as a fallback.
456 */
462 GrColorType ct) const {
463 return {};
464 }
465
466 bool validateSurfaceParams(const SkISize&,
467 const GrBackendFormat&,
468 GrRenderable renderable,
469 int renderTargetSampleCnt,
471 GrTextureType) const;
472
474
475 /** These are used when creating a new texture internally. */
477
479
480 /**
481 * The CLAMP_TO_BORDER wrap mode for texture coordinates was added to desktop GL in 1.3, and
482 * GLES 3.2, but is also available in extensions. Vulkan and Metal always have support.
483 */
485
486 /**
487 * Returns the skgpu::Swizzle to use when sampling or reading back from a texture with the
488 * passed in GrBackendFormat and GrColorType.
489 */
491
492 /**
493 * Returns the skgpu::Swizzle to use when writing colors to a surface with the passed in
494 * GrBackendFormat and GrColorType.
495 */
497
498 virtual uint64_t computeFormatKey(const GrBackendFormat&) const = 0;
499
501
502 /**
503 * Adds fields to the key to represent the sampler that will be created for the passed
504 * in parameters. Currently this extra keying is only needed when building a vulkan pipeline
505 * with immutable samplers.
506 */
509 const GrBackendFormat&) const {}
510
512 kNone = 0,
513 // If using discardable msaa surfaces in vulkan, when we break up a render pass for an
514 // inline upload, we must do a load msaa subpass for the second render pass. However, if the
515 // original render pass did not have this load subpass (e.g. clear or discard load op), then
516 // all the GrProgramInfos for draws that end up in the second render pass will have been
517 // recorded thinking they will be in a render pass with only 1 subpass. Thus we add an
518 // override flag to the makeDesc call to force the actually VkPipeline that gets created to
519 // be created using a render pass with 2 subpasses. We do miss on the pre-compile with this
520 // approach, but inline uploads are very rare and already slow.
522 };
524
525
529
530 // This method specifies, for each backend, the extra properties of a RT when Ganesh creates one
531 // internally. For example, for Vulkan, Ganesh always creates RTs that can be used as input
532 // attachments.
536
537 bool supportsDynamicMSAA(const GrRenderTargetProxy*) const;
538
539 virtual bool dmsaaResolveCanBeUsedAsTextureInSameRenderPass() const { return true; }
540
541 // skbug.com/11935. Task reordering is disabled for some GPUs on GL due to driver bugs.
545
546 bool avoidDithering() const {
547 return fAvoidDithering;
548 }
549
553
554 // anglebug.com/7796
555 bool avoidLineDraws() const { return fAvoidLineDraws; }
556
557 /**
558 * Checks whether the passed color type is renderable. If so, the same color type is passed
559 * back along with the default format used for the color type. If not, provides an alternative
560 * (perhaps lower bit depth and/or unorm instead of float) color type that is supported
561 * along with it's default format or kUnknown if there no renderable fallback format.
562 */
563 std::tuple<GrColorType, GrBackendFormat> getFallbackColorTypeAndFormat(GrColorType,
564 int sampleCount) const;
565
566#if defined(GR_TEST_UTILS)
567 virtual std::vector<GrTest::TestFormatColorTypeCombination> getTestingCombinations() const = 0;
568#endif
569
570protected:
571 // Subclasses must call this at the end of their init method in order to do final processing on
572 // the caps (including overrides requested by the client).
573 // NOTE: this method will only reduce the caps, never expand them.
575
576#if defined(GR_TEST_UTILS)
577 void setDeviceName(const char* n) {
578 fDeviceName = n;
579 }
580#endif
581
582 virtual bool onSupportsDynamicMSAA(const GrRenderTargetProxy*) const { return false; }
583
584 std::unique_ptr<GrShaderCaps> fShaderCaps;
585
624
625 // Driver workaround
634
635 // ANGLE performance workaround
637
641
642 // Requires fence sync support in GL.
644
645 // Not (yet) implemented in VK backend.
647
649
652 static_assert(static_cast<int>(skgpu::BlendEquation::kLast) < 32);
653
656
667
669
670#if defined(GR_TEST_UTILS)
671 std::string fDeviceName;
672#endif
673
674private:
675 void applyOptionsOverrides(const GrContextOptions& options);
676
678 virtual void onDumpJSON(SkJSONWriter*) const {}
679 virtual bool onSurfaceSupportsWritePixels(const GrSurface*) const = 0;
680 virtual bool onCanCopySurface(const GrSurfaceProxy* dst, const SkIRect& dstRect,
681 const GrSurfaceProxy* src, const SkIRect& srcRect) const = 0;
683
684 // Backends should implement this if they have any extra requirements for use of window
685 // rectangles for a specific GrBackendRenderTarget outside of basic support.
687 return true;
688 }
689
691
693 const GrBackendFormat& srcFormat,
694 GrColorType dstColorType) const = 0;
695
697
701
702 bool fSuppressPrints : 1;
703 bool fWireframeMode : 1;
704
705 using INHERITED = SkRefCnt;
706};
707
709
710#endif
const char * options
GrDstSampleFlags
GrTextureType
GrColorType
GrInternalSurfaceFlags
#define GR_MAKE_BITFIELD_CLASS_OPS(X)
Definition GrTypes.h:42
#define SkASSERT(cond)
Definition SkAssert.h:116
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static constexpr bool SkToBool(const T &x)
Definition SkTo.h:35
bool discardStencilValuesAfterRenderPass() const
Definition GrCaps.h:122
virtual void addExtraSamplerKey(skgpu::KeyBuilder *, GrSamplerState, const GrBackendFormat &) const
Definition GrCaps.h:507
virtual skgpu::Swizzle onGetReadSwizzle(const GrBackendFormat &, GrColorType) const =0
bool fSupportsProtectedContent
Definition GrCaps.h:648
bool advancedBlendEquationSupport() const
Definition GrCaps.h:162
virtual void onApplyOptionsOverrides(const GrContextOptions &)
Definition GrCaps.h:677
bool avoidLineDraws() const
Definition GrCaps.h:555
SurfaceReadPixelsSupport
Definition GrCaps.h:296
bool transferFromBufferToBufferSupport() const
Definition GrCaps.h:369
bool avoidWritePixelsFastPath() const
Definition GrCaps.h:141
bool fDynamicStateArrayGeometryProcessorTextureSupport
Definition GrCaps.h:646
int fMaxPreferredRenderTargetSize
Definition GrCaps.h:658
bool shouldInitializeTextures() const
Definition GrCaps.h:386
virtual uint64_t computeFormatKey(const GrBackendFormat &) const =0
bool reducedShaderMode() const
Definition GrCaps.h:190
int fMaxVertexAttributes
Definition GrCaps.h:659
bool fFinishedProcAsyncCallbackSupport
Definition GrCaps.h:640
std::tuple< GrColorType, GrBackendFormat > getFallbackColorTypeAndFormat(GrColorType, int sampleCount) const
Definition GrCaps.cpp:499
bool fAvoidStencilBuffers
Definition GrCaps.h:627
bool mipmapSupport() const
Definition GrCaps.h:72
int fMaxRenderTargetSize
Definition GrCaps.h:657
virtual GrInternalSurfaceFlags getExtraSurfaceFlagsForDeferredRT() const
Definition GrCaps.h:533
bool disablePerspectiveSDFText() const
Definition GrCaps.h:550
bool finishedProcAsyncCallbackSupport() const
Definition GrCaps.h:409
bool fReadPixelsRowBytesSupport
Definition GrCaps.h:621
bool performPartialClearsAsDraws() const
Definition GrCaps.h:426
GrDstSampleFlags getDstSampleFlagsForProxy(const GrRenderTargetProxy *, bool drawUsesMSAA) const
Definition GrCaps.cpp:461
bool crossContextTextureSupport() const
Definition GrCaps.h:411
virtual bool isFormatTexturable(const GrBackendFormat &, GrTextureType) const =0
virtual GrDstSampleFlags onGetDstSampleFlagsForProxy(const GrRenderTargetProxy *) const
Definition GrCaps.h:698
bool fNativeDrawIndexedIndirectIsBroken
Definition GrCaps.h:629
const GrShaderCaps * shaderCaps() const
Definition GrCaps.h:63
std::unique_ptr< GrShaderCaps > fShaderCaps
Definition GrCaps.h:584
virtual SupportedWrite supportedWritePixelsColorType(GrColorType surfaceColorType, const GrBackendFormat &surfaceFormat, GrColorType srcColorType) const =0
bool fPreferClientSideDynamicBuffers
Definition GrCaps.h:603
bool fMSAAResolvesAutomatically
Definition GrCaps.h:600
virtual int maxRenderTargetSampleCount(const GrBackendFormat &) const =0
bool fReuseScratchTextures
Definition GrCaps.h:589
bool anisoSupport() const
Definition GrCaps.h:74
bool surfaceSupportsWritePixels(const GrSurface *) const
Definition GrCaps.cpp:305
bool avoidReorderingRenderTasks() const
Definition GrCaps.h:542
GrDriverBugWorkarounds fDriverBugWorkarounds
Definition GrCaps.h:668
bool conservativeRasterSupport() const
Definition GrCaps.h:95
size_t bufferUpdateDataPreserveAlignment() const
Definition GrCaps.h:250
virtual skgpu::Swizzle getWriteSwizzle(const GrBackendFormat &, GrColorType) const =0
bool semaphoreSupport() const
Definition GrCaps.h:402
bool fNativeDrawIndirectSupport
Definition GrCaps.h:596
bool fPreferVRAMUseOverFlushes
Definition GrCaps.h:636
bool fAnisoSupport
Definition GrCaps.h:588
bool supportsProtectedContent() const
Definition GrCaps.h:422
int maxTextureSize() const
Definition GrCaps.h:229
virtual GrBackendFormat getBackendFormatFromCompressionType(SkTextureCompressionType) const =0
bool fAvoidLineDraws
Definition GrCaps.h:633
virtual SurfaceReadPixelsSupport surfaceSupportsReadPixels(const GrSurface *) const =0
bool transferFromBufferToTextureSupport() const
Definition GrCaps.h:368
virtual GrProgramDesc makeDesc(GrRenderTarget *, const GrProgramInfo &, ProgramDescOverrideFlags overrideFlags=ProgramDescOverrideFlags::kNone) const =0
bool avoidStencilBuffers() const
Definition GrCaps.h:139
uint32_t fMaxPushConstantsSize
Definition GrCaps.h:663
int maxVertexAttributes() const
maximum number of attribute values per vertex
Definition GrCaps.h:221
bool fTransferFromBufferToBufferSupport
Definition GrCaps.h:618
int maxRenderTargetSize() const
Definition GrCaps.h:223
bool backendSemaphoreSupport() const
Definition GrCaps.h:406
virtual void onDumpJSON(SkJSONWriter *) const
Definition GrCaps.h:678
bool fTransferFromBufferToTextureSupport
Definition GrCaps.h:616
virtual bool onAreColorTypeAndFormatCompatible(GrColorType, const GrBackendFormat &) const =0
bool fTextureBarrierSupport
Definition GrCaps.h:593
bool fAvoidLargeIndexBufferDraws
Definition GrCaps.h:614
uint32_t fAdvBlendEqDisableFlags
Definition GrCaps.h:651
bool wireframeMode() const
Definition GrCaps.h:399
bool fBuffersAreInitiallyZero
Definition GrCaps.h:607
bool fTransferPixelsToRowBytesSupport
Definition GrCaps.h:620
int fBufferMapThreshold
Definition GrCaps.h:655
bool clampToBorderSupport() const
Definition GrCaps.h:484
bool preferDiscardableMSAAAttachment() const
Definition GrCaps.h:107
virtual DstCopyRestrictions getDstCopyRestrictions(const GrRenderTargetProxy *src, GrColorType ct) const
Definition GrCaps.h:461
size_t transferFromBufferToBufferAlignment() const
Definition GrCaps.h:244
bool fMustSyncGpuDuringAbandon
Definition GrCaps.h:623
bool wireframeSupport() const
Definition GrCaps.h:96
virtual bool isFormatSRGB(const GrBackendFormat &) const =0
bool avoidLargeIndexBufferDraws() const
Definition GrCaps.h:433
bool fBackendSemaphoreSupport
Definition GrCaps.h:639
bool preferClientSideDynamicBuffers() const
Definition GrCaps.h:114
BlendEquationSupport
Definition GrCaps.h:149
@ kAdvancedCoherent_BlendEquationSupport
Definition GrCaps.h:154
@ kLast_BlendEquationSupport
Definition GrCaps.h:157
@ kAdvanced_BlendEquationSupport
Definition GrCaps.h:152
@ kBasic_BlendEquationSupport
Definition GrCaps.h:150
bool halfFloatVertexAttributeSupport() const
Definition GrCaps.h:108
void dumpJSON(SkJSONWriter *) const
Definition GrCaps.cpp:302
bool nativeDrawIndirectSupport() const
Definition GrCaps.h:84
bool fHalfFloatVertexAttributeSupport
Definition GrCaps.h:610
bool fClampToBorderSupport
Definition GrCaps.h:611
bool fSampleLocationsSupport
Definition GrCaps.h:594
bool fGpuTracingSupport
Definition GrCaps.h:591
bool fOversizedStencilSupport
Definition GrCaps.h:592
bool buffersAreInitiallyZero() const
Definition GrCaps.h:391
bool fSemaphoreSupport
Definition GrCaps.h:638
virtual bool isFormatCopyable(const GrBackendFormat &) const =0
bool nativeDrawIndexedIndirectIsBroken() const
Definition GrCaps.h:144
bool areColorTypeAndFormatCompatible(GrColorType grCT, const GrBackendFormat &format) const
Definition GrCaps.cpp:428
bool supportsDynamicMSAA(const GrRenderTargetProxy *) const
Definition GrCaps.cpp:470
bool drawInstancedSupport() const
Definition GrCaps.h:80
int fMaxWindowRectangles
Definition GrCaps.h:661
bool fTwoSidedStencilRefsAndMasksMustMatch
Definition GrCaps.h:605
bool usePrimitiveRestart() const
Definition GrCaps.h:112
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
Definition GrCaps.cpp:400
virtual bool onCanCopySurface(const GrSurfaceProxy *dst, const SkIRect &dstRect, const GrSurfaceProxy *src, const SkIRect &srcRect) const =0
bool fUsePrimitiveRestart
Definition GrCaps.h:602
bool advancedCoherentBlendEquationSupport() const
Definition GrCaps.h:166
virtual bool isFormatRenderable(const GrBackendFormat &format, int sampleCount) const =0
int maxPreferredRenderTargetSize() const
Definition GrCaps.h:227
bool sampleLocationsSupport() const
Definition GrCaps.h:79
bool fMipmapSupport
Definition GrCaps.h:587
bool fWireframeSupport
Definition GrCaps.h:599
int fInternalMultisampleCount
Definition GrCaps.h:662
uint32_t maxPushConstantsSize() const
Definition GrCaps.h:238
ProgramDescOverrideFlags
Definition GrCaps.h:511
bool isFormatCompressed(const GrBackendFormat &format) const
Definition GrCaps.cpp:457
uint32_t fMapBufferFlags
Definition GrCaps.h:654
bool npotTextureTileSupport() const
Definition GrCaps.h:69
GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(ProgramDescOverrideFlags)
bool fPerformPartialClearsAsDraws
Definition GrCaps.h:612
uint32_t mapBufferFlags() const
Definition GrCaps.h:211
bool fReuseScratchBuffers
Definition GrCaps.h:590
virtual SupportedRead onSupportedReadPixelsColorType(GrColorType srcColorType, const GrBackendFormat &srcFormat, GrColorType dstColorType) const =0
bool fWritePixelsRowBytesSupport
Definition GrCaps.h:619
bool fShouldCollapseSrcOverToSrcWhenAble
Definition GrCaps.h:622
const GrDriverBugWorkarounds & workarounds() const
Definition GrCaps.h:500
size_t fTransferBufferRowBytesAlignment
Definition GrCaps.h:664
bool disableTessellationPathRenderer() const
Definition GrCaps.h:441
bool dynamicStateArrayGeometryProcessorTextureSupport() const
Definition GrCaps.h:418
bool isWindowRectanglesSupportedForRT(const GrBackendRenderTarget &rt) const
Definition GrCaps.h:234
bool textureBarrierSupport() const
Definition GrCaps.h:78
bool avoidDithering() const
Definition GrCaps.h:546
size_t bufferMapThreshold() const
Definition GrCaps.h:373
bool fPerformColorClearsAsDraws
Definition GrCaps.h:613
bool fAvoidReorderingRenderTasks
Definition GrCaps.h:630
bool useClientSideIndirectBuffers() const
Definition GrCaps.h:85
bool twoSidedStencilRefsAndMasksMustMatch() const
Definition GrCaps.h:133
SupportedRead supportedReadPixelsColorType(GrColorType srcColorType, const GrBackendFormat &srcFormat, GrColorType dstColorType) const
Definition GrCaps.cpp:366
virtual bool isFormatAsColorTypeRenderable(GrColorType ct, const GrBackendFormat &format, int sampleCount=1) const =0
virtual bool onSupportsDynamicMSAA(const GrRenderTargetProxy *) const
Definition GrCaps.h:582
bool fNPOTTextureTileSupport
Definition GrCaps.h:586
bool validateSurfaceParams(const SkISize &, const GrBackendFormat &, GrRenderable renderable, int renderTargetSampleCnt, skgpu::Mipmapped, GrTextureType) const
Definition GrCaps.cpp:327
bool fSupportsAHardwareBufferImages
Definition GrCaps.h:609
bool isAdvancedBlendEquationDisabled(skgpu::BlendEquation equation) const
Definition GrCaps.h:170
bool fTransferFromSurfaceToBufferSupport
Definition GrCaps.h:617
bool fMustClearUploadedBufferData
Definition GrCaps.h:606
bool reuseScratchBuffers() const
Definition GrCaps.h:218
void finishInitialization(const GrContextOptions &options)
Definition GrCaps.cpp:107
virtual bool onSurfaceSupportsWritePixels(const GrSurface *) const =0
bool mustClearUploadedBufferData() const
Definition GrCaps.h:380
bool canCopySurface(const GrSurfaceProxy *dst, const SkIRect &dstRect, const GrSurfaceProxy *src, const SkIRect &srcRect) const
Definition GrCaps.cpp:309
bool mustSyncGpuDuringAbandon() const
Definition GrCaps.h:185
virtual bool dmsaaResolveCanBeUsedAsTextureInSameRenderPass() const
Definition GrCaps.h:539
bool shouldCollapseSrcOverToSrcWhenAble() const
Definition GrCaps.h:179
bool fShouldInitializeTextures
Definition GrCaps.h:608
size_t transferBufferRowBytesAlignment() const
Definition GrCaps.h:241
bool readPixelsRowBytesSupport() const
Definition GrCaps.h:365
bool oversizedStencilSupport() const
Definition GrCaps.h:77
bool performColorClearsAsDraws() const
Definition GrCaps.h:431
bool preferFullscreenClears() const
Definition GrCaps.h:118
MapFlags
Definition GrCaps.h:196
@ kCanMap_MapFlag
Definition GrCaps.h:199
@ kSubset_MapFlag
Definition GrCaps.h:201
@ kNone_MapFlags
Definition GrCaps.h:197
@ kAsyncRead_MapFlag
Definition GrCaps.h:202
virtual int getRenderTargetSampleCount(int requestedCount, const GrBackendFormat &) const =0
bool suppressPrints() const
Definition GrCaps.h:371
virtual GrBackendFormat onGetDefaultBackendFormat(GrColorType) const =0
bool fAvoidWritePixelsFastPath
Definition GrCaps.h:628
BlendEquationSupport fBlendEquationSupport
Definition GrCaps.h:650
size_t fBufferUpdateDataPreserveAlignment
Definition GrCaps.h:666
bool fPreferDiscardableMSAAAttachment
Definition GrCaps.h:601
bool msaaResolvesAutomatically() const
Definition GrCaps.h:100
bool fConservativeRasterSupport
Definition GrCaps.h:598
bool writePixelsRowBytesSupport() const
Definition GrCaps.h:354
BlendEquationSupport blendEquationSupport() const
Definition GrCaps.h:160
bool transferPixelsToRowBytesSupport() const
Definition GrCaps.h:360
bool reuseScratchTextures() const
Definition GrCaps.h:217
bool fDisableTessellationPathRenderer
Definition GrCaps.h:626
bool preferVRAMUseOverFlushes() const
Definition GrCaps.h:137
int internalMultisampleCount(const GrBackendFormat &format) const
Definition GrCaps.h:271
bool performStencilClearsAsDraws() const
Definition GrCaps.h:438
bool fUseClientSideIndirectBuffers
Definition GrCaps.h:597
bool fPerformStencilClearsAsDraws
Definition GrCaps.h:615
bool fDrawInstancedSupport
Definition GrCaps.h:595
size_t fTransferFromBufferToBufferAlignment
Definition GrCaps.h:665
bool supportsAHardwareBufferImages() const
Definition GrCaps.h:397
bool gpuTracingSupport() const
Definition GrCaps.h:76
int fMaxTextureSize
Definition GrCaps.h:660
bool fDisablePerspectiveSDFText
Definition GrCaps.h:632
virtual bool onIsWindowRectanglesSupportedForRT(const GrBackendRenderTarget &) const
Definition GrCaps.h:686
bool fCrossContextTextureSupport
Definition GrCaps.h:643
bool fPreferFullscreenClears
Definition GrCaps.h:604
bool fAvoidDithering
Definition GrCaps.h:631
skgpu::Swizzle getReadSwizzle(const GrBackendFormat &format, GrColorType colorType) const
Definition GrCaps.cpp:443
int maxWindowRectangles() const
Definition GrCaps.h:231
bool transferFromSurfaceToBufferSupport() const
Definition GrCaps.h:367
uint32_t uint32_t * format
static constexpr bool BlendEquationIsAdvanced(BlendEquation equation)
Definition Blend.h:129
BlendEquation
Definition Blend.h:26
Renderable
Definition GpuTypes.h:69
Mipmapped
Definition GpuTypes.h:53
GrSurfaceProxy::RectsMustMatch fRectsMustMatch
Definition GrCaps.h:458
GrColorType fColorType
Definition GrCaps.h:333
size_t fOffsetAlignmentForTransferBuffer
Definition GrCaps.h:336
GrColorType fColorType
Definition GrCaps.h:318
size_t fOffsetAlignmentForTransferBuffer
Definition GrCaps.h:321
bool fReducedShaderMode