Commit c3607098 by Tim Van Patten Committed by Commit Bot

Revert "Vulkan: Let shader use rotation specialized constant"

This reverts commit 47b3db22. Reason for revert: Broke the ANGLE roll into Chromium: https://chromium-review.googlesource.com/c/chromium/src/+/2531069 [1875/27343] SOLINK ./libGLESv2.so FAILED: libGLESv2.so libGLESv2.so.TOC /b/s/w/ir/cipd_bin_packages/cpython/bin/python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libGLESv2.so" --tocfile="./libGLESv2.so.TOC" --output="./libGLESv2.so" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-soname="libGLESv2.so" -Wl,--fatal-warnings -Wl,--build-id -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,--color-diagnostics -Wl,--no-call-graph-profile-sort -m64 -Werror -nostdlib++ --sysroot=../../build/linux/debian_sid_amd64-sysroot -L../../build/linux/debian_sid_amd64-sysroot/usr/local/lib/x86_64-linux-gnu -L../../build/linux/debian_sid_amd64-sysroot/lib/x86_64-linux-gnu -L../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu -Wl,-rpath=\$ORIGIN -Wl,--export-dynamic -Wl,-rpath=\$ORIGIN -o "./libGLESv2.so" @"./libGLESv2.so.rsp" ld.lld: error: undefined symbol: sh::TranslatorVulkan::GetDriverUniformFlipXYRef(sh::TVariable const*) >>> referenced by RewriteDfdy.cpp:134 (../../third_party/angle/src/compiler/translator/tree_ops/RewriteDfdy.cpp:134) >>> translator/RewriteDfdy.o:(sh::(anonymous namespace)::Traverser::visitUnaryWithRotation(sh::Visit, sh::TIntermUnary*)) in archive obj/third_party/angle/libtranslator.a >>> referenced by RewriteDfdy.cpp:200 (../../third_party/angle/src/compiler/translator/tree_ops/RewriteDfdy.cpp:200) >>> translator/RewriteDfdy.o:(sh::(anonymous namespace)::Traverser::visitUnaryWithoutRotation(sh::Visit, sh::TIntermUnary*)) in archive obj/third_party/angle/libtranslator.a ld.lld: error: undefined symbol: sh::TranslatorVulkan::GetDriverUniformFragRotationMatrixRef(sh::TVariable const*) >>> referenced by RewriteDfdy.cpp:136 (../../third_party/angle/src/compiler/translator/tree_ops/RewriteDfdy.cpp:136) >>> translator/RewriteDfdy.o:(sh::(anonymous namespace)::Traverser::visitUnaryWithRotation(sh::Visit, sh::TIntermUnary*)) in archive obj/third_party/angle/libtranslator.a clang: error: linker command failed with exit code 1 (use -v to see invocation) Original change's description: > Vulkan: Let shader use rotation specialized constant > > If use rotation specialized constant is enabled via compiler options, > this CL will use rotation specialized constant to generate flipXY, > rotation matrix and negFlipXY. This allows the driver to optimize for > the minimum instructions for rotation. > > Bug: b/171750979 > Change-Id: I9851ac999d4d35b9f230f796e5445bca0dcb1e77 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2514773 > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Tim Van Patten <timvp@google.com> TBR=ianelliott@google.com,timvp@google.com,syoussefi@chromium.org,jmadill@chromium.org,cclao@google.com Change-Id: Id3976259d1f4049aa62b679ad5b25c2ac337c92b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: b/171750979 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2532702Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
parent 246de6ba
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
// Version number for shader translation API. // Version number for shader translation API.
// It is incremented every time the API changes. // It is incremented every time the API changes.
#define ANGLE_SH_VERSION 240 #define ANGLE_SH_VERSION 239
enum ShShaderSpec enum ShShaderSpec
{ {
...@@ -341,9 +341,6 @@ const ShCompileOptions SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION = UINT64_C(1) << 55; ...@@ -341,9 +341,6 @@ const ShCompileOptions SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION = UINT64_C(1) << 55;
// Allow compiler to insert Android pre-rotation code. // Allow compiler to insert Android pre-rotation code.
const ShCompileOptions SH_ADD_PRE_ROTATION = UINT64_C(1) << 56; const ShCompileOptions SH_ADD_PRE_ROTATION = UINT64_C(1) << 56;
// Allow compiler to use specialization constant to do pre-rotation and y flip.
const ShCompileOptions SH_USE_ROTATION_SPECIALIZATION_CONSTANT = UINT64_C(1) << 57;
// Defines alternate strategies for implementing array index clamping. // Defines alternate strategies for implementing array index clamping.
enum ShArrayIndexClampingStrategy enum ShArrayIndexClampingStrategy
{ {
...@@ -783,21 +780,6 @@ enum class SpecializationConstantId : uint32_t ...@@ -783,21 +780,6 @@ enum class SpecializationConstantId : uint32_t
EnumCount = InvalidEnum, EnumCount = InvalidEnum,
}; };
enum class SurfaceRotation : uint32_t
{
Identity,
Rotated90Degrees,
Rotated180Degrees,
Rotated270Degrees,
FlippedIdentity,
FlippedRotated90Degrees,
FlippedRotated180Degrees,
FlippedRotated270Degrees,
InvalidEnum,
EnumCount = InvalidEnum,
};
// Interface block name containing the aggregate default uniforms // Interface block name containing the aggregate default uniforms
extern const char kDefaultUniformsNameVS[]; extern const char kDefaultUniformsNameVS[];
extern const char kDefaultUniformsNameTCS[]; extern const char kDefaultUniformsNameTCS[];
......
...@@ -216,8 +216,6 @@ angle_translator_sources = [ ...@@ -216,8 +216,6 @@ angle_translator_sources = [
"src/compiler/translator/tree_util/FindMain.h", "src/compiler/translator/tree_util/FindMain.h",
"src/compiler/translator/tree_util/FindSymbolNode.cpp", "src/compiler/translator/tree_util/FindSymbolNode.cpp",
"src/compiler/translator/tree_util/FindSymbolNode.h", "src/compiler/translator/tree_util/FindSymbolNode.h",
"src/compiler/translator/tree_util/FlipRotateSpecConst.cpp",
"src/compiler/translator/tree_util/FlipRotateSpecConst.h",
"src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp", "src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp",
"src/compiler/translator/tree_util/IntermNodePatternMatcher.h", "src/compiler/translator/tree_util/IntermNodePatternMatcher.h",
"src/compiler/translator/tree_util/IntermNode_util.cpp", "src/compiler/translator/tree_util/IntermNode_util.cpp",
......
...@@ -64,7 +64,7 @@ TIntermBinary *CreateDriverUniformRef(const TVariable *driverUniforms, const cha ...@@ -64,7 +64,7 @@ TIntermBinary *CreateDriverUniformRef(const TVariable *driverUniforms, const cha
ANGLE_NO_DISCARD bool AppendVertexShaderPositionYCorrectionToMain(TCompiler *compiler, ANGLE_NO_DISCARD bool AppendVertexShaderPositionYCorrectionToMain(TCompiler *compiler,
TIntermBlock *root, TIntermBlock *root,
TSymbolTable *symbolTable, TSymbolTable *symbolTable,
TIntermTyped *negFlipY) TIntermSwizzle *negFlipY)
{ {
// Create a symbol reference to "gl_Position" // Create a symbol reference to "gl_Position"
const TVariable *position = BuiltInVariable::gl_Position(); const TVariable *position = BuiltInVariable::gl_Position();
...@@ -151,7 +151,7 @@ bool TranslatorMetal::translate(TIntermBlock *root, ...@@ -151,7 +151,7 @@ bool TranslatorMetal::translate(TIntermBlock *root,
if (getShaderType() == GL_VERTEX_SHADER) if (getShaderType() == GL_VERTEX_SHADER)
{ {
TIntermTyped *negFlipY = GetDriverUniformNegFlipYRef(driverUniforms); auto negFlipY = getDriverUniformNegFlipYRef(driverUniforms);
// Append gl_Position.y correction to main // Append gl_Position.y correction to main
if (!AppendVertexShaderPositionYCorrectionToMain(this, root, &getSymbolTable(), negFlipY)) if (!AppendVertexShaderPositionYCorrectionToMain(this, root, &getSymbolTable(), negFlipY))
......
...@@ -24,20 +24,15 @@ class TranslatorVulkan : public TCompiler ...@@ -24,20 +24,15 @@ class TranslatorVulkan : public TCompiler
public: public:
TranslatorVulkan(sh::GLenum type, ShShaderSpec spec); TranslatorVulkan(sh::GLenum type, ShShaderSpec spec);
static TIntermTyped *GetDriverUniformFlipXYRef(const TVariable *driverUniforms);
static TIntermTyped *GetDriverUniformNegFlipYRef(const TVariable *driverUniforms);
static TIntermTyped *GetDriverUniformFragRotationMatrixRef(const TVariable *driverUniforms);
static TIntermTyped *GetDriverUniformPreRotationMatrixRef(const TVariable *driverUniforms);
protected: protected:
ANGLE_NO_DISCARD bool translate(TIntermBlock *root, ANGLE_NO_DISCARD bool translate(TIntermBlock *root,
ShCompileOptions compileOptions, ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics) override; PerformanceDiagnostics *perfDiagnostics) override;
bool shouldFlattenPragmaStdglInvariantAll() override; bool shouldFlattenPragmaStdglInvariantAll() override;
TIntermSwizzle *getDriverUniformNegFlipYRef(const TVariable *driverUniforms) const;
TIntermBinary *getDriverUniformDepthRangeReservedFieldRef( TIntermBinary *getDriverUniformDepthRangeReservedFieldRef(
const TVariable *driverUniforms) const; const TVariable *driverUniforms) const;
// Subclass can call this method to transform the AST before writing the final output. // Subclass can call this method to transform the AST before writing the final output.
// See TranslatorMetal.cpp. // See TranslatorMetal.cpp.
ANGLE_NO_DISCARD bool translateImpl(TIntermBlock *root, ANGLE_NO_DISCARD bool translateImpl(TIntermBlock *root,
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "compiler/translator/StaticType.h" #include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h" #include "compiler/translator/SymbolTable.h"
#include "compiler/translator/TranslatorVulkan.h"
#include "compiler/translator/tree_util/FlipRotateSpecConst.h"
#include "compiler/translator/tree_util/IntermNode_util.h" #include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/tree_util/IntermTraverse.h" #include "compiler/translator/tree_util/IntermTraverse.h"
...@@ -26,54 +24,44 @@ class Traverser : public TIntermTraverser ...@@ -26,54 +24,44 @@ class Traverser : public TIntermTraverser
{ {
public: public:
ANGLE_NO_DISCARD static bool Apply(TCompiler *compiler, ANGLE_NO_DISCARD static bool Apply(TCompiler *compiler,
ShCompileOptions compileOptions,
TIntermNode *root, TIntermNode *root,
const TSymbolTable &symbolTable, const TSymbolTable &symbolTable,
FlipRotateSpecConst *rotationSpecConst, TIntermBinary *flipXY,
const TVariable *driverUniforms); TIntermTyped *fragRotation);
private: private:
Traverser(TSymbolTable *symbolTable, Traverser(TIntermBinary *flipXY, TIntermTyped *fragRotation, TSymbolTable *symbolTable);
ShCompileOptions compileOptions,
FlipRotateSpecConst *rotationSpecConst,
const TVariable *driverUniforms);
bool visitUnary(Visit visit, TIntermUnary *node) override; bool visitUnary(Visit visit, TIntermUnary *node) override;
bool visitUnaryWithRotation(Visit visit, TIntermUnary *node); bool visitUnaryWithRotation(Visit visit, TIntermUnary *node);
bool visitUnaryWithoutRotation(Visit visit, TIntermUnary *node); bool visitUnaryWithoutRotation(Visit visit, TIntermUnary *node);
FlipRotateSpecConst *mRotationSpecConst = nullptr; TIntermBinary *mFlipXY = nullptr;
const TVariable *mDriverUniforms = nullptr; TIntermTyped *mFragRotation = nullptr;
bool mUsePreRotation = false;
}; };
Traverser::Traverser(TSymbolTable *symbolTable, Traverser::Traverser(TIntermBinary *flipXY, TIntermTyped *fragRotation, TSymbolTable *symbolTable)
ShCompileOptions compileOptions,
FlipRotateSpecConst *rotationSpecConst,
const TVariable *driverUniforms)
: TIntermTraverser(true, false, false, symbolTable), : TIntermTraverser(true, false, false, symbolTable),
mRotationSpecConst(rotationSpecConst), mFlipXY(flipXY),
mDriverUniforms(driverUniforms), mFragRotation(fragRotation)
mUsePreRotation(compileOptions & SH_ADD_PRE_ROTATION)
{} {}
// static // static
bool Traverser::Apply(TCompiler *compiler, bool Traverser::Apply(TCompiler *compiler,
ShCompileOptions compileOptions,
TIntermNode *root, TIntermNode *root,
const TSymbolTable &symbolTable, const TSymbolTable &symbolTable,
FlipRotateSpecConst *rotationSpecConst, TIntermBinary *flipXY,
const TVariable *driverUniforms) TIntermTyped *fragRotation)
{ {
TSymbolTable *pSymbolTable = const_cast<TSymbolTable *>(&symbolTable); TSymbolTable *pSymbolTable = const_cast<TSymbolTable *>(&symbolTable);
Traverser traverser(pSymbolTable, compileOptions, rotationSpecConst, driverUniforms); Traverser traverser(flipXY, fragRotation, pSymbolTable);
root->traverse(&traverser); root->traverse(&traverser);
return traverser.updateTree(compiler, root); return traverser.updateTree(compiler, root);
} }
bool Traverser::visitUnary(Visit visit, TIntermUnary *node) bool Traverser::visitUnary(Visit visit, TIntermUnary *node)
{ {
if (mUsePreRotation) if (mFragRotation)
{ {
return visitUnaryWithRotation(visit, node); return visitUnaryWithRotation(visit, node);
} }
...@@ -114,52 +102,36 @@ bool Traverser::visitUnaryWithRotation(Visit visit, TIntermUnary *node) ...@@ -114,52 +102,36 @@ bool Traverser::visitUnaryWithRotation(Visit visit, TIntermUnary *node)
// //
// correctedDfdx(operand) = dFdy(operand) * mFlipXY.y // correctedDfdx(operand) = dFdy(operand) * mFlipXY.y
// correctedDfdy(operand) = dFdx(operand) * mFlipXY.x // correctedDfdy(operand) = dFdx(operand) * mFlipXY.x
//
// TODO(ianelliott): Look at the performance of this approach and potentially optimize it
// http://anglebug.com/4678
TIntermTyped *multiplierX; // Get a vec2 with the correct half of ANGLEUniforms.fragRotation
TIntermTyped *multiplierY; TIntermBinary *halfRotationMat = nullptr;
if (node->getOp() == EOpDFdx) if (node->getOp() == EOpDFdx)
{ {
multiplierX = mRotationSpecConst->getMultiplierXForDFdx(); halfRotationMat =
multiplierY = mRotationSpecConst->getMultiplierYForDFdx(); new TIntermBinary(EOpIndexDirect, mFragRotation->deepCopy(), CreateIndexNode(0));
} }
else else
{ {
multiplierX = mRotationSpecConst->getMultiplierXForDFdy(); halfRotationMat =
multiplierY = mRotationSpecConst->getMultiplierYForDFdy(); new TIntermBinary(EOpIndexDirect, mFragRotation->deepCopy(), CreateIndexNode(1));
} }
if (!multiplierX) // Multiply halfRotationMat by ANGLEUniforms.flipXY and store in a temporary variable
{ TIntermBinary *rotatedFlipXY = new TIntermBinary(EOpMul, mFlipXY->deepCopy(), halfRotationMat);
ASSERT(!multiplierY); const TType *vec2Type = StaticType::GetBasic<EbtFloat, 2>();
TIntermTyped *flipXY = TranslatorVulkan::GetDriverUniformFlipXYRef(mDriverUniforms); TIntermSymbol *tmpRotFlipXY = new TIntermSymbol(CreateTempVariable(mSymbolTable, vec2Type));
TIntermTyped *fragRotation = TIntermSequence *tmpDecl = new TIntermSequence;
TranslatorVulkan::GetDriverUniformFragRotationMatrixRef(mDriverUniforms); tmpDecl->push_back(CreateTempInitDeclarationNode(&tmpRotFlipXY->variable(), rotatedFlipXY));
insertStatementsInParentBlock(*tmpDecl);
// Get a vec2 with the correct half of ANGLEUniforms.fragRotation
TIntermBinary *halfRotationMat = nullptr; // Get the .x and .y swizzles to use as multipliers
if (node->getOp() == EOpDFdx) TVector<int> swizzleOffsetX = {0};
{ TVector<int> swizzleOffsetY = {1};
halfRotationMat = new TIntermBinary(EOpIndexDirect, fragRotation, CreateIndexNode(0)); TIntermSwizzle *multiplierX = new TIntermSwizzle(tmpRotFlipXY, swizzleOffsetX);
} TIntermSwizzle *multiplierY = new TIntermSwizzle(tmpRotFlipXY->deepCopy(), swizzleOffsetY);
else
{
halfRotationMat = new TIntermBinary(EOpIndexDirect, fragRotation, CreateIndexNode(1));
}
// Multiply halfRotationMat by ANGLEUniforms.flipXY and store in a temporary variable
TIntermBinary *rotatedFlipXY = new TIntermBinary(EOpMul, flipXY, halfRotationMat);
const TType *vec2Type = StaticType::GetBasic<EbtFloat, 2>();
TIntermSymbol *tmpRotFlipXY = new TIntermSymbol(CreateTempVariable(mSymbolTable, vec2Type));
TIntermSequence *tmpDecl = new TIntermSequence;
tmpDecl->push_back(CreateTempInitDeclarationNode(&tmpRotFlipXY->variable(), rotatedFlipXY));
insertStatementsInParentBlock(*tmpDecl);
// Get the .x and .y swizzles to use as multipliers
TVector<int> swizzleOffsetX = {0};
TVector<int> swizzleOffsetY = {1};
multiplierX = new TIntermSwizzle(tmpRotFlipXY, swizzleOffsetX);
multiplierY = new TIntermSwizzle(tmpRotFlipXY->deepCopy(), swizzleOffsetY);
}
// Get the results of dFdx(operand) and dFdy(operand), and multiply them by the swizzles // Get the results of dFdx(operand) and dFdy(operand), and multiply them by the swizzles
TIntermTyped *operand = node->getOperand(); TIntermTyped *operand = node->getOperand();
...@@ -194,13 +166,8 @@ bool Traverser::visitUnaryWithoutRotation(Visit visit, TIntermUnary *node) ...@@ -194,13 +166,8 @@ bool Traverser::visitUnaryWithoutRotation(Visit visit, TIntermUnary *node)
size_t objectSize = node->getType().getObjectSize(); size_t objectSize = node->getType().getObjectSize();
TOperator multiplyOp = (objectSize == 1) ? EOpMul : EOpVectorTimesScalar; TOperator multiplyOp = (objectSize == 1) ? EOpMul : EOpVectorTimesScalar;
TIntermTyped *flipY = mRotationSpecConst->getFlipY(); TIntermBinary *flipY =
if (!flipY) new TIntermBinary(EOpIndexDirect, mFlipXY->deepCopy(), CreateIndexNode(1));
{
TIntermTyped *flipXY = TranslatorVulkan::GetDriverUniformFlipXYRef(mDriverUniforms);
flipY = new TIntermBinary(EOpIndexDirect, flipXY, CreateIndexNode(1));
}
// Correct dFdy()'s value: // Correct dFdy()'s value:
// (dFdy() * mFlipXY.y) // (dFdy() * mFlipXY.y)
TIntermBinary *correctedDfdy = new TIntermBinary(multiplyOp, newDfdy, flipY); TIntermBinary *correctedDfdy = new TIntermBinary(multiplyOp, newDfdy, flipY);
...@@ -210,22 +177,21 @@ bool Traverser::visitUnaryWithoutRotation(Visit visit, TIntermUnary *node) ...@@ -210,22 +177,21 @@ bool Traverser::visitUnaryWithoutRotation(Visit visit, TIntermUnary *node)
return true; return true;
} }
} // anonymous namespace } // anonymous namespace
bool RewriteDfdy(TCompiler *compiler, bool RewriteDfdy(TCompiler *compiler,
ShCompileOptions compileOptions,
TIntermNode *root, TIntermNode *root,
const TSymbolTable &symbolTable, const TSymbolTable &symbolTable,
int shaderVersion, int shaderVersion,
FlipRotateSpecConst *rotationSpecConst, TIntermBinary *flipXY,
const TVariable *driverUniforms) TIntermTyped *fragRotation)
{ {
// dFdy is only valid in GLSL 3.0 and later. // dFdy is only valid in GLSL 3.0 and later.
if (shaderVersion < 300) if (shaderVersion < 300)
return true; return true;
return Traverser::Apply(compiler, compileOptions, root, symbolTable, rotationSpecConst, return Traverser::Apply(compiler, root, symbolTable, flipXY, fragRotation);
driverUniforms);
} }
} // namespace sh } // namespace sh
...@@ -14,28 +14,23 @@ ...@@ -14,28 +14,23 @@
#define COMPILER_TRANSLATOR_TREEOPS_FLIP_DFDY_H_ #define COMPILER_TRANSLATOR_TREEOPS_FLIP_DFDY_H_
#include "common/angleutils.h" #include "common/angleutils.h"
#include "compiler/translator/Compiler.h"
namespace sh namespace sh
{ {
class TCompiler; class TCompiler;
class TIntermNode; class TIntermNode;
class TIntermSymbol;
class TIntermBinary; class TIntermBinary;
class TIntermTyped; class TIntermTyped;
class TSymbolTable; class TSymbolTable;
class TVariable;
class FlipRotateSpecConst;
// If fragRotation = nullptr, no rotation will be applied. // If fragRotation = nullptr, no rotation will be applied.
ANGLE_NO_DISCARD bool RewriteDfdy(TCompiler *compiler, ANGLE_NO_DISCARD bool RewriteDfdy(TCompiler *compiler,
ShCompileOptions compileOptions,
TIntermNode *root, TIntermNode *root,
const TSymbolTable &symbolTable, const TSymbolTable &symbolTable,
int shaderVersion, int shaderVersion,
FlipRotateSpecConst *rotationSpecConst, TIntermBinary *flipXY,
const TVariable *driverUniforms); TIntermTyped *fragRotation);
} // namespace sh } // namespace sh
......
//
// 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.
//
// FlipRotationSpecConst.h: Add code to generate AST node for flip and rotation matrices and
// vectors.
//
#ifndef COMPILER_TRANSLATOR_TREEUTIL_FLIPROTATESPECCONST_H_
#define COMPILER_TRANSLATOR_TREEUTIL_FLIPROTATESPECCONST_H_
#include "common/angleutils.h"
#include "compiler/translator/SymbolTable.h"
class TIntermTyped;
class TIntermSymbol;
class TVariable;
namespace sh
{
class FlipRotateSpecConst
{
public:
FlipRotateSpecConst();
~FlipRotateSpecConst();
TIntermTyped *getMultiplierXForDFdx();
TIntermTyped *getMultiplierYForDFdx();
TIntermTyped *getMultiplierXForDFdy();
TIntermTyped *getMultiplierYForDFdy();
TIntermTyped *getPreRotationMatrix();
TIntermTyped *getFragRotationMatrix();
TIntermTyped *getFlipXY();
TIntermTyped *getNegFlipXY();
TIntermTyped *getFlipY();
TIntermTyped *getNegFlipY();
void generateSymbol(TSymbolTable *symbolTable);
void outputLayoutString(TInfoSinkBase &sink) const;
private:
TIntermSymbol *mSpecConstSymbol;
// True if mSpecConstSymbol has been used
bool mReferenced;
};
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEUTIL_FLIPROTATESPECCONST_H_
...@@ -3127,23 +3127,13 @@ void ContextVk::updateSurfaceRotationDrawFramebuffer(const gl::State &glState) ...@@ -3127,23 +3127,13 @@ void ContextVk::updateSurfaceRotationDrawFramebuffer(const gl::State &glState)
mCurrentRotationDrawFramebuffer = mCurrentRotationDrawFramebuffer =
DetermineSurfaceRotation(drawFramebuffer, mCurrentWindowSurface); DetermineSurfaceRotation(drawFramebuffer, mCurrentWindowSurface);
// DetermineSurfaceRotation() does not encode yflip information. Shader code uses if (mCurrentRotationDrawFramebuffer != mGraphicsPipelineDesc->getSurfaceRotation())
// SurfaceRotation specialization constant to determine yflip as well. We add yflip information
// to the SurfaceRotation here so the shader does yflip properly.
SurfaceRotation rotationAndFlip = mCurrentRotationDrawFramebuffer;
if (isViewportFlipEnabledForDrawFBO())
{
ASSERT(ToUnderlying(rotationAndFlip) < ToUnderlying(SurfaceRotation::FlippedIdentity));
rotationAndFlip = static_cast<SurfaceRotation>(
ToUnderlying(SurfaceRotation::FlippedIdentity) + ToUnderlying(rotationAndFlip));
}
if (rotationAndFlip != mGraphicsPipelineDesc->getSurfaceRotation())
{ {
// surface rotation are specialization constants, which affects program compilation. When // surface rotation are specialization constants, which affects program compilation. When
// rotation changes, we need to update GraphicsPipelineDesc so that the correct pipeline // rotation changes, we need to update GraphicsPipelineDesc so that the correct pipeline
// program object will be retrieved. // program object will be retrieved.
mGraphicsPipelineDesc->updateSurfaceRotation(&mGraphicsPipelineTransition, rotationAndFlip); mGraphicsPipelineDesc->updateSurfaceRotation(&mGraphicsPipelineTransition,
mCurrentRotationDrawFramebuffer);
} }
} }
......
...@@ -72,9 +72,6 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte ...@@ -72,9 +72,6 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte
// context state does not allow it // context state does not allow it
compileOptions |= SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION; compileOptions |= SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION;
// Let compiler use specialized constant for pre-rotation.
compileOptions |= SH_USE_ROTATION_SPECIALIZATION_CONSTANT;
if (contextVk->getFeatures().enablePreRotateSurfaces.enabled || if (contextVk->getFeatures().enablePreRotateSurfaces.enabled ||
contextVk->getFeatures().emulatedPrerotation90.enabled || contextVk->getFeatures().emulatedPrerotation90.enabled ||
contextVk->getFeatures().emulatedPrerotation180.enabled || contextVk->getFeatures().emulatedPrerotation180.enabled ||
......
...@@ -359,12 +359,6 @@ ...@@ -359,12 +359,6 @@
4344 VULKAN ANDROID : dEQP-GLES2.functional.fragment_ops.random.62 = FAIL 4344 VULKAN ANDROID : dEQP-GLES2.functional.fragment_ops.random.62 = FAIL
4344 VULKAN ANDROID : dEQP-GLES2.functional.fragment_ops.random.78 = FAIL 4344 VULKAN ANDROID : dEQP-GLES2.functional.fragment_ops.random.78 = FAIL
// Failing on the Pixel2.
172932466 VULKAN PIXEL2ORXL : dEQP-GLES2.functional.shaders.indexing.tmp_array.float_const_write_dynamic_read_vertex = FAIL
172932466 VULKAN PIXEL2ORXL : dEQP-GLES2.functional.shaders.indexing.tmp_array.vec2_const_write_dynamic_read_vertex = FAIL
172932466 VULKAN PIXEL2ORXL : dEQP-GLES2.functional.shaders.indexing.tmp_array.vec3_const_write_dynamic_read_vertex = FAIL
172932466 VULKAN PIXEL2ORXL : dEQP-GLES2.functional.shaders.indexing.tmp_array.vec4_const_write_dynamic_read_vertex = FAIL
// These tests also fail on AMD windows driver as it is not allowed to use emulation due to errors. // These tests also fail on AMD windows driver as it is not allowed to use emulation due to errors.
3243 VULKAN WIN AMD : dEQP-GLES2.functional.shaders.texture_functions.vertex.texturecubelod = FAIL 3243 VULKAN WIN AMD : dEQP-GLES2.functional.shaders.texture_functions.vertex.texturecubelod = FAIL
3243 VULKAN WIN AMD : dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_nearest = FAIL 3243 VULKAN WIN AMD : dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_nearest = FAIL
......
...@@ -292,7 +292,3 @@ ...@@ -292,7 +292,3 @@
// Vulkan Android failures with these formats // Vulkan Android failures with these formats
5277 VULKAN ANDROID : dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2* = FAIL 5277 VULKAN ANDROID : dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb10_a2* = FAIL
5277 VULKAN ANDROID : dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5* = FAIL 5277 VULKAN ANDROID : dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.rgba8_snorm_rgb9_e5* = FAIL
// Skip on Pixel2 to reduce the bots test time so that it won't timeout
172936025 VULKAN PIXEL2ORXL : dEQP-GLES31.functional.copy_image.mixed.viewclass_128_bits_mixed.*.* = SKIP
172936025 VULKAN PIXEL2ORXL : dEQP-GLES31.functional.copy_image.compressed.viewclass_astc*.*.* = SKIP
...@@ -642,13 +642,6 @@ ...@@ -642,13 +642,6 @@
// 161540999 PIXEL2ORXL VULKAN : dEQP-GLES3.functional.fragment_ops.random.35 = FAIL // 161540999 PIXEL2ORXL VULKAN : dEQP-GLES3.functional.fragment_ops.random.35 = FAIL
4344 VULKAN ANDROID : dEQP-GLES3.functional.fragment_ops.random.73 = FAIL 4344 VULKAN ANDROID : dEQP-GLES3.functional.fragment_ops.random.73 = FAIL
// Failing on the Pixel2.
172932466 VULKAN PIXEL2ORXL : dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_128_vertex = FAIL
172932466 VULKAN PIXEL2ORXL : dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.float_64_vertex = FAIL
172932466 VULKAN PIXEL2ORXL : dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_128_vertex = FAIL
172932466 VULKAN PIXEL2ORXL : dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_16_vertex = FAIL
172932466 VULKAN PIXEL2ORXL : dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_32_vertex = FAIL
172932466 VULKAN PIXEL2ORXL : dEQP-GLES3.functional.shaders.large_constant_arrays.indexing.vec4_64_vertex = FAIL
// Fails only with SwiftShader: // Fails only with SwiftShader:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment