Hash :
490ff869
Author :
Date :
2024-03-14T00:00:00
Always redeclare clip/cull distance built-ins When clip or cull distance built-in arrays are implicitly sized, various pruning passes may produce an inconsistent AST state thus causing translation or linking failures. Adjusted the dedicated validation pass to inject an explicit declaration thus bypassing the issue. Additional updates: * Ensured that API clip distance state emulation is applied when a variable is declared but not assigned * Reverted previous clip/cull distance related changes to TIntermBinary::hasSideEffects as they are redundant now * Fixed failing AST validation for MSL varying emulation * Aligned linking error messages with the specifications * Updated tests and cleaned-up obsolete code Fixed: angleproject:8591 Change-Id: Ic8cfaf37778b8532bbab32ab998d5350b85d67ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372714 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
//
// 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.
//
// The ValidateClipCullDistance function checks if the sum of array sizes for gl_ClipDistance and
// gl_CullDistance exceeds gl_MaxCombinedClipAndCullDistances
//
#ifndef COMPILER_TRANSLATOR_VALIDATECLIPCULLDISTANCE_H_
#define COMPILER_TRANSLATOR_VALIDATECLIPCULLDISTANCE_H_
#include "GLSLANG/ShaderVars.h"
#include "compiler/translator/Compiler.h"
namespace sh
{
class TIntermBlock;
class TDiagnostics;
bool ValidateClipCullDistance(TCompiler *compiler,
TIntermBlock *root,
TDiagnostics *diagnostics,
const unsigned int maxCombinedClipAndCullDistances,
uint8_t *clipDistanceSizeOut,
uint8_t *cullDistanceSizeOut,
bool *clipDistanceUsedOut);
} // namespace sh
#endif