Hash :
45237a04
Author :
Date :
2022-01-11T00:14:01
Metal: Fix undefined behavior of depth write Writing to an unbound depth attachment is undefined behavior in Metal. Fix this by emitting a function constant to guard depth buffer use in fragment shaders. Bug: angleproject:6865 Change-Id: Id7c10d0aeb349aacfe09c397bc292a71199ab50a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3380304 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
//
// Copyright 2022 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.
//
#ifndef COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_GUARDFRAGDEPTHWRITE_H_
#define COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_GUARDFRAGDEPTHWRITE_H_
#include "compiler/translator/Compiler.h"
#include "compiler/translator/TranslatorMetalDirect/ProgramPrelude.h"
#include "compiler/translator/TranslatorMetalDirect/SymbolEnv.h"
namespace sh
{
ANGLE_NO_DISCARD bool GuardFragDepthWrite(TCompiler &compiler, TIntermBlock &root);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TRANSLATORMETALDIRECT_GUARDFRAGDEPTHWRITE_H_