Hash :
c75473c2
Author :
Date :
2020-11-23T14:26:32
Vulkan: Generalize FlipRotationSpecConst to SpecializationConstant Specialization constant are used not just for flip/rotation. It also used for other things. This CL merges all specialization constant usage (lineRasterEmulation, flip, rotation, halfRenderArea) into one class and rename FlipRotationSpecConst to SpecConst. Bug: b/173800146 Change-Id: I8dc3354b6caedbb183cec29855fc1c301ec8872a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2555812 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
//
// 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.
//
// This mutating tree traversal flips the 2nd argument of interpolateAtOffset() to account for
// Y-coordinate flipping
//
// From: interpolateAtOffset(float interpolant, vec2 offset);
// To: interpolateAtOffset(float interpolant, vec2(offset * (pre-rotation * viewportYScale)));
//
// See http://anglebug.com/3589
#ifndef COMPILER_TRANSLATOR_TREEOPS_FLIP_INTERPOLATEATOFFSET_H_
#define COMPILER_TRANSLATOR_TREEOPS_FLIP_INTERPOLATEATOFFSET_H_
#include "common/angleutils.h"
namespace sh
{
class TCompiler;
class TIntermNode;
class TIntermBinary;
class TIntermTyped;
class TSymbolTable;
// If fragRotation = nullptr, no rotation will be applied.
ANGLE_NO_DISCARD bool RewriteInterpolateAtOffset(TCompiler *compiler,
ShCompileOptions compileOptions,
TIntermNode *root,
const TSymbolTable &symbolTable,
int shaderVersion,
SpecConst *specConst,
const DriverUniform *driverUniforms);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_FLIP_INTERPOLATEATOFFSET_H_