Hash :
558df6f1
Author :
Date :
2023-08-21T00:00:00
Fix fragment output variables validation * Reject fragment shaders that assign out-of-range fragment locations * Reject fragment shaders that assign output variables of different types to the same location * Apply similar validation for fragment outputs bound via API calls * Ensure that masks for active output variables and draw buffer types are set after processing all fragment output bindings Bug: angleproject:1085 Change-Id: If29cbb58be1981279fc97c67739fe4136b0cdc98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4813656 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
//
// Copyright 2013 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.
//
// ValidateOutputs validates fragment shader outputs. It checks for conflicting locations,
// out-of-range locations, that locations are specified when using multiple outputs, and YUV output
// validity.
//
#ifndef COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_
#define COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_
#include <GLSLANG/ShaderLang.h>
#include "compiler/translator/ExtensionBehavior.h"
namespace sh
{
class TCompiler;
class TIntermBlock;
class TDiagnostics;
// Returns true if the shader has no conflicting or otherwise erroneous fragment outputs.
bool ValidateOutputs(TIntermBlock *root,
const TExtensionBehavior &extBehavior,
const ShBuiltInResources &resources,
bool usesPixelLocalStorage,
TDiagnostics *diagnostics);
} // namespace sh
#endif // COMPILER_TRANSLATOR_VALIDATEOUTPUTS_H_