diff options
Diffstat (limited to 'src/gpu/vk')
-rw-r--r-- | src/gpu/vk/GrVkCaps.cpp | 15 | ||||
-rw-r--r-- | src/gpu/vk/GrVkCaps.h | 10 | ||||
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 7 |
3 files changed, 29 insertions, 3 deletions
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp index f614ae39c6..383d3caf49 100644 --- a/src/gpu/vk/GrVkCaps.cpp +++ b/src/gpu/vk/GrVkCaps.cpp @@ -19,6 +19,7 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface* fMustDoCopiesFromOrigin = false; fSupportsCopiesAsDraws = false; fMustSubmitCommandsBeforeCopyOp = false; + fMustSleepOnTearDown = false; /************************************************************************** * GrDrawTargetCaps fields @@ -79,6 +80,16 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface* fMustSubmitCommandsBeforeCopyOp = true; } +#if defined(SK_BUILD_FOR_WIN) + if (kNvidia_VkVendor == properties.vendorID) { + fMustSleepOnTearDown = true; + } +#elif defined(SK_BUILD_FOR_ANDROID) + if (kImagination_VkVendor == properties.vendorID) { + fMustSleepOnTearDown = true; + } +#endif + this->applyOptionsOverrides(contextOptions); fShaderCaps->applyOptionsOverrides(contextOptions); } @@ -163,6 +174,10 @@ void GrVkCaps::initShaderCaps(const VkPhysicalDeviceProperties& properties, uint } } + if (kImagination_VkVendor == properties.vendorID) { + shaderCaps->fAtan2ImplementedAsAtanYOverX = true; + } + // Vulkan is based off ES 3.0 so the following should all be supported shaderCaps->fUsesPrecisionModifiers = true; shaderCaps->fFlatInterpolationSupport = true; diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h index b390a9b2af..6d030f69a1 100644 --- a/src/gpu/vk/GrVkCaps.h +++ b/src/gpu/vk/GrVkCaps.h @@ -76,6 +76,10 @@ public: return fMustSubmitCommandsBeforeCopyOp; } + bool mustSleepOnTearDown() const { + return fMustSleepOnTearDown; + } + /** * Returns both a supported and most prefered stencil format to use in draws. */ @@ -87,6 +91,7 @@ private: enum VkVendor { kQualcomm_VkVendor = 20803, kNvidia_VkVendor = 4318, + kImagination_VkVendor = 4112, }; void init(const GrContextOptions& contextOptions, const GrVkInterface* vkInterface, @@ -136,6 +141,11 @@ private: // as draws. bool fMustSubmitCommandsBeforeCopyOp; + // Sometimes calls to QueueWaitIdle return before actually signalling the fences + // on the command buffers even though they have completed. This causes an assert to fire when + // destroying the command buffers. Therefore we add a sleep to make sure the fence signals. + bool fMustSleepOnTearDown; + typedef GrCaps INHERITED; }; diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 853e68cc00..b94a37957f 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -168,12 +168,13 @@ GrVkGpu::~GrVkGpu() { // destroying the command buffers. Currently this ony seems to happen on windows, so we add a // sleep to make sure the fence signals. #ifdef SK_DEBUG + if (this->vkCaps().mustSleepOnTearDown()) { #if defined(SK_BUILD_FOR_WIN) - Sleep(10); // In milliseconds + Sleep(10); // In milliseconds #else - // Uncomment if above bug happens on non windows build. - // sleep(1); // In seconds + sleep(1); // In seconds #endif + } #endif #ifdef SK_DEBUG |