Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1218)

Unified Diff: src/gpu/vk/GrVkPipelineState.cpp

Issue 2318143002: Merge building of program desc in Vulkan into one step (Closed)
Patch Set: more cleanup Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.h ('k') | src/gpu/vk/GrVkPipelineStateBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkPipelineState.cpp
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 2dd691cf29c6fe190ca1acfa78e319d1d60058ed..23983854daee7c7820be42be376a0659e38c7b35 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -483,14 +483,16 @@ uint32_t get_blend_info_key(const GrPipeline& pipeline) {
return key;
}
-void GrVkPipelineState::BuildStateKey(const GrPipeline& pipeline, GrPrimitiveType primitiveType,
- SkTArray<uint8_t, true>* key) {
- // Save room for the key length and key header
- key->reset();
- key->push_back_n(kData_StateKeyOffset);
-
- GrProcessorKeyBuilder b(key);
+bool GrVkPipelineState::Desc::Build(Desc* desc,
+ const GrPrimitiveProcessor& primProc,
+ const GrPipeline& pipeline,
+ GrPrimitiveType primitiveType,
+ const GrGLSLCaps& caps) {
+ if (!INHERITED::Build(desc, primProc, pipeline, caps)) {
+ return false;
+ }
+ GrProcessorKeyBuilder b(&desc->key());
GrVkRenderTarget* vkRT = (GrVkRenderTarget*)pipeline.getRenderTarget();
vkRT->simpleRenderPass()->genKey(&b);
@@ -503,8 +505,5 @@ void GrVkPipelineState::BuildStateKey(const GrPipeline& pipeline, GrPrimitiveTyp
b.add32(primitiveType);
- // Set key length
- int keyLength = key->count();
- SkASSERT(0 == (keyLength % 4));
- *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength);
+ return true;
}
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.h ('k') | src/gpu/vk/GrVkPipelineStateBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698