Граф коммитов

268 Коммитов

Автор SHA1 Сообщение Дата
Geoff Lang e70413c7ec Roll EGL headers.
Update CGL backend to use new EGL types.

BUG=angleproject:1707

Change-Id: I165e81a758cad0a8036aef68c44a57bcc61e982d
Reviewed-on: https://chromium-review.googlesource.com/428292
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2017-01-17 22:09:03 +00:00
Qin Jiajia 4af4951ff9 Tighten the workaround for B5G6R5 on Intel drivers
This driver bug has been fixed in 20.19.15.4539.

BUG=chromium:644610
TEST=dEQP-GLES3.functional.fbo.blit.default_framebuffer.rgb565*

Change-Id: I37556304ed4f70771fb88b792c01b6be5b3aa294
Reviewed-on: https://chromium-review.googlesource.com/424103
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2017-01-05 14:29:01 +00:00
Jamie Madill 80ab03c58d Add angle_white_box_tests for libANGLE render tests.
angle_end2end_tests included tests that used both the entry points
from our shared libraries as well as calling libANGLE classes like
gl::Context directly. Split these into a new test executable.

This also removes the libANGLE code from all the end2end tests.

It's necessary to add static versions of libEGL and libGLESv2 so
that we call safely call methods in libANGLE an the entry points
from the same target.

BUG=angleproject:1660

Change-Id: I6d82021b9300231ddb5fee435e5d77728f8f1292
Reviewed-on: https://chromium-review.googlesource.com/419175
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2017-01-04 19:24:32 +00:00
Jamie Madill a818c327fe translator: Remove non-sh scoped APIs.
Now that Chromium is switched over, we can remove the old global
APIs so they no longer conflict with glslang/Vulkan.

BUG=angleproject:1319

Change-Id: Ia673d47caa7ca40139e4989fac374acd48f52ab9
Reviewed-on: https://chromium-review.googlesource.com/408517
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2017-01-03 21:33:08 +00:00
Shao f165f0b4c6 Tighten the workarounds on isnan for Intel drivers
This driver bug has been fixed in 21.20.16.4542.

BUG=chromium:650547

Change-Id: I2a5c7c01bf48d854bd6c4c6a380e57617e00529a
Reviewed-on: https://chromium-review.googlesource.com/422992
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-12-27 19:26:20 +00:00
Kai Ninomiya d5fe352a91 Add GL_EXT_texture_compression_s3tc_srgb to GLES2/gl2ext.h
This extension is currently in draft; ANGLE will be the first implementation.

BUG=angleproject:1553
BUG=chromium:630498

Change-Id: I795caa36f722a347cb7924990b60452d51b1e177
Reviewed-on: https://chromium-review.googlesource.com/423435
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2016-12-23 02:02:27 +00:00
Kai Ninomiya 4eee74de64 Update GLES2/gl2ext.h to revision 33260 (2016-10-27)
From https://www.khronos.org/registry/gles/api/GLES2/gl2ext.h

BUG=angleproject:1553

Change-Id: I3a0e5ee77de3db02eace63d40df7db040a739f88
Reviewed-on: https://chromium-review.googlesource.com/423434
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2016-12-23 00:20:47 +00:00
Olli Etuaho 09b04a2ffc Add shader translator support for OVR_multiview
The OVR_multiview and OVR_multiview2 extensions add gl_ViewID_OVR to
shaders. gl_ViewID_OVR can be translated either as is in GLSL output
or as a uniform by setting the SH_TRANSLATE_VIEWID_OVR_AS_UNIFORM
compiler flag.

If WebGL output is selected, the shaders will be validated according
to proposed rules in the WEBGL_multiview spec.

BUG=angleproject:1669
TEST=angle_unittests

Change-Id: I19ea3a6c8b4edb78be03f1a50a96bfef018870d0
Reviewed-on: https://chromium-review.googlesource.com/422848
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2016-12-22 12:10:08 +00:00
Jamie Madill e09bd5d32e Vulkan: Add display creation, test and extension.
With this CL we have the ability to create Vulkan test configs and run
basic tests, although the only thing that works is creating a Vulkan
Renderer using the extension.

BUG=angleproject:1319

Change-Id: I8ad17bba01241334be7da16e68fea38762ca6a20
Reviewed-on: https://chromium-review.googlesource.com/367750
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2016-12-20 23:42:25 +00:00
Jamie Madill 408293f8a4 D3D11: Fix stale SRVs with tiny depth textures.
When the tiny depth texture would get re-created on change, it was
not freeing any cached SRVs which were pointing to the old tex.
Fix this by erasing the cache entry if the texure is recreated.

Also include a test which hooks into the workarounds to force
testing on every platform.

Also narrow the workaround to only apply to depth/stencil textures
which use these mips in GL, rather than D3D, where we always create
a full mip chain.

BUG=angleproject:1664

Change-Id: If0ac396b8847e1bf9b50165e5332da573e9bb3e4
Reviewed-on: https://chromium-review.googlesource.com/421567
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2016-12-20 16:39:10 +00:00
Olli Etuaho da9fb093e0 Work around atan(y, x) bug on NVIDIA
atan(y, x) is not always returning expected results on NVIDIA OpenGL
drivers between versions 367 and 375. Work around this by emulating
atan(y, x) using the regular atan(x) function. A fix to the driver is
expected in a future release.

It is most convenient to implement the vector atan(y, x) functions by
using the scalar atan(y, x) function. Support for simple dependencies
between emulated functions is added to BuiltInFunctionEmulator. In the
current implementation one function is allowed to have at most one
other function as its dependency.

BUG=chromium:672380
TEST=angle_end2end_tests

Change-Id: I9eba8b0b7979c7c7eaed353b264932e41830beb1
Reviewed-on: https://chromium-review.googlesource.com/419016
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-12-13 18:05:53 +00:00
Qiankun Miao f52fe93dca Work around unary minus operator float issue on Intel Mac 10.11
Result of -float is wrong on Intel Mac 10.11 drivers. Replace -float
with 0.0 - float to work around this issue.

BUG=308366
BUG=672380

Change-Id: I53bc2eda7259fff5805bec39896fc7b7a6eaf665
Reviewed-on: https://chromium-review.googlesource.com/417169
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2016-12-12 15:38:53 +00:00
Geoff Lang c339c4e590 Split WebGL compatibility into two extensions.
The mechanism for requesting extensions is now a separate extension.
Added a way to query the extensions that support enabling.

BUG=angleproject:1523

Change-Id: I2efaa9f6d67b12ecae325f455404e34ba04d0e7c
Reviewed-on: https://chromium-review.googlesource.com/414529
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-12-01 17:24:53 +00:00
Corentin Wallez 1b896c6293 translator: remove code related to for-loop unrolling
For loop unrolling is not used and causes the translator fuzzer to find
a hang when unrolling tons of nested loops (duh).
Also remove MMap.h which was unused.

This is essentially a revert of https://codereview.appspot.com/4331048

BUG=chromium:665255

Change-Id: Id6940f7e306d4ed53bc992f751e9ffe733190f17
Reviewed-on: https://chromium-review.googlesource.com/412023
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2016-11-18 21:53:38 +00:00
Jamie Madill 861ebb3bb8 Use ShaderVars instead of ShaderLang in headers.
We only need the typed variable information in our header files.
The entry point and other enum info can be encapsulated better
in the cpp files that call through to the translator. The only
tricky one is the compile options, which we return from our
implementation - put the typedef for these in the ShaderVars
header to fix this.

This should partially work around the problem of shaderlang
for Vulkan and ANGLE's translator (also ShaderLang) using some
identifiers with the same names.

BUG=angleproject:1576

Change-Id: I43c530486498c210796b9e197a6780bf2f7b3afb
Reviewed-on: https://chromium-review.googlesource.com/412423
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2016-11-18 17:24:16 +00:00
Qiankun Miao 41f9f6732f Remove invariant qualifier for ESSL 3.0 on AMD driver
AMD driver in Linux requires invariant qualifier to match between
shaders even for GLSL >= 4.2. This conflicts with ESSL 3.0 which
disallows invariant qualifier in fragment shader. Remove invariant
qualifier in vertex shader to workaround AMD driver bug.

BUG=chromium:639760
TEST=webgl2_conformance

Change-Id: Id5adf7e7032105486df90a1f200471ea81ee5c36
Reviewed-on: https://chromium-review.googlesource.com/411917
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
2016-11-17 23:19:51 +00:00
Yuly Novikov ea5865497e Cleanup after translator component removal
- Unite translator with translator_lib
- Remove flags and defines for shared library exports

BUG=angleproject:1596

Change-Id: Icd145a4b79e2472766a2b56017bb0f36f244482e
Reviewed-on: https://chromium-review.googlesource.com/410261
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2016-11-11 19:45:51 +00:00
Qiankun Miao 89dd8f3701 Remove invariant declaration in vertex shader for translation from ESSL 3.00 to GLSL <= 4.1
This is a follow-up patch of
https://chromium-review.googlesource.com/408569. This CL removes
invariant declaration in ESSL 3.00 vertex shader, such like:
"
out vec4 foo;
invariant foo;
"

This CL also adds the workarounds in libANGLE.

BUG=chromium:639760
TEST=webgl2_conformance

Change-Id: I568ab51a9a2f5da10d1aff0b63aae8805097e081
Reviewed-on: https://chromium-review.googlesource.com/409157
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-11-10 16:41:25 +00:00
Zhenyao Mo b7bf742696 Don't ouput "invarant" and "centroid" in GLSL 4.1 or older.
BUG=chromium:639760,chromium:641129
TEST=webgl2_conformance

Change-Id: I5fe87246eaea78888529d7b45b79399e6065daa9
Reviewed-on: https://chromium-review.googlesource.com/408569
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
2016-11-09 02:18:35 +00:00
Jamie Madill 8bbbb820a0 translator: Remove deprecated HLSL output flags.
These flags were adding redundant configs to the fuzzer.

BUG=angleproject:1522

Change-Id: I49ad56f0d7aceaae326d2d4387c4c750866465f3
Reviewed-on: https://chromium-review.googlesource.com/408338
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2016-11-07 22:53:58 +00:00
Jamie Madill acb4b81a95 translator: Put ShaderLang APIs in "sh" namespace.
Working with glslang in Vulkan means we are static linking libANGLE
with functions that have the same name as our translator APIs. We
can fix this by scoping our APIs. We don't need to scope the types
of the file, since they don't conflict.

This will require a follow-up patch to remove the unscoped APIs
once we switch over Chromium.

We also scope TCompiler and some related classes to avoid multiply
defined link errors with glslang.

BUG=angleproject:1576

Change-Id: I729b19467d2ff7d374a82044b16dbebdf2dc8f16
Reviewed-on: https://chromium-review.googlesource.com/408337
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2016-11-07 21:43:15 +00:00
Geoff Lang 2dacfb2a6d Fix EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE enum typo.
BUG=angleproject:1332

Change-Id: I69a5780521a4810ae93567fbe875a8c5e361850e
Reviewed-on: https://chromium-review.googlesource.com/406632
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2016-11-02 19:22:22 +00:00
Qiankun Miao 705a919443 Reland "Remove invariant qualifier for input in fragment shader"
This relands https://chromium-review.googlesource.com/#/c/400005/.

ESSL and GLSL are not consistent on invariant matching in vertex shader
and fragment shader. See the following rules:
ESSL 1.00 - input and output must match
ESSL 3.00 - only output, inputs cannot be declared as invariant.

GLSL 1.10.59 - does not exist
GLSL 1.20.8  - input and output must match
GLSL 1.30.10 - input and output must match
GLSL 1.40.8  - input and output must match
GLSL 1.50.11 - input and output must match
GLSL 3.30.6  - input and output must match
GLSL 4.00.9  - input and output must match
GLSL 4.10.6  - input and output must match
GLSL 4.20.11 - input can omit invariant
GLSL 4.30.8  - input can omit invariant
GLSL 4.40.9  - input can omit invariant
GLSL 4.50.5  - input can omit invariant

Since GLSL 4.20, invariant qualifier description were changed to:
"
Only variables output from a shader (including those that are then input
to a subsequent shader) can be candidates for invariance. This includes
user-defined output variables and the built-in output variables. As only
outputs need be declared with invariant, an output from one shader stage
will still match an input of a subsequent stage without the input being
declared as invariant.
"
It's not very clear if input in fragment can be declared as invariant.
Mesa driver disallows use of input declared as invariant in fragment
shader, while other drivers may allow it. This CL removes invariant
declaration for input in fragment shader except AMD driver in Linux.
AMD's driver obviously contradicts the spec by forcing invariance to
match between vertex and fragment shaders.

BUG=chromium:639760, chromium:659326
TEST=conformance/glsl/misc/shaders-with-invariance.html and
conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html

Change-Id: I0aa9be14f0cee7a11a249c91fba27c570c52ca1b
Reviewed-on: https://chromium-review.googlesource.com/404228
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2016-10-29 00:45:33 +00:00
Geoff Lang 2018c0bac4 Add a EGL_ANGLE_d3d_texture_client_buffer extension.
Allows creation of pbuffers from D3D texture objects.

BUG=540829
BUG=angleproject:1144

Change-Id: If8ea717ef011608cd01357c217837133d726d3ea
Reviewed-on: https://chromium-review.googlesource.com/316804
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-10-27 16:45:18 +00:00
Geoff Lang 0a9661f2b4 Implement robust the GetInternalFormativ entry point.
BUG=angleproject:1354

Change-Id: Ib25fe4905fdd6c532c67de1d4ca1ba37932f8e0b
Reviewed-on: https://chromium-review.googlesource.com/401149
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2016-10-20 19:01:50 +00:00
Qin Jiajia 7835b525b7 Reland "Add workaround for unused std140 and shared uniform blocks on MacOS"
On some Mac drivers with shader version 4.1, they will
treat unused std140 and shared uniform blocks' members as inactive. However,
WebGL2.0 based on OpenGL ES3.0.4 requires all members of a named uniform block
declared with a shared or std140 layout qualifier to be considered active.
The uniform block itself is also considered active.

This workaround is to reference all members of unused std140 and shared uniform blocks
at the beginning of the vertex/fragment shader's main().

BUG=chromium:618464
TEST=UniformBufferTest.ActiveUniformBlockNumber

Change-Id: I18da4e2b61b0170068bf5ea38ce54667b0737780
Reviewed-on: https://chromium-review.googlesource.com/395648
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2016-10-13 15:31:57 +00:00
Geoff Lang 47110bf4b3 Implement CHROMIUM_copy_compressed_texture for D3D11.
BUG=angleproject:1356

Change-Id: Id563997d2921cf558c52a781ae66d8bde58d1f2f
Reviewed-on: https://chromium-review.googlesource.com/339847
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2016-10-07 14:56:11 +00:00
Geoff Lang 168445c20c Add an extension for requesting a NULL Display.
BUG=angleproject:1468

Change-Id: Ief4b0e7d7a0420e59e547cd24fde53deb3718ccb
Reviewed-on: https://chromium-review.googlesource.com/388845
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-10-05 20:07:22 +00:00
Kenneth Russell c9e6026c51 Revert "Add workaround for unused std140 and shared uniform blocks on MacOS"
This reverts commit 9aa83fe302.

The new test UniformBufferTest.ActiveUniformNumberAndName/ES3_OPENGL is failing on multiple platforms. Examples:
https://build.chromium.org/p/chromium.gpu.fyi/builders/Mac%2010.10%20Release%20%28ATI%29/builds/12285
https://build.chromium.org/p/chromium.gpu.fyi/builders/Linux%20Release%20(ATI)

Change-Id: I78b1a4d58e9a291e40ad304eb32f990e0518f7ee
Reviewed-on: https://chromium-review.googlesource.com/391049
Reviewed-by: Kenneth Russell <kbr@chromium.org>
2016-10-01 00:16:35 +00:00
Geoff Lang ff5b2d5128 Add a GL_ANGLE_robust_client_memory extension.
This allows specifying data size to all GL functions that provide a pointer to
client memory and a length parameter for all functions in which the driver
writes to client memory.

BUG=angleproject:1354

Change-Id: Ia68be1576b957cb529c87b5e0d1bd638c7dbd371
Reviewed-on: https://chromium-review.googlesource.com/382012
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-09-29 18:09:19 +00:00
Qin Jiajia 9aa83fe302 Add workaround for unused std140 and shared uniform blocks on MacOS
On some Mac drivers with shader version 4.1, they will
treat unused std140 and shared uniform blocks' members as inactive. However,
WebGL2.0 based on OpenGL ES3.0.4 requires all members of a named uniform block
declared with a shared or std140 layout qualifier to be considered active.
The uniform block itself is also considered active.

This workaround is to reference all members of unused std140 and shared uniform blocks
at the beginning of the vertex/fragment shader's main().

BUG=chromium:618464
TEST=UniformBufferTest.ActiveUniformBlockNumber

Change-Id: I1d2c5e3e8da04786ac6a37fd26f7bb9c14cd76ed
Reviewed-on: https://chromium-review.googlesource.com/387169
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-09-29 02:50:45 +00:00
Shao 6f0a0dca16 Workaround isnan() on Intel drivers
On some Intel drivers, calling function isnan() on highp float will get wrong
answer. This patch work arounds this bug by using an expression to emulate
this function.

BUG=chromium:650547

Change-Id: I5bc5e0352c434f42cd2c55103a74f9f7ba51a72c
Reviewed-on: https://chromium-review.googlesource.com/389834
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2016-09-28 16:34:11 +00:00
Geoff Lang f41a7151a5 Add an extension to disable resource generation on bind.
BUG=angleproject:1518

Change-Id: I662f7b07da5c97831496f2617b0adadf9858bdc9
Reviewed-on: https://chromium-review.googlesource.com/386799
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2016-09-23 14:16:37 +00:00
Geoff Lang c287ea6e0a Add WebGL validation extensions to ANGLE.
BUG=angleproject:1523

Change-Id: I6fecb5055ed8087665aeee34b3a066ea8f38d51b
Reviewed-on: https://chromium-review.googlesource.com/386281
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2016-09-20 15:27:28 +00:00
Jiawei-Shao e292e90280 Workaround the unary minus operator issue on Intel
On some Intel D3D drivers, evaluating unary minor operator on an
integer variable may get wrong answer in vertex shader.

This patch works around this bug by replacing -(int) with ~(int)+1
on Windows Intel.

BUG=chromium:644033

Change-Id: I0af719e84d618a33f25bcb33bde0c381fb462a31
Reviewed-on: https://chromium-review.googlesource.com/381675
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2016-09-20 14:58:29 +00:00
Qiankun Miao 09cfac606e Work around For and While loop bugs on Intel Mac OSX
Condition calculation in for and while loops has bug on Intel Mac. Work
around it by converting "CONDITION" to "CONDITION && true".

This CL also adds previous SH_EMULATE_ABS_INT_FUNCTION workaround to
the ANGLE GL back-end on OSX

BUG=chromium:644669
TEST=deqp/functional/gles3/shaderloop_for/while.html

Change-Id: I910f662b054f259fcb601b9938841b3a2d066840
Reviewed-on: https://chromium-review.googlesource.com/381678
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Qiankun Miao <qiankun.miao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2016-09-15 03:14:24 +00:00
Qiankun Miao 7ebb97fc9a Use 64-bits compile options
BUG=chromium:645071

Change-Id: I31825123bf4cb45fb37a93f538e8936487beb5ff
Reviewed-on: https://chromium-review.googlesource.com/382712
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-09-13 20:54:59 +00:00
Olli Etuaho 966456de40 Remove SH_TIMING_RESTRICTIONS compiler flag
The timing restrictions code is not in use and not updated for ESSL3,
so it is better to remove it to make refactoring the AST easier.

It can also be argued that perfect prevention of shader timing attacks
is not feasible due to factors that are not under control of ANGLE,
such as fixed function color compression in GPUs. Such color
compression may make the use of texture bandwidth and thus performance
dependent on the content of a texture regardless of whether a
compressed format is chosen through the API.

SH_DEPENDENCY_GRAPH flag that could only be active together with the
timing restrictions flag is also removed, along with all the code that
was supporting it. The newer CallDAG code is used for different
purposes and is kept.

BUG=angleproject:1490
TEST=angle_unittests

Change-Id: I2cd10e18df366e8e43f7c3af1ca12d2a4bfb2007
Reviewed-on: https://chromium-review.googlesource.com/384511
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2016-09-13 06:58:58 +00:00
Qiankun Miao e5bb72ff28 Remove SH_EMULATE_BUILT_IN_FUNCTIONS which isn't used
The flag is not used in chrome. We decide to do per emulation per flag.

BUG=chromium:642227

Change-Id: I936d53e5015186e35e672d0cb51c853a941582d2
Reviewed-on: https://chromium-review.googlesource.com/379077
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2016-09-01 14:54:29 +00:00
Qiankun Miao a4e6f07433 Work around abs() issue in Intel Mac drivers
abs(i) where i is an integer returns unexpected result in Intel Mac.
This works around the issue by emulating abs(i) manually.

BUG=chromium:642227
TEST=deqp/functional/gles3/shadercommonfunction.html

Change-Id: I2a41e0f4bcb0766109d651e663283b1760468017
Reviewed-on: https://chromium-review.googlesource.com/377628
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
2016-08-31 19:40:37 +00:00
Qiankun Miao c2c5fc48e3 Remove CSS Shader related code
CSS shader has been removed from spec and chrome code base. Remove the
code in ANGLE.

BUG=chromium:233383

Change-Id: I93a35437f540e51ce7af9d49f21ca60d7c0b156a
Reviewed-on: https://chromium-review.googlesource.com/378739
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2016-08-31 17:55:49 +00:00
Yuly Novikov e3352f94a1 Change angle_util to be a shared library
So that there will be one instance of static thread synchronization variables
in AndroidWindow.
Previously there was one instance in lib_angle_deqp_gles2_tests__library
and one in libangle_deqp_libgles2, resulting in AndroidWindow::initialize
waiting forever.

Also make the change in GYP build to fix standalone build,
and fix rpath issues on Mac.

BUG=angleproject:1471
TEST=end2end and deqp tests on standalone Win10 and end2end on GN Mac 10.11

Change-Id: I731578459400bb47d269df129aabed9b67b555e6
Reviewed-on: https://chromium-review.googlesource.com/376202
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2016-08-30 20:50:59 +00:00
Shao 11e43ecee2 Add a workaround for Intel drivers on glsl function texelfetchoffset
GLSL function texelfetchoffset will be translated into texture.Load in
ANGLE. In D3D there is a note that When one or more of the coordinates
in Location exceeds the u, v, or w mipmap level dimensions of the
texture, Load returns zero in all components, but in glsl there is no
such restriction, which will cause the WebGL 2 dEQP test
deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html fail
on Windows with Intel GPU.

Adapted from ExpandIntegerPowExpressions.cpp, this patch adds a
translation from texelFetchOffset into texelFetch to work around this
issue.

BUG=angleproject:1469

Change-Id: Iecfb9570472036acf5960789bdb1a63f191316be
Reviewed-on: https://chromium-review.googlesource.com/367883
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2016-08-27 17:51:36 +00:00
Geoff Lang 1fe74c7e2e Manually compute the mipmap size for the textureSize builtin.
There were two issues with the current implementation:
 * The GetDimensions function already takes into account the base level of the
   SRV.
 * The GetDimensions function returns doesn't return valid sizes for levels
   that don't exist in the SRV.  Instead, manually do the lod offset.

BUG=angleproject:931
BUG=angleproject:1316

TEST=dEQP-GLES3.functional.shaders.texture_functions.texturesize.sampler2d_fixed_vertex

Change-Id: I63259b563a42b93b73949e0ef7ac412099a42f13
Reviewed-on: https://chromium-review.googlesource.com/376099
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2016-08-26 19:47:28 +00:00
Martin Radev 4c4c8e7252 Add compute program compilation and linking support
Compute shaders can be now compiled and linked to create programs.
Some tests are added to verify successful and unsuccessful compute
shader linking.

The patch also replaces std::array<int, 3> with a custom struct
WorkGroupSize.

BUG=angleproject:1442

TEST=angle_end2end_tests
TEST=angle_unittests

Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84
Reviewed-on: https://chromium-review.googlesource.com/366740
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2016-08-26 09:51:18 +00:00
Yuly Novikov 55033e583b Revert "Change angle_util to be a shared library"
This reverts commit 2f9b5e6f79.

Change-Id: I90a7ba0596e79795c9549bc268eabff69c96d572
Reviewed-on: https://chromium-review.googlesource.com/376079
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2016-08-25 18:12:11 +00:00
Yuly Novikov 2f9b5e6f79 Change angle_util to be a shared library
So that there will be one instance of static thread synchronization variables
in AndroidWindow.
Previously there was one instance in lib_angle_deqp_gles2_tests__library
and one in libangle_deqp_libgles2, resulting in AndroidWindow::initialize
waiting forever.

BUG=angleproject:1471

Change-Id: Ia529c91e34960eb352730c1bb89a91ce6336c8a0
Reviewed-on: https://chromium-review.googlesource.com/368983
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-08-24 21:01:16 +00:00
Kenneth Russell bccc65d323 Flatten "#pragma STDGL invariant(all)" into varying variables.
This is implemented as a compiler option which is enabled by default
when outputting to desktop GLSL version 130 and greater, which does
not support this #pragma in fragment shaders. As a workaround, and for
better compatibility on desktop OpenGL drivers, this pragma is also
flattened into the outputs of vertex shaders, and the inputs of ESSL
1.00 fragment shaders.

TEST=conformance/glsl/misc/shaders-with-invariance.html with --enable-unsafe-es3-apis
BUG=629622, angleproject:1293

Change-Id: Ib040230915e639971505ed496d26e804c9d64e68
Reviewed-on: https://chromium-review.googlesource.com/361792
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
2016-08-17 22:12:39 +00:00
Martin Radev 802abe0150 Add compute shader compilation support in the glsl compiler
Support is added for compute shader compilation. There is a small
extension to the parser so that 'local_size_x = ', 'local_size_y = '
and 'local_size_z = ' are supported as layout qualifiers.

A few shader compilation tests are added and one which checks the AST
whether the layout qualifiers are properly parsed.

BUG=angleproject:1442

TEST=angle_unittests
TEST=angle_end2end_tests

Change-Id: I67283797d1cf13fa4ac47faa2a6e66d93a2db867
Reviewed-on: https://chromium-review.googlesource.com/362300
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2016-08-09 16:04:13 +00:00
Martin Radev e93d24ef1f Add es3.1 shader constants
The patch adds all shader built-in constants.

BUG=angleproject:1442

TEST=angle_unittests
TEST=angle_end2end_tests

Change-Id: I81cae479d6506a8faa2dce023d5fcc2c1291d521
Reviewed-on: https://chromium-review.googlesource.com/364460
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2016-08-04 13:00:25 +00:00