Accept RenderTargets as parameters to Image::copy.

This gives us the flexibility to use copy internally for Textures
as well as FBO attachments. This will be useful for the TexSubImage
performance workaround.

BUG=angle:729

Change-Id: I4df8ef3a5a928d44ef84100cd96a5d35f12b47fa
Reviewed-on: https://chromium-review.googlesource.com/219863
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Fix a bug in MaxTextureSizeTest.RenderToTexture.

This bug only presented itself in our D3D9 Renderer. In D3D11 we
would stretch the texture to fit -- this is behaviour correct in
ES3 but not in the ANGLE spec draft.

BUG=angle:769

Change-Id: Iddb8551c9645aa6f0841e2dc9d96fbd196bc6788
Reviewed-on: https://chromium-review.googlesource.com/221061
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Fix D3D9 varyings limits.

We were off by one varying, since D3D9 treats PSIZE specially.

BUG=angle:769

Change-Id: Id5242d12c3ca42da3f3f528ff4a21445dba89701
Reviewed-on: https://chromium-review.googlesource.com/221062
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Don't run the DrawBuffers tests in D3D9.

We only support MRT on the D3D11 Renderer for now, so we can skip
running these tests entirely on the D3D9 back-end.

BUG=angle:769

Change-Id: I442936fe987ae1749d5ee7626f6a4737e824ac6f
Reviewed-on: https://chromium-review.googlesource.com/221063
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Disable broken D3D9 GLSL Varying tests.

Not sure at the moment if we can only disable tests in D3D9/etc,
but these tests are broken for D3D9 and hence we can disable them
to return angle_tests to passing.

BUG=angle:769

Change-Id: I3c13f985fde99c3d885f825de60af841c8f3f0f1
Reviewed-on: https://chromium-review.googlesource.com/221067
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Remove context pointer from State

BUG=angle:685

State needs only to track a few variables from Context's caps,
so store those instead of a pointer to Context.

Change-Id: I36d448dcaccf9780d6df2cfc82ef975b2ba0346f
Reviewed-on: https://chromium-review.googlesource.com/219804
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Vertex management functions can take a State reference instead of pointers to attrib data.

BUG=angle:685

Change-Id: I0bfc26c53eb1358a023ac5d4ec20be06f9c90f4a
Reviewed-on: https://chromium-review.googlesource.com/219352
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Change mVertexAttribCurrentValues from fixed-size array to STL container.

BUG=angle:685

Change-Id: I42fc6c919f42cd6ab1c11531742f9a2c5ad0cd3d
Reviewed-on: https://chromium-review.googlesource.com/219353
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Use a caps-dependent sized vector to store Uniform Buffers

BUG=angle:685

Change-Id: I3f2e9fcccf27aebbb4ec5485286eec9828851887
Reviewed-on: https://chromium-review.googlesource.com/219805
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Store XFB buffers in a vector in State.

BUG=angle:685

Change-Id: I4bff717f716ba21633c59244560fd56f41f587ed
Reviewed-on: https://chromium-review.googlesource.com/219806
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Fix typos in caps generation method names.

Change-Id: I7efa752b2276cb92b4ca12ffaf7aa37c514525f0
Reviewed-on: https://chromium-review.googlesource.com/219807
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Fix building angleutils.cpp on Linux

vsnprintf is defined in stdio.h according to the standard. It was not in
the include chain of angleutils.cpp, which broke the build on Linux on
some configurations. Seems like other toolchains include the function in
some non-standard way.

BUG=angle:761

Change-Id: Idcd75776e8a9b83dad182d1b4bac0beac006c6ac
Reviewed-on: https://chromium-review.googlesource.com/221053
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Introduce new method commitRegion to TextureD3D.

Replacing commitRect with commitRegion, which takes generic
parameter types, will allow us to call it directly from the
base class TextureD3D. This will be useful in subsequent
patches that introduce the SubData performance workaround.

BUG=angle:729

Change-Id: I37bf12f847b43f7c961b403321de19f547258b01
Reviewed-on: https://chromium-review.googlesource.com/220274
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use the virtual commitRegion in TextureD3D::subData.

This allows us remove the duplicated code in the various typed
methods that checks for an error before committing.

BUG=angle:729

Change-Id: Icd0ad2be55ac423baec3855e05c53f4b624b6764
Reviewed-on: https://chromium-review.googlesource.com/220275
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Add TextureStorage::setData.

Usually we copy data from the Image classes into the Storage. This
method, which will only apply to D3D11, is useful for our SubData
performance workaround.

BUG=angle:729

Change-Id: I50ca8158ee9e0638f59f617b9e6170b508eaeb44
Reviewed-on: https://chromium-review.googlesource.com/219837
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Add option to support EXT_draw_buffers with NV_draw_buffers

After this patch, it is possible to set a flag to change
EXT_draw_buffers extension directives to NV_draw_buffers in ESSL.
This enables users of ANGLE to emulate EXT_draw_buffers by using
NV_draw_buffers in combination with GLES3.0.

Change-Id: I5dacdbd6cd0d0362424ea3791557342c42efd4bd
Reviewed-on: https://chromium-review.googlesource.com/219941
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Update Program, ProgramBinary and HLSLCompiler to use Error objects.

BUG=angle:520

Change-Id: Ibbe8c95780fecfb68f4558e99e3a761107da6aee
Reviewed-on: https://chromium-review.googlesource.com/220790
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Updated authorship and contributors for Borbitsoft/Tibor den Ouden

Removed Borbitsoft from the AUTHORS file, added Tibor den Ouden.
Removed Borbitsoft from CONTRIBUTORS file, company section.
Moved Tibor den Ouden in CONTRIBUTORS file from company section to individual section

Change-Id: I3ab47d637d0879fde8f9dc0f714e2cb44562c897
Reviewed-on: https://chromium-review.googlesource.com/221054
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Restrict the tests that use ClearBuffer to ES3.

We had changed the configurations to run them in ES2 mode, while
ClearBuffer is an ES3-only method.

BUG=angle:769

Change-Id: I63d92af4702a133aa8bbf52444dfef59a4f602b0
Reviewed-on: https://chromium-review.googlesource.com/221064
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Accept a second form of WARP Test renderer string.

On our Renderer test, we would be overly restrictive in the forms
of Renderer string we would accept for WARP. On this machine, it
returns a different string than the one we had in the test. Expand
the test to accept both.

BUG=angle:769

Change-Id: If27644d32d6d7d0eff77ff9cca81faee3b2be4e1
Reviewed-on: https://chromium-review.googlesource.com/221066
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>