Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: src/gpu/vk/GrVkPipeline.cpp

Issue 1756493002: Use VkPipelineCaches during VkPipeline creation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix mipmap issues Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkPipeline.h ('k') | src/gpu/vk/GrVkResourceProvider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrVkPipeline.h" 8 #include "GrVkPipeline.h"
9 9
10 #include "GrGeometryProcessor.h" 10 #include "GrGeometryProcessor.h"
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 // TODO: mask out any state we might want to set dynamically 428 // TODO: mask out any state we might want to set dynamically
429 dynamicInfo->dynamicStateCount = 0; 429 dynamicInfo->dynamicStateCount = 0;
430 } 430 }
431 431
432 GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline, 432 GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
433 const GrPrimitiveProcessor& primProc, 433 const GrPrimitiveProcessor& primProc,
434 VkPipelineShaderStageCreateInfo* shaderStageI nfo, 434 VkPipelineShaderStageCreateInfo* shaderStageI nfo,
435 int shaderStageCount, 435 int shaderStageCount,
436 GrPrimitiveType primitiveType, 436 GrPrimitiveType primitiveType,
437 const GrVkRenderPass& renderPass, 437 const GrVkRenderPass& renderPass,
438 VkPipelineLayout layout) { 438 VkPipelineLayout layout,
439 VkPipelineCache cache) {
439 VkPipelineVertexInputStateCreateInfo vertexInputInfo; 440 VkPipelineVertexInputStateCreateInfo vertexInputInfo;
440 VkVertexInputBindingDescription bindingDesc; 441 VkVertexInputBindingDescription bindingDesc;
441 // TODO: allocate this based on VkPhysicalDeviceLimits::maxVertexInputAttrib utes 442 // TODO: allocate this based on VkPhysicalDeviceLimits::maxVertexInputAttrib utes
442 static const int kMaxVertexAttributes = 16; 443 static const int kMaxVertexAttributes = 16;
443 static VkVertexInputAttributeDescription attributeDesc[kMaxVertexAttributes] ; 444 static VkVertexInputAttributeDescription attributeDesc[kMaxVertexAttributes] ;
444 setup_vertex_input_state(primProc, &vertexInputInfo, &bindingDesc, 1, 445 setup_vertex_input_state(primProc, &vertexInputInfo, &bindingDesc, 1,
445 attributeDesc, kMaxVertexAttributes); 446 attributeDesc, kMaxVertexAttributes);
446 447
447 VkPipelineInputAssemblyStateCreateInfo inputAssemblyInfo; 448 VkPipelineInputAssemblyStateCreateInfo inputAssemblyInfo;
448 setup_input_assembly_state(primitiveType, &inputAssemblyInfo); 449 setup_input_assembly_state(primitiveType, &inputAssemblyInfo);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 pipelineCreateInfo.pColorBlendState = &colorBlendInfo; 489 pipelineCreateInfo.pColorBlendState = &colorBlendInfo;
489 pipelineCreateInfo.pDynamicState = &dynamicInfo; 490 pipelineCreateInfo.pDynamicState = &dynamicInfo;
490 pipelineCreateInfo.layout = layout; 491 pipelineCreateInfo.layout = layout;
491 pipelineCreateInfo.renderPass = renderPass.vkRenderPass(); 492 pipelineCreateInfo.renderPass = renderPass.vkRenderPass();
492 pipelineCreateInfo.subpass = 0; 493 pipelineCreateInfo.subpass = 0;
493 pipelineCreateInfo.basePipelineHandle = VK_NULL_HANDLE; 494 pipelineCreateInfo.basePipelineHandle = VK_NULL_HANDLE;
494 pipelineCreateInfo.basePipelineIndex = -1; 495 pipelineCreateInfo.basePipelineIndex = -1;
495 496
496 VkPipeline vkPipeline; 497 VkPipeline vkPipeline;
497 VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateGraphicsPipelines(gpu->d evice(), 498 VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateGraphicsPipelines(gpu->d evice(),
498 VK_NUL L_HANDLE, 1, 499 cache, 1,
499 &pipel ineCreateInfo, 500 &pipel ineCreateInfo,
500 nullpt r, &vkPipeline)); 501 nullpt r, &vkPipeline));
501 if (err) { 502 if (err) {
502 return nullptr; 503 return nullptr;
503 } 504 }
504 505
505 return new GrVkPipeline(vkPipeline); 506 return new GrVkPipeline(vkPipeline);
506 } 507 }
507 508
508 void GrVkPipeline::freeGPUData(const GrVkGpu* gpu) const { 509 void GrVkPipeline::freeGPUData(const GrVkGpu* gpu) const {
509 GR_VK_CALL(gpu->vkInterface(), DestroyPipeline(gpu->device(), fPipeline, nul lptr)); 510 GR_VK_CALL(gpu->vkInterface(), DestroyPipeline(gpu->device(), fPipeline, nul lptr));
510 } 511 }
511 512
512 513
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkPipeline.h ('k') | src/gpu/vk/GrVkResourceProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698