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

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

Issue 2195713002: Properly recycle uniform buffers in vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@slownanobench
Patch Set: rebase Created 4 years, 4 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/GrVkBuffer.cpp ('k') | src/gpu/vk/GrVkUniformBuffer.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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 } 375 }
376 376
377 void GrVkPipelineState::addUniformResources(GrVkCommandBuffer& commandBuffer) { 377 void GrVkPipelineState::addUniformResources(GrVkCommandBuffer& commandBuffer) {
378 if (fUniformDescriptorSet) { 378 if (fUniformDescriptorSet) {
379 commandBuffer.addRecycledResource(fUniformDescriptorSet); 379 commandBuffer.addRecycledResource(fUniformDescriptorSet);
380 } 380 }
381 if (fSamplerDescriptorSet) { 381 if (fSamplerDescriptorSet) {
382 commandBuffer.addRecycledResource(fSamplerDescriptorSet); 382 commandBuffer.addRecycledResource(fSamplerDescriptorSet);
383 } 383 }
384 384
385
386 if (fVertexUniformBuffer.get()) { 385 if (fVertexUniformBuffer.get()) {
387 commandBuffer.addResource(fVertexUniformBuffer->resource()); 386 commandBuffer.addRecycledResource(fVertexUniformBuffer->resource());
388 } 387 }
389 if (fFragmentUniformBuffer.get()) { 388 if (fFragmentUniformBuffer.get()) {
390 commandBuffer.addResource(fFragmentUniformBuffer->resource()); 389 commandBuffer.addRecycledResource(fFragmentUniformBuffer->resource());
391 } 390 }
391
392 for (int i = 0; i < fSamplers.count(); ++i) { 392 for (int i = 0; i < fSamplers.count(); ++i) {
393 commandBuffer.addResource(fSamplers[i]); 393 commandBuffer.addResource(fSamplers[i]);
394 } 394 }
395 395
396 for (int i = 0; i < fTextureViews.count(); ++i) { 396 for (int i = 0; i < fTextureViews.count(); ++i) {
397 commandBuffer.addResource(fTextureViews[i]); 397 commandBuffer.addResource(fTextureViews[i]);
398 } 398 }
399 399
400 for (int i = 0; i < fTextures.count(); ++i) { 400 for (int i = 0; i < fTextures.count(); ++i) {
401 commandBuffer.addResource(fTextures[i]); 401 commandBuffer.addResource(fTextures[i]);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 501
502 b.add32(get_blend_info_key(pipeline)); 502 b.add32(get_blend_info_key(pipeline));
503 503
504 b.add32(primitiveType); 504 b.add32(primitiveType);
505 505
506 // Set key length 506 // Set key length
507 int keyLength = key->count(); 507 int keyLength = key->count();
508 SkASSERT(0 == (keyLength % 4)); 508 SkASSERT(0 == (keyLength % 4));
509 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); 509 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength);
510 } 510 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkBuffer.cpp ('k') | src/gpu/vk/GrVkUniformBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698