Skip to content

Commit

Permalink
Merge pull request #111 from JacobDomagala/100-prioritize-discrete-gp…
Browse files Browse the repository at this point in the history
…u-over-integrated-one

[#100]: Prioritize discrete GPU over integrated one
  • Loading branch information
JacobDomagala authored Feb 21, 2023
2 parents a351217 + add207d commit 50ef7c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/render/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,13 @@ isDeviceSuitable(VkPhysicalDevice device, VkSurfaceKHR surface)
VkPhysicalDeviceFeatures supportedFeatures;
vkGetPhysicalDeviceFeatures(device, &supportedFeatures);

return indices.isComplete() && extensionsSupported && swapChainAdequate
&& supportedFeatures.samplerAnisotropy && supportedFeatures.multiDrawIndirect
&& supportedFeatures.geometryShader;
// Make sure we use discrete GPU
VkPhysicalDeviceProperties physicalDeviceProperties;
vkGetPhysicalDeviceProperties(device, &physicalDeviceProperties);
auto isDiscrete = physicalDeviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU;

return indices.isComplete() && extensionsSupported && swapChainAdequate && isDiscrete
&& supportedFeatures.samplerAnisotropy && supportedFeatures.multiDrawIndirect;
}

VkSampleCountFlagBits
Expand Down

0 comments on commit 50ef7c2

Please sign in to comment.