Instead of duplicating GL header define values, explictly return
GLenum for variable queries in the shader inspection API. This
reduces the duplicate defines in the shader compiler header.
BUG=angle:466
Change-Id: If631b20ce68747297a946e1371def7709027a613
Reviewed-on: https://chromium-review.googlesource.com/204937
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Depth-stencil buffers were using the same pointer for both
attachments, which was causing a double-delete in the
Framebuffer destructor.
BUG=angle:686
Change-Id: I8b263e5a084c33b495ce18ef2a2a810918ef6540
Reviewed-on: https://chromium-review.googlesource.com/205639
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
clientVersion was only useful for intitial validation of formats and not
required for queries. Only use the client version and caps structure to
validate if a format is available and then trust that it is supported past
the validation layer.
Fixed some inconsistancies between tables such as missing formats or
incorrect load functions in the ES3 tables.
BUG=angle:659
Change-Id: I8d33c902156ee6fb41efe937d93b0586191726e5
Reviewed-on: https://chromium-review.googlesource.com/201167
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
A common place to define required GL includes gives us a nice
point to centralize GL customizations. In the header currently
are the basic GLES headers with extensions, and a define
carried over from desktop GL.
BUG=angle:466
Change-Id: I6fc61947b4514654ec21355a786904eac04656c0
Reviewed-on: https://chromium-review.googlesource.com/204936
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Since these types originate from the translator, use an appropriate
namespace. Also rename some of the gl helper functions to be more
specific to their functionality.
BUG=angle:466
Change-Id: Idc29987b2053b3c40748dd46b581f3dbd8a6fd61
Reviewed-on: https://chromium-review.googlesource.com/204680
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
This function was a duplicate of ValidTexture2DDestinationTarget.
Also clean up a bit of the code in Framebuffer::completeness.
BUG=angle:660
Change-Id: Iee8d011274bfb2e426346e3ccdde7342fbb7ef44
Reviewed-on: https://chromium-review.googlesource.com/202595
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
RenderbufferProxySet and FramebufferTextureBindingPointer aren't
necessary any more with our refactored renderbuffer classes and
ownership of attachments by the Framebuffer.
We can also consolidate the FramebufferAttachment and implementation
to a single class, and no longer need to store ref counted objects
in the Framebuffer class directly.
BUG=angle:660
Change-Id: Idcc06dfb42b47242b33494e797a0ba06d6669511
Reviewed-on: https://chromium-review.googlesource.com/201838
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
We were rejecting npot textures for level 0, even though it is
valid in GLES 2 for non-mipped textures to have npot size.
BUG=381495
Change-Id: Iacc3ab50d6487ecba804fd8963aa0a2ada2f1cae
Reviewed-on: https://chromium-review.googlesource.com/205220
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
With PBOs being exposed through an extension in ES2 now, this check is
uneccessary.
Change-Id: I609a4bcd944194d104e0774e5f6ea34e072c8d9c
Reviewed-on: https://chromium-review.googlesource.com/201320
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
We would traverse the applyRenderTarget path from several entry
points, which could then trigger a GL error. In-line with our
validation refactoring, move all error checks prior to executing
any state logic.
BUG=angle:571
Change-Id: I51f5bcfa41be7cdba7771eb87d5a831fa622f984
Reviewed-on: https://chromium-review.googlesource.com/203772
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
A part of a larger refactoring to clean up the draw call
validation.
BUG=angle:571
Change-Id: I0b220d68c04524a81ca11dc58e10c90e458cabde
Reviewed-on: https://chromium-review.googlesource.com/203771
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
The GL expects us to reject invalid draw calls before we start
doing any work, so we can prevent internal unnecessary state
changes.
BUG=angle:571
Change-Id: Ic71218b3c2d5dc310280d3738bb1387753a10e03
Reviewed-on: https://chromium-review.googlesource.com/203770
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
ANGLE (and WebGL) restrict the back and front stencil masks
on draw, due to D3D restrictions. We would previously only
validate this if the stencil was enabled in D3D9. In D3D11
we would validate the stencil masks even if the stencil is
disabled, which is the behaviour the spec suggests.
Moving the error check to before the draw also prevents any
issue with interrupting a draw call mid-way through.
BUG=angle:571
BUG=378754
Change-Id: If7651c2be559eef64a872082e144dafa3b2c524b
Reviewed-on: https://chromium-review.googlesource.com/203299
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
We would use different code for all of our input and ouput stages
in HLSL (vertex output, GS input, GS output, PS input). This was
causing an HLSL error and some bugs in certain transform feedback
instances.
Fix this by using a helper method to use compatible code for each
of the stages.
BUG=angle:667
Change-Id: Idada969a775eccb5788723e0c7fa3ade9cb2d9ec
Reviewed-on: https://chromium-review.googlesource.com/203778
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
This was breaking the build for some compilers (GCC on android).
Change-Id: Ibfe5603710961497b6c15aa2d9cb568096ca1dd4
Reviewed-on: https://chromium-review.googlesource.com/204897
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Always generate the same pixel shader no matter what framebuffer is bound.
BUG=angle:670
Change-Id: I3fa91ff43363d49b38a19d3815ea523946c675d5
Reviewed-on: https://chromium-review.googlesource.com/204573
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
OutputHLSL was become a large, unweildy file. Some were also useful
to other classes, even on the GL back-end, but were inacessible.
Refactoring patch only.
BUG=angle:466
Change-Id: Id216147122ca105c6ccdf0ba0c5f6c5038726965
Reviewed-on: https://chromium-review.googlesource.com/203459
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Greatly simplifies the format utils by not having any internal format <->
DXGI format conversions depend on the client version. 32 bit floats and
24bit integers have very close precision in the [0,1] range so there
should be no precision issues.
BUG=angle:659
Change-Id: Ife64445ef35f77283fc4c70c98754f5e87b6fb19
Reviewed-on: https://chromium-review.googlesource.com/202507
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
We were using the wrong enum for the varying type, as well as using
the row count of the type. We should be using the column count, but
for matrices we treat them as transposed.
BUG=angle:679
Change-Id: I0eb7f68f629a4372c6822f65b2de51ecc88a03ed
Reviewed-on: https://chromium-review.googlesource.com/204520
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Running dEQP-GLES3.functional.transform_feedback would trigger a few
assertion failures because of some regressions that crept into our
code.
Among the regressions is assuming we can't map a buffer that has no
underlying storage object. This is valid since we sometimes allow
setData without creating a native storage.
Additionally we should free our existing data store on a new call
to SetData, to prevent old but "new" data revisions from complicating
our storage.
BUG=angle:679
Change-Id: Icd96a8a55a2b957d29382d8b8bbd7e8a7ab0cf65
Reviewed-on: https://chromium-review.googlesource.com/204342
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Varyings beginning with "dx_" would not get decorated properly, or
at all, which could cause potential internal variables and certainly
caused link errors. Fix this by no longer treating the "dx_" prefix
differently.
Also fix our naming of "dx_Position" to be consistent with our other
internal types.
BUG=angle:678
Change-Id: I03da0494a3d934d82ae7b3f8f12a576ff9bc3869
Reviewed-on: https://chromium-review.googlesource.com/203777
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Renames the ANGLE_platform_angle_d3d extension to ANGLE_platform_angle
which acts as an umbrella extension for all the angle display types but
requires the sub-extensions (d3d, opengl, software) to be present for the
enums to be valid (similar to the OES_framebuffer_object extension).
BUG=angle:668
Change-Id: I2c00021558d8b781b20f948f5e0df03f734bd033
Reviewed-on: https://chromium-review.googlesource.com/202597
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Removing the Renderer pointer is one step towards making FBO
attachments a minimal state object. Eventually we will be able
to store them as arrays instead of arrays of pointers.
BUG=angle:660
Change-Id: Idce34e06c339ecb18c60fef12d2ed911d0c4e0f6
Reviewed-on: https://chromium-review.googlesource.com/201835
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Renderbuffers are a clear object type in GL, and this patch adds
a more consistent state representation for them. They're managed
by the ResourceManager, and have a storage implementation similar
to Textures, but much simpler.
BUG=angle:660
Change-Id: Ia17199bb8cb570d48db42e1f28ccbcc12a902fcf
Reviewed-on: https://chromium-review.googlesource.com/201834
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
We were using the new, larger size for our buffer data copy step,
instead of the old, smaller size. This bug was causing a crash on
older nVidia drivers during normal browser usage.
Reproducible with the index-validation-large-buffer WebGL test.
BUG=angle:667
BUG=384420
Change-Id: I98ee893e0d8ba0bfc9adfe5a338da9b940248879
Reviewed-on: https://chromium-review.googlesource.com/203776
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>