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

213 Коммитов

Автор SHA1 Сообщение Дата
Frank Henigman 5b1180df68 Add gyp deprecation warning.
gyp_angle now prints a warning every time it is run.
All targets print the same warning as one of their build steps.
The DEPS change updates gypi_to_gn so it doesn't choke on
files with 'target_defaults' sections.

BUG=angleproject:1569

Change-Id: Ibdf277fcc14cf4ebc7b7db78270210752cd8ef9d
Reviewed-on: https://chromium-review.googlesource.com/711155
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
2017-12-18 23:04:55 +00:00
Jiawei Shao bd924af173 ES31: Remove support of GL_OES_geometry_shader in compiler
This patch intends to remove the support of GL_OES_geometry_shader
in ANGLE compiler.

To make the implementation simpler, currently we decide to only
support "GL_EXT_geometry_shader" as the extension string of geometry
shader in ANGLE.

This patch also updates all the related shaders in angle_unittests
into R"()" format.

BUG=angleproject:1941
TEST=angle_unittests

Change-Id: Ife9858abeedfb46b02c5c2fb1cda16fa27198511
Reviewed-on: https://chromium-review.googlesource.com/773451
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2017-12-14 18:32:04 +00:00
Olli Etuaho 465835d61f Support arrays of arrays in the API
The ShaderVariable class that is used as an interface between the
compiler and the rest of the code gets arrays of arrays support.

Array of array variables are passed from the compiler just like any
other variables. However, when stored in Program state each innermost
array constitutes a separate variable. This is done to make the
implementation match the GLES specification for program interface
query APIs.

This will be tested more fully once support for parsing arrays of
arrays lands in the compiler.

TEST=angle_end2end_tests, angle_unittests
BUG=angleproject:2125

Change-Id: I0f7159000f039be92a87a52b3b68cd9a215a21cb
Reviewed-on: https://chromium-review.googlesource.com/684742
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2017-11-22 12:38:32 +00:00
Frank Henigman d0ef13a250 Stand-alone build with gn.
This should do the same things as the stand-alone gyp build, but with gn.
You should switch to gn as gyp support will go away.

You need a recent enough version of gn.  If yours is too old try this one:
  ./buildtools/linux64/gn

If "gclient sync" or anything fails with an ImportError on gyp stuff,
try running it with the following PYTHONPATH in the environment:
  PYTHONPATH=tools/gyp/pylib

BUG=angleproject:1569

Change-Id: I56d19bec2d8b649a7bd65062c656cbfc69ea3dd8
Reviewed-on: https://chromium-review.googlesource.com/642588
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
2017-10-18 17:02:13 +00:00
Corentin Wallez 8a9e0fc238 Fix standalone compilation on Mac
The std::pair constructor isn't constexpr there.

BUG=

Change-Id: I7711185c6c991fd5793cc6c785e9905710660cd9
Reviewed-on: https://chromium-review.googlesource.com/723849
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2017-10-17 20:59:00 +00:00
Yunchao He 128e536ab6 Fix a small build issue.
Strcmp in SampleApplication.cpp is a cstring function. So some
compilers (at least the default gcc compiler in my Ubuntu 17.04)
would think that strcmp is not declared and lead to build failure,
even we have include <string> in header file.

Now that we use std::string variable in SampleApplication.h, it is
better to include <string> in that header file as what it is.
Then add <string.h> to include cstring functions in .cpp file to
fix the build issue.

BUG=angleproject:2180

Change-Id: Id97a6956480637c1218314c04d9b331031c7b911
Reviewed-on: https://chromium-review.googlesource.com/711396
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2017-10-11 13:37:35 +00:00
Jamie Madill 1fce3283f0 Samples: Add command line flag to select renderer.
This gives us the ability to test Vulkan without a special recompile,
and keeps the default setting to the default ANGLE renderer. Only
implemented for the hello_triangle sample currently.

Also includes an extra error message for missing EGL config, which is
where the Vulkan init fails right now, due to missing depth/stencil
support.

Also includes a hack to get Vulkan samples running without depth/
stencil.

BUG=angleproject:2167

Change-Id: I6925b9b84956fb69cbf602a828ea95d8c7125b68
Reviewed-on: https://chromium-review.googlesource.com/707688
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2017-10-10 14:58:03 +00:00
Olli Etuaho a20af6d7e8 Use C++11 raw string literals instead of SHADER_SOURCE macro
This is better in many ways:
1. It doesn't confuse clang format
2. \n doesn't need to be included after preprocessor directives like
   the version directive.
3. It's using built-in functionality instead of something custom.

Raw string literals should be the preferred way to include shader
source in C++ files going forward.

BUG=angleproject:2157
TEST=angle_end2end_tests

Change-Id: I8b236a6e2d5c25d920297e5bc5b5b143eddeba1f
Reviewed-on: https://chromium-review.googlesource.com/671046
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2017-09-18 15:08:15 +00:00
Martin Radev 1aa66bc73d Add ANGLE_multiview sample
The patch adds a sample which makes use of the ANGLE_multiview
extension to draw the same scene to two views each having its
own camera matrix.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: I4b765a189047bf219a05e98b032ad95efbb36905
Reviewed-on: https://chromium-review.googlesource.com/655166
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2017-09-11 07:51:59 +00:00
Jiawei-Shao df7d7c9ec7 Split varyings into input and output varyings in compiler
This patch intends to split all vector<Varying> into two vectors
to store input and output varyings separately in the compiler.

This patch is a base of implementing the built-ins, inputs and
outputs of a geometry shader to ANGLE GLSL compiler. Unlike the
vertex shaders (their outputs are varyings) and fragment shaders
(their inputs are varyings), the inputs and outputs of geometry
shaders are all varyings, so we need two vector<Varying> to store
them correctly.

BUG=angleproject:1941

Change-Id: I9e8cc16045d5e29e9a80a09dc31b33a7ae39b345
Reviewed-on: https://chromium-review.googlesource.com/593347
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2017-08-02 13:16:49 +00:00
Shao b5cc1198b8 ES31: Add Geometry Shader layout qualifiers in GLSL compiler
This patch intends to implement Geometry Shader layout qualifiers
required in OpenGL ES 3.1 extension GL_OES_geometry_shader in ANGLE
GLSL compiler.

1. Add support to the shader type GL_GEOMETRY_SHADER_OES.
2. Implement Geometry Shader layout qualifiers in the GLSL compiler:
(1) Add support to OpenGL ES 3.1 extension "GL_OES_geometry_shader".
(2) Add validations of the input and output primitive declarations
    in the Geometry Shader layout declarations.
(3) Add 'invocations' and 'max_vertices' support in the Geometry
    Shader layout declarations
3. Add unit tests to cover all the new features added in this patch.

BUG=angleproject:1941
TEST=angle_unittests

Change-Id: Ie693e11f8a00dab3552626ed63e9336c7fbd3cb8
Reviewed-on: https://chromium-review.googlesource.com/560647
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2017-07-26 20:50:54 +00:00
Olli Etuaho 0d2ecb4ea9 Output mapped name of shader variables in shader_translator
This makes understanding and debugging the mapped names in the
translator interface easier.

TEST=shader_translator -u

Change-Id: I2457142a6f0a8baa623e80b00cc86c8df90e6718
Reviewed-on: https://chromium-review.googlesource.com/579968
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2017-07-20 17:43:01 +00:00
Martin Radev c39a19aa93 Select viewport index in the GLSL/ESSL vertex shader
The patch enables viewport selection for multiview rendering in the
GLSL/ESSL vertex shader through the use of the GL_NV_viewport_array2
extension. The AST is modified only for GLSL and ESSL to include the
viewport selection expression after ViewID_OVR's initialization.

BUG=angleproject:2062
TEST=angle_unittests

Change-Id: Iee05bb5a4b687ed53ddbdd466f1572227b1f0cde
2017-07-11 18:32:28 +03:00
Martin Radev 69056a1ecf Declare and initialize ViewID_OVR and InstanceID
The patch modifies the vertex shader's AST to declare and initialize
the global variables ViewID_OVR and InstanceID. Every occurrence of
gl_ViewID_OVR gets replaced by ViewID_OVR and initialized in main
with a value dependent on gl_InstanceID and the number of views.
To guarantee correct results for instanced rendering, each occurrence
of gl_InstanceID is replaced with InstanceID and initialized similarly.

BUG=angleproject:2062
TEST=angle_unittests

Change-Id: I48be688605b5af869bc370758e70ccc209ea4419
Reviewed-on: https://chromium-review.googlesource.com/548596
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2017-06-30 10:27:19 +00:00
Ken Russell fcadd08ad7 Provide build target for angle_shader_translator sample.
This is useful for building the sample within Chromium rather than
in ANGLE's standalone build, which has other requirements like a
full Visual Studio installation.

BUG=angleproject:2095

Change-Id: I785d87ecb5166d8f640a5c8a5f321c3209017cc5
Reviewed-on: https://chromium-review.googlesource.com/553399
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2017-06-29 15:03:04 +00:00
Olli Etuaho 9733ceefa4 Initialize uninitialized locals in GLSL output
Guarantee that local variables are initialized before they are used
in GLSL output. In HLSL output all variables were already being
initialized.

Locals are initialized using an AST transform. The local variable init
can only be run after some simplification of the AST, so that it is
able to handle complex cases like:

for (int i[2], j = i[0]; i[0] < 3; ++i[0]) {
}

If we're dealing with ESSL 1.00 which lacks array constructors, in
this kind of case the uninitialized array initialization code needs to
be hoisted out of the loop init statement, and the code also needs to
make sure that j's initializer is run after i is initialized.

Another complex case involves nameless structs. This can be an issue
also in ESSL 3.00 and above:

for (struct { float f; } s; s.f < 1.0; ++s.f) {
}

Since the struct doesn't have a name, its constructor can not be used.
We solve this by initializing the struct members individually,
similarly to how arrays are initialized in ESSL 1.00.

Initializing local variables is disabled on Mac and Android for now.
On Mac, invalid behavior was exposed in the WebGL 2.0 tests when
enabling it. On Android, the dEQP test runs failed for an unknown
reason. Bugs have been opened to resolve these issues later.

BUG=angleproject:1966
TEST=angle_end2end_tests, WebGL conformance tests

Change-Id: Ic06927f5b6cc9619bc82c647ee966605cd80bab2
Reviewed-on: https://chromium-review.googlesource.com/504728
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2017-05-29 15:55:18 +00:00
Yunchao He f81ce4a374 Refactoring: replace NULL by nullptr for pointers (3rd CL).
This CL mainly handles passing/returning NULL to/from a function.

BUG=angleproject:2001

Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009
Reviewed-on: https://chromium-review.googlesource.com/485060
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2017-04-25 14:32:47 +00:00
Andrei Volykhin a552707181 Add support for EXT_YUV_target
Add new sampler type "__samplerExternal2DY2YEXT"
to sample a YUV texture image and output color value
without any color conversion,
new additional type to specify color space standard formula and
built-in functions for yuv to rgb transformation.

Change-Id: I1780650fe84cd75191c1ca1e4118e89d585bfd92
Reviewed-on: https://chromium-review.googlesource.com/454697
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2017-03-22 20:50:14 +00:00
Olli Etuaho 4336489ffc Parse binding layout qualifier for opaque types
This patch adds binding layout qualifier support for opaque types.
Binding layout qualifier on blocks is not yet supported.

This includes support for GLSL output and some minor simplification of
related functionality in ParseContext.

TEST=angle_unittests, dEQP-GLES31.functional.layout_binding.*
BUG=angleproject:1442

Change-Id: I53fb505b5a539bccee70613f3969fba81965ae84
Reviewed-on: https://chromium-review.googlesource.com/441586
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2017-02-15 15:41:10 +00:00
Olli Etuaho 4be6c6ccd7 Add missing sampler types to shader_translator output
The types are organized as in the ESSL 3.10 spec.

BUG=angleproject:1681

Change-Id: If8e0ab2c604fcf9b61d3d89719e95854d494231c
Reviewed-on: https://chromium-review.googlesource.com/427843
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2017-01-13 15:37:40 +00:00
Jamie Madill dcab56a1b8 Move some file utils to common.
Since common is shared through all ANGLE code (libANGLE/tests/samples)
this is the most general place for these utils, and will give libANGLE
access to them. We'll need them to get the current executable dir for
loading the Vulkan layers.

This also means we'll need to fix the global static variable use when
we have the ability.

BUG=angleproject:1319
BUG=chromium:677841

Change-Id: I7af61920635135b28a2f02f4a8d019ee88c9dd28
Reviewed-on: https://chromium-review.googlesource.com/425440
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2017-01-05 23:41:59 +00:00
JiangYizhou 4021932f25 translator: Add ES3.1 multisample texture support.
Implement shader objects, [iu]sampler2DMS, textureSize(gsampler2DMS).
as well as texelFetch(gsampler2DMS,P,sample) for the glsl.

BUG=angleproject:1590

TEST=angle_unittests
TEST=angle_end2end_tests

Change-Id: I781023f7bec34ad0264af69f34bb182b50bd1fbd
Reviewed-on: https://chromium-review.googlesource.com/423175
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2017-01-05 13:39:20 +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
Corentin Wallez 922cbfcb8e common: Add a vector arithmetic helper classes
Change-Id: I2f96baedf10d346eaa150bab04f8f6ca3ba573b9
Reviewed-on: https://chromium-review.googlesource.com/414272
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2016-12-02 15:28:39 +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
Corentin Wallez 7f07caa961 Rename the build/ directory.
GYP related files went in gypfiles/, and the gni went in gni/ this
changes frees up the build/ directory name for Chromium's build/
directory.

BUG=angleproject:1569

Change-Id: I76fe343d569239c2732ba87986fcf7debc21d417
Reviewed-on: https://chromium-review.googlesource.com/403029
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-11-08 14:48:42 +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
Yuly Novikov e653403bae Remove component translator target and keep static_library.
Rename translator_static to translator and use it everywhere.

BUG=angleproject:1596

Change-Id: I36c990d54979d2460b1513a65cca0b82f8d65c80
Reviewed-on: https://chromium-review.googlesource.com/406668
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2016-11-03 17:07:18 +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
Olli Etuaho 87d410c8db Disallow multiple locations on output variables
GLSL ES specs from version 3.00 to 3.20 all mention that output layout
location qualifier may appear at most once within a declaration.
Enforce this rule when parsing shaders.

Also set max draw buffers to 8 when compiling GLSL ES >= 3.00 in the
qualification order tests and shader translator sample, so that
parsing locations > 0 will succeed.

BUG=angleproject:1505
TEST=angle_unittests

Change-Id: I50fe409041385f5e10e695f43dc3a572433e9772
Reviewed-on: https://chromium-review.googlesource.com/381211
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2016-09-12 14:21:48 +00:00
Jamie Madill d08163d704 Fix standalone build.
BUG=angleproject:1471

Change-Id: I52aadeb58f75d5b944421bd0cd4a5dddead3f6d1
Reviewed-on: https://chromium-review.googlesource.com/379916
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-09-01 20:47:12 +00:00
Kenneth Russell b962aab6ff Remove stray reference to SH_EMULATE_BUILT_IN_FUNCTIONS.
BUG=chromium:642227

Change-Id: Ie1d74c0abd355a0bddc3c2b700390a3a2a9c4823
Reviewed-on: https://chromium-review.googlesource.com/379875
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2016-09-01 17:55:58 +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
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 1be913cff8 Add support for ES31 context creation
The dEQP test for context creation passes.

SH_WEBGL3_SPEC has been added, but it should be considered whether we
should keep it, remove it or rename it. It was added so that there is
a webgl mapping to es 310 shaders. Check Compiler.cpp. The bison file
has been modified so that some tokens from es3 can be also used in
es31 as well.

A separate macro ES3_1_ONLY is added so that some tokens are limited
only for es 310 shaders.

BUG=angleproject:1442
TEST=angle_unittests

Change-Id: I2e5ca227c96046c30dc796ab934f3fda9c533eba
Reviewed-on: https://chromium-review.googlesource.com/360300
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2016-07-20 12:58:19 +00:00
Olli Etuaho 9b4e8626f8 Redesign samplers in shaders on D3D11
Translation of samplers to HLSL on D3D11 is changed as follows:

Instead of passing around HLSL sampler and HLSL texture references in
shaders, all references to ESSL samplers are converted to constant
indices within the shader body. Each ESSL sampler is identified by an
unique index. In the code generated to implement ESSL texture functions,
these indices are used to index arrays of HLSL samplers and HLSL
textures to get the sampler and texture to use.

HLSL textures and samplers are grouped into arrays by their types. Each
unique combination of a HLSL texture type + HLSL sampler type gets its
own array. To convert a unique sampler index to an index to one of these
arrays, a constant offset is applied. In the most common case of a 2D
texture and a regular (non-comparison) sampler, the index offset is
always zero and is omitted.

The end goal of this refactoring is to make adding extra metadata for
samplers easier. The unique sampler index can be used in follow-up
changes to index an array of metadata passed in uniforms, which can
contain such things as the base level of the texture.

This does not solve the issues with samplers in structs.

The interface from the point of view of libANGLE is still exactly the
same, the only thing that changes is how samplers are handled inside the
shader.

On feature level 9_3, the D3D compiler has a bug where it can report that
the maximum sampler index is exceeded when in fact it is not. This can
happen when an array of samplers is declared in the shader. Because of
this the new approach can't be used on D3D11 feature level 9_3, but it
will continue using the old approach instead.

BUG=angleproject:1261
TEST=angle_end2end_tests,
     dEQP-GLES3.functional.shaders.texture_functions.* (no regressions)
     dEQP-GLES3.functional.texture.units.* (no regressions)

Change-Id: I5fbb0c4280000202dc2795a628b56bd8194ef96f
Reviewed-on: https://chromium-review.googlesource.com/320571
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
2016-02-01 21:58:06 +00:00
Corentin Wallez 541591d509 Fix some override related warnings.
BUG=

Change-Id: I9e67ba2165ac87959f319fd2485fe385c60a8ea0
Reviewed-on: https://chromium-review.googlesource.com/324461
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
2016-02-01 18:55:56 +00:00
Jamie Madill f83cbc6531 Use std::random functions for test and samples RNG.
These standard functions are much more powerful than the C random()
routines. Use them to improve the random utils, and use a class
to clean things up further.

This fixes a problem I was having using random_utils where I was
having trouble generating random 32 bit unsigned integers.

BUG=angleproject:1290

Change-Id: I5081764053d0667a4e323553b7dea531256aa778
Reviewed-on: https://chromium-review.googlesource.com/323440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
2016-01-26 19:37:18 +00:00
Corentin Wallez 7acd7354a5 Revert "Revert "OSXWindow: fix window size and position computations""
This reverts commit 67d810449c.

Change-Id: I4fcaffeb161d22c1cea72fd764461b0c38024e01
Reviewed-on: https://chromium-review.googlesource.com/322214
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
2016-01-21 15:26:00 +00:00
Corentin Wallez 67d810449c Revert "OSXWindow: fix window size and position computations"
This reverts commit 3408753302.

Change-Id: Ide87d79791aa37095127f048929e1b7a925259ab
Reviewed-on: https://chromium-review.googlesource.com/322391
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
2016-01-19 15:29:19 +00:00
Corentin Wallez 3408753302 OSXWindow: fix window size and position computations
Also improve debug messages in window_test.

BUG=angleproject:1273

Change-Id: Ie47dc1d7ad3be5a55d2a199334bba606f2b45ad0
Reviewed-on: https://chromium-review.googlesource.com/322350
Tryjob-Request: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
2016-01-18 15:35:05 +00:00
Corentin Wallez 200205840c Small cleanup of MultiWindow
Fixes a glitch on OSX where the root window would swap twice, causing a
glitch.

Change-Id: I5886105fb18ed8f45e69cd10b5d1cac49b82093f
Reviewed-on: https://chromium-review.googlesource.com/320291
Tryjob-Request: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
2016-01-08 15:41:56 +00:00
Jamie Madill 90c253a616 Add an instancing perf test.
BUG=526217
BUG=angleproject:1164

Change-Id: Ia353a3b2fa0ab0e8b7fd15d72bb63e5ecb7833b1
Reviewed-on: https://chromium-review.googlesource.com/301469
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
2015-12-16 14:04:14 +00:00
hendrikw bb7740cc32 angle: prevent huge allocations when GL_MAX_VERTEX_ATTRIBS fails
I'm not sure why yet, but when using angle in skia,
getIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs) sometimes fails,
and when that happens we attempt to allocate and array with the size of
maxVertexAttribs, which is uninitialized, which could be huge.

Prevent this by initializing the variable.

Also sweep through other similar calls and ensure that these use
initialized values (test code has not been updated)

BUG=skia:4380

Change-Id: If1f3cf72f2b2829ad3933637af8778d574a20f61
Reviewed-on: https://chromium-review.googlesource.com/307239
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Dian Xiang <dianx@google.com>
Tested-by: Hendrik Wagenaar <hendrikw@chromium.org>
2015-10-23 16:36:45 +00:00
Austin Kinross adb857b2f6 Fix MultipleDrawBuffers sample when GL_OES_texture_npot isn't active
If the GL_OES_texture_npot extension isn't active, then setting
GL_TEXTURE_WRAP_S/T to GL_REPEAT for a NPOT texture results in black
rendering. This is specified in Section 3.8.2 of the OpenGL ES 2.0
specification.

Setting GL_TEXTURE_WRAP_S/T to GL_CLAMP_TO_EDGE is valid even if the
NPOT extension isn't active.

Change-Id: Ibd553620995df32138bf8153d1036fd05d386d90
Reviewed-on: https://chromium-review.googlesource.com/306302
Tested-by: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2015-10-19 17:07:14 +00:00
Kimmo Kinnunen 5f0246ca6d Implement gl_FragDepth for GLES SL 3.0
Makes it an error to access gl_FragDepthEXT  in #version 300 es shader.

TODO:
Lacks the feature to make "#extension GL_EXT_frag_depth : require" an
error for #version 300 es.

Reland of: https://chromium-review.googlesource.com/#/c/287570

BUG=angleproject:1102
TEST=angle_unittest

Change-Id: I064d918d65f37539cb1e14f12173ca5591a4ea3f
Reviewed-on: https://chromium-review.googlesource.com/301711
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
2015-09-29 18:57:23 +00:00
Jamie Madill ad60e8ee26 Move more sample_util sources to util.
These sample utils can also be useful for writing perf tests.

BUG=angleproject:1164

Change-Id: I44b5d63b57bfce7a541442fd02cd729a1bab17f0
Reviewed-on: https://chromium-review.googlesource.com/301468
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
2015-09-28 19:00:21 +00:00
Geoff Lang ee48376c1f Update to the latest versions of the GL and EGL headers.
Add GLES 3.1 and 3.2 headers.

Remove GLES 3.0 extension headers and entry point files.

Re-land fixes double define from different style defines in libGLESv2.gypi
and other projects.

Re-land fixes missing defines in angle_util project in gn.

Change-Id: I1952413cd4390e6f5450df809f8f5867bf6f49e2
Reviewed-on: https://chromium-review.googlesource.com/299771
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
2015-09-15 20:13:55 +00:00
Geoff Lang 0393310feb Revert "Update to the latest versions of the GL and EGL headers."
Issues with GN build.

This reverts commit 8284436798.

Change-Id: I99d186019135bbbe250e95c9567854108d31c556
Reviewed-on: https://chromium-review.googlesource.com/299870
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
2015-09-15 17:07:24 +00:00