From 5c8cdf91215b1c6d9f2718a5d66bbeefcea7fe71 Mon Sep 17 00:00:00 2001 From: David G Yu Date: Mon, 24 Jun 2019 16:47:56 -0700 Subject: [PATCH] Fixed regression in MTLComputeEvaluator Fixed the initialization of patchArray and patchParam in the implementation of the MTLComputeEvaluator::EvalPatches() compute kernel. --- opensubdiv/osd/mtlComputeKernel.metal | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/opensubdiv/osd/mtlComputeKernel.metal b/opensubdiv/osd/mtlComputeKernel.metal index 416d282a..ca171283 100644 --- a/opensubdiv/osd/mtlComputeKernel.metal +++ b/opensubdiv/osd/mtlComputeKernel.metal @@ -255,16 +255,16 @@ kernel void eval_patches( as_type(patchCoords[current*5+3]), as_type(patchCoords[current*5+4])); - OsdPatchArray patchArray = OsdPatchArrayInit(patchArrays[current*6+0], - patchArrays[current*6+1], - patchArrays[current*6+2], - patchArrays[current*6+3], - patchArrays[current*6+4], - patchArrays[current*6+5]); + OsdPatchArray patchArray = OsdPatchArrayInit(patchArrays[patchCoord.arrayIndex*6+0], + patchArrays[patchCoord.arrayIndex*6+1], + patchArrays[patchCoord.arrayIndex*6+2], + patchArrays[patchCoord.arrayIndex*6+3], + patchArrays[patchCoord.arrayIndex*6+4], + patchArrays[patchCoord.arrayIndex*6+5]); - OsdPatchParam patchParam = OsdPatchParamInit(patchParams[current*3+0], - patchParams[current*3+1], - as_type(patchParams[current*3+2])); + OsdPatchParam patchParam = OsdPatchParamInit(patchParams[patchCoord.patchIndex*3+0], + patchParams[patchCoord.patchIndex*3+1], + as_type(patchParams[patchCoord.patchIndex*3+2])); int patchType = OsdPatchParamIsRegular(patchParam) ? patchArray.regDesc : patchArray.desc;