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

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

Issue 1914053004: Remove unnessary uniform barriers in Vulkan. (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 unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.cpp ('k') | no next file » | 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 "GrVkPipelineStateDataManager.h" 8 #include "GrVkPipelineStateDataManager.h"
9 9
10 #include "GrVkGpu.h" 10 #include "GrVkGpu.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 buffer = static_cast<char*>(buffer) + uniformOffset; 241 buffer = static_cast<char*>(buffer) + uniformOffset;
242 memcpy(buffer, matrices, count * 16 * sizeof(float)); 242 memcpy(buffer, matrices, count * 16 * sizeof(float));
243 } 243 }
244 }; 244 };
245 245
246 bool GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu, 246 bool GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu,
247 GrVkUniformBuffer* verte xBuffer, 247 GrVkUniformBuffer* verte xBuffer,
248 GrVkUniformBuffer* fragm entBuffer) const { 248 GrVkUniformBuffer* fragm entBuffer) const {
249 bool updatedBuffer = false; 249 bool updatedBuffer = false;
250 if (vertexBuffer && fVertexUniformsDirty) { 250 if (vertexBuffer && fVertexUniformsDirty) {
251 vertexBuffer->addMemoryBarrier(gpu,
252 VK_ACCESS_UNIFORM_READ_BIT,
253 VK_ACCESS_HOST_WRITE_BIT,
254 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT,
255 VK_PIPELINE_STAGE_HOST_BIT,
256 false);
257 SkAssertResult(vertexBuffer->updateData(gpu, fVertexUniformData.get(), f VertexUniformSize, 251 SkAssertResult(vertexBuffer->updateData(gpu, fVertexUniformData.get(), f VertexUniformSize,
258 &updatedBuffer)); 252 &updatedBuffer));
259 fVertexUniformsDirty = false; 253 fVertexUniformsDirty = false;
260 } 254 }
261 255
262 if (fragmentBuffer && fFragmentUniformsDirty) { 256 if (fragmentBuffer && fFragmentUniformsDirty) {
263 fragmentBuffer->addMemoryBarrier(gpu,
264 VK_ACCESS_UNIFORM_READ_BIT,
265 VK_ACCESS_HOST_WRITE_BIT,
266 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
267 VK_PIPELINE_STAGE_HOST_BIT,
268 false);
269 SkAssertResult(fragmentBuffer->updateData(gpu, fFragmentUniformData.get( ), 257 SkAssertResult(fragmentBuffer->updateData(gpu, fFragmentUniformData.get( ),
270 fFragmentUniformSize, &updated Buffer)); 258 fFragmentUniformSize, &updated Buffer));
271 fFragmentUniformsDirty = false; 259 fFragmentUniformsDirty = false;
272 } 260 }
273 return updatedBuffer; 261 return updatedBuffer;
274 } 262 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698