diff --git a/gfx/angle/checkout/out/gen/angle/angle_commit.h b/gfx/angle/checkout/out/gen/angle/angle_commit.h index 0988b577d0e3..7b221d500987 100644 --- a/gfx/angle/checkout/out/gen/angle/angle_commit.h +++ b/gfx/angle/checkout/out/gen/angle/angle_commit.h @@ -1,5 +1,5 @@ -#define ANGLE_COMMIT_HASH "791816843657" +#define ANGLE_COMMIT_HASH "419cd2c3213b" #define ANGLE_COMMIT_HASH_SIZE 12 -#define ANGLE_COMMIT_DATE "2024-06-06 10:35:11 -0700" -#define ANGLE_COMMIT_POSITION 19738 +#define ANGLE_COMMIT_DATE "2024-07-29 14:40:59 -0700" +#define ANGLE_COMMIT_POSITION 19739 #define ANGLE_HAS_BINARY_LOADING diff --git a/gfx/angle/checkout/src/compiler/translator/tree_ops/InitializeVariables.cpp b/gfx/angle/checkout/src/compiler/translator/tree_ops/InitializeVariables.cpp index 789610ecc0bd..0bac4accb4d5 100644 --- a/gfx/angle/checkout/src/compiler/translator/tree_ops/InitializeVariables.cpp +++ b/gfx/angle/checkout/src/compiler/translator/tree_ops/InitializeVariables.cpp @@ -309,6 +309,37 @@ class InitializeLocalsTraverser : public TIntermTraverser return false; } + bool visitFunctionDefinition(Visit visit, TIntermFunctionDefinition *node) override + { + // Initialize output function arguments as well, the parameter passed in at call time may be + // clobbered if the function doesn't fully write to the argument. + + TIntermSequence initCode; + + const TFunction *function = node->getFunction(); + for (size_t paramIndex = 0; paramIndex < function->getParamCount(); ++paramIndex) + { + const TVariable *paramVariable = function->getParam(paramIndex); + const TType ¶mType = paramVariable->getType(); + + if (paramType.getQualifier() != EvqParamOut) + { + continue; + } + + CreateInitCode(new TIntermSymbol(paramVariable), mCanUseLoopsToInitialize, + mHighPrecisionSupported, &initCode, mSymbolTable); + } + + if (!initCode.empty()) + { + TIntermSequence *body = node->getBody()->getSequence(); + body->insert(body->begin(), initCode.begin(), initCode.end()); + } + + return true; + } + private: int mShaderVersion; bool mCanUseLoopsToInitialize; diff --git a/gfx/angle/cherry_picks.txt b/gfx/angle/cherry_picks.txt index 59a3f544384d..0b7a4be5a8e5 100644 --- a/gfx/angle/cherry_picks.txt +++ b/gfx/angle/cherry_picks.txt @@ -1,3 +1,20 @@ +commit 419cd2c3213b594f8e2488bf48034fed20ace81d +Author: Shahbaz Youssefi +Date: Mon Mar 27 13:05:36 2023 -0400 + + Translator: Initialize out arguments too for WebGL + + Local variables were initialized for WebGL, but not `out` arguments. + However, `out` arguments completely overwrite the passed-in variable at + call site, so they should also be zeroed out. + + Bug: chromium:1425685 + Change-Id: Ib2f61a962eea74c4933aafa4d5ad377189cec578 + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4375137 + Reviewed-by: Geoff Lang + Reviewed-by: Kenneth Russell + Commit-Queue: Shahbaz Youssefi + commit 7918168436578718b234bfd56da152e34a85af1d Author: Kelsey Gilbert Date: Tue Jun 4 15:37:29 2024 -0700