aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk
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 /src/gpu/vk
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>
Diffstat (limited to 'src/gpu/vk')
-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
9 files changed, 41 insertions, 52 deletions
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);