Commit 8c04d077 by Olli Etuaho Committed by Commit Bot

Make minimum GLSL version for compute shaders GLSL 430

Compute shaders were added to the core OpenGL spec in version 4.3. Also don't output GL_ARB_explicit_attrib_location extension directive for compute shaders. This extension is only relevant for vertex and fragment shaders. BUG=angleproject:1442 TEST=angle_end2end_tests Change-Id: I92021ac048b38ffbc5a61af408b37c387193389b Reviewed-on: https://chromium-review.googlesource.com/418657Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 56a2f95f
...@@ -253,7 +253,8 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root) ...@@ -253,7 +253,8 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root)
} }
// GLSL ES 3 explicit location qualifiers need to use an extension before GLSL 330 // GLSL ES 3 explicit location qualifiers need to use an extension before GLSL 330
if (getShaderVersion() >= 300 && getOutputType() < SH_GLSL_330_CORE_OUTPUT) if (getShaderVersion() >= 300 && getOutputType() < SH_GLSL_330_CORE_OUTPUT &&
getShaderType() != GL_COMPUTE_SHADER)
{ {
sink << "#extension GL_ARB_explicit_attrib_location : require\n"; sink << "#extension GL_ARB_explicit_attrib_location : require\n";
} }
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "compiler/translator/VersionGLSL.h" #include "compiler/translator/VersionGLSL.h"
#include "angle_gl.h"
namespace sh namespace sh
{ {
...@@ -55,6 +57,10 @@ TVersionGLSL::TVersionGLSL(sh::GLenum type, ...@@ -55,6 +57,10 @@ TVersionGLSL::TVersionGLSL(sh::GLenum type,
{ {
ensureVersionIsAtLeast(GLSL_VERSION_120); ensureVersionIsAtLeast(GLSL_VERSION_120);
} }
if (type == GL_COMPUTE_SHADER)
{
ensureVersionIsAtLeast(GLSL_VERSION_430);
}
} }
void TVersionGLSL::visitSymbol(TIntermSymbol *node) void TVersionGLSL::visitSymbol(TIntermSymbol *node)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment