Refactor BeginQuery validation out of gl::Context.

Part of our effort to relocate all validation logic to a preliminary
pass outside of our state tracking or rendering layers.

BUG=angle:571

Change-Id: I5241daef6249910a781e78fd066debe0ab1d3f2b
Reviewed-on: https://chromium-review.googlesource.com/199348
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Move validation of EndQuery out of gl::Context.

BUG=angle:571

Change-Id: I8913eb1b565a4282d9d84d06933e8b854453f17d
Reviewed-on: https://chromium-review.googlesource.com/199349
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Optimize texture application in draw calls.

Gather all bound textures and samplers first and then pass them to
generateSwizzles and applyTextures to reduce redundant get calls.

BUG=260069

Change-Id: I5b10dddb01a6bfd756c58b76218838cfc1fd59b6
Reviewed-on: https://chromium-review.googlesource.com/199343
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Fix binary serialization to use explicit size and type.

Loading program binaries across different architectures would cause
runtime errors due to use of size_t.

Also fix the ANGLE major and minor version that were clobbered in an
earlier commit.

BUG=angle:647
BUG=371435

Change-Id: I9473cc7e119592fce336aa47881839543e337b69
Reviewed-on: https://chromium-review.googlesource.com/199633
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Handle interface blocks in getVariableInfo and
getUserDefinedVariableInfo.

BUG=angle:654

Change-Id: I07a230bbf2387e85168c50cb3719c669a7890f8a
Reviewed-on: https://chromium-review.googlesource.com/199687
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Don't discard serials of zero from the set of bound framebuffer serials.

A serial of zero is a valid texture serial but it was used by
RenderbufferStorage to denote a non-texture binding. Added a isTexture
method to Renderbuffers and RenderbufferStorage
has been updated to return -1 as the current texture serial to avoid
collisions.

BUG=angle:633

Change-Id: Ie27e4b185ac09b48b593ae0dea02aeff5950a44f
Reviewed-on: https://chromium-review.googlesource.com/200123
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Explicitly set the swap effect.

swapChainDesc.SwapEffect wasn't being set. The whole structure was initialized
to 0 and DXGI_SWAP_EFFECT_DISCARD has value 0 so this should have no effect.
Also sorted the field initialization in the order they're declared.

BUG=373360

Change-Id: If0113e7468c0bad024a07fec6ad9e223e19494b5
Reviewed-on: https://chromium-review.googlesource.com/200046
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Adds resource string generation to ANGLE

This will avoid Chrome source having to be updated each time that ANGLE's
ShBuiltInResources changes.

BUG=374942

Change-Id: If54dba8351de9b261ff269e885f231547c08ff0a
Reviewed-on: https://chromium-review.googlesource.com/200171
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Fix build on Windows 8.1 SDK.

The Windows 8.1 SDK includes a new DLL compiler DLL, and is useful
to test against, so we should fix the few deprecated functions and
warnings.

BUG=angle:649

Change-Id: I28bcf49564f3f7d7403d939d61dd78d3972281ba
Reviewed-on: https://chromium-review.googlesource.com/199341
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Fix build warnings in x64.

A std::min/max with size_t and unsigned int.

Popped up in f98e63a54b8a2.

BUG=

Change-Id: I25f26ddbe7fb333f895be8a8dce3d3d73044c3f9
Reviewed-on: https://chromium-review.googlesource.com/200484
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Refactor UniformMatrix validation.

Move the shared validation logic to validationES.cpp.

BUG=angle:571

Change-Id: I2fb06a012703c647de2176914238b48665145c6f
Reviewed-on: https://chromium-review.googlesource.com/200073
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Refactor Uniform validation to validationES.cpp.

This patch also incidentally fixes some bugged validation in the
new ES3 unsigned int uniform API entry points.

BUG=angle:571

Change-Id: I89bd909467bd9418fe5ce3f246561765cf27a5e9
Reviewed-on: https://chromium-review.googlesource.com/200074
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Move all uniform validation from ProgramBinary to API layer.

This will have the contract of having a successful API call once we
call into the ANGLE internals, having successfully passed valiation.

BUG=angle:571

Change-Id: Ia8d6eccc1e42bdf9e9cc5c10094a08729b42778a
Reviewed-on: https://chromium-review.googlesource.com/200075
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Fix arrays-of-struct and nested struct uniforms.

Our computation of register offsets had a few errors that
messed up nested structs and arrays of structs.

This fixes a WebGL test, as well as several dEQP tests.

BUG=angle:505
TEST=WebGL CTS 1.0.3, dEQP-GELS3.functional.uniform-api

Change-Id: Id5a0f39481e079fe5ef5ef856943dc1f91ee3639
Reviewed-on: https://chromium-review.googlesource.com/200045
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Automate the es conformance tests by wrapping them in the gtest suite.

BUG=angle:497

Change-Id: If12b2dd79f9f666c5d686237d5663f316171b15c
Reviewed-on: https://chromium-review.googlesource.com/200043
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Automate the DEQP tests by wrapping them in the gtest suite.

BUG=angle:497

Change-Id: If0a72c053bccccc4369ec78dd70173bbadb1be7b
Reviewed-on: https://chromium-review.googlesource.com/200044
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Move state query validation out of Context.

Generate all GL errors in the validation helper functions, instead of
within the state manipulation logic and internals of Context.

BUG=angle:571

Change-Id: I7a3f540e2ae0f5f8c7126e2593717cc3200dd7e5
Reviewed-on: https://chromium-review.googlesource.com/200551
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Make available EGL surface parameters queryable.

BUG=angle:331

Change-Id: Idb3c3ddc6ddd6bfc21b15b7e8942975ce4cd051f
Reviewed-on: https://chromium-review.googlesource.com/200811
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Fix placement of windows.h include for Win 8.1 SDK.

The windows header must be included before versionhelpers.h.

BUG=angle:649

Change-Id: Ifee95b2918ea039f9a1c93ad0244bf2d35bd8570
Reviewed-on: https://chromium-review.googlesource.com/201462
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Regenerate public projects.

Change-Id: Ibaccaa46457e9ee4379c137182673153a17f207d
Reviewed-on: https://chromium-review.googlesource.com/201461
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>