aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkCaps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/vk/GrVkCaps.cpp')
-rw-r--r--src/gpu/vk/GrVkCaps.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 16a91c1a1f..d185b17c78 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -145,7 +145,17 @@ void GrVkCaps::initSampleCount(const VkPhysicalDeviceProperties& properties) {
void GrVkCaps::initGrCaps(const VkPhysicalDeviceProperties& properties,
const VkPhysicalDeviceMemoryProperties& memoryProperties,
uint32_t featureFlags) {
- fMaxVertexAttributes = SkTMin(properties.limits.maxVertexInputAttributes, (uint32_t)INT_MAX);
+ // So GPUs, like AMD, are reporting MAX_INT support vertex attributes. In general, there is no
+ // need for us ever to support that amount, and it makes tests which tests all the vertex
+ // attribs timeout looping over that many. For now, we'll cap this at 64 max and can raise it if
+ // we ever find that need.
+ static const uint32_t kMaxVertexAttributes = 64;
+ fMaxVertexAttributes = SkTMin(properties.limits.maxVertexInputAttributes, kMaxVertexAttributes);
+ // AMD advertises support for MAX_UINT vertex input attributes, but in reality only supports 32.
+ if (kAMD_VkVendor == properties.vendorID) {
+ fMaxVertexAttributes = SkTMin(fMaxVertexAttributes, 32);
+ }
+
// We could actually query and get a max size for each config, however maxImageDimension2D will
// give the minimum max size across all configs. So for simplicity we will use that for now.
fMaxRenderTargetSize = SkTMin(properties.limits.maxImageDimension2D, (uint32_t)INT_MAX);