aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-06-23 15:17:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-25 17:55:45 +0000
commitff168d9258e0101826a8072b4ee077c3d2aa7258 (patch)
treec8338ce3ffb83b18575785a3bd98b2607e59bb1a
parent721e63727f38b9c7664a173ab475d7c7a58cd8a8 (diff)
Put GrPrimitiveProcessor/GrGeometryProcessor before GrPipeline in param lists.
We were inconsistent about which order these were in. Having the processor first will make the parameter order more logical for an upcoming change. Also, the primitive processor comes logically before the pipeline. Change-Id: I3968c5e4e6dff01f9c4ad311eb1795b3c7580ff5 Reviewed-on: https://skia-review.googlesource.com/137228 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
-rw-r--r--src/gpu/GrGpuCommandBuffer.cpp7
-rw-r--r--src/gpu/GrGpuCommandBuffer.h8
-rw-r--r--src/gpu/GrOpFlushState.cpp2
-rw-r--r--src/gpu/GrPathRendering.cpp6
-rw-r--r--src/gpu/GrPathRendering.h10
-rw-r--r--src/gpu/ccpr/GrCCCoverageProcessor.cpp4
-rw-r--r--src/gpu/ccpr/GrCCPathProcessor.cpp2
-rw-r--r--src/gpu/gl/GrGLGpu.cpp10
-rw-r--r--src/gpu/gl/GrGLGpu.h9
-rw-r--r--src/gpu/gl/GrGLGpuCommandBuffer.h6
-rw-r--r--src/gpu/gl/GrGLGpuProgramCache.cpp4
-rw-r--r--src/gpu/gl/GrGLPathRendering.cpp6
-rw-r--r--src/gpu/gl/GrGLPathRendering.h5
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp6
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.h4
-rw-r--r--src/gpu/glsl/GrGLSLProgramBuilder.cpp29
-rw-r--r--src/gpu/glsl/GrGLSLProgramBuilder.h4
-rw-r--r--src/gpu/mock/GrMockGpuCommandBuffer.h2
-rw-r--r--src/gpu/ops/GrDrawPathOp.cpp2
-rw-r--r--src/gpu/vk/GrVkGpuCommandBuffer.cpp20
-rw-r--r--src/gpu/vk/GrVkGpuCommandBuffer.h8
-rw-r--r--src/gpu/vk/GrVkPipeline.cpp11
-rw-r--r--src/gpu/vk/GrVkPipeline.h2
-rw-r--r--src/gpu/vk/GrVkPipelineStateBuilder.cpp15
-rw-r--r--src/gpu/vk/GrVkPipelineStateBuilder.h2
-rw-r--r--src/gpu/vk/GrVkPipelineStateCache.cpp18
-rw-r--r--src/gpu/vk/GrVkResourceProvider.cpp9
-rw-r--r--src/gpu/vk/GrVkResourceProvider.h8
-rw-r--r--tests/GrMeshTest.cpp2
-rw-r--r--tests/GrPipelineDynamicStateTest.cpp2
30 files changed, 104 insertions, 119 deletions
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp
index fa2ce077b5..617ed75ae7 100644
--- a/src/gpu/GrGpuCommandBuffer.cpp
+++ b/src/gpu/GrGpuCommandBuffer.cpp
@@ -26,8 +26,8 @@ void GrGpuRTCommandBuffer::clearStencilClip(const GrFixedClip& clip, bool inside
this->onClearStencilClip(clip, insideStencilMask);
}
-bool GrGpuRTCommandBuffer::draw(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+bool GrGpuRTCommandBuffer::draw(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrMesh meshes[],
const GrPipeline::DynamicState dynamicStates[],
int meshCount,
@@ -51,7 +51,6 @@ bool GrGpuRTCommandBuffer::draw(const GrPipeline& pipeline,
this->gpu()->stats()->incNumFailedDraws();
return false;
}
- this->onDraw(pipeline, primProc, meshes, dynamicStates, meshCount, bounds);
+ this->onDraw(primProc, pipeline, meshes, dynamicStates, meshCount, bounds);
return true;
}
-
diff --git a/src/gpu/GrGpuCommandBuffer.h b/src/gpu/GrGpuCommandBuffer.h
index 6963d23ebe..4fae620625 100644
--- a/src/gpu/GrGpuCommandBuffer.h
+++ b/src/gpu/GrGpuCommandBuffer.h
@@ -97,8 +97,8 @@ public:
// GrMesh object and emit a draw for it. Each draw will use the same GrPipeline and
// GrPrimitiveProcessor. This may fail if the draw would exceed any resource limits (e.g.
// number of vertex attributes is too large).
- bool draw(const GrPipeline&,
- const GrPrimitiveProcessor&,
+ bool draw(const GrPrimitiveProcessor&,
+ const GrPipeline&,
const GrMesh[],
const GrPipeline::DynamicState[],
int meshCount,
@@ -132,8 +132,8 @@ private:
virtual GrGpu* gpu() = 0;
// overridden by backend-specific derived class to perform the draw call.
- virtual void onDraw(const GrPipeline&,
- const GrPrimitiveProcessor&,
+ virtual void onDraw(const GrPrimitiveProcessor&,
+ const GrPipeline&,
const GrMesh[],
const GrPipeline::DynamicState[],
int meshCount,
diff --git a/src/gpu/GrOpFlushState.cpp b/src/gpu/GrOpFlushState.cpp
index 09b657a64d..b24e89abb0 100644
--- a/src/gpu/GrOpFlushState.cpp
+++ b/src/gpu/GrOpFlushState.cpp
@@ -43,7 +43,7 @@ void GrOpFlushState::executeDrawsAndUploadsForMeshDrawOp(uint32_t opID, const Sk
++fCurrUpload;
}
SkASSERT(fCurrDraw->fPipeline->proxy() == this->drawOpArgs().fProxy);
- this->rtCommandBuffer()->draw(*fCurrDraw->fPipeline, *fCurrDraw->fGeometryProcessor,
+ this->rtCommandBuffer()->draw(*fCurrDraw->fGeometryProcessor, *fCurrDraw->fPipeline,
fMeshes.begin() + fCurrMesh, nullptr, fCurrDraw->fMeshCnt,
opBounds);
fCurrMesh += fCurrDraw->fMeshCnt;
diff --git a/src/gpu/GrPathRendering.cpp b/src/gpu/GrPathRendering.cpp
index 2da1d2fb31..1af220cd24 100644
--- a/src/gpu/GrPathRendering.cpp
+++ b/src/gpu/GrPathRendering.cpp
@@ -49,8 +49,8 @@ void GrPathRendering::stencilPath(const StencilPathArgs& args, const GrPath* pat
this->onStencilPath(args, path);
}
-void GrPathRendering::drawPath(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+void GrPathRendering::drawPath(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
// Cover pass settings in pipeline.
const GrStencilSettings& stencilPassSettings,
const GrPath* path) {
@@ -58,5 +58,5 @@ void GrPathRendering::drawPath(const GrPipeline& pipeline,
if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) {
fGpu->xferBarrier(pipeline.renderTarget(), barrierType);
}
- this->onDrawPath(pipeline, primProc, stencilPassSettings, path);
+ this->onDrawPath(primProc, pipeline, stencilPassSettings, path);
}
diff --git a/src/gpu/GrPathRendering.h b/src/gpu/GrPathRendering.h
index 0a1abc1057..ab13674c15 100644
--- a/src/gpu/GrPathRendering.h
+++ b/src/gpu/GrPathRendering.h
@@ -109,17 +109,17 @@ public:
void stencilPath(const StencilPathArgs& args, const GrPath* path);
- void drawPath(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
- const GrStencilSettings& stencilPassSettings, // Cover pass settings in pipeline.
+ void drawPath(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
+ const GrStencilSettings& stencilPassSettings, // Cover pass settings in pipeline.
const GrPath* path);
protected:
GrPathRendering(GrGpu* gpu) : fGpu(gpu) { }
virtual void onStencilPath(const StencilPathArgs&, const GrPath*) = 0;
- virtual void onDrawPath(const GrPipeline&,
- const GrPrimitiveProcessor&,
+ virtual void onDrawPath(const GrPrimitiveProcessor&,
+ const GrPipeline&,
const GrStencilSettings&,
const GrPath*) = 0;
diff --git a/src/gpu/ccpr/GrCCCoverageProcessor.cpp b/src/gpu/ccpr/GrCCCoverageProcessor.cpp
index 75d0667b09..94b027abe9 100644
--- a/src/gpu/ccpr/GrCCCoverageProcessor.cpp
+++ b/src/gpu/ccpr/GrCCCoverageProcessor.cpp
@@ -228,12 +228,12 @@ void GrCCCoverageProcessor::draw(GrOpFlushState* flushState, const GrPipeline& p
const GrPipeline::DynamicState dynamicStates[], int meshCount,
const SkRect& drawBounds) const {
GrGpuRTCommandBuffer* cmdBuff = flushState->rtCommandBuffer();
- cmdBuff->draw(pipeline, *this, meshes, dynamicStates, meshCount, drawBounds);
+ cmdBuff->draw(*this, pipeline, meshes, dynamicStates, meshCount, drawBounds);
// Geometry shader backend draws primitives in two subpasses.
if (Impl::kGeometryShader == fImpl) {
SkASSERT(GSSubpass::kHulls == fGSSubpass);
GrCCCoverageProcessor cornerProc(*this, GSSubpass::kCorners);
- cmdBuff->draw(pipeline, cornerProc, meshes, dynamicStates, meshCount, drawBounds);
+ cmdBuff->draw(cornerProc, pipeline, meshes, dynamicStates, meshCount, drawBounds);
}
}
diff --git a/src/gpu/ccpr/GrCCPathProcessor.cpp b/src/gpu/ccpr/GrCCPathProcessor.cpp
index e180724f8a..e1a508619a 100644
--- a/src/gpu/ccpr/GrCCPathProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPathProcessor.cpp
@@ -147,7 +147,7 @@ void GrCCPathProcessor::drawPaths(GrOpFlushState* flushState, const GrPipeline&
enablePrimitiveRestart);
mesh.setVertexData(resources.vertexBuffer());
- flushState->rtCommandBuffer()->draw(pipeline, *this, &mesh, nullptr, 1, bounds);
+ flushState->rtCommandBuffer()->draw(*this, pipeline, &mesh, nullptr, 1, bounds);
}
void GLSLPathProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 9e73259a55..97dc3d17ab 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1683,9 +1683,9 @@ void GrGLGpu::flushMinSampleShading(float minSampleShading) {
}
}
-bool GrGLGpu::flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc,
+bool GrGLGpu::flushGLState(const GrPrimitiveProcessor& primProc, const GrPipeline& pipeline,
bool willDrawPoints) {
- sk_sp<GrGLProgram> program(fProgramCache->refProgram(this, pipeline, primProc, willDrawPoints));
+ sk_sp<GrGLProgram> program(fProgramCache->refProgram(this, primProc, pipeline, willDrawPoints));
if (!program) {
GrCapsDebugf(this->caps(), "Failed to create program!\n");
return false;
@@ -2248,8 +2248,8 @@ void GrGLGpu::flushViewport(const GrGLIRect& viewport) {
#endif
#endif
-void GrGLGpu::draw(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+void GrGLGpu::draw(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrMesh meshes[],
const GrPipeline::DynamicState dynamicStates[],
int meshCount) {
@@ -2262,7 +2262,7 @@ void GrGLGpu::draw(const GrPipeline& pipeline,
break;
}
}
- if (!this->flushGLState(pipeline, primProc, hasPoints)) {
+ if (!this->flushGLState(primProc, pipeline, hasPoints)) {
return;
}
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index d08974498a..782b0b0540 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -82,13 +82,12 @@ public:
// The GrGLGpuRTCommandBuffer does not buffer up draws before submitting them to the gpu.
// Thus this is the implementation of the draw call for the corresponding passthrough function
// on GrGLRTGpuCommandBuffer.
- void draw(const GrPipeline&,
- const GrPrimitiveProcessor&,
+ void draw(const GrPrimitiveProcessor&,
+ const GrPipeline&,
const GrMesh[],
const GrPipeline::DynamicState[],
int meshCount);
-
// GrMesh::SendToGpuImpl methods. These issue the actual GL draw calls.
// Marked final as a hint to the compiler to not use virtual dispatch.
void sendMeshToGpu(GrPrimitiveType, const GrBuffer* vertexBuffer, int vertexCount,
@@ -254,7 +253,7 @@ private:
// Flushes state from GrPipeline to GL. Returns false if the state couldn't be set.
// willDrawPoints must be true if point primitives will be rendered after setting the GL state.
- bool flushGLState(const GrPipeline&, const GrPrimitiveProcessor&, bool willDrawPoints);
+ bool flushGLState(const GrPrimitiveProcessor&, const GrPipeline&, bool willDrawPoints);
void flushProgram(sk_sp<GrGLProgram>);
@@ -295,7 +294,7 @@ private:
~ProgramCache();
void abandon();
- GrGLProgram* refProgram(const GrGLGpu*, const GrPipeline&, const GrPrimitiveProcessor&,
+ GrGLProgram* refProgram(const GrGLGpu*, const GrPrimitiveProcessor&, const GrPipeline&,
bool hasPointSize);
private:
diff --git a/src/gpu/gl/GrGLGpuCommandBuffer.h b/src/gpu/gl/GrGLGpuCommandBuffer.h
index c45bf5f141..84e05a8998 100644
--- a/src/gpu/gl/GrGLGpuCommandBuffer.h
+++ b/src/gpu/gl/GrGLGpuCommandBuffer.h
@@ -84,14 +84,14 @@ public:
private:
GrGpu* gpu() override { return fGpu; }
- void onDraw(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+ void onDraw(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrMesh mesh[],
const GrPipeline::DynamicState dynamicStates[],
int meshCount,
const SkRect& bounds) override {
SkASSERT(pipeline.renderTarget() == fRenderTarget);
- fGpu->draw(pipeline, primProc, mesh, dynamicStates, meshCount);
+ fGpu->draw(primProc, pipeline, mesh, dynamicStates, meshCount);
}
void onClear(const GrFixedClip& clip, GrColor color) override {
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index faa2eb8c56..e00ef29fd0 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -69,8 +69,8 @@ void GrGLGpu::ProgramCache::abandon() {
}
GrGLProgram* GrGLGpu::ProgramCache::refProgram(const GrGLGpu* gpu,
- const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
bool isPoints) {
#ifdef PROGRAM_CACHE_STATS
++fTotalRequests;
@@ -96,7 +96,7 @@ GrGLProgram* GrGLGpu::ProgramCache::refProgram(const GrGLGpu* gpu,
#ifdef PROGRAM_CACHE_STATS
++fCacheMisses;
#endif
- GrGLProgram* program = GrGLProgramBuilder::CreateProgram(pipeline, primProc, &desc, fGpu);
+ GrGLProgram* program = GrGLProgramBuilder::CreateProgram(primProc, pipeline, &desc, fGpu);
if (nullptr == program) {
return nullptr;
}
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index 45bc018487..79481290f4 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -111,11 +111,11 @@ void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath*
}
}
-void GrGLPathRendering::onDrawPath(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+void GrGLPathRendering::onDrawPath(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrStencilSettings& stencilPassSettings,
const GrPath* path) {
- if (!this->gpu()->flushGLState(pipeline, primProc, false)) {
+ if (!this->gpu()->flushGLState(primProc, pipeline, false)) {
return;
}
const GrGLPath* glPath = static_cast<const GrGLPath*>(path);
diff --git a/src/gpu/gl/GrGLPathRendering.h b/src/gpu/gl/GrGLPathRendering.h
index 0c1d19286b..1dfb756f3e 100644
--- a/src/gpu/gl/GrGLPathRendering.h
+++ b/src/gpu/gl/GrGLPathRendering.h
@@ -65,10 +65,11 @@ public:
protected:
void onStencilPath(const StencilPathArgs&, const GrPath*) override;
- void onDrawPath(const GrPipeline&,
- const GrPrimitiveProcessor&,
+ void onDrawPath(const GrPrimitiveProcessor&,
+ const GrPipeline&,
const GrStencilSettings&,
const GrPath*) override;
+
private:
/**
* Mark certain functionality as not supported.
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 79e13d3555..a883d7e397 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -29,8 +29,8 @@
#define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X)
#define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X)
-GrGLProgram* GrGLProgramBuilder::CreateProgram(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+GrGLProgram* GrGLProgramBuilder::CreateProgram(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
GrProgramDesc* desc,
GrGLGpu* gpu) {
#ifdef SK_DEBUG
@@ -66,7 +66,7 @@ GrGLProgramBuilder::GrGLProgramBuilder(GrGLGpu* gpu,
const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
GrProgramDesc* desc)
- : INHERITED(pipeline, primProc, desc)
+ : INHERITED(primProc, pipeline, desc)
, fGpu(gpu)
, fVaryingHandler(this)
, fUniformHandler(this)
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index 30d5179325..dd21a6d500 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -35,8 +35,8 @@ public:
* the surface origin.
* @return true if generation was successful.
*/
- static GrGLProgram* CreateProgram(const GrPipeline&,
- const GrPrimitiveProcessor&,
+ static GrGLProgram* CreateProgram(const GrPrimitiveProcessor&,
+ const GrPipeline&,
GrProgramDesc*,
GrGLGpu*);
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index cae1c2ad65..19600a27e5 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -19,22 +19,21 @@
const int GrGLSLProgramBuilder::kVarsPerBlock = 8;
-GrGLSLProgramBuilder::GrGLSLProgramBuilder(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+GrGLSLProgramBuilder::GrGLSLProgramBuilder(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
GrProgramDesc* desc)
- : fVS(this)
- , fGS(this)
- , fFS(this)
- , fStageIndex(-1)
- , fPipeline(pipeline)
- , fPrimProc(primProc)
- , fDesc(desc)
- , fGeometryProcessor(nullptr)
- , fXferProcessor(nullptr)
- , fNumVertexSamplers(0)
- , fNumGeometrySamplers(0)
- , fNumFragmentSamplers(0) {
-}
+ : fVS(this)
+ , fGS(this)
+ , fFS(this)
+ , fStageIndex(-1)
+ , fPipeline(pipeline)
+ , fPrimProc(primProc)
+ , fDesc(desc)
+ , fGeometryProcessor(nullptr)
+ , fXferProcessor(nullptr)
+ , fNumVertexSamplers(0)
+ , fNumGeometrySamplers(0)
+ , fNumFragmentSamplers(0) {}
void GrGLSLProgramBuilder::addFeature(GrShaderFlags shaders,
uint32_t featureBit,
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.h b/src/gpu/glsl/GrGLSLProgramBuilder.h
index 7d0ce74abe..c53cf19da8 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.h
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.h
@@ -93,9 +93,7 @@ public:
int fFragmentProcessorCnt;
protected:
- explicit GrGLSLProgramBuilder(const GrPipeline&,
- const GrPrimitiveProcessor&,
- GrProgramDesc*);
+ explicit GrGLSLProgramBuilder(const GrPrimitiveProcessor&, const GrPipeline&, GrProgramDesc*);
void addFeature(GrShaderFlags shaders, uint32_t featureBit, const char* extensionName);
diff --git a/src/gpu/mock/GrMockGpuCommandBuffer.h b/src/gpu/mock/GrMockGpuCommandBuffer.h
index 2229fa34b6..7a94e9a7b4 100644
--- a/src/gpu/mock/GrMockGpuCommandBuffer.h
+++ b/src/gpu/mock/GrMockGpuCommandBuffer.h
@@ -50,7 +50,7 @@ public:
void submit() override { fGpu->submitCommandBuffer(this); }
private:
- void onDraw(const GrPipeline&, const GrPrimitiveProcessor&, const GrMesh[],
+ void onDraw(const GrPrimitiveProcessor&, const GrPipeline&, const GrMesh[],
const GrPipeline::DynamicState[], int meshCount, const SkRect& bounds) override {
++fNumDraws;
}
diff --git a/src/gpu/ops/GrDrawPathOp.cpp b/src/gpu/ops/GrDrawPathOp.cpp
index a8081fcff8..185b3c07f2 100644
--- a/src/gpu/ops/GrDrawPathOp.cpp
+++ b/src/gpu/ops/GrDrawPathOp.cpp
@@ -81,7 +81,7 @@ void GrDrawPathOp::onExecute(GrOpFlushState* state) {
GrStencilSettings stencil;
init_stencil_pass_settings(*state, this->fillType(), &stencil);
- state->gpu()->pathRendering()->drawPath(pipeline, *pathProc, stencil, fPath.get());
+ state->gpu()->pathRendering()->drawPath(*pathProc, pipeline, stencil, fPath.get());
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
index 0058a948fe..95bcb13cbf 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
@@ -560,8 +560,8 @@ void GrVkGpuRTCommandBuffer::bindGeometry(const GrBuffer* indexBuffer,
}
}
-GrVkPipelineState* GrVkGpuRTCommandBuffer::prepareDrawState(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+GrVkPipelineState* GrVkGpuRTCommandBuffer::prepareDrawState(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
GrPrimitiveType primitiveType,
bool hasDynamicState) {
CommandBufferInfo& cbInfo = fCommandBufferInfos[fCurrentCmdInfo];
@@ -629,8 +629,8 @@ static void prepare_sampled_images(const GrResourceIOProcessor& processor,
}
}
-void GrVkGpuRTCommandBuffer::onDraw(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+void GrVkGpuRTCommandBuffer::onDraw(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrMesh meshes[],
const GrPipeline::DynamicState dynamicStates[],
int meshCount,
@@ -653,10 +653,8 @@ void GrVkGpuRTCommandBuffer::onDraw(const GrPipeline& pipeline,
}
GrPrimitiveType primitiveType = meshes[0].primitiveType();
- GrVkPipelineState* pipelineState = this->prepareDrawState(pipeline,
- primProc,
- primitiveType,
- SkToBool(dynamicStates));
+ GrVkPipelineState* pipelineState =
+ this->prepareDrawState(primProc, pipeline, primitiveType, SkToBool(dynamicStates));
if (!pipelineState) {
return;
}
@@ -670,10 +668,8 @@ void GrVkGpuRTCommandBuffer::onDraw(const GrPipeline& pipeline,
pipelineState->freeTempResources(fGpu);
SkDEBUGCODE(pipelineState = nullptr);
primitiveType = mesh.primitiveType();
- pipelineState = this->prepareDrawState(pipeline,
- primProc,
- primitiveType,
- SkToBool(dynamicStates));
+ pipelineState = this->prepareDrawState(
+ primProc, pipeline, primitiveType, SkToBool(dynamicStates));
if (!pipelineState) {
return;
}
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.h b/src/gpu/vk/GrVkGpuCommandBuffer.h
index 93990be697..b56d157d25 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.h
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.h
@@ -86,13 +86,13 @@ private:
const GrBuffer* vertexBuffer,
const GrBuffer* instanceBuffer);
- GrVkPipelineState* prepareDrawState(const GrPipeline&,
- const GrPrimitiveProcessor&,
+ GrVkPipelineState* prepareDrawState(const GrPrimitiveProcessor&,
+ const GrPipeline&,
GrPrimitiveType,
bool hasDynamicState);
- void onDraw(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+ void onDraw(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrMesh mesh[],
const GrPipeline::DynamicState[],
int meshCount,
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index c5b4592950..385cc8b48b 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -258,8 +258,8 @@ static void setup_viewport_scissor_state(VkPipelineViewportStateCreateInfo* view
SkASSERT(viewportInfo->viewportCount == viewportInfo->scissorCount);
}
-static void setup_multisample_state(const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
+static void setup_multisample_state(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrCaps* caps,
VkPipelineMultisampleStateCreateInfo* multisampleInfo) {
memset(multisampleInfo, 0, sizeof(VkPipelineMultisampleStateCreateInfo));
@@ -441,9 +441,10 @@ static void setup_dynamic_state(VkPipelineDynamicStateCreateInfo* dynamicInfo,
dynamicInfo->pDynamicStates = dynamicStates;
}
-GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
- const GrStencilSettings& stencil,
+GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu,
const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
+ const GrStencilSettings& stencil,
VkPipelineShaderStageCreateInfo* shaderStageInfo,
int shaderStageCount,
GrPrimitiveType primitiveType,
@@ -468,7 +469,7 @@ GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
setup_viewport_scissor_state(&viewportInfo);
VkPipelineMultisampleStateCreateInfo multisampleInfo;
- setup_multisample_state(pipeline, primProc, gpu->caps(), &multisampleInfo);
+ setup_multisample_state(primProc, pipeline, gpu->caps(), &multisampleInfo);
// We will only have one color attachment per pipeline.
VkPipelineColorBlendAttachmentState attachmentStates[1];
diff --git a/src/gpu/vk/GrVkPipeline.h b/src/gpu/vk/GrVkPipeline.h
index 0b6e0da731..69281eff3f 100644
--- a/src/gpu/vk/GrVkPipeline.h
+++ b/src/gpu/vk/GrVkPipeline.h
@@ -25,9 +25,9 @@ struct SkIRect;
class GrVkPipeline : public GrVkResource {
public:
static GrVkPipeline* Create(GrVkGpu* gpu,
+ const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline,
const GrStencilSettings&,
- const GrPrimitiveProcessor& primProc,
VkPipelineShaderStageCreateInfo* shaderStageInfo,
int shaderStageCount,
GrPrimitiveType primitiveType,
diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
index c67847ce9c..c4c748ba9c 100644
--- a/src/gpu/vk/GrVkPipelineStateBuilder.cpp
+++ b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
@@ -17,9 +17,9 @@
GrVkPipelineState* GrVkPipelineStateBuilder::CreatePipelineState(
GrVkGpu* gpu,
+ const GrPrimitiveProcessor& primProc,
const GrPipeline& pipeline,
const GrStencilSettings& stencil,
- const GrPrimitiveProcessor& primProc,
GrPrimitiveType primitiveType,
Desc* desc,
const GrVkRenderPass& renderPass) {
@@ -38,11 +38,10 @@ GrVkPipelineStateBuilder::GrVkPipelineStateBuilder(GrVkGpu* gpu,
const GrPipeline& pipeline,
const GrPrimitiveProcessor& primProc,
GrProgramDesc* desc)
- : INHERITED(pipeline, primProc, desc)
- , fGpu(gpu)
- , fVaryingHandler(this)
- , fUniformHandler(this) {
-}
+ : INHERITED(primProc, pipeline, desc)
+ , fGpu(gpu)
+ , fVaryingHandler(this)
+ , fUniformHandler(this) {}
const GrCaps* GrVkPipelineStateBuilder::caps() const {
return fGpu->caps();
@@ -169,9 +168,9 @@ GrVkPipelineState* GrVkPipelineStateBuilder::finalize(const GrStencilSettings& s
++numShaderStages;
}
- GrVkPipeline* pipeline = resourceProvider.createPipeline(fPipeline,
+ GrVkPipeline* pipeline = resourceProvider.createPipeline(fPrimProc,
+ fPipeline,
stencil,
- fPrimProc,
shaderStageInfo,
numShaderStages,
primitiveType,
diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.h b/src/gpu/vk/GrVkPipelineStateBuilder.h
index 5fdb0eae5a..f5fb739505 100644
--- a/src/gpu/vk/GrVkPipelineStateBuilder.h
+++ b/src/gpu/vk/GrVkPipelineStateBuilder.h
@@ -58,9 +58,9 @@ public:
* @return true if generation was successful.
*/
static GrVkPipelineState* CreatePipelineState(GrVkGpu*,
+ const GrPrimitiveProcessor&,
const GrPipeline&,
const GrStencilSettings&,
- const GrPrimitiveProcessor&,
GrPrimitiveType,
Desc*,
const GrVkRenderPass& renderPass);
diff --git a/src/gpu/vk/GrVkPipelineStateCache.cpp b/src/gpu/vk/GrVkPipelineStateCache.cpp
index f7423c790b..310fa1046d 100644
--- a/src/gpu/vk/GrVkPipelineStateCache.cpp
+++ b/src/gpu/vk/GrVkPipelineStateCache.cpp
@@ -74,10 +74,10 @@ void GrVkResourceProvider::PipelineStateCache::release() {
}
GrVkPipelineState* GrVkResourceProvider::PipelineStateCache::refPipelineState(
- const GrPipeline& pipeline,
- const GrPrimitiveProcessor& primProc,
- GrPrimitiveType primitiveType,
- const GrVkRenderPass& renderPass) {
+ const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
+ GrPrimitiveType primitiveType,
+ const GrVkRenderPass& renderPass) {
#ifdef GR_PIPELINE_STATE_CACHE_STATS
++fTotalRequests;
#endif
@@ -111,14 +111,8 @@ GrVkPipelineState* GrVkResourceProvider::PipelineStateCache::refPipelineState(
#ifdef GR_PIPELINE_STATE_CACHE_STATS
++fCacheMisses;
#endif
- GrVkPipelineState* pipelineState(
- GrVkPipelineStateBuilder::CreatePipelineState(fGpu,
- pipeline,
- stencil,
- primProc,
- primitiveType,
- &desc,
- renderPass));
+ GrVkPipelineState* pipelineState(GrVkPipelineStateBuilder::CreatePipelineState(
+ fGpu, primProc, pipeline, stencil, primitiveType, &desc, renderPass));
if (nullptr == pipelineState) {
return nullptr;
}
diff --git a/src/gpu/vk/GrVkResourceProvider.cpp b/src/gpu/vk/GrVkResourceProvider.cpp
index 9a219c8861..b4290ce6f0 100644
--- a/src/gpu/vk/GrVkResourceProvider.cpp
+++ b/src/gpu/vk/GrVkResourceProvider.cpp
@@ -57,16 +57,15 @@ void GrVkResourceProvider::init() {
fUniformDSHandle = GrVkDescriptorSetManager::Handle(0);
}
-GrVkPipeline* GrVkResourceProvider::createPipeline(const GrPipeline& pipeline,
+GrVkPipeline* GrVkResourceProvider::createPipeline(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrStencilSettings& stencil,
- const GrPrimitiveProcessor& primProc,
VkPipelineShaderStageCreateInfo* shaderStageInfo,
int shaderStageCount,
GrPrimitiveType primitiveType,
const GrVkRenderPass& renderPass,
VkPipelineLayout layout) {
-
- return GrVkPipeline::Create(fGpu, pipeline, stencil, primProc, shaderStageInfo,
+ return GrVkPipeline::Create(fGpu, primProc, pipeline, stencil, shaderStageInfo,
shaderStageCount, primitiveType, renderPass, layout,
fPipelineCache);
}
@@ -185,7 +184,7 @@ GrVkPipelineState* GrVkResourceProvider::findOrCreateCompatiblePipelineState(
const GrPrimitiveProcessor& proc,
GrPrimitiveType primitiveType,
const GrVkRenderPass& renderPass) {
- return fPipelineStateCache->refPipelineState(pipeline, proc, primitiveType, renderPass);
+ return fPipelineStateCache->refPipelineState(proc, pipeline, primitiveType, renderPass);
}
void GrVkResourceProvider::getSamplerDescriptorSetHandle(VkDescriptorType type,
diff --git a/src/gpu/vk/GrVkResourceProvider.h b/src/gpu/vk/GrVkResourceProvider.h
index 00263c87f6..8b87983dec 100644
--- a/src/gpu/vk/GrVkResourceProvider.h
+++ b/src/gpu/vk/GrVkResourceProvider.h
@@ -43,9 +43,9 @@ public:
// Set up any initial vk objects
void init();
- GrVkPipeline* createPipeline(const GrPipeline& pipeline,
+ GrVkPipeline* createPipeline(const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
const GrStencilSettings& stencil,
- const GrPrimitiveProcessor& primProc,
VkPipelineShaderStageCreateInfo* shaderStageInfo,
int shaderStageCount,
GrPrimitiveType primitiveType,
@@ -171,8 +171,8 @@ private:
void abandon();
void release();
- GrVkPipelineState* refPipelineState(const GrPipeline&,
- const GrPrimitiveProcessor&,
+ GrVkPipelineState* refPipelineState(const GrPrimitiveProcessor&,
+ const GrPipeline&,
GrPrimitiveType,
const GrVkRenderPass& renderPass);
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index f95dbc8603..af6633fce7 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -394,7 +394,7 @@ void DrawMeshHelper::drawMesh(const GrMesh& mesh) {
GrRenderTargetProxy* proxy = fState->drawOpArgs().fProxy;
GrPipeline pipeline(proxy, GrPipeline::ScissorState::kDisabled, SkBlendMode::kSrc);
GrMeshTestProcessor mtp(mesh.isInstanced(), mesh.hasVertexData());
- fState->rtCommandBuffer()->draw(pipeline, mtp, &mesh, nullptr, 1,
+ fState->rtCommandBuffer()->draw(mtp, pipeline, &mesh, nullptr, 1,
SkRect::MakeIWH(kImageWidth, kImageHeight));
}
diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp
index b5bc74d382..b8e893be6e 100644
--- a/tests/GrPipelineDynamicStateTest.cpp
+++ b/tests/GrPipelineDynamicStateTest.cpp
@@ -148,7 +148,7 @@ private:
mesh.setNonIndexedNonInstanced(4);
mesh.setVertexData(fVertexBuffer.get(), 4 * i);
}
- state->rtCommandBuffer()->draw(pipeline, GrPipelineDynamicStateTestProcessor(),
+ state->rtCommandBuffer()->draw(GrPipelineDynamicStateTestProcessor(), pipeline,
meshes.begin(), kDynamicStates, 4,
SkRect::MakeIWH(kScreenSize, kScreenSize));
}