| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // sleep to make sure the fence singals. | 170 // sleep to make sure the fence singals. |
| 171 #ifdef SK_DEBUG | 171 #ifdef SK_DEBUG |
| 172 #if defined(SK_BUILD_FOR_WIN) | 172 #if defined(SK_BUILD_FOR_WIN) |
| 173 Sleep(10); // In milliseconds | 173 Sleep(10); // In milliseconds |
| 174 #else | 174 #else |
| 175 // Uncomment if above bug happens on non windows build. | 175 // Uncomment if above bug happens on non windows build. |
| 176 // sleep(1); // In seconds | 176 // sleep(1); // In seconds |
| 177 #endif | 177 #endif |
| 178 #endif | 178 #endif |
| 179 | 179 |
| 180 // VK_ERROR_DEVICE_LOST is acceptable when tearing down (see 4.2.4 in spec) | 180 #ifdef SK_DEBUG |
| 181 SkASSERT(VK_SUCCESS == res || VK_ERROR_DEVICE_LOST == res); | 181 if (this->vkCaps().allowInitializationErrorOnTearDown()) { |
| 182 SkASSERT(VK_SUCCESS == res || |
| 183 VK_ERROR_DEVICE_LOST == res || |
| 184 VK_ERROR_INITIALIZATION_FAILED == res); |
| 185 } else { |
| 186 SkASSERT(VK_SUCCESS == res || VK_ERROR_DEVICE_LOST == res); |
| 187 } |
| 188 #endif |
| 182 | 189 |
| 183 // must call this just before we destroy the VkDevice | 190 // must call this just before we destroy the VkDevice |
| 184 fResourceProvider.destroyResources(); | 191 fResourceProvider.destroyResources(); |
| 185 | 192 |
| 186 VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr)); | 193 VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr)); |
| 187 | 194 |
| 188 #if USE_SKSL | 195 #if USE_SKSL |
| 189 delete fCompiler; | 196 delete fCompiler; |
| 190 #else | 197 #else |
| 191 shaderc_compiler_release(fCompiler); | 198 shaderc_compiler_release(fCompiler); |
| (...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1841 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment | 1848 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment |
| 1842 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment | 1849 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment |
| 1843 // which is always at the first attachment. | 1850 // which is always at the first attachment. |
| 1844 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); | 1851 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); |
| 1845 fCurrentCmdBuffer->executeCommands(this, buffer); | 1852 fCurrentCmdBuffer->executeCommands(this, buffer); |
| 1846 fCurrentCmdBuffer->endRenderPass(this); | 1853 fCurrentCmdBuffer->endRenderPass(this); |
| 1847 | 1854 |
| 1848 this->didWriteToSurface(target, &bounds); | 1855 this->didWriteToSurface(target, &bounds); |
| 1849 } | 1856 } |
| 1850 | 1857 |
| OLD | NEW |