| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 if (GrTextureParams::kMipMap_FilterMode == params.filterMode()) { | 297 if (GrTextureParams::kMipMap_FilterMode == params.filterMode()) { |
| 298 if (texture->texturePriv().mipMapsAreDirty()) { | 298 if (texture->texturePriv().mipMapsAreDirty()) { |
| 299 gpu->generateMipmap(texture); | 299 gpu->generateMipmap(texture); |
| 300 texture->texturePriv().dirtyMipMaps(false); | 300 texture->texturePriv().dirtyMipMaps(false); |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 fSamplers.push(gpu->resourceProvider().findOrCreateCompatibleSampler(par
ams, | 304 fSamplers.push(gpu->resourceProvider().findOrCreateCompatibleSampler(par
ams, |
| 305 texture->texturePriv()
.maxMipMapLevel())); | 305 texture->texturePriv()
.maxMipMapLevel())); |
| 306 | 306 |
| 307 const GrVkImage::Resource* textureResource = texture->resource(); | 307 const GrVkResource* textureResource = texture->resource(); |
| 308 textureResource->ref(); | 308 textureResource->ref(); |
| 309 fTextures.push(textureResource); | 309 fTextures.push(textureResource); |
| 310 | 310 |
| 311 const GrVkImageView* textureView = texture->textureView(allowSRGBInputs)
; | 311 const GrVkImageView* textureView = texture->textureView(allowSRGBInputs)
; |
| 312 textureView->ref(); | 312 textureView->ref(); |
| 313 fTextureViews.push(textureView); | 313 fTextureViews.push(textureView); |
| 314 | 314 |
| 315 // Change texture layout so it can be read in shader | 315 // Change texture layout so it can be read in shader |
| 316 texture->setImageLayout(gpu, | 316 texture->setImageLayout(gpu, |
| 317 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, | 317 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 504 |
| 505 b.add32(get_blend_info_key(pipeline)); | 505 b.add32(get_blend_info_key(pipeline)); |
| 506 | 506 |
| 507 b.add32(primitiveType); | 507 b.add32(primitiveType); |
| 508 | 508 |
| 509 // Set key length | 509 // Set key length |
| 510 int keyLength = key->count(); | 510 int keyLength = key->count(); |
| 511 SkASSERT(0 == (keyLength % 4)); | 511 SkASSERT(0 == (keyLength % 4)); |
| 512 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); | 512 *reinterpret_cast<uint32_t*>(key->begin()) = SkToU32(keyLength); |
| 513 } | 513 } |
| OLD | NEW |