| OLD | NEW |
| 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" |
| 11 #include "GrVkUniformBuffer.h" | 11 #include "GrVkUniformBuffer.h" |
| 12 | 12 |
| 13 GrVkPipelineStateDataManager::GrVkPipelineStateDataManager(const UniformInfoArra
y& uniforms, | 13 GrVkPipelineStateDataManager::GrVkPipelineStateDataManager(const UniformInfoArra
y& uniforms, |
| 14 uint32_t vertexUnifor
mSize, | 14 uint32_t vertexUnifor
mSize, |
| 15 uint32_t fragmentUnif
ormSize) | 15 uint32_t fragmentUnif
ormSize) |
| 16 : fVertexUniformSize(vertexUniformSize) | 16 : fVertexUniformSize(vertexUniformSize) |
| 17 , fFragmentUniformSize(fragmentUniformSize) | 17 , fFragmentUniformSize(fragmentUniformSize) |
| 18 , fVertexUniformsDirty(false) | 18 , fVertexUniformsDirty(false) |
| 19 , fFragmentUniformsDirty(false) { | 19 , fFragmentUniformsDirty(false) { |
| 20 fVertexUniformData.reset(vertexUniformSize); | 20 fVertexUniformData.reset(vertexUniformSize); |
| 21 fFragmentUniformData.reset(fragmentUniformSize); | 21 fFragmentUniformData.reset(fragmentUniformSize); |
| 22 int count = uniforms.count(); | 22 int count = uniforms.count(); |
| 23 fUniforms.push_back_n(count); | 23 fUniforms.push_back_n(count); |
| 24 // We must add uniforms in same order is the UniformInfoArray so that Unifor
mHandles already | 24 // We must add uniforms in same order is the UniformInfoArray so that Unifor
mHandles already |
| 25 // owned by other objects will still match up here. | 25 // owned by other objects will still match up here. |
| 26 for (int i = 0; i < count; i++) { | 26 for (int i = 0; i < count; i++) { |
| 27 Uniform& uniform = fUniforms[i]; | 27 Uniform& uniform = fUniforms[i]; |
| 28 const GrVkUniformHandler::UniformInfo uniformInfo = uniforms[i]; | 28 const GrVkUniformHandler::UniformInfo uniformInfo = uniforms[i]; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 VK_ACCESS_UNIFORM_READ_BIT, | 272 VK_ACCESS_UNIFORM_READ_BIT, |
| 273 VK_ACCESS_HOST_WRITE_BIT, | 273 VK_ACCESS_HOST_WRITE_BIT, |
| 274 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, | 274 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, |
| 275 VK_PIPELINE_STAGE_HOST_BIT, | 275 VK_PIPELINE_STAGE_HOST_BIT, |
| 276 false); | 276 false); |
| 277 SkAssertResult(fragmentBuffer->updateData(gpu, fFragmentUniformData.get(
), | 277 SkAssertResult(fragmentBuffer->updateData(gpu, fFragmentUniformData.get(
), |
| 278 fFragmentUniformSize)); | 278 fFragmentUniformSize)); |
| 279 fFragmentUniformsDirty = false; | 279 fFragmentUniformsDirty = false; |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 | |
| OLD | NEW |