chromium/third_party/angle/src/compiler/translator/tree_util/ReplaceArrayOfMatrixVarying.cpp

//
// Copyright 2020 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.
//
// ReplaceArrayOfMatrixVarying: Find any references to array of matrices varying
// and replace it with array of vectors.
//

#include "compiler/translator/tree_util/ReplaceArrayOfMatrixVarying.h"

#include <vector>

#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/utilities.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/tree_util/BuiltIn.h"
#include "compiler/translator/tree_util/FindMain.h"
#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/tree_util/ReplaceVariable.h"
#include "compiler/translator/tree_util/RunAtTheEndOfShader.h"
#include "compiler/translator/util.h"

namespace sh
{

// We create two variables to replace the given varying:
// - The new varying which is an array of vectors to be used at input/ouput only.
// - The new global variable which is a same type as given variable, to temporarily be used
// as replacements for assignments, arithmetic ops and so on. During input/ouput phrase, this temp
// variable will be copied from/to the array of vectors variable above.
// NOTE(hqle): Consider eliminating the need for using temp variable.

namespace
{
class CollectVaryingTraverser : public TIntermTraverser
{};
}  // namespace

[[nodiscard]] bool ReplaceArrayOfMatrixVarying(TCompiler *compiler,
                                               TIntermBlock *root,
                                               TSymbolTable *symbolTable,
                                               const TVariable *varying)
{}

[[nodiscard]] bool ReplaceArrayOfMatrixVaryings(TCompiler *compiler,
                                                TIntermBlock *root,
                                                TSymbolTable *symbolTable)
{}

}  // namespace sh