Hash :
4d7a3993
Author :
Date :
2020-05-27T14:08:20
Vulkan: Rotate gl_PointCoord for Android pre-rotation This extends the current y-flip that's done for gl_PointCoord. Now, gl_PointCoord is rotated and then flips both the x and y-axis (similar to gl_FragCoord). The tests used to reproduce the problem and the fix are: angle_deqp_gles2_tests --local-output --gtest_filter=dEQP.GLES2/functional_shaders_builtin_variable_pointcoord* --use-angle=vulkan angle_end2end_tests --local-output --gtest_filter=*GLSLTest.PointCoordConsistency*Vulkan* Bug: b/157476696 Change-Id: Iada8680eda8322f7382ff242e4a9422a66114f07 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2216700 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
//
// Copyright 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.
//
// TranslatorVulkan:
// A GLSL-based translator that outputs shaders that fit GL_KHR_vulkan_glsl.
// The shaders are then fed into glslang to spit out SPIR-V (libANGLE-side).
// See: https://www.khronos.org/registry/vulkan/specs/misc/GL_KHR_vulkan_glsl.txt
//
#ifndef COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_
#define COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_
#include "compiler/translator/Compiler.h"
namespace sh
{
class TOutputVulkanGLSL;
class TranslatorVulkan : public TCompiler
{
public:
TranslatorVulkan(sh::GLenum type, ShShaderSpec spec);
protected:
ANGLE_NO_DISCARD bool translate(TIntermBlock *root,
ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics) override;
bool shouldFlattenPragmaStdglInvariantAll() override;
TIntermSwizzle *getDriverUniformNegFlipYRef(const TVariable *driverUniforms) const;
TIntermBinary *getDriverUniformDepthRangeReservedFieldRef(
const TVariable *driverUniforms) const;
// Subclass can call this method to transform the AST before writing the final output.
// See TranslatorMetal.cpp.
ANGLE_NO_DISCARD bool translateImpl(TIntermBlock *root,
ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics,
const TVariable **driverUniformsOut,
TOutputVulkanGLSL *outputGLSL);
// Give subclass such as TranslatorMetal a chance to do depth transform before
// TranslatorVulkan apply its own transform.
ANGLE_NO_DISCARD virtual bool transformDepthBeforeCorrection(TIntermBlock *root,
const TVariable *driverUniforms)
{
return true;
}
};
} // namespace sh
#endif // COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_