Hash :
98c2e169
Author :
Date :
2022-05-20T16:17:49
Vulkan: Reduce pre-rotation spec const to bool The specialization constant now only dictates whether x and y should be swapped. The complete 8 possible states of rotation and y-flip are achieved by using this swap in combination with a driver uniform for x and y flip. Swapping is still a specialization constant to avoid degrading performance of dFdx/dFdy which otherwise would need both to be evaluated instead of one. On platforms which don't support pre-rotation, the specialization constant will never change and driver uniforms entirely govern y-flip. On platforms that do support pre-rotation, only two variations of the pipeline are needed. Bug: angleproject:7366 Change-Id: I73f84e89fa9349d2098fa5b21573aee57d93a30c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3663151 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
//
// Copyright 2019 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.
//
// RewriteDfdy: Transform dFdx and dFdy according to pre-rotation and viewport y-flip.
#ifndef COMPILER_TRANSLATOR_TREEOPS_REWRITEDFDY_H_
#define COMPILER_TRANSLATOR_TREEOPS_REWRITEDFDY_H_
#include "common/angleutils.h"
#include "compiler/translator/Compiler.h"
namespace sh
{
class TCompiler;
class TIntermBlock;
class TSymbolTable;
class SpecConst;
class DriverUniform;
ANGLE_NO_DISCARD bool RewriteDfdy(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable,
int shaderVersion,
SpecConst *specConst,
const DriverUniform *driverUniforms);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_REWRITEDFDY_H_