Add compute shader compilation support in the glsl compiler
Support is added for compute shader compilation. There is a small
extension to the parser so that 'local_size_x = ', 'local_size_y = '
and 'local_size_z = ' are supported as layout qualifiers.
A few shader compilation tests are added and one which checks the AST
whether the layout qualifiers are properly parsed.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I67283797d1cf13fa4ac47faa2a6e66d93a2db867
Reviewed-on: https://chromium-review.googlesource.com/362300
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/Compiler.h b/src/compiler/translator/Compiler.h
index 4657daa..b982556 100644
--- a/src/compiler/translator/Compiler.h
+++ b/src/compiler/translator/Compiler.h
@@ -85,6 +85,9 @@
int getShaderVersion() const { return shaderVersion; }
TInfoSink& getInfoSink() { return infoSink; }
+ bool isComputeShaderLocalSizeDeclared() const { return mComputeShaderLocalSizeDeclared; }
+ const TLocalSize &getComputeShaderLocalSize() { return mComputeShaderLocalSize; }
+
// Clears the results from the previous compilation.
void clearResults();
@@ -227,6 +230,10 @@
TInfoSink infoSink; // Output sink.
const char *mSourcePath; // Path of source file or NULL
+ // compute shader local group size
+ bool mComputeShaderLocalSizeDeclared;
+ TLocalSize mComputeShaderLocalSize;
+
// name hashing.
ShHashFunction64 hashFunction;
NameMap nameMap;