Hash :
4cef8a49
Author :
Date :
2019-11-26T00:04:00
Metal: Support depthRange near > far Metal doesn't natively support near > far depthRange, need to emulate it via shader. Bug: angleproject:2634 Change-Id: I1885cad3467478a0dcc4b25b7d41f980b9e03103 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1919282 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
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
//
// Copyright (c) 2019 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.
//
// TranslatorMetal:
// A GLSL-based translator that outputs shaders that fit GL_KHR_vulkan_glsl.
// It takes into account some considerations for Metal backend also.
// 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
//
// The SPIR-V will then be translated to Metal Shading Language later in Metal backend.
//
#ifndef LIBANGLE_RENDERER_METAL_TRANSLATORMETAL_H_
#define LIBANGLE_RENDERER_METAL_TRANSLATORMETAL_H_
#include "compiler/translator/TranslatorVulkan.h"
namespace sh
{
class TranslatorMetal : public TranslatorVulkan
{
public:
TranslatorMetal(sh::GLenum type, ShShaderSpec spec);
protected:
ANGLE_NO_DISCARD bool translate(TIntermBlock *root,
ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics) override;
ANGLE_NO_DISCARD bool transformDepthBeforeCorrection(TIntermBlock *root,
const TVariable *driverUniforms) override;
};
} // namespace sh
#endif /* LIBANGLE_RENDERER_METAL_TRANSLATORMETAL_H_ */