Move shader variables into the base impl.

These variable types apply across shader types. Either we'll want a
way to cache them after we query them, or we'll do a pre-parse pass
similar to our current Chromium GLSL to GLSL pre-pass where we store
the variables in ANGLE. In either case, they're shared across GL
implementations so make sense as queries from gl::Shader.

BUG=angle:731

Change-Id: I23f5541423abb4af87a2bc2fc1e9f4047fd2ff90
Reviewed-on: https://chromium-review.googlesource.com/214870
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Compact the D3D shader specializations into one.

BUG=angle:731

Change-Id: I4f35a05aeea130f9011ec62cfe931ed23e2681c9
Reviewed-on: https://chromium-review.googlesource.com/214871
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use the CollectVariables path on the HLSL translator.

This approach consolidates our two methods, and lets us reuse the
same code for both methods of variable collection.

BUG=angle:466

Change-Id: Ie92f76ff0b6d0d0dbfd211a234d0ab86290fa798
Reviewed-on: https://chromium-review.googlesource.com/213504
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Move CollectVariables to sh namespace.

BUG=angle:466

Change-Id: I903ea840e333dfeb44f242a1759aed39974d0510
Reviewed-on: https://chromium-review.googlesource.com/213505
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Mark shared and std140 UBOs as always active.

This aligns ANGLE with the GL spec. With this fix, we pass
all of the dEQP conformance tests in Functional / Uniform
Buffer Object that don't rely on single buffers.

BUG=angle:507

Change-Id: I6063a416e3f7ee6d5327d96850e3d0cc8521c817
Reviewed-on: https://chromium-review.googlesource.com/213506
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Retrieve render colorbuffers as a single vector.

Making all our render methods query FBO attachments for rendering
in one place will allow us to easily control the MRT peformance
workaround, and simplify the implementation.

BUG=angle:705

Change-Id: I6c476d45b81228d6ffe8831347443994237e3593
Reviewed-on: https://chromium-review.googlesource.com/215843
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Use libANGLE to reduce duplicated ANGLE source compiles.

libGLESv2_static and libGLESv2 can re-use the same object files.

BUG=angle:733

Change-Id: I894f4b5b6fbc1fc47812609d9e996691daf9f318
Reviewed-on: https://chromium-review.googlesource.com/214188
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Refactor Framebuffer::invalidateSub.

Use our new helper methods to simplify this method.

BUG=angle:732

Change-Id: I56b837678d5efbc60de6de4bdb01447ca811e71d
Reviewed-on: https://chromium-review.googlesource.com/213855
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Add an ImageIndex helper struct to index into tex levels.

This encapsulates the three values needed to index into the image
array. It will simplify the logic for querying texture images from
the base calss.

BUG=angle:732

Change-Id: I31c55b3f972fd4d96ab540ec8498ef4b9b2ba16b
Reviewed-on: https://chromium-review.googlesource.com/213856
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Add a new TextureAttachment class to simplify FBO attachments.

This single class will eventually replace the four child classes.

BUG=angle:732

Change-Id: Ie2862b4458c8b1302ff4fc5fbe0e4ded3b81894d
Reviewed-on: https://chromium-review.googlesource.com/213857
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Fix MSVC librarian warning about no target machine.

We had the appropriate setting in our linker settings, but were
missing the entry in our librarian settings. The new static lib
target exposed the error.

Change-Id: I689ccb3cd6dbf2218c869b33500aaef43b8a421f
Reviewed-on: https://chromium-review.googlesource.com/216460
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Declare commit_id a gyp 'hard_dependency'.

Hard dependencies are marked for static library targets, unlike
normal soft dependencies which the static libraries ignore. This
change ensures we run the commit_id script before compiling any
static libraries that depend on it.

Change-Id: Ic29652012883273810c2863132d6f49bd6ada4b8
Reviewed-on: https://chromium-review.googlesource.com/216461
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use attachment binding points for dynamic PS key.

Because our output signature is only dependent on the arrangment
of the attachments, not the attachment type, use the output
layout key for now. If we need to, we could store both, in the
future.

BUG=angle:705

Change-Id: I3b99954d30b91a4741fdd6f48f8ffcf88c0bea7a
Reviewed-on: https://chromium-review.googlesource.com/215846
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Enable MRT pixel shader rewriting.

Writing to all 8 pixel outputs was causing performance problems on
Intel and AMD. Enabling Geoff's work to rewrite our pixel shaders
solves the regression.

This patch also includes a workaround to the nVidia driver bug
where it would ignore NULL RT values in OMSetRenderTargets, by
compacting the RT list to skip NULL values.

BUG=angle:705
BUG=365078

Change-Id: Ia68af6f0ccd5f10c484d6f76297a0bec694948f0
Reviewed-on: https://chromium-review.googlesource.com/214852
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Drop support for the old "full multiplexed" MRT shaders.

This will simplify the code somewhat. It should no longer be
necessary now that we have the nVidia workaround.

BUG=angle:705

Change-Id: I1abe1abd9f03472341ce4315975a76c56b252bb4
Reviewed-on: https://chromium-review.googlesource.com/216111
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Fix typo in "PixelShaderOuputVariable".

Change-Id: I2b223c9b80faa3ff2a0f94bd52ca73edf3d67cf7
Reviewed-on: https://chromium-review.googlesource.com/216273
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use ImageIndex to return Texture attachment properties.

This and subsequent patches will eliminate the need for typed
attachments.

BUG=angle:732

Change-Id: Ia1cfa672855b577f7a2ce219e6ed8ca1e3e16cc1
Reviewed-on: https://chromium-review.googlesource.com/213858
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Eliminate typed render target Texture attachment method.

More convergance to the base TextureAttachment class.

BUG=angle:732

Change-Id: I9aae1a49ab3908a4eb4cec4bce201b88a7d93926
Reviewed-on: https://chromium-review.googlesource.com/213859
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Update Buffers to return Error objects instead of calling gl::error.

BUG=angle:520

Change-Id: I4b6af8e2d4fae97639518e2acd26e2d4be93c925
Reviewed-on: https://chromium-review.googlesource.com/209881
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Update clear calls to return Error objects instead of calling gl::error.

BUG=angle:520

Change-Id: I474a6ed29b882963f7f3425515e7d65f8f69b3e4
Reviewed-on: https://chromium-review.googlesource.com/211440
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>