vk: Fix geometry-shader input varying locations

Bug: skia:
Change-Id: I60e0c25fa05ea53b0969fdee54620bec639ae159
Reviewed-on: https://skia-review.googlesource.com/24440
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2017-07-18 11:39:14 -06:00 committed by Skia Commit-Bot
parent c432b0ca8a
commit 135e446b9f

View File

@ -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