Fuse GrPrimitiveProcessor & GrGeometryProcessor into a new GrGeometryProcessor
With the removal of NVPR we no longer need this distinction.
Bug: skia:11760
Change-Id: I225a4feb764395fb72aca3ffc8b6d05396bf0b1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386890
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/GrOpsRenderPass.cpp b/src/gpu/GrOpsRenderPass.cpp
index 663d12f..f408b3f 100644
--- a/src/gpu/GrOpsRenderPass.cpp
+++ b/src/gpu/GrOpsRenderPass.cpp
@@ -11,8 +11,8 @@
#include "src/gpu/GrCaps.h"
#include "src/gpu/GrCpuBuffer.h"
#include "src/gpu/GrDrawIndirectCommand.h"
+#include "src/gpu/GrGeometryProcessor.h"
#include "src/gpu/GrGpu.h"
-#include "src/gpu/GrPrimitiveProcessor.h"
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrScissorState.h"
@@ -64,7 +64,7 @@
// Both the 'programInfo' and this renderPass have an origin. Since they come from the same
// place (i.e., the target renderTargetProxy) they had best agree.
SkASSERT(programInfo.origin() == fOrigin);
- if (programInfo.primProc().hasInstanceAttributes()) {
+ if (programInfo.geomProc().hasInstanceAttributes()) {
SkASSERT(this->gpu()->caps()->drawInstancedSupport());
}
if (programInfo.pipeline().usesConservativeRaster()) {
@@ -91,7 +91,7 @@
this->resetActiveBuffers();
- if (programInfo.primProc().numVertexAttributes() > this->gpu()->caps()->maxVertexAttributes()) {
+ if (programInfo.geomProc().numVertexAttributes() > this->gpu()->caps()->maxVertexAttributes()) {
fDrawPipelineStatus = DrawPipelineStatus::kFailedToBind;
return;
}
@@ -104,7 +104,7 @@
#ifdef SK_DEBUG
fScissorStatus = (programInfo.pipeline().isScissorTestEnabled()) ?
DynamicStateStatus::kUninitialized : DynamicStateStatus::kDisabled;
- bool hasTextures = (programInfo.primProc().numTextureSamplers() > 0);
+ bool hasTextures = (programInfo.geomProc().numTextureSamplers() > 0);
if (!hasTextures) {
programInfo.pipeline().visitProxies([&hasTextures](GrSurfaceProxy*, GrMipmapped) {
hasTextures = true;
@@ -113,9 +113,9 @@
fTextureBindingStatus = (hasTextures) ?
DynamicStateStatus::kUninitialized : DynamicStateStatus::kDisabled;
fHasIndexBuffer = false;
- fInstanceBufferStatus = (programInfo.primProc().hasInstanceAttributes()) ?
+ fInstanceBufferStatus = (programInfo.geomProc().hasInstanceAttributes()) ?
DynamicStateStatus::kUninitialized : DynamicStateStatus::kDisabled;
- fVertexBufferStatus = (programInfo.primProc().hasVertexAttributes()) ?
+ fVertexBufferStatus = (programInfo.geomProc().hasVertexAttributes()) ?
DynamicStateStatus::kUninitialized : DynamicStateStatus::kDisabled;
#endif
@@ -133,14 +133,14 @@
SkDEBUGCODE(fScissorStatus = DynamicStateStatus::kConfigured);
}
-void GrOpsRenderPass::bindTextures(const GrPrimitiveProcessor& primProc,
- const GrSurfaceProxy* const primProcTextures[],
+void GrOpsRenderPass::bindTextures(const GrGeometryProcessor& geomProc,
+ const GrSurfaceProxy* const geomProcTextures[],
const GrPipeline& pipeline) {
#ifdef SK_DEBUG
- SkASSERT((primProc.numTextureSamplers() > 0) == SkToBool(primProcTextures));
- for (int i = 0; i < primProc.numTextureSamplers(); ++i) {
- const auto& sampler = primProc.textureSampler(i);
- const GrSurfaceProxy* proxy = primProcTextures[i];
+ SkASSERT((geomProc.numTextureSamplers() > 0) == SkToBool(geomProcTextures));
+ for (int i = 0; i < geomProc.numTextureSamplers(); ++i) {
+ const auto& sampler = geomProc.textureSampler(i);
+ const GrSurfaceProxy* proxy = geomProcTextures[i];
SkASSERT(proxy);
SkASSERT(proxy->backendFormat() == sampler.backendFormat());
SkASSERT(proxy->backendFormat().textureType() == sampler.backendFormat().textureType());
@@ -164,7 +164,7 @@
// Don't assert on fTextureBindingStatus. onBindTextures() just turns into a no-op when there
// aren't any textures, and it's hard to tell from the GrPipeline whether there are any. For
// many clients it is easier to just always call this method.
- if (!this->onBindTextures(primProc, primProcTextures, pipeline)) {
+ if (!this->onBindTextures(geomProc, geomProcTextures, pipeline)) {
fDrawPipelineStatus = DrawPipelineStatus::kFailedToBind;
return;
}