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