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