Update Queries to return Error objects instead of calling gl::error.

BUG=angle:520

Change-Id: If8f2bb1c4de7b9cc30861a06aab1d89c97305b26
Reviewed-on: https://chromium-review.googlesource.com/216699
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
gn: Fix source paths

Change-Id: Idf0c746d7e4e9f03b176744e8ff027be2d5f25ad
Reviewed-on: https://chromium-review.googlesource.com/218520
Reviewed-by: Brett Wilson <brettw@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Commit-Queue: Cem Kocagil <ckocagil@chromium.org>
Tested-by: Cem Kocagil <ckocagil@chromium.org>
Add several missing header guard comments

These were causing build failures under GCC.

Change-Id: Iba19ed166f909fe559d19731f31849770619f412
Reviewed-on: https://chromium-review.googlesource.com/218580
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Don't modify the function parameters in ProgramBinary::setUniform.

BUG=414450

Change-Id: Ib5ebf18e57af671b8694ffcfc3cb152557f7f002
Reviewed-on: https://chromium-review.googlesource.com/218500
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Move validation of ANGLE_instanced_arrays to the validation layer.

BUG=angle:520

Change-Id: Idb3c50235a7029e72c58bc202aba0cfab735202a
Reviewed-on: https://chromium-review.googlesource.com/218510
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Fix the varying sort comparator in ShaderD3D.

The comparator was actually a <= operator, while sort requires a
strict < operator. This was causing a potential assertion failure.

Bug report from Kerim Borchaev.

BUG=angle:742

Change-Id: I37c2925ab0b85e70ee1b2be3c72c6ddc062e8d28
Reviewed-on: https://chromium-review.googlesource.com/218506
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Accept ImageIndex in TextureD3D::subImage and getImage.

This paves the way for setting data on the TextureStorage directly
instead of working through the Image objects.

BUG=angle:741

Change-Id: I3be3d5f9b2e45707c1630b74ad3f4789e034c3fd
Reviewed-on: https://chromium-review.googlesource.com/218311
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Fix enum in FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE query.

We were using DEPTH_STENCIL instead of DEPTH_STENCIL_ATTACHMENT.

BUG=angle:739

Change-Id: I0c746c374577dca2b965dfd7ccfac793f7075efb
Reviewed-on: https://chromium-review.googlesource.com/218592
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Merge the sampler uniform application into ProgramBinary::setUniform.

 * Fixes incorrect dirty checks for the dirty sampler mappings flag.
 * Fixes WebGL tests:
   * conformance_canvas_texture_bindings_unaffected_on_resize
   * conformance_reading_read_pixels_test
   * conformance_uniforms_uniform_default_values

BUG=414450

Change-Id: I132dbc301a236aef153fb6da4c6b64c36b0ba3f3
Reviewed-on: https://chromium-review.googlesource.com/218501
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Fix incorrect error check.

The registers variable became a pointer but this error check was not
updated.

BUG=angle:743

Change-Id: Id2cd7b5ba39180281a3bbc408cd7c31bc663500c
Reviewed-on: https://chromium-review.googlesource.com/218507
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Improve D3D11 varying packing when there are more varyings than registers.

BUG=angle:738

Change-Id: I0599840fc79d571230acf26105d512322bcffdcd
Reviewed-on: https://chromium-review.googlesource.com/214108
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Don't skip draw calls on zero-sized viewports.

If transform feedback is active, primitives still need to be rendered even
if no pixels are written to the framebuffer.

Instead of checking for active transform feedback, simply remove the draw
call skipping optimization since it is most likely an application mistake to
draw with a zero sized viewport and we shouldn't optimize for this case.

This change doesn't affect the clear calls because the viewport is set to the
framebuffer size which is non-zero.

BUG=angle:743

Change-Id: I04af9d6de5aad3040e3c6b3c24990e107e21ad36
Reviewed-on: https://chromium-review.googlesource.com/218508
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Use ImageIndex in getRenderTarget.

Also change ImageIndex to allow invalid indexes for layer. In 3D
indexes, sometimes the layer parameter is invalid, indicating we
index an entire mip level instead of a layer of a mip level.

BUG=angle:741

Change-Id: I7b410f9aaf568f215bb93ae063934669a8fa09bd
Reviewed-on: https://chromium-review.googlesource.com/218312
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Use dynamically sized containers for texture and sampler bindings.

BUG=angle:685

Change-Id: I7af97a95deee69fbdebca2b57403244f45516e67
Reviewed-on: https://chromium-review.googlesource.com/216564
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Fix Renderer11 signed/unsigned warning in 32-bit.

Change-Id: I1e11f54b0ae245cdd7e090ab0748821738ad6314
Reviewed-on: https://chromium-review.googlesource.com/218761
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Updated the vertex buffer classes to use Error objects.

BUG=angle:520

Change-Id: Id003e66b2acbf37dbbe66aaca2fa336c3c884be2
Reviewed-on: https://chromium-review.googlesource.com/217102
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Use ImageIndex in getRenderTargetSerial.

Also move getRenderTargetSerial to the TextureStorageInterface
base class, since it shares a common interface.

BUG=angle:741

Change-Id: I1bc1cfac6426e241ac91d373884a7dd8a1c5b188
Reviewed-on: https://chromium-review.googlesource.com/218313
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Move generateMipmap to storage interface base class.

Using a little bit more of code repetition allows us to move the
implementation of the mipmaps to a simple virtual interface in
TextureStorage.

BUG=angle:741

Change-Id: I7661d0cc3bdb02b646da0802cba285650d7832b2
Reviewed-on: https://chromium-review.googlesource.com/218314
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Squash the TextureStorageInterface heirarchy.

Since there are no longer any significant differences in the child
classes of TextureStorageInterface, we can scrap the different
implementations. This involves changing the function names of some
Renderer functions which relied on overloading.

BUG=angle:741

Change-Id: I074797e4ac0bf3ecf8fe4bddf84eaed28b1a2c23
Reviewed-on: https://chromium-review.googlesource.com/218315
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Remove rx::TextureStorageInterface entirely.

This class provides no added benefit now that we've scrapped the
type-specialized classes. We can squash it's functionality into
TextureStorage instead.

BUG=angle:741

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