| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 key |= (blendInfo.fEquation << (kBlendWriteShift + 2 * kBlendCoeffShift)); | 480 key |= (blendInfo.fEquation << (kBlendWriteShift + 2 * kBlendCoeffShift)); |
| 481 | 481 |
| 482 return key; | 482 return key; |
| 483 } | 483 } |
| 484 | 484 |
| 485 bool GrVkPipelineState::Desc::Build(Desc* desc, | 485 bool GrVkPipelineState::Desc::Build(Desc* desc, |
| 486 const GrPrimitiveProcessor& primProc, | 486 const GrPrimitiveProcessor& primProc, |
| 487 const GrPipeline& pipeline, | 487 const GrPipeline& pipeline, |
| 488 GrPrimitiveType primitiveType, | 488 GrPrimitiveType primitiveType, |
| 489 const GrGLSLCaps& caps) { | 489 const GrGLSLCaps& caps) { |
| 490 if (!INHERITED::Build(desc, primProc, pipeline, caps)) { | 490 if (!INHERITED::Build(desc, primProc, primitiveType == kPoints_GrPrimitiveTy
pe, pipeline, |
| 491 caps)) { |
| 491 return false; | 492 return false; |
| 492 } | 493 } |
| 493 | 494 |
| 494 GrProcessorKeyBuilder b(&desc->key()); | 495 GrProcessorKeyBuilder b(&desc->key()); |
| 495 GrVkRenderTarget* vkRT = (GrVkRenderTarget*)pipeline.getRenderTarget(); | 496 GrVkRenderTarget* vkRT = (GrVkRenderTarget*)pipeline.getRenderTarget(); |
| 496 vkRT->simpleRenderPass()->genKey(&b); | 497 vkRT->simpleRenderPass()->genKey(&b); |
| 497 | 498 |
| 498 pipeline.getStencil().genKey(&b); | 499 pipeline.getStencil().genKey(&b); |
| 499 | 500 |
| 500 SkASSERT(sizeof(GrDrawFace) <= sizeof(uint32_t)); | 501 SkASSERT(sizeof(GrDrawFace) <= sizeof(uint32_t)); |
| 501 b.add32((int32_t)pipeline.getDrawFace()); | 502 b.add32((int32_t)pipeline.getDrawFace()); |
| 502 | 503 |
| 503 b.add32(get_blend_info_key(pipeline)); | 504 b.add32(get_blend_info_key(pipeline)); |
| 504 | 505 |
| 505 b.add32(primitiveType); | 506 b.add32(primitiveType); |
| 506 | 507 |
| 507 return true; | 508 return true; |
| 508 } | 509 } |
| OLD | NEW |