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

Unified Diff: src/gpu/vk/GrVkPipelineStateCache.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/GrVkPipelineStateBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkPipelineStateCache.cpp
diff --git a/src/gpu/vk/GrVkPipelineStateCache.cpp b/src/gpu/vk/GrVkPipelineStateCache.cpp
index 1becad5adf2709e626c636f780bf89229d79fc9e..2e6a85bb2c6737b0509cf403e1c7987f60e64a8c 100644
--- a/src/gpu/vk/GrVkPipelineStateCache.cpp
+++ b/src/gpu/vk/GrVkPipelineStateCache.cpp
@@ -29,7 +29,7 @@ struct GrVkResourceProvider::PipelineStateCache::Entry {
}
static uint32_t Hash(const GrVkPipelineState::Desc& key) {
- return key.fChecksum;
+ return key.getChecksum();
}
sk_sp<GrVkPipelineState> fPipelineState;
@@ -99,20 +99,12 @@ sk_sp<GrVkPipelineState> GrVkResourceProvider::PipelineStateCache::refPipelineSt
#endif
// Get GrVkProgramDesc
GrVkPipelineState::Desc desc;
- if (!GrProgramDesc::Build(&desc.fProgramDesc, primProc, pipeline, *fGpu->vkCaps().glslCaps())) {
+ if (!GrVkPipelineState::Desc::Build(&desc, primProc, pipeline, primitiveType,
+ *fGpu->vkCaps().glslCaps())) {
GrCapsDebugf(fGpu->caps(), "Failed to build vk program descriptor!\n");
return nullptr;
}
- desc.fProgramDesc.finalize();
-
- // Get vulkan specific descriptor key
- GrVkPipelineState::BuildStateKey(pipeline, primitiveType, &desc.fStateKey);
- // Get checksum of entire PipelineDesc
- int keyLength = desc.fStateKey.count();
- SkASSERT(0 == (keyLength % 4));
- // Seed the checksum with the checksum of the programDesc then add the vulkan key to it.
- desc.fChecksum = SkOpts::hash(desc.fStateKey.begin(), keyLength,
- desc.fProgramDesc.getChecksum());
+ desc.finalize();
Entry* entry = nullptr;
if (Entry** entryptr = fHashTable.find(desc)) {
« no previous file with comments | « src/gpu/vk/GrVkPipelineStateBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698