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

Side by Side Diff: src/gpu/vk/GrVkPipelineState.cpp

Issue 2159333002: Recycle small uniform buffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update values Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkResourceProvider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrVkPipelineState.h" 8 #include "GrVkPipelineState.h"
9 9
10 #include "GrPipeline.h" 10 #include "GrPipeline.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // Currently we are always binding a descriptor set for uniform buffers. 61 // Currently we are always binding a descriptor set for uniform buffers.
62 if (vertexUniformSize || fragmentUniformSize) { 62 if (vertexUniformSize || fragmentUniformSize) {
63 fDSCount++; 63 fDSCount++;
64 fStartDS = GrVkUniformHandler::kUniformBufferDescSet; 64 fStartDS = GrVkUniformHandler::kUniformBufferDescSet;
65 } 65 }
66 if (numSamplers) { 66 if (numSamplers) {
67 fDSCount++; 67 fDSCount++;
68 fStartDS = SkTMin(fStartDS, (int)GrVkUniformHandler::kSamplerDescSet); 68 fStartDS = SkTMin(fStartDS, (int)GrVkUniformHandler::kSamplerDescSet);
69 } 69 }
70 70
71 fVertexUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, vertexUniformSize, true)); 71 fVertexUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, vertexUniformSize) );
72 fFragmentUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, fragmentUniformS ize, true)); 72 fFragmentUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, fragmentUniformS ize));
73 73
74 fNumSamplers = numSamplers; 74 fNumSamplers = numSamplers;
75 } 75 }
76 76
77 GrVkPipelineState::~GrVkPipelineState() { 77 GrVkPipelineState::~GrVkPipelineState() {
78 // Must of freed all GPU resources before this is destroyed 78 // Must of freed all GPU resources before this is destroyed
79 SkASSERT(!fPipeline); 79 SkASSERT(!fPipeline);
80 SkASSERT(!fPipelineLayout); 80 SkASSERT(!fPipelineLayout);
81 SkASSERT(!fSamplers.count()); 81 SkASSERT(!fSamplers.count());
82 SkASSERT(!fTextureViews.count()); 82 SkASSERT(!fTextureViews.count());
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 491
492 b.add32(get_blend_info_key(pipeline)); 492 b.add32(get_blend_info_key(pipeline));
493 493
494 b.add32(primitiveType); 494 b.add32(primitiveType);
495 495
496 // Set key length 496 // Set key length
497 int keyLength = key->count(); 497 int keyLength = key->count();
498 SkASSERT(0 == (keyLength % 4)); 498 SkASSERT(0 == (keyLength % 4));
499 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); 499 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength);
500 } 500 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkResourceProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698