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 26 matching lines...) Expand all Loading... |
37 #include "vk/GrVkTypes.h" | 37 #include "vk/GrVkTypes.h" |
38 | 38 |
39 #if USE_SKSL | 39 #if USE_SKSL |
40 #include "SkSLCompiler.h" | 40 #include "SkSLCompiler.h" |
41 #endif | 41 #endif |
42 | 42 |
43 #define VK_CALL(X) GR_VK_CALL(this->vkInterface(), X) | 43 #define VK_CALL(X) GR_VK_CALL(this->vkInterface(), X) |
44 #define VK_CALL_RET(RET, X) GR_VK_CALL_RET(this->vkInterface(), RET, X) | 44 #define VK_CALL_RET(RET, X) GR_VK_CALL_RET(this->vkInterface(), RET, X) |
45 #define VK_CALL_ERRCHECK(X) GR_VK_CALL_ERRCHECK(this->vkInterface(), X) | 45 #define VK_CALL_ERRCHECK(X) GR_VK_CALL_ERRCHECK(this->vkInterface(), X) |
46 | 46 |
47 #ifdef ENABLE_VK_LAYERS | 47 #ifdef SK_ENABLE_VK_LAYERS |
48 VKAPI_ATTR VkBool32 VKAPI_CALL DebugReportCallback( | 48 VKAPI_ATTR VkBool32 VKAPI_CALL DebugReportCallback( |
49 VkDebugReportFlagsEXT flags, | 49 VkDebugReportFlagsEXT flags, |
50 VkDebugReportObjectTypeEXT objectType, | 50 VkDebugReportObjectTypeEXT objectType, |
51 uint64_t object, | 51 uint64_t object, |
52 size_t location, | 52 size_t location, |
53 int32_t messageCode, | 53 int32_t messageCode, |
54 const char* pLayerPrefix, | 54 const char* pLayerPrefix, |
55 const char* pMessage, | 55 const char* pMessage, |
56 void* pUserData) { | 56 void* pUserData) { |
57 if (flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { | 57 if (flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { |
(...skipping 28 matching lines...) Expand all Loading... |
86 //////////////////////////////////////////////////////////////////////////////// | 86 //////////////////////////////////////////////////////////////////////////////// |
87 | 87 |
88 GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, | 88 GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, |
89 const GrVkBackendContext* backendCtx) | 89 const GrVkBackendContext* backendCtx) |
90 : INHERITED(context) | 90 : INHERITED(context) |
91 , fDevice(backendCtx->fDevice) | 91 , fDevice(backendCtx->fDevice) |
92 , fQueue(backendCtx->fQueue) | 92 , fQueue(backendCtx->fQueue) |
93 , fResourceProvider(this) { | 93 , fResourceProvider(this) { |
94 fBackendContext.reset(backendCtx); | 94 fBackendContext.reset(backendCtx); |
95 | 95 |
96 #ifdef ENABLE_VK_LAYERS | 96 #ifdef SK_ENABLE_VK_LAYERS |
97 fCallback = VK_NULL_HANDLE; | 97 fCallback = VK_NULL_HANDLE; |
98 if (backendCtx->fExtensions & kEXT_debug_report_GrVkExtensionFlag) { | 98 if (backendCtx->fExtensions & kEXT_debug_report_GrVkExtensionFlag) { |
99 // Setup callback creation information | 99 // Setup callback creation information |
100 VkDebugReportCallbackCreateInfoEXT callbackCreateInfo; | 100 VkDebugReportCallbackCreateInfoEXT callbackCreateInfo; |
101 callbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EX
T; | 101 callbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EX
T; |
102 callbackCreateInfo.pNext = nullptr; | 102 callbackCreateInfo.pNext = nullptr; |
103 callbackCreateInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | | 103 callbackCreateInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | |
104 VK_DEBUG_REPORT_WARNING_BIT_EXT | | 104 VK_DEBUG_REPORT_WARNING_BIT_EXT | |
105 //VK_DEBUG_REPORT_INFORMATION_BIT_EXT | | 105 //VK_DEBUG_REPORT_INFORMATION_BIT_EXT | |
106 //VK_DEBUG_REPORT_DEBUG_BIT_EXT | | 106 //VK_DEBUG_REPORT_DEBUG_BIT_EXT | |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 fResourceProvider.destroyResources(); | 184 fResourceProvider.destroyResources(); |
185 | 185 |
186 VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr)); | 186 VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr)); |
187 | 187 |
188 #if USE_SKSL | 188 #if USE_SKSL |
189 delete fCompiler; | 189 delete fCompiler; |
190 #else | 190 #else |
191 shaderc_compiler_release(fCompiler); | 191 shaderc_compiler_release(fCompiler); |
192 #endif | 192 #endif |
193 | 193 |
194 #ifdef ENABLE_VK_LAYERS | 194 #ifdef SK_ENABLE_VK_LAYERS |
195 if (fCallback) { | 195 if (fCallback) { |
196 VK_CALL(DestroyDebugReportCallbackEXT(fBackendContext->fInstance, fCallb
ack, nullptr)); | 196 VK_CALL(DestroyDebugReportCallbackEXT(fBackendContext->fInstance, fCallb
ack, nullptr)); |
197 fCallback = VK_NULL_HANDLE; | 197 fCallback = VK_NULL_HANDLE; |
198 } | 198 } |
199 #endif | 199 #endif |
200 } | 200 } |
201 | 201 |
202 /////////////////////////////////////////////////////////////////////////////// | 202 /////////////////////////////////////////////////////////////////////////////// |
203 | 203 |
204 GrGpuCommandBuffer* GrVkGpu::createCommandBuffer( | 204 GrGpuCommandBuffer* GrVkGpu::createCommandBuffer( |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 } | 1562 } |
1563 | 1563 |
1564 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment | 1564 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment |
1565 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment | 1565 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment |
1566 // which is always at the first attachment. | 1566 // which is always at the first attachment. |
1567 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); | 1567 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); |
1568 fCurrentCmdBuffer->executeCommands(this, buffer); | 1568 fCurrentCmdBuffer->executeCommands(this, buffer); |
1569 fCurrentCmdBuffer->endRenderPass(this); | 1569 fCurrentCmdBuffer->endRenderPass(this); |
1570 } | 1570 } |
1571 | 1571 |
OLD | NEW |