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

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

Issue 2165283002: Remove DrawFace enum from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try again Created 4 years, 5 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/text/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/vk/GrVkPipelineState.cpp » ('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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 memset(colorBlendInfo, 0, sizeof(VkPipelineColorBlendStateCreateInfo)); 349 memset(colorBlendInfo, 0, sizeof(VkPipelineColorBlendStateCreateInfo));
350 colorBlendInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_ INFO; 350 colorBlendInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_ INFO;
351 colorBlendInfo->pNext = nullptr; 351 colorBlendInfo->pNext = nullptr;
352 colorBlendInfo->flags = 0; 352 colorBlendInfo->flags = 0;
353 colorBlendInfo->logicOpEnable = VK_FALSE; 353 colorBlendInfo->logicOpEnable = VK_FALSE;
354 colorBlendInfo->attachmentCount = 1; 354 colorBlendInfo->attachmentCount = 1;
355 colorBlendInfo->pAttachments = attachmentState; 355 colorBlendInfo->pAttachments = attachmentState;
356 // colorBlendInfo->blendConstants is set dynamically 356 // colorBlendInfo->blendConstants is set dynamically
357 } 357 }
358 358
359 VkCullModeFlags draw_face_to_vk_cull_mode(GrPipelineBuilder::DrawFace drawFace) { 359 VkCullModeFlags draw_face_to_vk_cull_mode(GrDrawFace drawFace) {
360 // Assumes that we've set the front face to be ccw 360 // Assumes that we've set the front face to be ccw
361 static const VkCullModeFlags gTable[] = { 361 static const VkCullModeFlags gTable[] = {
362 VK_CULL_MODE_NONE, // kBoth_DrawFace 362 VK_CULL_MODE_NONE, // kBoth_DrawFace
363 VK_CULL_MODE_BACK_BIT, // kCCW_DrawFace, cull back face 363 VK_CULL_MODE_BACK_BIT, // kCCW_DrawFace, cull back face
364 VK_CULL_MODE_FRONT_BIT, // kCW_DrawFace, cull front face 364 VK_CULL_MODE_FRONT_BIT, // kCW_DrawFace, cull front face
365 }; 365 };
366 GR_STATIC_ASSERT(0 == GrPipelineBuilder::kBoth_DrawFace); 366 GR_STATIC_ASSERT(0 == (int)GrDrawFace::kBoth);
367 GR_STATIC_ASSERT(1 == GrPipelineBuilder::kCCW_DrawFace); 367 GR_STATIC_ASSERT(1 == (int)GrDrawFace::kCCW);
368 GR_STATIC_ASSERT(2 == GrPipelineBuilder::kCW_DrawFace); 368 GR_STATIC_ASSERT(2 == (int)GrDrawFace::kCW);
369 SkASSERT((unsigned)drawFace <= 2); 369 SkASSERT(-1 < (int)drawFace && (int)drawFace <= 2);
370 370
371 return gTable[drawFace]; 371 return gTable[(int)drawFace];
372 } 372 }
373 373
374 void setup_raster_state(const GrVkGpu* gpu, 374 void setup_raster_state(const GrVkGpu* gpu,
375 const GrPipeline& pipeline, 375 const GrPipeline& pipeline,
376 VkPipelineRasterizationStateCreateInfo* rasterInfo) { 376 VkPipelineRasterizationStateCreateInfo* rasterInfo) {
377 memset(rasterInfo, 0, sizeof(VkPipelineRasterizationStateCreateInfo)); 377 memset(rasterInfo, 0, sizeof(VkPipelineRasterizationStateCreateInfo));
378 rasterInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_IN FO; 378 rasterInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_IN FO;
379 rasterInfo->pNext = nullptr; 379 rasterInfo->pNext = nullptr;
380 rasterInfo->flags = 0; 380 rasterInfo->flags = 0;
381 rasterInfo->depthClampEnable = VK_FALSE; 381 rasterInfo->depthClampEnable = VK_FALSE;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 549 }
550 550
551 void GrVkPipeline::SetDynamicState(GrVkGpu* gpu, 551 void GrVkPipeline::SetDynamicState(GrVkGpu* gpu,
552 GrVkCommandBuffer* cmdBuffer, 552 GrVkCommandBuffer* cmdBuffer,
553 const GrPipeline& pipeline) { 553 const GrPipeline& pipeline) {
554 const GrRenderTarget& target = *pipeline.getRenderTarget(); 554 const GrRenderTarget& target = *pipeline.getRenderTarget();
555 set_dynamic_scissor_state(gpu, cmdBuffer, pipeline, target); 555 set_dynamic_scissor_state(gpu, cmdBuffer, pipeline, target);
556 set_dynamic_viewport_state(gpu, cmdBuffer, target); 556 set_dynamic_viewport_state(gpu, cmdBuffer, target);
557 set_dynamic_blend_constant_state(gpu, cmdBuffer, pipeline); 557 set_dynamic_blend_constant_state(gpu, cmdBuffer, pipeline);
558 } 558 }
OLDNEW
« no previous file with comments | « src/gpu/text/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/vk/GrVkPipelineState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698