Reduce translator sources compile count to one.

With this change, the common sources shared between translator
and translator_static are compiled in a static library. There
is only one file with exported functions which needs to be
compiled for each target. This should reduce ANGLE and chromium
build times.

BUG=angle:569

Change-Id: I3ce011872323ec988befbd6db731add4fce5787b
Reviewed-on: https://chromium-review.googlesource.com/197271
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Add an ANGLE test for the permissive blit fix.

BUG=361931

Change-Id: Ib44667422f524e5dcc3035692e8f725c24e92821
Reviewed-on: https://chromium-review.googlesource.com/194981
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
(cherry picked from commit 6795ca48559cedbc94c2a5c1e24ce9bd0139571a)
Reviewed-on: https://chromium-review.googlesource.com/197251
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Implementation of buffer map for pack buffers.

Internally pack buffers are CPU pointers, with an associated
staging texture. In the map call we copy the data out of the
staging memory to CPU memory, and return a pointer to the CPU
buffer.

BUG=angle:511

Change-Id: I2a82addd2f21241d8d49554b2fc71d890a166386
Reviewed-on: https://chromium-review.googlesource.com/195366
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
(cherry picked from commit 0b44a455b5a81b84662e57f30348f4e791f62358)
Reviewed-on: https://chromium-review.googlesource.com/197272
Lazy creation of the BufferStorage staging buffer.

Only creating the staging buffer on use saves us from allocating
a D3D11 staging buffer for pack buffers. This saves some memory
and time when we're only using a buffer object for asynchronous
readback.

BUG=angle:511

Change-Id: I97b37cc27aba4a4526025815b5935b9e74abae2e
Reviewed-on: https://chromium-review.googlesource.com/195367
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
(cherry picked from commit ebf396c1dd243223240bac6ea7f01a23893f9a28)
Reviewed-on: https://chromium-review.googlesource.com/197281
Fix scoped structure references.

We had neglected to reference scope bracket values when
initially constructing the scoped struct name. Fixes the
new WebGL test.

BUG=angle:618

Change-Id: Ie78a8264c9e16c5a6574cecd662adbd5475d6495
Reviewed-on: https://chromium-review.googlesource.com/197252
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Verify that the compiler has been initialized before freeing it.

BUG=angle:625

Change-Id: I8bba0dea26eacf02df4568cfb6840aa332bd0df8
Reviewed-on: https://chromium-review.googlesource.com/197655
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Allow non-4x4 compressed blocks for small mip layers.

CompressedTexSubImage would disallow 1x1 or 2x2 mips being set for any mip
level except 0.  This made it impossible to set the data in the lowest mip
levels.

BUG=angle:623

Change-Id: I623414ae4fd5d6b051579285160296b03fd36486
Reviewed-on: https://chromium-review.googlesource.com/197250
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
(cherry picked from commit cc84a853eb5ab63a744657da704f84905565ab9e)
Reviewed-on: https://chromium-review.googlesource.com/197654
Fix a performance regression.

"Refactor BufferStorage11" caused a performance regression by dropping the line
which sets mReadUsageCount to 0. This causes markBufferUsage() to clear mResovedData
which then has to be restored on the next getData() call.

BUG=angle:613

Change-Id: I61c4b4960305a69b315c20ced66265a770002338
Reviewed-on: https://chromium-review.googlesource.com/197503
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Remove unused mWriteUsageCount.

BUG=angle:613

Change-Id: Ia0d9f4ff3b4ace57532b061f5729fa82f49c4497
Reviewed-on: https://chromium-review.googlesource.com/197710
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Early out when direct binding not supported.

BUG=angle:613

Change-Id: I488dca027e3f6d23cda546ca44af54dcc3338047
Reviewed-on: https://chromium-review.googlesource.com/197720
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Refactor setting the input layout and vertex buffers separately.

BUG=angle:613

Change-Id: Id2ecfc215ef65164cb9ee8bfbad168e9af658386
Reviewed-on: https://chromium-review.googlesource.com/197722
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Fixes to the standalone Linux build.

Several small build errors present on Linux cropped up due to
different warning flags and platform quirks.

BUG=angle:627

Change-Id: If8f651cacf05bb06ecb129be47b12729ccc3f69b
Reviewed-on: https://chromium-review.googlesource.com/197724
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Optimize alignment and conversion test for float attribute types.

The generic alignment and conversion test to check for the possibility of using
direct storage is relatively expensive. Float types can be tested more quickly.

BUG=angle:613

Change-Id: I5ab008ce82c8b652f0392c20a80a5b198b2437a5
Reviewed-on: https://chromium-review.googlesource.com/197721
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reference .git/index as a dependency of commit_id.

Any time the git index changes, we will re-run the commit id hook.
This will ensure we never are left with stale commit ids from
other git commits.

BUG=angle:626

Change-Id: I03c37225fb902b6c1801e8f993d767122e8bfeb6
Reviewed-on: https://chromium-review.googlesource.com/197723
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Fix 64-bit build failures.

Update the BufferStorage classes to use size_t for all sizes and offsets.
BufferStorage9 now uses a std::vector to manage its memory.

BUG=angle:631

Change-Id: Iea4e7b33ede59a5b9c6a1245690c4b7865096fc3
Reviewed-on: https://chromium-review.googlesource.com/197819
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Keep persistent pack buffer memory storage.

Keeping a persistent storage allows us to treat the memory
buffer as the canonical copy of the pack buffer data, and
simplifies corner cases.

BUG=angle:511

Change-Id: Ied4dcb2edce2b85f68645f5a65603cbf18ad5a16
Reviewed-on: https://chromium-review.googlesource.com/197701
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Enable PBO asynchronous readback in Renderer11.

BUG=angle:511

Change-Id: Id795a85ec1daa396fc51f021c37fe23df3ecc065
Reviewed-on: https://chromium-review.googlesource.com/197702
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Add tests for pack buffer corner cases.

BUG=angle:511

Change-Id: I72ff4f8fa83d9dda4d186d727035085ecc39a9dc
Reviewed-on: https://chromium-review.googlesource.com/197703
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Use a static function instead of a static initializer for defaultBlockInfo.

BUG=angle:640

Change-Id: I5fe568c9a2b492a5bd8a42142762229c5f992c7e
Reviewed-on: https://chromium-review.googlesource.com/198248
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Replace catch blocks from std::bad_alloc to ellipses.

It seems we weren't catching bad_alloc despite using the correct syntax.
Using ellipses solves the problem, and since we only expect bad_alloc
it does the equivalent result of catching and returning out of memory.

I'm currently not aware of the proper syntax to catch bad_alloc.

BUg=angle:634

Change-Id: Ib3154546d1b72d180cb565c71f35716696863cdd
Reviewed-on: https://chromium-review.googlesource.com/198245
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>