By setting a null current context, there is a brief window where all GL
calls will fail. Since there is only one WGL context, just leave in on
the unreferenced window until a new window is made current.
BUG=angleproject:890
Change-Id: I51eadf23ca61e274f7d174ac5a9e0592bcdadebc
Reviewed-on: https://chromium-review.googlesource.com/265483
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
WARP does not support surface sharing like native D3D11. This,
combined with a Chromium-side change, should fix WARP rendering
in Chrome.
BUG=angleproject:973
BUG=429792
Change-Id: I41e778625e8697e45657843f2f337bcffe7ddbe2
Reviewed-on: https://chromium-review.googlesource.com/265611
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This saves a ms or two on D3D11 startup.
Change-Id: I156c25029a0b2aeb48e5b76b31737c155111e07f
Reviewed-on: https://chromium-review.googlesource.com/264936
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This helps a local user profile their D3D11 startup time.
BUG=436191
BUG=angleproject:966
Change-Id: Ib1b3d62194233cd502980d87c316a95e9bd3a04c
Reviewed-on: https://chromium-review.googlesource.com/264935
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Now that Chromium is switched to ANGLE's new Platform tracing
methods, we can junk the old APIs.
BUG=angleproject:966
BUG=436191
Change-Id: Ie2564eed9e5ce4604e0dcd4582618e7467b2d590
Reviewed-on: https://chromium-review.googlesource.com/264934
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Access to the D3D device is needed for some advanced scenarios.
New entry points eglQueryDisplayAttribANGLE and
eglQueryDeviceAttribANGLE have been added in this change
to implement this extension.
BUG=angleproject:935
Change-Id: Ie39e86a2b6c6d8d05a08964b2907fb9fba5dec13
Reviewed-on: https://chromium-review.googlesource.com/265591
Tested-by: Cooper Partin <coopp@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Compile error on clang:
src/libANGLE/Display.cpp:259:23: error: allocation of incomplete type 'egl::Device'
mDevice = new Device(this, impl);
^~~~~~
src/libANGLE/Display.h:36:7: note: forward declaration of 'egl::Device'
class Device;
^
In file included from src/libANGLE/Display.cpp:11:
In file included from src/libANGLE/Display.h:17:
In file included from src/libANGLE/Error.h:80:
In file included from src/libANGLE/Error.inl:9:
src/common/angleutils.h:66:5: error: deleting pointer to incomplete type 'egl::Device' may cause undefined behavior [-Werror,-Wdelete-incomplete]
delete resource;
^ ~~~~~~~~
src/libANGLE/Display.cpp:209:5: note: in instantiation of function template specialization 'SafeDelete<egl::Device>' requested here
SafeDelete(mDevice);
^
src/libANGLE/Display.h:36:7: note: forward declaration of 'egl::Device'
class Device;
^
2 errors generated.
This reverts commit 6dacaff4e0.
Change-Id: Ide348e156324a5af668604362c0b249ea73b6083
Reviewed-on: https://chromium-review.googlesource.com/265626
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Access to the D3D device is needed for some advanced scenarios.
New entry points eglQueryDisplayAttribANGLE and
eglQueryDeviceAttribANGLE have been added in this change
to implement this extension.
BUG=angleproject:935
Change-Id: Id1560b0887fa5882b9858af7bad9043ada67038d
Reviewed-on: https://chromium-review.googlesource.com/251610
Tested-by: Cooper Partin <coopp@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Newly added code in TIntermConstantUnion::fold uses nullptr where as
remaining part of the function uses NULL. This change removes NULL and
consistently uses nullptr in complete function.
Change-Id: I600dcf11b686d8d72b2bcdac88b7158288c68105
Reviewed-on: https://chromium-review.googlesource.com/265395
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
This change adds constant folding support for unary common built-ins:
abs, sign, floor, trunc, round, roundEven, ceil and fract.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common*
(80 out of 210 tests started passing with this change)
Change-Id: I06800ed0e03764c0f7aab6bcd45c4f122de5a3c1
Reviewed-on: https://chromium-review.googlesource.com/265394
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
This change adds constant folding support for unary exponential
built-ins - exp, log, exp2, log2, sqrt and inversesqrt.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.exponential*
(48 out of 56 tests started passing with this change)
Change-Id: Ie7808cd57d6ed7598c642a9a0940b8f5bd293741
Reviewed-on: https://chromium-review.googlesource.com/265393
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
This change adds constant folding support for trigonometry built-in
functions. Constant folding for these functions also fixes constant
expression issues where constant initializer is a built-in trignometry
function whose arguments are all constant expressions.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.angle_and_trigonometry*
(112 out of 120 tests pass with this change)
Change-Id: I66275b2ae9faecef63d76763d21a9b67d9bb68fa
Reviewed-on: https://chromium-review.googlesource.com/265392
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Don't print all the other measurements and values, since they'll
just add noise to the perf bot dashboards. Also increase the
run time of the DrawCallPerfTest to 10.0 seconds.
BUG=angleproject:744
BUG=468852
Change-Id: If076055ad46b4e6923f39687edcaa25930b188a7
Reviewed-on: https://chromium-review.googlesource.com/265464
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Rename nonInitErrorCheck to declareVariable to clarify that it declares
variables. Merge arrayErrorCheck with that so that logic that is common
between array and non-array declarations is only in one place. This
will simplify adding array initializer handling. This also enables
redeclaring gl_LastFragData using ESSL3 array type syntax.
Comments in executeInitializer claimed that the TVariable object was
needed for error recovery, but that was not actually true, so it can also
use the new declareVariable method. Make "variable" a local variable
instead of a parameter to executeInitializer, since the parameter was
never used by callers of the function.
TEST=angle_unittests, WebGL conformance tests
BUG=angleproject:941
Change-Id: Ie133be62afc3e1f997370803cf21cada4e738935
Reviewed-on: https://chromium-review.googlesource.com/264674
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
AST analysis to narrow down usage of [[loop]] and [[unroll]] failed to account
for break statements inside switch statements. Add switch statement handling.
This fixes asserts/crashes in dEQP tests.
BUG=angleproject:937
TEST=dEQP-GLES3.functional.shaders.switch.*
Change-Id: I04fdfe4733772a2a234934123bbfacf0376df562
Reviewed-on: https://chromium-review.googlesource.com/265191
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Newly added code in TIntermConstantUnion::fold uses nullptr where as
remaining part of the function uses NULL. This change removes NULL and
consistently uses nullptr in complete function.
Change-Id: Ieaada3cf46bf3e16d3ef91b300c86537f778c33f
Reviewed-on: https://chromium-review.googlesource.com/264632
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
This change adds constant folding support for unary common built-ins:
abs, sign, floor, trunc, round, roundEven, ceil and fract.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common*
(80 out of 210 tests started passing with this change)
Change-Id: I09f2f99b3108e0d2fb1919a0631e4317b6a28be3
Reviewed-on: https://chromium-review.googlesource.com/263709
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
This change adds constant folding support for unary exponential
built-ins - exp, log, exp2, log2, sqrt and inversesqrt.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.exponential*
(48 out of 56 tests started passing with this change)
Change-Id: I22af56876d1b7ce305697bf9bf43ad9ec5d8a3a5
Reviewed-on: https://chromium-review.googlesource.com/263708
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
This change adds constant folding support for trigonometry built-in
functions. Constant folding for these functions also fixes constant
expression issues where constant initializer is a built-in trignometry
function whose arguments are all constant expressions.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.angle_and_trigonometry*
(112 out of 120 tests pass with this change)
Change-Id: I2ed4360532469fe0d70048d5f2300a8db6f9fcda
Reviewed-on: https://chromium-review.googlesource.com/263679
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Remove some unnecessary TPublicType/TType conversions from the code, and
clean up code style. voidErrorCheck is changed to take TBasicType so that
it can be used with both TType and TPublicType.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I6f6cbc0761a4fc971299bad48864309009c54e7f
Reviewed-on: https://chromium-review.googlesource.com/264673
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
A number of mistakes had slipped in to this test that made the
compilation of some shaders always fail regardless of the semantic checks
applied by the parser.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I9906792e2c7fe3805288255b855afb46840a77a7
Reviewed-on: https://chromium-review.googlesource.com/264811
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
These attributes are now used exactly in the loops and ifs
that require them, limiting the number of failed compilations
due to excessive unrolling and flattening.
Also output Lod0 functions only when needed.
Adds unit tests for LOOP, FLATTEN and Lod0 generation.
The patch was tested against the WebGL CTS 1.0.4 for which all the
failures existed prior to this patch and seem to be unrelated to this
change. It also works correctly on the following sites that had trouble
with [[loop]] and [[unroll]]:
* dev.miaumiau.cat/rayTracer "Skull Demo"
* The turbulenz engine particle demo
* Lots of ShaderToy samples (including "Volcanic" and "Metropolis")
* Google Maps Earth mode
* Lots of Chrome Experiments
* Lagoa
* madebyevan.com/webgl-water
* SketchFab
* Unit Tests
BUG=angleproject:937
BUG=395048
Change-Id: I856de9025f10b79781929ec212dbffc2064a940e
Reviewed-on: https://chromium-review.googlesource.com/264791
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
It should not be possible to redeclare arrays. This seems to be another
thing left over from earlier erroneous code which allowed declaring
unsized arrays.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I711565230b35df077f268cec6fdeac6c4c03b4cd
Reviewed-on: https://chromium-review.googlesource.com/264672
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
First, remove duplicate check for const qualifier on arrays. Only keep
the check inside arrayQualifierErrorCheck().
Second, ESSL3 will introduce array initializers and by extension constant
arrays, so it should allow const qualifier on arrays. These checks are
somewhat superfluous in ESSL1 as well, since the parser already checks
for missing initializers, but it's useful to keep the informative error
messages around.
Add a few tests to make sure that when the ESSL3 implementation
progresses, it still checks for missing initializers on constant arrays.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: Id871c872c5b92e2a5bf81c00080ac23004916a75
Reviewed-on: https://chromium-review.googlesource.com/264671
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Caused linking failures on mac because the unit test asks for TranslatorHLSL which is not compiled.
This reverts commit 3342e01f2a.
Change-Id: I02b2f54ca5b90611f11b7a549e75bf2e8310639d
Reviewed-on: https://chromium-review.googlesource.com/264790
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
These attributes are now used exactly in the loops and ifs
that require them, limiting the number of failed compilations
due to excessive unrolling and flattening.
Also output Lod0 functions only when needed.
Adds unit tests for LOOP, FLATTEN and Lod0 generation.
The patch was tested against the WebGL CTS 1.0.4 for which all the
failures existed prior to this patch and seem to be unrelated to this
change. It also works correctly on the following sites that had trouble
with [[loop]] and [[unroll]]:
* dev.miaumiau.cat/rayTracer "Skull Demo"
* The turbulenz engine particle demo
* Lots of ShaderToy samples (including "Volcanic" and "Metropolis")
* Google Maps Earth mode
* Lots of Chrome Experiments
* Lagoa
* madebyevan.com/webgl-water
* SketchFab
* Unit Tests
BUG=angleproject:937
BUG=395048
Change-Id: If7baddae1cdae0b3a414aa49e5a4c4babedbfe50
Reviewed-on: https://chromium-review.googlesource.com/261263
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
This will allow narrowing down which usages of
[[flatten]] and [[unroll]] are actually useful.
BUG=angleproject:937
BUG=395048
Change-Id: I091e647e3053d22edadd0cabb7c50bd5efa690b2
Reviewed-on: https://chromium-review.googlesource.com/263776
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
This will allow narrowing down which usages of
[[flatten]] and [[unroll]] are actually useful.
BUG=angleproject:937
BUG=395048
Change-Id: Ib8d7b98431b8cd3563e1eff8ecc9ed5df1a9b7d6
Reviewed-on: https://chromium-review.googlesource.com/263775
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
Also adds a simple unit test checking the pruning
BUG=angleproject:937
BUG=395048
Change-Id: I88440378f66178dcebebcd596f8f80235903f20e
Reviewed-on: https://chromium-review.googlesource.com/264568
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>