| OLD | NEW |
| 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 Loading... |
| 82 | 82 |
| 83 GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, | 83 GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, |
| 84 const GrVkBackendContext* backendCtx) | 84 const GrVkBackendContext* backendCtx) |
| 85 : INHERITED(context) | 85 : INHERITED(context) |
| 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 fCallback = nullptr; | 92 fCallback = VK_NULL_HANDLE; |
| 93 if (backendCtx->fExtensions & kEXT_debug_report_GrVkExtensionFlag) { | 93 if (backendCtx->fExtensions & kEXT_debug_report_GrVkExtensionFlag) { |
| 94 // Setup callback creation information | 94 // Setup callback creation information |
| 95 VkDebugReportCallbackCreateInfoEXT callbackCreateInfo; | 95 VkDebugReportCallbackCreateInfoEXT callbackCreateInfo; |
| 96 callbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EX
T; | 96 callbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EX
T; |
| 97 callbackCreateInfo.pNext = nullptr; | 97 callbackCreateInfo.pNext = nullptr; |
| 98 callbackCreateInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | | 98 callbackCreateInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | |
| 99 VK_DEBUG_REPORT_WARNING_BIT_EXT | | 99 VK_DEBUG_REPORT_WARNING_BIT_EXT | |
| 100 //VK_DEBUG_REPORT_INFORMATION_BIT_EXT | | 100 //VK_DEBUG_REPORT_INFORMATION_BIT_EXT | |
| 101 //VK_DEBUG_REPORT_DEBUG_BIT_EXT | | 101 //VK_DEBUG_REPORT_DEBUG_BIT_EXT | |
| 102 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; | 102 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // must call this just before we destroy the VkDevice | 146 // must call this just before we destroy the VkDevice |
| 147 fResourceProvider.destroyResources(); | 147 fResourceProvider.destroyResources(); |
| 148 | 148 |
| 149 VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr)); | 149 VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr)); |
| 150 | 150 |
| 151 shaderc_compiler_release(fCompiler); | 151 shaderc_compiler_release(fCompiler); |
| 152 | 152 |
| 153 #ifdef ENABLE_VK_LAYERS | 153 #ifdef ENABLE_VK_LAYERS |
| 154 if (fCallback) { | 154 if (fCallback) { |
| 155 VK_CALL(DestroyDebugReportCallbackEXT(fBackendContext->fInstance, fCallb
ack, nullptr)); | 155 VK_CALL(DestroyDebugReportCallbackEXT(fBackendContext->fInstance, fCallb
ack, nullptr)); |
| 156 fCallback = nullptr; | 156 fCallback = VK_NULL_HANDLE; |
| 157 } | 157 } |
| 158 #endif | 158 #endif |
| 159 } | 159 } |
| 160 | 160 |
| 161 /////////////////////////////////////////////////////////////////////////////// | 161 /////////////////////////////////////////////////////////////////////////////// |
| 162 | 162 |
| 163 void GrVkGpu::submitCommandBuffer(SyncQueue sync) { | 163 void GrVkGpu::submitCommandBuffer(SyncQueue sync) { |
| 164 SkASSERT(fCurrentCmdBuffer); | 164 SkASSERT(fCurrentCmdBuffer); |
| 165 fCurrentCmdBuffer->end(this); | 165 fCurrentCmdBuffer->end(this); |
| 166 | 166 |
| (...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 aglSwapBuffers(aglGetCurrentContext()); | 1807 aglSwapBuffers(aglGetCurrentContext()); |
| 1808 int set_a_break_pt_here = 9; | 1808 int set_a_break_pt_here = 9; |
| 1809 aglSwapBuffers(aglGetCurrentContext()); | 1809 aglSwapBuffers(aglGetCurrentContext()); |
| 1810 #elif defined(SK_BUILD_FOR_WIN32) | 1810 #elif defined(SK_BUILD_FOR_WIN32) |
| 1811 SwapBuf(); | 1811 SwapBuf(); |
| 1812 int set_a_break_pt_here = 9; | 1812 int set_a_break_pt_here = 9; |
| 1813 SwapBuf(); | 1813 SwapBuf(); |
| 1814 #endif | 1814 #endif |
| 1815 #endif | 1815 #endif |
| 1816 } | 1816 } |
| OLD | NEW |