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

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

Issue 1832613003: Revise layer, extension and feature setup for Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove extra def of ENABLE_VK_LAYERS 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/GrVkGpu.h ('k') | src/gpu/vk/GrVkInterface.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 2015 Google Inc. 2 * Copyright 2015 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 "GrVkGpu.h" 8 #include "GrVkGpu.h"
9 9
10 #include "GrContextOptions.h" 10 #include "GrContextOptions.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, 82 GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options,
83 const GrVkBackendContext* backendCtx) 83 const GrVkBackendContext* backendCtx)
84 : INHERITED(context) 84 : INHERITED(context)
85 , fVkInstance(backendCtx->fInstance) 85 , fVkInstance(backendCtx->fInstance)
86 , fDevice(backendCtx->fDevice) 86 , fDevice(backendCtx->fDevice)
87 , fQueue(backendCtx->fQueue) 87 , fQueue(backendCtx->fQueue)
88 , fResourceProvider(this) { 88 , fResourceProvider(this) {
89 fBackendContext.reset(backendCtx); 89 fBackendContext.reset(backendCtx);
90 90
91 #ifdef ENABLE_VK_LAYERS 91 #ifdef ENABLE_VK_LAYERS
92 if (this->vkInterface()->hasInstanceExtension(VK_EXT_DEBUG_REPORT_EXTENSION_ NAME)) { 92 if (backendCtx->fExtensions & kEXT_debug_report_GrVkExtensionFlag) {
93 /* Setup callback creation information */ 93 // Setup callback creation information
94 VkDebugReportCallbackCreateInfoEXT callbackCreateInfo; 94 VkDebugReportCallbackCreateInfoEXT callbackCreateInfo;
95 callbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EX T; 95 callbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EX T;
96 callbackCreateInfo.pNext = nullptr; 96 callbackCreateInfo.pNext = nullptr;
97 callbackCreateInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | 97 callbackCreateInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT |
98 VK_DEBUG_REPORT_WARNING_BIT_EXT | 98 VK_DEBUG_REPORT_WARNING_BIT_EXT |
99 //VK_DEBUG_REPORT_INFORMATION_BIT_EXT | 99 //VK_DEBUG_REPORT_INFORMATION_BIT_EXT |
100 //VK_DEBUG_REPORT_DEBUG_BIT_EXT | 100 //VK_DEBUG_REPORT_DEBUG_BIT_EXT |
101 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; 101 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
102 callbackCreateInfo.pfnCallback = &DebugReportCallback; 102 callbackCreateInfo.pfnCallback = &DebugReportCallback;
103 callbackCreateInfo.pUserData = nullptr; 103 callbackCreateInfo.pUserData = nullptr;
104 104
105 /* Register the callback */ 105 // Register the callback
106 GR_VK_CALL_ERRCHECK(this->vkInterface(), CreateDebugReportCallbackEXT(fV kInstance, 106 GR_VK_CALL_ERRCHECK(this->vkInterface(), CreateDebugReportCallbackEXT(fV kInstance,
107 &callbackCreateInfo, nullptr, &fCallback)); 107 &callbackCreateInfo, nullptr, &fCallback));
108 } 108 }
109 #endif 109 #endif
110 110
111 fCompiler = shaderc_compiler_initialize(); 111 fCompiler = shaderc_compiler_initialize();
112 112
113 fVkCaps.reset(new GrVkCaps(options, this->vkInterface(), backendCtx->fPhysic alDevice)); 113 fVkCaps.reset(new GrVkCaps(options, this->vkInterface(), backendCtx->fPhysic alDevice,
114 backendCtx->fFeatures));
114 fCaps.reset(SkRef(fVkCaps.get())); 115 fCaps.reset(SkRef(fVkCaps.get()));
115 116
116 VK_CALL(GetPhysicalDeviceMemoryProperties(backendCtx->fPhysicalDevice, &fPhy sDevMemProps)); 117 VK_CALL(GetPhysicalDeviceMemoryProperties(backendCtx->fPhysicalDevice, &fPhy sDevMemProps));
117 118
118 const VkCommandPoolCreateInfo cmdPoolInfo = { 119 const VkCommandPoolCreateInfo cmdPoolInfo = {
119 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // sType 120 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // sType
120 nullptr, // pNext 121 nullptr, // pNext
121 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // CmdPoolCreateFlags 122 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // CmdPoolCreateFlags
122 backendCtx->fQueueFamilyIndex, // queueFamilyIndex 123 backendCtx->fQueueFamilyIndex, // queueFamilyIndex
123 }; 124 };
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 int set_a_break_pt_here = 9; 1422 int set_a_break_pt_here = 9;
1422 aglSwapBuffers(aglGetCurrentContext()); 1423 aglSwapBuffers(aglGetCurrentContext());
1423 #elif defined(SK_BUILD_FOR_WIN32) 1424 #elif defined(SK_BUILD_FOR_WIN32)
1424 SwapBuf(); 1425 SwapBuf();
1425 int set_a_break_pt_here = 9; 1426 int set_a_break_pt_here = 9;
1426 SwapBuf(); 1427 SwapBuf();
1427 #endif 1428 #endif
1428 #endif 1429 #endif
1429 } 1430 }
1430 1431
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkGpu.h ('k') | src/gpu/vk/GrVkInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698