Hash :
b2d6a9be
Author :
Date :
2015-03-30T16:00:53
Stub simplifying array assignment for HLSL output Add an AST traverser that rejects shaders with expressions that use the return value of an assignment where an array is assigned to another array. In the future this should be made into a tool that can simplify these expressions so that return values of array assignments are not used. In its current form this code prevents OutputHLSL from producing garbage code when the original code contains expressions like a = (b = c); where a, b, and c are all arrays. BUG=angleproject:960 Change-Id: I11353d7ed7160c853e58a0ef3471ca439cb314c8 Reviewed-on: https://chromium-review.googlesource.com/263070 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
//
// 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.
//
// SimplifyArrayAssignment is an AST traverser to replace statements where
// the return value of array assignment is used with statements where
// the return value of array assignment is not used.
//
#ifndef COMPILER_TRANSLATOR_SIMPLIFYARRAYASSIGNMENT_H_
#define COMPILER_TRANSLATOR_SIMPLIFYARRAYASSIGNMENT_H_
#include "common/angleutils.h"
#include "compiler/translator/IntermNode.h"
class SimplifyArrayAssignment : public TIntermTraverser
{
public:
SimplifyArrayAssignment() { }
virtual bool visitBinary(Visit visit, TIntermBinary *node);
};
#endif // COMPILER_TRANSLATOR_SIMPLIFYARRAYASSIGNMENT_H_