chromium/third_party/angle/src/compiler/translator/tree_ops/spirv/EmulateAdvancedBlendEquations.cpp

//
// Copyright 2022 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.
//
// EmulateAdvancedBlendEquations.cpp: Emulate advanced blend equations by implicitly reading back
// from the color attachment (as an input attachment) and apply the equation function based on a
// uniform.
//

#include "compiler/translator/tree_ops/spirv/EmulateAdvancedBlendEquations.h"

#include <map>

#include "GLSLANG/ShaderVars.h"
#include "common/PackedEnums.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/tree_util/DriverUniform.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/RunAtTheEndOfShader.h"

namespace sh
{
namespace
{

// All helper functions that may be generated.
class Builder
{};

bool Builder::build(TIntermBlock *root)
{}

void Builder::findColorOutput(TIntermBlock *root)
{}

TIntermSymbol *MakeVariable(TSymbolTable *symbolTable, const char *name, const TType *type)
{}

void Builder::createSubpassInputVar(TIntermBlock *root)
{}

TIntermTyped *Float(float f)
{}

TFunction *MakeFunction(TSymbolTable *symbolTable,
                        const char *name,
                        const TType *returnType,
                        const TVector<const TVariable *> &args)
{}

TIntermFunctionDefinition *MakeFunctionDefinition(const TFunction *function, TIntermBlock *body)
{}

TIntermFunctionDefinition *MakeSimpleFunctionDefinition(TSymbolTable *symbolTable,
                                                        const char *name,
                                                        TIntermTyped *returnExpression,
                                                        const TVector<TIntermSymbol *> &args)
{}

void Builder::generateHslHelperFunctions()
{}

void Builder::generateBlendFunctions()
{}

void Builder::insertGeneratedFunctions(TIntermBlock *root)
{}

// On some platforms 1.0f is not returned even when the dividend and divisor have the same value.
// In such cases emit 1.0f when the dividend and divisor are equal, else return the divide node
TIntermTyped *Builder::divideFloatNode(TIntermTyped *dividend, TIntermTyped *divisor)
{}

TIntermSymbol *Builder::premultiplyAlpha(TIntermBlock *blendBlock,
                                         TIntermTyped *var,
                                         const char *name)
{}

TIntermTyped *GetFirstElementIfArray(TIntermTyped *var)
{}

void Builder::generatePreamble(TIntermBlock *blendBlock)
{}

void Builder::generateEquationSwitch(TIntermBlock *blendBlock)
{}
}  // anonymous namespace

bool EmulateAdvancedBlendEquations(TCompiler *compiler,
                                   TIntermBlock *root,
                                   TSymbolTable *symbolTable,
                                   const AdvancedBlendEquations &advancedBlendEquations,
                                   const DriverUniform *driverUniforms,
                                   InputAttachmentMap *inputAttachmentMapOut)
{}  // namespace

}  // namespace sh