From 135e446b9f035f6b028df77b006ac556294d5dbb Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Tue, 18 Jul 2017 11:39:14 -0600 Subject: [PATCH] vk: Fix geometry-shader input varying locations Bug: skia: Change-Id: I60e0c25fa05ea53b0969fdee54620bec639ae159 Reviewed-on: https://skia-review.googlesource.com/24440 Reviewed-by: Greg Daniel Commit-Queue: Chris Dalton --- src/gpu/vk/GrVkVaryingHandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gpu/vk/GrVkVaryingHandler.cpp b/src/gpu/vk/GrVkVaryingHandler.cpp index d936e2bd1a..9a38159849 100644 --- a/src/gpu/vk/GrVkVaryingHandler.cpp +++ b/src/gpu/vk/GrVkVaryingHandler.cpp @@ -71,11 +71,12 @@ void finalize_helper(GrVkVaryingHandler::VarArray& vars) { var.addLayoutQualifier(location.c_str()); int elementSize = grsltype_to_location_size(var.getType()); - SkASSERT(elementSize); + SkASSERT(elementSize > 0); int numElements = 1; - if (var.isArray()) { - numElements = var.getArrayCount(); + if (var.isArray() && !var.isUnsizedArray()) { + numElements = var.getArrayCount(); } + SkASSERT(numElements > 0); locationIndex += elementSize * numElements; } // Vulkan requires at least 64 locations to be supported for both vertex output and fragment