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

Unified Diff: src/gpu/vk/GrVkPipelineStateDataManager.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/GrVkPipelineStateDataManager.h ('k') | src/gpu/vk/GrVkUniformBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkPipelineStateDataManager.cpp
diff --git a/src/gpu/vk/GrVkPipelineStateDataManager.cpp b/src/gpu/vk/GrVkPipelineStateDataManager.cpp
index 86066abe0bd858e9f67b69a0d3cfb19e533c180a..60d7d7fee85175e33534914b05afc0e6617f7ff6 100644
--- a/src/gpu/vk/GrVkPipelineStateDataManager.cpp
+++ b/src/gpu/vk/GrVkPipelineStateDataManager.cpp
@@ -253,9 +253,10 @@ template<> struct set_uniform_matrix<4> {
}
};
-void GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu,
+bool GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu,
GrVkUniformBuffer* vertexBuffer,
GrVkUniformBuffer* fragmentBuffer) const {
+ bool updatedBuffer = false;
if (vertexBuffer && fVertexUniformsDirty) {
vertexBuffer->addMemoryBarrier(gpu,
VK_ACCESS_UNIFORM_READ_BIT,
@@ -263,7 +264,8 @@ void GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu,
VK_PIPELINE_STAGE_VERTEX_SHADER_BIT,
VK_PIPELINE_STAGE_HOST_BIT,
false);
- SkAssertResult(vertexBuffer->updateData(gpu, fVertexUniformData.get(), fVertexUniformSize));
+ SkAssertResult(vertexBuffer->updateData(gpu, fVertexUniformData.get(), fVertexUniformSize,
+ &updatedBuffer));
fVertexUniformsDirty = false;
}
@@ -275,7 +277,8 @@ void GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu,
VK_PIPELINE_STAGE_HOST_BIT,
false);
SkAssertResult(fragmentBuffer->updateData(gpu, fFragmentUniformData.get(),
- fFragmentUniformSize));
+ fFragmentUniformSize, &updatedBuffer));
fFragmentUniformsDirty = false;
}
+ return updatedBuffer;
}
« no previous file with comments | « src/gpu/vk/GrVkPipelineStateDataManager.h ('k') | src/gpu/vk/GrVkUniformBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698