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

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

Issue 2468653002: Remove GrStencilSettings from GrPipeline (Closed)
Patch Set: Remove GrStencilSettings from GrPipeline Created 4 years, 1 month 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/GrVkPipelineState.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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 dynamicInfo->pNext = VK_NULL_HANDLE; 390 dynamicInfo->pNext = VK_NULL_HANDLE;
391 dynamicInfo->flags = 0; 391 dynamicInfo->flags = 0;
392 dynamicStates[0] = VK_DYNAMIC_STATE_VIEWPORT; 392 dynamicStates[0] = VK_DYNAMIC_STATE_VIEWPORT;
393 dynamicStates[1] = VK_DYNAMIC_STATE_SCISSOR; 393 dynamicStates[1] = VK_DYNAMIC_STATE_SCISSOR;
394 dynamicStates[2] = VK_DYNAMIC_STATE_BLEND_CONSTANTS; 394 dynamicStates[2] = VK_DYNAMIC_STATE_BLEND_CONSTANTS;
395 dynamicInfo->dynamicStateCount = 3; 395 dynamicInfo->dynamicStateCount = 3;
396 dynamicInfo->pDynamicStates = dynamicStates; 396 dynamicInfo->pDynamicStates = dynamicStates;
397 } 397 }
398 398
399 GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline, 399 GrVkPipeline* GrVkPipeline::Create(GrVkGpu* gpu, const GrPipeline& pipeline,
400 const GrStencilSettings& stencil,
400 const GrPrimitiveProcessor& primProc, 401 const GrPrimitiveProcessor& primProc,
401 VkPipelineShaderStageCreateInfo* shaderStageI nfo, 402 VkPipelineShaderStageCreateInfo* shaderStageI nfo,
402 int shaderStageCount, 403 int shaderStageCount,
403 GrPrimitiveType primitiveType, 404 GrPrimitiveType primitiveType,
404 const GrVkRenderPass& renderPass, 405 const GrVkRenderPass& renderPass,
405 VkPipelineLayout layout, 406 VkPipelineLayout layout,
406 VkPipelineCache cache) { 407 VkPipelineCache cache) {
407 VkPipelineVertexInputStateCreateInfo vertexInputInfo; 408 VkPipelineVertexInputStateCreateInfo vertexInputInfo;
408 VkVertexInputBindingDescription bindingDesc; 409 VkVertexInputBindingDescription bindingDesc;
409 SkSTArray<16, VkVertexInputAttributeDescription> attributeDesc; 410 SkSTArray<16, VkVertexInputAttributeDescription> attributeDesc;
410 SkASSERT(primProc.numAttribs() <= gpu->vkCaps().maxVertexAttributes()); 411 SkASSERT(primProc.numAttribs() <= gpu->vkCaps().maxVertexAttributes());
411 VkVertexInputAttributeDescription* pAttribs = attributeDesc.push_back_n(prim Proc.numAttribs()); 412 VkVertexInputAttributeDescription* pAttribs = attributeDesc.push_back_n(prim Proc.numAttribs());
412 setup_vertex_input_state(primProc, &vertexInputInfo, &bindingDesc, 1, pAttri bs); 413 setup_vertex_input_state(primProc, &vertexInputInfo, &bindingDesc, 1, pAttri bs);
413 414
414 VkPipelineInputAssemblyStateCreateInfo inputAssemblyInfo; 415 VkPipelineInputAssemblyStateCreateInfo inputAssemblyInfo;
415 setup_input_assembly_state(primitiveType, &inputAssemblyInfo); 416 setup_input_assembly_state(primitiveType, &inputAssemblyInfo);
416 417
417 VkPipelineDepthStencilStateCreateInfo depthStencilInfo; 418 VkPipelineDepthStencilStateCreateInfo depthStencilInfo;
418 setup_depth_stencil_state(pipeline.getStencil(), &depthStencilInfo); 419 setup_depth_stencil_state(stencil, &depthStencilInfo);
419 420
420 VkPipelineViewportStateCreateInfo viewportInfo; 421 VkPipelineViewportStateCreateInfo viewportInfo;
421 setup_viewport_scissor_state(&viewportInfo); 422 setup_viewport_scissor_state(&viewportInfo);
422 423
423 VkPipelineMultisampleStateCreateInfo multisampleInfo; 424 VkPipelineMultisampleStateCreateInfo multisampleInfo;
424 setup_multisample_state(pipeline, primProc, gpu->caps(), &multisampleInfo); 425 setup_multisample_state(pipeline, primProc, gpu->caps(), &multisampleInfo);
425 426
426 // We will only have one color attachment per pipeline. 427 // We will only have one color attachment per pipeline.
427 VkPipelineColorBlendAttachmentState attachmentStates[1]; 428 VkPipelineColorBlendAttachmentState attachmentStates[1];
428 VkPipelineColorBlendStateCreateInfo colorBlendInfo; 429 VkPipelineColorBlendStateCreateInfo colorBlendInfo;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 538 }
538 539
539 void GrVkPipeline::SetDynamicState(GrVkGpu* gpu, 540 void GrVkPipeline::SetDynamicState(GrVkGpu* gpu,
540 GrVkCommandBuffer* cmdBuffer, 541 GrVkCommandBuffer* cmdBuffer,
541 const GrPipeline& pipeline) { 542 const GrPipeline& pipeline) {
542 const GrRenderTarget& target = *pipeline.getRenderTarget(); 543 const GrRenderTarget& target = *pipeline.getRenderTarget();
543 set_dynamic_scissor_state(gpu, cmdBuffer, pipeline, target); 544 set_dynamic_scissor_state(gpu, cmdBuffer, pipeline, target);
544 set_dynamic_viewport_state(gpu, cmdBuffer, target); 545 set_dynamic_viewport_state(gpu, cmdBuffer, target);
545 set_dynamic_blend_constant_state(gpu, cmdBuffer, pipeline); 546 set_dynamic_blend_constant_state(gpu, cmdBuffer, pipeline);
546 } 547 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkPipeline.h ('k') | src/gpu/vk/GrVkPipelineState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698