diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /gfx/angle/src/libANGLE/renderer/gl/CompilerGL.cpp | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/angle/src/libANGLE/renderer/gl/CompilerGL.cpp')
-rwxr-xr-x | gfx/angle/src/libANGLE/renderer/gl/CompilerGL.cpp | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/gfx/angle/src/libANGLE/renderer/gl/CompilerGL.cpp b/gfx/angle/src/libANGLE/renderer/gl/CompilerGL.cpp new file mode 100755 index 000000000..71be15611 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/gl/CompilerGL.cpp @@ -0,0 +1,91 @@ +// +// Copyright 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. +// +// CompilerGL: +// Implementation of the GL compiler methods. +// + +#include "libANGLE/renderer/gl/CompilerGL.h" + +#include "libANGLE/renderer/gl/FunctionsGL.h" + +namespace rx +{ + +namespace +{ + +ShShaderOutput GetShaderOutputType(const FunctionsGL *functions) +{ + ASSERT(functions); + + if (functions->standard == STANDARD_GL_DESKTOP) + { + // GLSL outputs + if (functions->isAtLeastGL(gl::Version(4, 5))) + { + return SH_GLSL_450_CORE_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(4, 4))) + { + return SH_GLSL_440_CORE_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(4, 3))) + { + return SH_GLSL_430_CORE_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(4, 2))) + { + return SH_GLSL_420_CORE_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(4, 1))) + { + return SH_GLSL_410_CORE_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(4, 0))) + { + return SH_GLSL_400_CORE_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(3, 3))) + { + return SH_GLSL_330_CORE_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(3, 2))) + { + return SH_GLSL_150_CORE_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(3, 1))) + { + return SH_GLSL_140_OUTPUT; + } + else if (functions->isAtLeastGL(gl::Version(3, 0))) + { + return SH_GLSL_130_OUTPUT; + } + else + { + return SH_GLSL_COMPATIBILITY_OUTPUT; + } + } + else if (functions->standard == STANDARD_GL_ES) + { + // ESSL outputs + return SH_ESSL_OUTPUT; + } + else + { + UNREACHABLE(); + return ShShaderOutput(0); + } +} + +} // anonymous namespace + +CompilerGL::CompilerGL(const FunctionsGL *functions) + : mTranslatorOutputType(GetShaderOutputType(functions)) +{ +} + +} // namespace rx |