Hash :
fab397e5
Author :
Date :
2019-07-25T10:18:50
Vulkan: Enforce an error when initializing a global with a non-const The ESSL 1.0 spec is clear that "initializers must be a constant expression." Yet, because of "legacy" applications (apparently just WebGL applications), the code was only issuing a warning and not an error. The "KHR-GLES2.shaders.negative.initialize" test requires an error be generated. This change splits the semantics, allowing GLES applications to get an error, and WebGL applications to get a warning. Note: This change is related to https://chromium-review.googlesource.com/829138 (for angleproject:2285). Bug: angleproject:3381 Change-Id: Ie243b7dd72102aeb52df506d121d1d2a8f6974d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1716617 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
//
// Copyright (c) 2002-2015 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_VALIDATEGLOBALINITIALIZER_H_
#define COMPILER_TRANSLATOR_VALIDATEGLOBALINITIALIZER_H_
namespace sh
{
class TIntermTyped;
// Returns true if the initializer is valid.
bool ValidateGlobalInitializer(TIntermTyped *initializer,
int shaderVersion,
bool isWebGL,
bool *warning);
} // namespace sh
#endif // COMPILER_TRANSLATOR_VALIDATEGLOBALINITIALIZER_H_