Hash :
edcfab40
Author :
Date :
2023-11-23T00:00:00
Metal: Implement textureCubeGrad transformation for AGX Wrapped all affected built-in function calls with helpers that transform derivative values. Fixed all *.texturegrad.* dEQP failures on Apple silicon. Fixed: angleproject:7021 Fixed: angleproject:8433 Change-Id: I16b023840ad267ab72d31fde3cb0fa7048e5310c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5071254 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
//
// Copyright 2023 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.
//
// Multiple GPU vendors have issues with transforming explicit cubemap
// derivatives onto the appropriate face. The workarounds are vendor-specific.
#ifndef COMPILER_TRANSLATOR_TREEOPS_PRETRANSFORMTEXTURECUBEGRADDERIVATIVES_H_
#define COMPILER_TRANSLATOR_TREEOPS_PRETRANSFORMTEXTURECUBEGRADDERIVATIVES_H_
#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
// GLSL specs say the following regarding cube
// map sampling with explicit derivatives:
//
// For the cube version, the partial derivatives of
// P are assumed to be in the coordinate system used
// before texture coordinates are projected onto the
// appropriate cube face.
//
// Apple silicon expects them partially pre-projected
// onto the target face and written to certain vector
// components depending on the major axis.
[[nodiscard]] bool PreTransformTextureCubeGradDerivatives(TCompiler *compiler,
TIntermBlock *root,
TSymbolTable *symbolTable,
int shaderVersion);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_PRETRANSFORMTEXTURECUBEGRADDERIVATIVES_H_