Hash :
16771259
Author :
Date :
2025-09-12T11:10:18
Update main() prototype in shader if main() has been replaced. If the main() function definition has been wrapped/replaced in a shader and a main() function prototype is also present, the prototype needs to be replaced. Otherwise it will continue to reference the replaced main() which can cause issues with shader translation steps. Bug: angleproject:444653099 Change-Id: Ie6ce85cac89e026876a1b6e25cd294f1d8a536c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6944807 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com>
//
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// FindMain.h: Adds functions to get the main function definition and its body.
#ifndef COMPILER_TRANSLATOR_TREEUTIL_FINDMAIN_H_
#define COMPILER_TRANSLATOR_TREEUTIL_FINDMAIN_H_
#include <cstddef>
namespace sh
{
class TIntermBlock;
class TIntermFunctionDefinition;
class TIntermFunctionPrototype;
size_t FindMainIndex(TIntermBlock *root);
TIntermFunctionDefinition *FindMain(TIntermBlock *root);
TIntermFunctionPrototype *FindMainPrototype(TIntermBlock *root);
TIntermBlock *FindMainBody(TIntermBlock *root);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEUTIL_FINDMAIN_H_