Add support for images in the compiler
The patch adds support for GLSL ES 3.1 image types.
Internal format layout qualifiers for images are added.
Support for the readonly and writeonly qualifiers are added. The other
memory qualifiers are omitted as to make the patch simpler.
Tests are added which check for correct and incorrect usage of images,
internal format layout and memory qualifiers.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: Ie4d3acb2a195de11b405ad54110a04c4c1de0b7e
Reviewed-on: https://chromium-review.googlesource.com/378855
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index eb5dd58..8e1fc19 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -517,14 +517,10 @@
symbolTable.push(); // ESSL3_1_BUILTINS
TPublicType integer;
- integer.setBasicType(EbtInt);
- integer.initializeSizeForScalarTypes();
- integer.array = false;
+ integer.initializeBasicType(EbtInt);
TPublicType floatingPoint;
- floatingPoint.setBasicType(EbtFloat);
- floatingPoint.initializeSizeForScalarTypes();
- floatingPoint.array = false;
+ floatingPoint.initializeBasicType(EbtFloat);
switch(shaderType)
{
@@ -563,9 +559,7 @@
{
ASSERT(samplerType > EbtGuardSamplerBegin && samplerType < EbtGuardSamplerEnd);
TPublicType sampler;
- sampler.initializeSizeForScalarTypes();
- sampler.setBasicType(samplerType);
- sampler.array = false;
+ sampler.initializeBasicType(samplerType);
symbolTable.setDefaultPrecision(sampler, EbpLow);
}