Reland "Rename instanceAttribSupport -> drawInstancedSupport"
This is a reland of 17f05c737e44810cb043d781a9760b03f1cb719a
Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
>
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com
Change-Id: I2e15ac72d86747c30e71bb50d30da48a5a342772
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282118
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index a994862..4d7158d 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -24,7 +24,7 @@
fTextureBarrierSupport = false;
fSampleLocationsSupport = false;
fMultisampleDisableSupport = false;
- fInstanceAttribSupport = false;
+ fDrawInstancedSupport = false;
fMixedSamplesSupport = false;
fConservativeRasterSupport = false;
fWireframeSupport = false;
@@ -192,7 +192,7 @@
writer->appendBool("Texture Barrier Support", fTextureBarrierSupport);
writer->appendBool("Sample Locations Support", fSampleLocationsSupport);
writer->appendBool("Multisample disable support", fMultisampleDisableSupport);
- writer->appendBool("Instance Attrib Support", fInstanceAttribSupport);
+ writer->appendBool("Draw Instanced Support", fDrawInstancedSupport);
writer->appendBool("Mixed Samples Support", fMixedSamplesSupport);
writer->appendBool("Conservative Raster Support", fConservativeRasterSupport);
writer->appendBool("Wireframe Support", fWireframeSupport);
diff --git a/src/gpu/GrCaps.h b/src/gpu/GrCaps.h
index 5f36fa9..bae8597 100644
--- a/src/gpu/GrCaps.h
+++ b/src/gpu/GrCaps.h
@@ -51,7 +51,7 @@
bool textureBarrierSupport() const { return fTextureBarrierSupport; }
bool sampleLocationsSupport() const { return fSampleLocationsSupport; }
bool multisampleDisableSupport() const { return fMultisampleDisableSupport; }
- bool instanceAttribSupport() const { return fInstanceAttribSupport; }
+ bool drawInstancedSupport() const { return fDrawInstancedSupport; }
bool mixedSamplesSupport() const { return fMixedSamplesSupport; }
bool conservativeRasterSupport() const { return fConservativeRasterSupport; }
bool wireframeSupport() const { return fWireframeSupport; }
@@ -464,7 +464,7 @@
bool fTextureBarrierSupport : 1;
bool fSampleLocationsSupport : 1;
bool fMultisampleDisableSupport : 1;
- bool fInstanceAttribSupport : 1;
+ bool fDrawInstancedSupport : 1;
bool fMixedSamplesSupport : 1;
bool fConservativeRasterSupport : 1;
bool fWireframeSupport : 1;
diff --git a/src/gpu/GrOpsRenderPass.cpp b/src/gpu/GrOpsRenderPass.cpp
index 38cc0a1..8167363 100644
--- a/src/gpu/GrOpsRenderPass.cpp
+++ b/src/gpu/GrOpsRenderPass.cpp
@@ -65,7 +65,7 @@
// place (i.e., the target renderTargetProxy) they had best agree.
SkASSERT(programInfo.origin() == fOrigin);
if (programInfo.primProc().hasInstanceAttributes()) {
- SkASSERT(this->gpu()->caps()->instanceAttribSupport());
+ SkASSERT(this->gpu()->caps()->drawInstancedSupport());
}
if (programInfo.pipeline().usesConservativeRaster()) {
SkASSERT(this->gpu()->caps()->conservativeRasterSupport());
@@ -243,7 +243,7 @@
void GrOpsRenderPass::drawInstanced(int instanceCount, int baseInstance, int vertexCount,
int baseVertex) {
- SkASSERT(this->gpu()->caps()->instanceAttribSupport());
+ SkASSERT(this->gpu()->caps()->drawInstancedSupport());
if (!this->prepareToDraw()) {
return;
}
@@ -255,7 +255,7 @@
void GrOpsRenderPass::drawIndexedInstanced(int indexCount, int baseIndex, int instanceCount,
int baseInstance, int baseVertex) {
- SkASSERT(this->gpu()->caps()->instanceAttribSupport());
+ SkASSERT(this->gpu()->caps()->drawInstancedSupport());
if (!this->prepareToDraw()) {
return;
}
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
index c6c60f6..242b992 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
@@ -22,7 +22,7 @@
GrBackendFormat defaultA8Format = caps.getDefaultBackendFormat(GrColorType::kAlpha_8,
GrRenderable::kYes);
if (caps.driverBlacklistCCPR() || !shaderCaps.integerSupport() ||
- !caps.instanceAttribSupport() || !shaderCaps.floatIs32Bits() ||
+ !caps.drawInstancedSupport() || !shaderCaps.floatIs32Bits() ||
!defaultA8Format.isValid() || // This checks both texturable and renderable
!caps.halfFloatVertexAttributeSupport()) {
return false;
diff --git a/src/gpu/d3d/GrD3DCaps.cpp b/src/gpu/d3d/GrD3DCaps.cpp
index 2b3c3c5..8996804 100644
--- a/src/gpu/d3d/GrD3DCaps.cpp
+++ b/src/gpu/d3d/GrD3DCaps.cpp
@@ -27,7 +27,7 @@
fReuseScratchTextures = true; //TODO: figure this out
fGpuTracingSupport = false; //TODO: figure this out
fOversizedStencilSupport = false; //TODO: figure this out
- fInstanceAttribSupport = true;
+ fDrawInstancedSupport = true;
// TODO: implement these
fSemaphoreSupport = false;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index fb735ac..8ee42cb 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -33,7 +33,6 @@
fVertexArrayObjectSupport = false;
fDebugSupport = false;
fES2CompatibilitySupport = false;
- fDrawInstancedSupport = false;
fDrawIndirectSupport = false;
fDrawRangeElementsSupport = false;
fMultiDrawIndirectSupport = false;
@@ -205,18 +204,18 @@
if (GR_IS_GR_GL(standard)) {
// 3.1 has draw_instanced but not instanced_arrays, for the time being we only care about
// instanced arrays, but we could make this more granular if we wanted
- fInstanceAttribSupport =
+ fDrawInstancedSupport =
version >= GR_GL_VER(3, 2) ||
(ctxInfo.hasExtension("GL_ARB_draw_instanced") &&
ctxInfo.hasExtension("GL_ARB_instanced_arrays"));
} else if (GR_IS_GR_GL_ES(standard)) {
- fInstanceAttribSupport =
+ fDrawInstancedSupport =
version >= GR_GL_VER(3, 0) ||
(ctxInfo.hasExtension("GL_EXT_draw_instanced") &&
ctxInfo.hasExtension("GL_EXT_instanced_arrays"));
} else if (GR_IS_GR_WEBGL(standard)) {
// WebGL 2.0 has DrawArraysInstanced and drawElementsInstanced
- fInstanceAttribSupport = version >= GR_GL_VER(2, 0);
+ fDrawInstancedSupport = version >= GR_GL_VER(2, 0);
}
if (GR_IS_GR_GL(standard)) {
@@ -3547,7 +3546,7 @@
}
// http://anglebug.com/4538
- if (fBaseVertexBaseInstanceSupport && !fInstanceAttribSupport) {
+ if (fBaseVertexBaseInstanceSupport && !fDrawInstancedSupport) {
fBaseVertexBaseInstanceSupport = false;
}
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index b4efd5d..3142963 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -310,9 +310,6 @@
/// Is there support for ES2 compatability?
bool ES2CompatibilitySupport() const { return fES2CompatibilitySupport; }
- /// Is there support for glDraw*Instanced?
- bool drawInstancedSupport() const { return fDrawInstancedSupport; }
-
/// Is there support for glDraw*Indirect? Note that the baseInstance fields of indirect draw
/// commands cannot be used unless we have base instance support.
bool drawIndirectSupport() const { return fDrawIndirectSupport; }
@@ -525,7 +522,6 @@
bool fVertexArrayObjectSupport : 1;
bool fDebugSupport : 1;
bool fES2CompatibilitySupport : 1;
- bool fDrawInstancedSupport : 1;
bool fDrawIndirectSupport : 1;
bool fDrawRangeElementsSupport : 1;
bool fMultiDrawIndirectSupport : 1;
diff --git a/src/gpu/gl/GrGLOpsRenderPass.cpp b/src/gpu/gl/GrGLOpsRenderPass.cpp
index a9f6454..5759d74 100644
--- a/src/gpu/gl/GrGLOpsRenderPass.cpp
+++ b/src/gpu/gl/GrGLOpsRenderPass.cpp
@@ -143,7 +143,7 @@
uint16_t maxIndexValue, int baseVertex) {
GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
if (fGpu->glCaps().baseVertexBaseInstanceSupport()) {
- SkASSERT(fGpu->glCaps().instanceAttribSupport());
+ SkASSERT(fGpu->glCaps().drawInstancedSupport());
SkASSERT(!fActiveVertexBuffer);
if (baseVertex != 0) {
GL_CALL(DrawElementsInstancedBaseVertexBaseInstance(
diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp
index cf66bf6..faeeceb 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -85,7 +85,7 @@
size_t offsetInBytes,
int divisor) {
SkASSERT(index >= 0 && index < fAttribArrayStates.count());
- SkASSERT(0 == divisor || gpu->caps()->instanceAttribSupport());
+ SkASSERT(0 == divisor || gpu->caps()->drawInstancedSupport());
AttribArrayState* array = &fAttribArrayStates[index];
const char* offsetAsPtr;
bool bufferChanged = false;
@@ -134,7 +134,7 @@
array->fStride = stride;
array->fOffset = offsetAsPtr;
}
- if (gpu->caps()->instanceAttribSupport() && array->fDivisor != divisor) {
+ if (gpu->caps()->drawInstancedSupport() && array->fDivisor != divisor) {
SkASSERT(0 == divisor || 1 == divisor); // not necessarily a requirement but what we expect.
GR_GL_CALL(gpu->glInterface(), VertexAttribDivisor(index, divisor));
array->fDivisor = divisor;
diff --git a/src/gpu/mock/GrMockCaps.h b/src/gpu/mock/GrMockCaps.h
index 269977f..180f8b2 100644
--- a/src/gpu/mock/GrMockCaps.h
+++ b/src/gpu/mock/GrMockCaps.h
@@ -17,7 +17,7 @@
GrMockCaps(const GrContextOptions& contextOptions, const GrMockOptions& options)
: INHERITED(contextOptions), fOptions(options) {
fMipMapSupport = options.fMipMapSupport;
- fInstanceAttribSupport = options.fInstanceAttribSupport;
+ fDrawInstancedSupport = options.fDrawInstancedSupport;
fHalfFloatVertexAttributeSupport = options.fHalfFloatVertexAttributeSupport;
fMapBufferFlags = options.fMapBufferFlags;
fBufferMapThreshold = SK_MaxS32; // Overridable in GrContextOptions.
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index a8fb63c..6b1355f 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -279,7 +279,7 @@
if (@available(macOS 10.11, iOS 9.0, *)) {
if (this->isMac() || 3 == fFamilyGroup) {
- fInstanceAttribSupport = true;
+ fDrawInstancedSupport = true;
}
}
diff --git a/src/gpu/ops/GrFillRRectOp.cpp b/src/gpu/ops/GrFillRRectOp.cpp
index 771437c..76122e5 100644
--- a/src/gpu/ops/GrFillRRectOp.cpp
+++ b/src/gpu/ops/GrFillRRectOp.cpp
@@ -145,7 +145,7 @@
const GrCaps* caps = ctx->priv().caps();
- if (!caps->instanceAttribSupport()) {
+ if (!caps->drawInstancedSupport()) {
return nullptr;
}
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 73df0ac..06b6d2f 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -41,7 +41,7 @@
fReuseScratchTextures = true; //TODO: figure this out
fGpuTracingSupport = false; //TODO: figure this out
fOversizedStencilSupport = false; //TODO: figure this out
- fInstanceAttribSupport = true;
+ fDrawInstancedSupport = true;
fSemaphoreSupport = true; // always available in Vulkan
fFenceSyncSupport = true; // always available in Vulkan
@@ -477,7 +477,7 @@
#endif
if (kARM_VkVendor == properties.vendorID) {
- fInstanceAttribSupport = false;
+ fDrawInstancedSupport = false;
fAvoidWritePixelsFastPath = true; // bugs.skia.org/8064
}