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

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

Issue 2112653002: Add static buffer support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments 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/GrVkPipelineStateDataManager.h ('k') | src/gpu/vk/GrVkResourceProvider.cpp » ('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 "GrVkPipelineStateDataManager.h" 8 #include "GrVkPipelineStateDataManager.h"
9 9
10 #include "GrVkGpu.h" 10 #include "GrVkGpu.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 }; 244 };
245 245
246 template<> struct set_uniform_matrix<4> { 246 template<> struct set_uniform_matrix<4> {
247 inline static void set(void* buffer, int uniformOffset, int count, const flo at matrices[]) { 247 inline static void set(void* buffer, int uniformOffset, int count, const flo at matrices[]) {
248 GR_STATIC_ASSERT(sizeof(float) == 4); 248 GR_STATIC_ASSERT(sizeof(float) == 4);
249 buffer = static_cast<char*>(buffer) + uniformOffset; 249 buffer = static_cast<char*>(buffer) + uniformOffset;
250 memcpy(buffer, matrices, count * 16 * sizeof(float)); 250 memcpy(buffer, matrices, count * 16 * sizeof(float));
251 } 251 }
252 }; 252 };
253 253
254 bool GrVkPipelineStateDataManager::uploadUniformBuffers(const GrVkGpu* gpu, 254 bool GrVkPipelineStateDataManager::uploadUniformBuffers(GrVkGpu* gpu,
255 GrVkUniformBuffer* verte xBuffer, 255 GrVkUniformBuffer* verte xBuffer,
256 GrVkUniformBuffer* fragm entBuffer) const { 256 GrVkUniformBuffer* fragm entBuffer) const {
257 bool updatedBuffer = false; 257 bool updatedBuffer = false;
258 if (vertexBuffer && fVertexUniformsDirty) { 258 if (vertexBuffer && fVertexUniformsDirty) {
259 SkAssertResult(vertexBuffer->updateData(gpu, fVertexUniformData.get(), f VertexUniformSize, 259 SkAssertResult(vertexBuffer->updateData(gpu, fVertexUniformData.get(), f VertexUniformSize,
260 &updatedBuffer)); 260 &updatedBuffer));
261 fVertexUniformsDirty = false; 261 fVertexUniformsDirty = false;
262 } 262 }
263 263
264 if (fragmentBuffer && fFragmentUniformsDirty) { 264 if (fragmentBuffer && fFragmentUniformsDirty) {
265 SkAssertResult(fragmentBuffer->updateData(gpu, fFragmentUniformData.get( ), 265 SkAssertResult(fragmentBuffer->updateData(gpu, fFragmentUniformData.get( ),
266 fFragmentUniformSize, &updated Buffer)); 266 fFragmentUniformSize, &updated Buffer));
267 fFragmentUniformsDirty = false; 267 fFragmentUniformsDirty = false;
268 } 268 }
269 return updatedBuffer; 269 return updatedBuffer;
270 } 270 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkPipelineStateDataManager.h ('k') | src/gpu/vk/GrVkResourceProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698