Revert "Rename instanceAttribSupport -> drawInstancedSupport"

This reverts commit 17f05c737e.

Reason for revert: chrome

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,csmartdalton@google.com

Change-Id: I2b28e3066f27b9d63713f93c0b44d7ba92fcdba9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281868
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2020-04-06 22:22:20 +00:00 committed by Skia Commit-Bot
parent aae8d13b09
commit 31c028c54b
16 changed files with 29 additions and 24 deletions

View File

@ -109,7 +109,7 @@ struct GrMockOptions {
// GrCaps options.
bool fMipMapSupport = false;
bool fDrawInstancedSupport = false;
bool fInstanceAttribSupport = false;
bool fHalfFloatVertexAttributeSupport = false;
uint32_t fMapBufferFlags = 0;
int fMaxTextureSize = 2048;

View File

@ -24,7 +24,7 @@ GrCaps::GrCaps(const GrContextOptions& options) {
fTextureBarrierSupport = false;
fSampleLocationsSupport = false;
fMultisampleDisableSupport = false;
fDrawInstancedSupport = false;
fInstanceAttribSupport = false;
fMixedSamplesSupport = false;
fConservativeRasterSupport = false;
fWireframeSupport = false;
@ -192,7 +192,7 @@ void GrCaps::dumpJSON(SkJSONWriter* writer) const {
writer->appendBool("Texture Barrier Support", fTextureBarrierSupport);
writer->appendBool("Sample Locations Support", fSampleLocationsSupport);
writer->appendBool("Multisample disable support", fMultisampleDisableSupport);
writer->appendBool("Draw Instanced Support", fDrawInstancedSupport);
writer->appendBool("Instance Attrib Support", fInstanceAttribSupport);
writer->appendBool("Mixed Samples Support", fMixedSamplesSupport);
writer->appendBool("Conservative Raster Support", fConservativeRasterSupport);
writer->appendBool("Wireframe Support", fWireframeSupport);

View File

@ -51,7 +51,7 @@ public:
bool textureBarrierSupport() const { return fTextureBarrierSupport; }
bool sampleLocationsSupport() const { return fSampleLocationsSupport; }
bool multisampleDisableSupport() const { return fMultisampleDisableSupport; }
bool drawInstancedSupport() const { return fDrawInstancedSupport; }
bool instanceAttribSupport() const { return fInstanceAttribSupport; }
bool mixedSamplesSupport() const { return fMixedSamplesSupport; }
bool conservativeRasterSupport() const { return fConservativeRasterSupport; }
bool wireframeSupport() const { return fWireframeSupport; }
@ -464,7 +464,7 @@ protected:
bool fTextureBarrierSupport : 1;
bool fSampleLocationsSupport : 1;
bool fMultisampleDisableSupport : 1;
bool fDrawInstancedSupport : 1;
bool fInstanceAttribSupport : 1;
bool fMixedSamplesSupport : 1;
bool fConservativeRasterSupport : 1;
bool fWireframeSupport : 1;

View File

@ -65,7 +65,7 @@ void GrOpsRenderPass::bindPipeline(const GrProgramInfo& programInfo, const SkRec
// place (i.e., the target renderTargetProxy) they had best agree.
SkASSERT(programInfo.origin() == fOrigin);
if (programInfo.primProc().hasInstanceAttributes()) {
SkASSERT(this->gpu()->caps()->drawInstancedSupport());
SkASSERT(this->gpu()->caps()->instanceAttribSupport());
}
if (programInfo.pipeline().usesConservativeRaster()) {
SkASSERT(this->gpu()->caps()->conservativeRasterSupport());
@ -243,7 +243,7 @@ void GrOpsRenderPass::drawIndexed(int indexCount, int baseIndex, uint16_t minInd
void GrOpsRenderPass::drawInstanced(int instanceCount, int baseInstance, int vertexCount,
int baseVertex) {
SkASSERT(this->gpu()->caps()->drawInstancedSupport());
SkASSERT(this->gpu()->caps()->instanceAttribSupport());
if (!this->prepareToDraw()) {
return;
}
@ -255,7 +255,7 @@ void GrOpsRenderPass::drawInstanced(int instanceCount, int baseInstance, int ver
void GrOpsRenderPass::drawIndexedInstanced(int indexCount, int baseIndex, int instanceCount,
int baseInstance, int baseVertex) {
SkASSERT(this->gpu()->caps()->drawInstancedSupport());
SkASSERT(this->gpu()->caps()->instanceAttribSupport());
if (!this->prepareToDraw()) {
return;
}

View File

@ -22,7 +22,7 @@ bool GrCoverageCountingPathRenderer::IsSupported(const GrCaps& caps, CoverageTyp
GrBackendFormat defaultA8Format = caps.getDefaultBackendFormat(GrColorType::kAlpha_8,
GrRenderable::kYes);
if (caps.driverBlacklistCCPR() || !shaderCaps.integerSupport() ||
!caps.drawInstancedSupport() || !shaderCaps.floatIs32Bits() ||
!caps.instanceAttribSupport() || !shaderCaps.floatIs32Bits() ||
!defaultA8Format.isValid() || // This checks both texturable and renderable
!caps.halfFloatVertexAttributeSupport()) {
return false;

View File

@ -27,7 +27,7 @@ GrD3DCaps::GrD3DCaps(const GrContextOptions& contextOptions, IDXGIAdapter1* adap
fReuseScratchTextures = true; //TODO: figure this out
fGpuTracingSupport = false; //TODO: figure this out
fOversizedStencilSupport = false; //TODO: figure this out
fDrawInstancedSupport = true;
fInstanceAttribSupport = true;
// TODO: implement these
fSemaphoreSupport = false;

View File

@ -33,6 +33,7 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
fVertexArrayObjectSupport = false;
fDebugSupport = false;
fES2CompatibilitySupport = false;
fDrawInstancedSupport = false;
fDrawIndirectSupport = false;
fDrawRangeElementsSupport = false;
fMultiDrawIndirectSupport = false;
@ -204,18 +205,18 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
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
fDrawInstancedSupport =
fInstanceAttribSupport =
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)) {
fDrawInstancedSupport =
fInstanceAttribSupport =
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
fDrawInstancedSupport = version >= GR_GL_VER(2, 0);
fInstanceAttribSupport = version >= GR_GL_VER(2, 0);
}
if (GR_IS_GR_GL(standard)) {
@ -3546,7 +3547,7 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
}
// http://anglebug.com/4538
if (fBaseVertexBaseInstanceSupport && !fDrawInstancedSupport) {
if (fBaseVertexBaseInstanceSupport && !fInstanceAttribSupport) {
fBaseVertexBaseInstanceSupport = false;
}

View File

@ -310,6 +310,9 @@ public:
/// 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; }
@ -522,6 +525,7 @@ private:
bool fVertexArrayObjectSupport : 1;
bool fDebugSupport : 1;
bool fES2CompatibilitySupport : 1;
bool fDrawInstancedSupport : 1;
bool fDrawIndirectSupport : 1;
bool fDrawRangeElementsSupport : 1;
bool fMultiDrawIndirectSupport : 1;

View File

@ -143,7 +143,7 @@ void GrGLOpsRenderPass::onDrawIndexed(int indexCount, int baseIndex, uint16_t mi
uint16_t maxIndexValue, int baseVertex) {
GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
if (fGpu->glCaps().baseVertexBaseInstanceSupport()) {
SkASSERT(fGpu->glCaps().drawInstancedSupport());
SkASSERT(fGpu->glCaps().instanceAttribSupport());
SkASSERT(!fActiveVertexBuffer);
if (baseVertex != 0) {
GL_CALL(DrawElementsInstancedBaseVertexBaseInstance(

View File

@ -85,7 +85,7 @@ void GrGLAttribArrayState::set(GrGLGpu* gpu,
size_t offsetInBytes,
int divisor) {
SkASSERT(index >= 0 && index < fAttribArrayStates.count());
SkASSERT(0 == divisor || gpu->caps()->drawInstancedSupport());
SkASSERT(0 == divisor || gpu->caps()->instanceAttribSupport());
AttribArrayState* array = &fAttribArrayStates[index];
const char* offsetAsPtr;
bool bufferChanged = false;
@ -134,7 +134,7 @@ void GrGLAttribArrayState::set(GrGLGpu* gpu,
array->fStride = stride;
array->fOffset = offsetAsPtr;
}
if (gpu->caps()->drawInstancedSupport() && array->fDivisor != divisor) {
if (gpu->caps()->instanceAttribSupport() && 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;

View File

@ -17,7 +17,7 @@ public:
GrMockCaps(const GrContextOptions& contextOptions, const GrMockOptions& options)
: INHERITED(contextOptions), fOptions(options) {
fMipMapSupport = options.fMipMapSupport;
fDrawInstancedSupport = options.fDrawInstancedSupport;
fInstanceAttribSupport = options.fInstanceAttribSupport;
fHalfFloatVertexAttributeSupport = options.fHalfFloatVertexAttributeSupport;
fMapBufferFlags = options.fMapBufferFlags;
fBufferMapThreshold = SK_MaxS32; // Overridable in GrContextOptions.

View File

@ -279,7 +279,7 @@ void GrMtlCaps::initGrCaps(const id<MTLDevice> device) {
if (@available(macOS 10.11, iOS 9.0, *)) {
if (this->isMac() || 3 == fFamilyGroup) {
fDrawInstancedSupport = true;
fInstanceAttribSupport = true;
}
}

View File

@ -145,7 +145,7 @@ std::unique_ptr<GrDrawOp> FillRRectOp::Make(GrRecordingContext* ctx,
const GrCaps* caps = ctx->priv().caps();
if (!caps->drawInstancedSupport()) {
if (!caps->instanceAttribSupport()) {
return nullptr;
}

View File

@ -41,7 +41,7 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface*
fReuseScratchTextures = true; //TODO: figure this out
fGpuTracingSupport = false; //TODO: figure this out
fOversizedStencilSupport = false; //TODO: figure this out
fDrawInstancedSupport = true;
fInstanceAttribSupport = true;
fSemaphoreSupport = true; // always available in Vulkan
fFenceSyncSupport = true; // always available in Vulkan
@ -477,7 +477,7 @@ void GrVkCaps::applyDriverCorrectnessWorkarounds(const VkPhysicalDevicePropertie
#endif
if (kARM_VkVendor == properties.vendorID) {
fDrawInstancedSupport = false;
fInstanceAttribSupport = false;
fAvoidWritePixelsFastPath = true; // bugs.skia.org/8064
}

View File

@ -141,7 +141,7 @@ class CCPRTest {
public:
void run(skiatest::Reporter* reporter, DoCoverageCount doCoverageCount, DoStroke doStroke) {
GrMockOptions mockOptions;
mockOptions.fDrawInstancedSupport = true;
mockOptions.fInstanceAttribSupport = true;
mockOptions.fHalfFloatVertexAttributeSupport = true;
mockOptions.fMapBufferFlags = GrCaps::kCanMap_MapFlag;
mockOptions.fConfigOptions[(int)GrColorType::kAlpha_F16].fRenderability =

View File

@ -231,7 +231,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrMeshTest, reporter, ctxInfo) {
});
for (bool indexed : {false, true}) {
if (!context->priv().caps()->drawInstancedSupport()) {
if (!context->priv().caps()->instanceAttribSupport()) {
break;
}