aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-04-05 15:48:48 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-06 19:10:03 +0000
commit55068bf8936af4dc0d5b1d470f94fb55a0718f29 (patch)
treee2bf9cce4e7ae7e1c2095be06e2613008169c98b /src/gpu
parent3e8c3458f036da88eca1225a5c6a2cce228f894e (diff)
vulkan: Fix an optimus-related failure with vkEnumeratePhysicalDevices
Bug: skia: Change-Id: I44be948b2e3ce925ff539de279db04bf8df7137c Reviewed-on: https://skia-review.googlesource.com/119060 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/vk/GrVkBackendContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp
index e473178223..269a8911e4 100644
--- a/src/gpu/vk/GrVkBackendContext.cpp
+++ b/src/gpu/vk/GrVkBackendContext.cpp
@@ -156,7 +156,8 @@ const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex
// TODO: find best match for our needs
gpuCount = 1;
err = grVkEnumeratePhysicalDevices(inst, &gpuCount, &physDev);
- if (err) {
+ // VK_INCOMPLETE is returned when the count we provide is less than the total device count.
+ if (err && VK_INCOMPLETE != err) {
SkDebugf("vkEnumeratePhysicalDevices failed: %d\n", err);
grVkDestroyInstance(inst, nullptr);
return nullptr;