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 "GrVkPipelineState.h" | 8 #include "GrVkPipelineState.h" |
9 | 9 |
10 #include "GrPipeline.h" | 10 #include "GrPipeline.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // Currently we are always binding a descriptor set for uniform buffers. | 61 // Currently we are always binding a descriptor set for uniform buffers. |
62 if (vertexUniformSize || fragmentUniformSize) { | 62 if (vertexUniformSize || fragmentUniformSize) { |
63 fDSCount++; | 63 fDSCount++; |
64 fStartDS = GrVkUniformHandler::kUniformBufferDescSet; | 64 fStartDS = GrVkUniformHandler::kUniformBufferDescSet; |
65 } | 65 } |
66 if (numSamplers) { | 66 if (numSamplers) { |
67 fDSCount++; | 67 fDSCount++; |
68 fStartDS = SkTMin(fStartDS, (int)GrVkUniformHandler::kSamplerDescSet); | 68 fStartDS = SkTMin(fStartDS, (int)GrVkUniformHandler::kSamplerDescSet); |
69 } | 69 } |
70 | 70 |
71 fVertexUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, vertexUniformSize,
true)); | 71 fVertexUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, vertexUniformSize)
); |
72 fFragmentUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, fragmentUniformS
ize, true)); | 72 fFragmentUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, fragmentUniformS
ize)); |
73 | 73 |
74 fNumSamplers = numSamplers; | 74 fNumSamplers = numSamplers; |
75 } | 75 } |
76 | 76 |
77 GrVkPipelineState::~GrVkPipelineState() { | 77 GrVkPipelineState::~GrVkPipelineState() { |
78 // Must of freed all GPU resources before this is destroyed | 78 // Must of freed all GPU resources before this is destroyed |
79 SkASSERT(!fPipeline); | 79 SkASSERT(!fPipeline); |
80 SkASSERT(!fPipelineLayout); | 80 SkASSERT(!fPipelineLayout); |
81 SkASSERT(!fSamplers.count()); | 81 SkASSERT(!fSamplers.count()); |
82 SkASSERT(!fTextureViews.count()); | 82 SkASSERT(!fTextureViews.count()); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 b.add32(get_blend_info_key(pipeline)); | 492 b.add32(get_blend_info_key(pipeline)); |
493 | 493 |
494 b.add32(primitiveType); | 494 b.add32(primitiveType); |
495 | 495 |
496 // Set key length | 496 // Set key length |
497 int keyLength = key->count(); | 497 int keyLength = key->count(); |
498 SkASSERT(0 == (keyLength % 4)); | 498 SkASSERT(0 == (keyLength % 4)); |
499 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); | 499 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); |
500 } | 500 } |
OLD | NEW |