From 6030b204d5dc553b81baaff9fe1eeab032d540bd Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 4 Nov 2024 15:07:36 -0400 Subject: [PATCH] libagx: simplify index patch expression Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/shaders/tessellator.cl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/asahi/lib/shaders/tessellator.cl b/src/asahi/lib/shaders/tessellator.cl index cd0743b6d8d..12c50c122aa 100644 --- a/src/asahi/lib/shaders/tessellator.cl +++ b/src/asahi/lib/shaders/tessellator.cl @@ -305,13 +305,10 @@ PatchIndexValue(private struct CHWTessellator *ctx, int index) return index + ctx->IndexPatchCtx.insidePointIndexDeltaToRealValue; } } else if (ctx->bUsingPatchedIndices2) { - if (index >= ctx->IndexPatchCtx2.baseIndexToInvert) { - if (index == ctx->IndexPatchCtx2.cornerCaseBadValue) - return ctx->IndexPatchCtx2.cornerCaseReplacementValue; - else - return ctx->IndexPatchCtx2.indexInversionEndPoint - index; - } else if (index == ctx->IndexPatchCtx2.cornerCaseBadValue) { + if (index == ctx->IndexPatchCtx2.cornerCaseBadValue) { return ctx->IndexPatchCtx2.cornerCaseReplacementValue; + } else if (index >= ctx->IndexPatchCtx2.baseIndexToInvert) { + return ctx->IndexPatchCtx2.indexInversionEndPoint - index; } }