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

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

Issue 1872553005: Don't create new descriptor set for vulkan uniforms every draw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/GrVkBuffer.cpp ('k') | src/gpu/vk/GrVkPipelineStateDataManager.h » ('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 3e442fb249b5c7d1b51a559156e8e3614e4186a4..e464848034cd0c61f4f66ad7bcec13aeb5e9aef1 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -200,17 +200,17 @@ void GrVkPipelineState::setData(GrVkGpu* gpu,
this->writeSamplers(gpu, textureBindings);
}
-
if (fVertexUniformBuffer.get() || fFragmentUniformBuffer.get()) {
- fUniformPoolManager.getNewDescriptorSet(gpu,
+ if (fDataManager.uploadUniformBuffers(gpu, fVertexUniformBuffer, fFragmentUniformBuffer) ||
+ VK_NULL_HANDLE == fDescriptorSets[GrVkUniformHandler::kUniformBufferDescSet]) {
+ fUniformPoolManager.getNewDescriptorSet(gpu,
&fDescriptorSets[GrVkUniformHandler::kUniformBufferDescSet]);
- this->writeUniformBuffers(gpu);
+ this->writeUniformBuffers(gpu);
+ }
}
}
void GrVkPipelineState::writeUniformBuffers(const GrVkGpu* gpu) {
- fDataManager.uploadUniformBuffers(gpu, fVertexUniformBuffer, fFragmentUniformBuffer);
-
VkWriteDescriptorSet descriptorWrites[2];
memset(descriptorWrites, 0, 2 * sizeof(VkWriteDescriptorSet));
« no previous file with comments | « src/gpu/vk/GrVkBuffer.cpp ('k') | src/gpu/vk/GrVkPipelineStateDataManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698