Invariant related processing.

* Fix a bug in PreProcessor for STDGL pragma.
* Record all invariant settings and set them in ShaderVariable.
* Write #pragma STDGL invariant(all) in GL

BUG=angle:776
TEST=https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shaders-with-invariance.html

Change-Id: Ie28b75480deed79f0c9f26e3b98f1778d1290182
Reviewed-on: https://chromium-review.googlesource.com/223610
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Fix missing include of common_defines.gypi.

Change-Id: I308956a700df4d440573fbae89e67cab0f2cf482
Reviewed-on: https://chromium-review.googlesource.com/224653
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Restrict use of TexStorage more in CopyImage.

We were being too permissive in some copyImage methods when checking
if we can create a render target or not. This would lead us to trying
to use an inconsistent TexStorage in some cases.

Note that we do need to create inconsistent TexStorage in cases where
we are doing a FBO copy *from* a mipmap-incomplete texture attachment.

BUG=angle:780

Change-Id: I5a849b5d8c53713e38cb5f5052a8bb88b3f56260
Reviewed-on: https://chromium-review.googlesource.com/224480
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Make commitRegion a base method of TextureD3D.

Use a helper method isValidIndex to preserve ASSERT checks.

Refactoring patch only.

BUG=angle:741

Change-Id: Ie19fa21db51cd0239a3b391de362584a9fbab2df
Reviewed-on: https://chromium-review.googlesource.com/222268
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Make ShBuiltInResources comparable with memcmp

Chromium builds a std::map with ShBuiltInResources as part of the key.
Comparator for == and < are needed for the map implementation.

Currently Chromium uses memcmp as the comparator. Padding
in ShBuiltInResources causes uninitialized reads.

Fix this by clearing the padding with memset during ShBuiltInResources
initialization.

Change-Id: I78aa3c59ce165503831aa2a67c96cf8af316c152
Reviewed-on: https://chromium-review.googlesource.com/223431
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Use windows_sdk_path for the 8.0 SDK path and windows_8_1_sdk_path for 8.1.

Change-Id: I0cb4262552852ccbc772ca828a0faa7d3e63784b
Reviewed-on: https://chromium-review.googlesource.com/224483
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Always include precision in interm output if it's available

This helps with debugging precision propagation issues.

BUG=angle:787

Change-Id: Ia969481c8d933455cdafef4ae25c6ab3946bc1c2
Reviewed-on: https://chromium-review.googlesource.com/224281
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Remove last uses of gl::error in the Buffer classes.

BUG=angle:520

Change-Id: Id18e93b440da64360a6845a42a2664ae531b06f9
Reviewed-on: https://chromium-review.googlesource.com/218769
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Change the C runtime from static to dynamic.

BUG=angle:733

Change-Id: Iab9a3fbc8aa1e05f4d969016ab28bac868089487
Reviewed-on: https://chromium-review.googlesource.com/224482
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Delete the ShaderImpl on gl::Shader object destruction.

BUG=angleproject:804

Change-Id: I4d68f9283299e9fb6b907a6406c37f92f8b08dbe
Reviewed-on: https://chromium-review.googlesource.com/224106
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Fix varying interpolation parsing.

This was broken sometime in the CollectVariables refactor.

BUG=angle:803

Change-Id: Iaa09449f02290c4547f87c1560465dc8998d957c
Reviewed-on: https://chromium-review.googlesource.com/224104
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Fix initialization sequence translation bug.

BUG=angle:805
TEST=https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/expression-list-in-declarator-initializer.html

Change-Id: I94fbdd0824dbe73034f8bf022aa53627582ad48b
Reviewed-on: https://chromium-review.googlesource.com/224813
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Zhenyao Mo <zmo@chromium.org>
Regenerate public projects.

Change-Id: Ifcff7cba0c16775fdc99812539416ad07d88bf5a
Reviewed-on: https://chromium-review.googlesource.com/225050
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Get rid of use of "static const std::string".

BUG=angle:807
TEST=angle_unittests

Change-Id: Ifa4d713deeb25d52a7aafc362a7e4630024fd511
Reviewed-on: https://chromium-review.googlesource.com/225004
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use a new class name for each window.

If a previous window was not cleaned up properly due to a crash in a
test, the subsequent windows can fail to be created because the class is
not destroyed.  Work around this by always creating a unique class before
creating the window.

Change-Id: Ied6b2818ef03fa12b07111d8204c3c1a6a5bd5ac
Reviewed-on: https://chromium-review.googlesource.com/225080
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Compiler flags and macros added to shader debug report

The list of D3D compiler flags and macros used if
compilation of a shader succeeds is added to the
shader debug output.

BUG=angle:751

Change-Id: Ie84a586010787fe8d9c0dedfe9208f881058a588
Reviewed-on: https://chromium-review.googlesource.com/224970
Tested-by: Tibor Ouden, den <tibordenouden@gmail.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Remove build_angle.gyp.

This file is a duplicate of angle.gyp, and we can remove it now that
Chrome and Blink are finished with it.

BUG=angle:460

Change-Id: Ida68c8343921ebe9a37b5bcd982e114c91febc3d
Reviewed-on: https://chromium-review.googlesource.com/225053
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Defer the creation of textures in TextureStorage11.

BUG=angle:520

Change-Id: If1c1f7519a84900f594701b6298b64ebf8798073
Reviewed-on: https://chromium-review.googlesource.com/219333
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Defer the creation of textures in TextureStorage9 and use Error objects.

BUG=angle:520

Change-Id: I5db70189d95babef14d48548054af4c7ff2bfc47
Reviewed-on: https://chromium-review.googlesource.com/219334
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Add robust D3D11 SRV state tracking.

This will ensure our currently set pixel and vertex SRVs match with
the underlying D3D state, and reduce the need for resetting them as
often.

BUG=angle:756
BUG=417424

Change-Id: I42e9e25182b279871ac4cdf8da5e2ab62c8cf71f
Reviewed-on: https://chromium-review.googlesource.com/225052
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>