Hash :
34130c2e
Author :
Date :
2020-11-07T15:11:14
Vulkan: Rewrite interpolateAtOffset to account for Y-flip
In order to fully suppot OES_shader_multisample_interpolation
rewrite interpolateAtOffset's offset parameter to account for
Y-coordinate flip.
Bug: angleproject:3589
Tests: dEQP-GLES31.functional.shaders.multisample_interpolation.
interpolate_at_offset.*.default_framebuffer
Change-Id: I6bf72ceb1c0466ff5d4a92b72d1ec9e2552d6f2a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2524711
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
//
// Copyright 2020 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 flips the 2nd argument of interpolateAtOffset() to account for
// Y-coordinate flipping
//
// From: interpolateAtOffset(float interpolant, vec2 offset);
// To: interpolateAtOffset(float interpolant, vec2(offset * (pre-rotation * viewportYScale)));
//
// See http://anglebug.com/3589
#ifndef COMPILER_TRANSLATOR_TREEOPS_FLIP_INTERPOLATEATOFFSET_H_
#define COMPILER_TRANSLATOR_TREEOPS_FLIP_INTERPOLATEATOFFSET_H_
#include "common/angleutils.h"
namespace sh
{
class TCompiler;
class TIntermNode;
class TIntermBinary;
class TIntermTyped;
class TSymbolTable;
// If fragRotation = nullptr, no rotation will be applied.
ANGLE_NO_DISCARD bool RewriteInterpolateAtOffset(TCompiler *compiler,
TIntermNode *root,
const TSymbolTable &symbolTable,
int shaderVersion,
TIntermBinary *flipXY,
TIntermTyped *fragRotation);
} // namespace sh
#endif // COMPILER_TRANSLATOR_TREEOPS_FLIP_INTERPOLATEATOFFSET_H_