| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrVkGpu.h" | 8 #include "GrVkGpu.h" |
| 9 | 9 |
| 10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 info); | 763 info); |
| 764 if (tgt && wrapDesc.fStencilBits) { | 764 if (tgt && wrapDesc.fStencilBits) { |
| 765 if (!createStencilAttachmentForRenderTarget(tgt, desc.fWidth, desc.fHeig
ht)) { | 765 if (!createStencilAttachmentForRenderTarget(tgt, desc.fWidth, desc.fHeig
ht)) { |
| 766 tgt->unref(); | 766 tgt->unref(); |
| 767 return nullptr; | 767 return nullptr; |
| 768 } | 768 } |
| 769 } | 769 } |
| 770 return tgt; | 770 return tgt; |
| 771 } | 771 } |
| 772 | 772 |
| 773 void GrVkGpu::generateMipmap(GrVkTexture* tex) const { | 773 void GrVkGpu::generateMipmap(GrVkTexture* tex) { |
| 774 // don't do anything for linearly tiled textures (can't have mipmaps) | 774 // don't do anything for linearly tiled textures (can't have mipmaps) |
| 775 if (tex->isLinearTiled()) { | 775 if (tex->isLinearTiled()) { |
| 776 SkDebugf("Trying to create mipmap for linear tiled texture"); | 776 SkDebugf("Trying to create mipmap for linear tiled texture"); |
| 777 return; | 777 return; |
| 778 } | 778 } |
| 779 | 779 |
| 780 // We cannot generate mipmaps for images that are multisampled. | 780 // We cannot generate mipmaps for images that are multisampled. |
| 781 // TODO: does it even make sense for rendertargets in general? | 781 // TODO: does it even make sense for rendertargets in general? |
| 782 if (tex->asRenderTarget() && tex->asRenderTarget()->numColorSamples() > 1) { | 782 if (tex->asRenderTarget() && tex->asRenderTarget()->numColorSamples() > 1) { |
| 783 return; | 783 return; |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1557 } | 1557 } |
| 1558 | 1558 |
| 1559 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment | 1559 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment |
| 1560 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment | 1560 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment |
| 1561 // which is always at the first attachment. | 1561 // which is always at the first attachment. |
| 1562 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); | 1562 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); |
| 1563 fCurrentCmdBuffer->executeCommands(this, buffer); | 1563 fCurrentCmdBuffer->executeCommands(this, buffer); |
| 1564 fCurrentCmdBuffer->endRenderPass(this); | 1564 fCurrentCmdBuffer->endRenderPass(this); |
| 1565 } | 1565 } |
| 1566 | 1566 |
| OLD | NEW |