Hash :
11e43ece
Author :
Date :
2016-08-11T09:54:08
Add a workaround for Intel drivers on glsl function texelfetchoffset GLSL function texelfetchoffset will be translated into texture.Load in ANGLE. In D3D there is a note that When one or more of the coordinates in Location exceeds the u, v, or w mipmap level dimensions of the texture, Load returns zero in all components, but in glsl there is no such restriction, which will cause the WebGL 2 dEQP test deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html fail on Windows with Intel GPU. Adapted from ExpandIntegerPowExpressions.cpp, this patch adds a translation from texelFetchOffset into texelFetch to work around this issue. BUG=angleproject:1469 Change-Id: Iecfb9570472036acf5960789bdb1a63f191316be Reviewed-on: https://chromium-review.googlesource.com/367883 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
//
// Copyright (c) 2016 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.
//
// This mutating tree traversal works around an issue on the translation
// from texelFetchOffset into HLSL function Load on INTEL drivers. It
// works by translating texelFetchOffset into texelFetch:
//
// - From: texelFetchOffset(sampler, Position, lod, offset)
// - To: texelFetch(sampler, Position+offset, lod)
//
// See http://anglebug.com/1469
#ifndef COMPILER_TRANSLATOR_REWRITE_TEXELFETCHOFFSET_H_
#define COMPILER_TRANSLATOR_REWRITE_TEXELFETCHOFFSET_H_
class TIntermNode;
class TSymbolTable;
namespace sh
{
void RewriteTexelFetchOffset(TIntermNode *root,
unsigned int *tempIndex,
const TSymbolTable &symbolTable,
int shaderVersion);
} // namespace sh
#endif // COMPILER_TRANSLATOR_REWRITE_TEXELFETCHOFFSET_H_