Commit Graph
111 Commits
Author SHA1 Message Date
Geoff Lang 38971fd135 Vulkan: Support multiple depth stencil formats for backbuffers.
Since the backbuffer's depth stencil is always emualted, it can support any
depth stencil format.

BUG=angleproject:2692

Change-Id: I29df62bb322c1ac4e9fcd54e4cbc4c219cf12e83
Reviewed-on: https://chromium-review.googlesource.com/1119075
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-18 18:13:34 +00:00
Jamie Madill 799e075abe Replace D24_UNORM with a packed version.
Adding an explicit X8 channel packs the format into 32 bits. This gives
the correct 4-byte alignment instead of a mysterious 3-byte version.

Bug: angleproject:2729
Change-Id: Id38f74db4ba61c500baeb6526a9d14e1d31d4363
Reviewed-on: https://chromium-review.googlesource.com/1140739
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-07-18 16:32:13 +00:00
Frank Henigman 419acc8f4f Vulkan: Convert streamed vertex data as needed.
Add two members to vk::Format:
- vertex data copy function
- flag indicating if the function converts or not
Use the function when streaming vertex data so it gets converted if needed.
Add fallbacks for integer formats.  These formats will now work everywhere,
as long as they are in client memory, not a buffer object.
Adjust test expectations accordingly.

BUG=angleproject:2405

Change-Id: I677221219d933c35740633a0ab7694293e218177
Reviewed-on: https://chromium-review.googlesource.com/1084328
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-07-16 15:47:20 +00:00
Frank Henigman d9618bf4fc Vulkan: prepare for buffer format fallbacks.
Generate code for buffer fallbacks as well as texture fallbacks.
No functional change.

BUG=angleproject:2405

Change-Id: I9f30a2cbb3cd9ba1d18474f99cba434b030b0232
Reviewed-on: https://chromium-review.googlesource.com/1113026
Commit-Queue: Frank Henigman <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-13 19:45:23 +00:00
Frank Henigman 569b9cb983 Fix run_code_generation.py hash calculation.
Open files with mode 'r' instead of 'rb' so the hash calculation
produces the same results on Linux and Windows.
Recalculate the hashes and proc_table_autogen.cpp which was out of date.

BUG=angleproject:2711

Change-Id: I31562c96ce36e6df009c44c565fe9a3f1b5ba6c4
Reviewed-on: https://chromium-review.googlesource.com/1128549
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Frank Henigman <[email protected]>
2018-07-10 22:25:05 +00:00
Geoff Lang cb8a921b7a Vulkan: Support RGB/BGR backbuffers emulated on RGBA/BGRA.
BUG=angleproject:2692
BUG=angleproject:2523
BUG=angleproject:2715
BUG=angleproject:2716

Change-Id: I538b385f8b66fb97e176953b0fc4a6299849c005
Reviewed-on: https://chromium-review.googlesource.com/1118713
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Luc Ferron <[email protected]>
2018-07-10 20:28:29 +00:00
Geoff Lang b1cc789c70 Finish populating the new_hashes map after finding a dirty input.
any_input_dirty would return early when finding a dirty input and not finish
filling the new_hashes map.  This would require multiple runs of the code
generation script to fully generate all the outputs.

BUG=angleproject:2695

Change-Id: Ie62190efe2765df432b0a535fb8d33ed2ffa66a7
Reviewed-on: https://chromium-review.googlesource.com/1127439
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-05 21:13:22 +00:00
Geoff Lang 9a25780193 Write relative paths with forward slashes to the code generation hashes.
This should avoid generating diffs when running the code generation with
different source directories or on different platforms.

BUG=angleproject:2695

Change-Id: I67776883bdbeb867a49bea00f16998c04f7857b4
Reviewed-on: https://chromium-review.googlesource.com/1127355
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-05 21:07:02 +00:00
Geoff Lang 5695a5b24c Allow the run_code_generation.py script to be run from any directory.
BUG=angleproject:2695

Change-Id: I9a083bf67b17ca0dc1ee213b75caa4ecece62f00
Reviewed-on: https://chromium-review.googlesource.com/1127354
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-07-05 20:53:02 +00:00
Geoff Lang be7e455c89 Vulkan: Regenerate builtin shaders.
BUG=angleproject:2691

Change-Id: Iafb1b4828fa0d54974bfb9d11a436ccaa910b942
Reviewed-on: https://chromium-review.googlesource.com/1127356
Reviewed-by: Jamie Madill <[email protected]>
2018-07-05 18:54:17 +00:00
Jamie Madill a72f400c5f run_code_generation: Compare hashes instead of mtime.
Using mtime is fundamentally flawed when working with git. Replace
these flaky checks with hash comparisons. The hashes are stored in an
autogenerated json file that will be stored in the repository.

This makes the run_code_generation script robust against any and all
input changes. It also removes the need to track script outputs as
dependencies.

Bug: angleproject:2697
Change-Id: I60f2a87a8680b1f775ad678b05112f5b16c7dde7
Reviewed-on: https://chromium-review.googlesource.com/1120159
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-06-29 21:30:39 +00:00
jchen10 82af620e05 ParallelCompile: Add entry points.
Add the extension text, entry points and validations.

BUG=chromium:849576
TEST=angle_end2end_tests

Change-Id: I4c06ee30e4f4fe9bb1c1fecada747b9c78fed0ea
Reviewed-on: https://chromium-review.googlesource.com/1103789
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jie A Chen <[email protected]>
2018-06-27 02:07:17 +00:00
jchen10 16f391d445 ParallelCompile: Update gl.xml
Updated from https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/master/xml/gl.xml.

BUG=chromium:849576

Change-Id: I92520d53844f7fff7e68ca49207151d4fa69c79e
Reviewed-on: https://chromium-review.googlesource.com/1111469
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-06-22 14:18:03 +00:00
Lingfeng Yang 9c4c0926ac Reland "GLES1: Point rasterization (partial implementation)"
This is a reland of 4004ae0e03

Fix: Put the missing early-out in ValidatePointParameterCommon

Original change's description:
> GLES1: Point rasterization (partial implementation)
>
> - Not included: Smooth points
>
> - GL_OES_point_sprite
> - Update test expectations. Note: due to different random sampling,
> edge cases were hit in UserClip. Disabling that test for now.
>
> BUG=angleproject:2306
>
> Change-Id: If8367bc3321804b3299d3bc381d6a8e236754baa
> Reviewed-on: https://chromium-review.googlesource.com/1101910
> Reviewed-by: Corentin Wallez <[email protected]>
> Commit-Queue: Lingfeng Yang <[email protected]>

Bug: angleproject:2306
Change-Id: Id8e71352a77ff0ce71cb604965effbfb8aca613e
Reviewed-on: https://chromium-review.googlesource.com/1108458
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Lingfeng Yang <[email protected]>
2018-06-20 19:42:32 +00:00
Frank Henigman a58d69e90b Revert "GLES1: Point rasterization (partial implementation)"
This reverts commit 4004ae0e03.

Crash in PointParameterTest.NegativeEnum/ES1_OPENGL.
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac%20FYI%20GPU%20ASAN%20Release/1178
angle_end2end_tests on Intel GPU on Mac on Mac-10.12.6 
angle_end2end_tests on ATI GPU on Mac Retina on Mac-10.12.6

Original change's description:
> GLES1: Point rasterization (partial implementation)
> 
> - Not included: Smooth points
> 
> - GL_OES_point_sprite
> - Update test expectations. Note: due to different random sampling,
> edge cases were hit in UserClip. Disabling that test for now.
> 
> BUG=angleproject:2306
> 
> Change-Id: If8367bc3321804b3299d3bc381d6a8e236754baa
> Reviewed-on: https://chromium-review.googlesource.com/1101910
> Reviewed-by: Corentin Wallez <[email protected]>
> Commit-Queue: Lingfeng Yang <[email protected]>

[email protected],[email protected],[email protected],[email protected]

Change-Id: I776ce0506d349382b3af035c962aa2c3f6826b99
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2306
Bug: angleproject:2680
Reviewed-on: https://chromium-review.googlesource.com/1108457
Reviewed-by: Frank Henigman <[email protected]>
Reviewed-by: Lingfeng Yang <[email protected]>
Commit-Queue: Frank Henigman <[email protected]>
2018-06-20 18:12:00 +00:00
Lingfeng Yang 4004ae0e03 GLES1: Point rasterization (partial implementation)
- Not included: Smooth points

- GL_OES_point_sprite
- Update test expectations. Note: due to different random sampling,
edge cases were hit in UserClip. Disabling that test for now.

BUG=angleproject:2306

Change-Id: If8367bc3321804b3299d3bc381d6a8e236754baa
Reviewed-on: https://chromium-review.googlesource.com/1101910
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Lingfeng Yang <[email protected]>
2018-06-19 21:26:41 +00:00
Frank Henigman 388f991ce8 Vulkan: fix third_party path.
run_code_generation.py stopped working, likely as a result of the big Vulkan repo reorganization.
I fixed a path, regenerated everything (by temporarily hacking the script so it thought everything
was dirty), and nothing changed except one comment.

BUG=angleproject:2558

Change-Id: I5ac4c040ac1ec207098172303cc2f2507cccdecb
Reviewed-on: https://chromium-review.googlesource.com/1103281
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tobin Ehlis <[email protected]>
2018-06-18 19:31:17 +00:00
Lingfeng Yang 74be296b0c GLES1: Texture environments setup
- Revise entry point definitions to use packed enums

BUG=angleproject:2306

Change-Id: I06ad95f475d1dbaf07ec24ff2544503c4a44e826
Reviewed-on: https://chromium-review.googlesource.com/1090996
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Lingfeng Yang <[email protected]>
2018-06-07 18:36:35 +00:00
Lingfeng Yang a0cfa873bc GLES1: Shade model API
+ add sample

BUG=angleproject:2306

Change-Id: Ie0c391618ec2b771cc99b96db02b9008a86272b9
Reviewed-on: https://chromium-review.googlesource.com/1079992
Commit-Queue: Lingfeng Yang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-06-01 00:21:59 +00:00
Lingfeng Yang d0febe7aa2 Reland "GLES1: Entry points for lighting and materials"
This is a reland of 4a09c1a245

Entry points have been autogenerated again.

Original change's description:
> GLES1: Entry points for lighting and materials
>
> - glLight*/glMaterial and their queries
> - Use new packed enums in these entry points, except for lightmodel
> which stays GLenum to be consistent with other generic glGet's
> - State.cpp: New glGet* queries related to light model and
> light/normal rescale enablement
> - GLES1State.cpp: Functions to get/set lighting/material state
> - Validation for lighting/materials
>
> + Add a few convenience methods to random_utils for sampling
> non-negative floats and a sampler for random booleans
>
> BUG=angleproject:2306
>
> Change-Id: If7ba0c0a0dc75f88fbaa986b904f1ea96ee6512e
> Reviewed-on: https://chromium-review.googlesource.com/1065502
> Commit-Queue: Lingfeng Yang <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

Bug: angleproject:2306
Change-Id: I434273acd5200dd9f4925e239a032cc8db31a434
Reviewed-on: https://chromium-review.googlesource.com/1072849
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Lingfeng Yang <[email protected]>
2018-05-25 17:07:04 +00:00
Jiawei Shao 5f9482f4c5 ES31: Implement FramebufferTextureEXT entry point
This patch adds the entry point and related validation for
FramebufferTextureEXT defined in OpenGL ES 3.1 extension
EXT_geometry_shader.

BUG=angleproject:1941
TEST=angle_end2end_tests

Change-Id: Id6804e0b3971f52273562ce1a325d8377926a558
Reviewed-on: https://chromium-review.googlesource.com/1069842
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-05-25 13:58:04 +00:00
Jamie Madill 493f95710e Add PrimitiveMode packed GLenum.
Bug: angleproject:2574
Change-Id: I3d7bd7ca0d69a364a611dc04799ea34906fc4a6c
Reviewed-on: https://chromium-review.googlesource.com/1067114
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-05-25 00:48:54 +00:00
Brandon Jones 795ab71993 Use os.path.join instead of slashes
Minor change to replace some forward slashes in a file path with
os.path.join to ensure cross platform compatibility.

Bug: angleproject:1395
Change-Id: Ib6b64a9f0b16ef69c9f973a682c329c157ee5622
Reviewed-on: https://chromium-review.googlesource.com/1072867
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-05-24 23:14:12 +00:00
Jamie Madill d4703d5058 Move packed enum code to common/
This makes it accessible in the utilities files.

Bug: angleproject:2574
Bug: angleproject:2169
Change-Id: I0fdd34b4233e72b7534cb2b09f451539c1a394cd
Reviewed-on: https://chromium-review.googlesource.com/1067110
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2018-05-24 22:49:25 +00:00
Jamie Madill 1c597eea31 Fix run_code_generation for huge diffs.
This uses the --full argument to work around max path limitations
on Windows. Also includes a couple minor changes for generators
to generate already-formatted code.

Bug: angleproject:2578
Change-Id: I1e400b02e828bfdca21cacb73c649f41226bef55
Reviewed-on: https://chromium-review.googlesource.com/1072161
Reviewed-by: Lingfeng Yang <[email protected]>
Reviewed-by: Luc Ferron <[email protected]>
Reviewed-by: Brandon1 Jones <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-05-24 22:03:19 +00:00
Brandon Jones ba16270867 Fix entry point generation on non-Windows
In "Implement EGL_ANGLE_explicit_context", backslashes were introduced in
a file path, which broke generation on non-Windows machines. This fixes
the issue.

Bug:angleproject:1395
Change-Id: I188c42c2a92afec37d7cb7dac5bffd7e855a0d2b
Reviewed-on: https://chromium-review.googlesource.com/1072509
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-05-24 21:02:09 +00:00
Lingfeng Yang 668e507f99 Revert "GLES1: Entry points for lighting and materials"
This reverts commit 4a09c1a245.

Reason for revert: Seems to break the build

Original change's description:
> GLES1: Entry points for lighting and materials
> 
> - glLight*/glMaterial and their queries
> - Use new packed enums in these entry points, except for lightmodel
> which stays GLenum to be consistent with other generic glGet's
> - State.cpp: New glGet* queries related to light model and
> light/normal rescale enablement
> - GLES1State.cpp: Functions to get/set lighting/material state
> - Validation for lighting/materials
> 
> + Add a few convenience methods to random_utils for sampling
> non-negative floats and a sampler for random booleans
> 
> BUG=angleproject:2306
> 
> Change-Id: If7ba0c0a0dc75f88fbaa986b904f1ea96ee6512e
> Reviewed-on: https://chromium-review.googlesource.com/1065502
> Commit-Queue: Lingfeng Yang <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

[email protected],[email protected],[email protected],[email protected]

Change-Id: Ifabd708ded87c7484ad6d466508e2c2d6ea2557c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2306
Reviewed-on: https://chromium-review.googlesource.com/1071828
Reviewed-by: Lingfeng Yang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-05-24 17:40:40 +00:00
Lingfeng Yang 4a09c1a245 GLES1: Entry points for lighting and materials
- glLight*/glMaterial and their queries
- Use new packed enums in these entry points, except for lightmodel
which stays GLenum to be consistent with other generic glGet's
- State.cpp: New glGet* queries related to light model and
light/normal rescale enablement
- GLES1State.cpp: Functions to get/set lighting/material state
- Validation for lighting/materials

+ Add a few convenience methods to random_utils for sampling
non-negative floats and a sampler for random booleans

BUG=angleproject:2306

Change-Id: If7ba0c0a0dc75f88fbaa986b904f1ea96ee6512e
Reviewed-on: https://chromium-review.googlesource.com/1065502
Commit-Queue: Lingfeng Yang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-05-24 17:04:40 +00:00
Brandon Jones 2b0cdcc1b4 Implement EGL_ANGLE_explicit_context
Implementation of EGL_ANGLE_explicit_context. Includes new libGLESv2 entry
points and exports, libANGLE entry points, extension declarations for
eglGetProcAddress, and unit tests. Autogeneration scripts have been
modified to produce entry points, exports, eglGetProcAddress function
table, extension function pointers, and function declarations.

Bug:angleproject:1395
Change-Id: I1b79c6069bbed05beb4700a32139a64ddc465c4c
Reviewed-on: https://chromium-review.googlesource.com/1039865
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2018-05-24 16:39:29 +00:00
Brandon Jones 41e59f55a4 Autogenerate libGLESv2.cpp and .def
Add generation of libGLESv2.cpp and libGLESv2.def to generate_entry_points.py

Bug: angleproject:2476
Change-Id: I86c7fb31f73ccbbbc32b28acca179b11527dff9e
Reviewed-on: https://chromium-review.googlesource.com/1040647
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-05-04 03:23:49 +00:00
Corentin Wallez ad3ae90a00 Use packed enums for QueryType.
BUG=angleproject:2169

Change-Id: I129a9d8e295859daa071a298dab9fe1895315cc0
Reviewed-on: https://chromium-review.googlesource.com/957318
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2018-05-02 18:33:46 +00:00
Jamie Madill d47044ad53 Vulkan: Add framework for internal shaders.
Vulkan intenal shaders are stored in a ShaderLibrary, and this is
owned by the RendererVk. This way the shaders are reused between all
the different Contexts. They are initialized lazily to keep init time
low. They also have an associated Serial (called a ProgramSerial) so
they can be identified in a PipelineDesc (used by the Pipeline cache).

We use a python script to build and invoke the glslang validator, that
also produces SPIR-V binary code snippets. These snippets are gathered
into an auto-generated file that is exposed via an auto-generated
header file. The InternalShaderID enum class gives access to the
internal shaders that are shared through the Vulkan back-end.

This also adds simple clear shaders to be used in masked color clears.
The patch doesn't add any functionality but it is split off from the
color clear functionality to keep the code size down.

Bug: angleproject:2339
Bug: angleproject:2455
Change-Id: Ie83043eda217c9f013817b198c92a3b7ba0878b4
Reviewed-on: https://chromium-review.googlesource.com/1031372
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-05-01 20:39:47 +00:00
Jamie Madill 0ade8e88d8 Use time tolerance in run_code_generation check.
The mtime values I was seeing on my file system were sometimes
floating point numbers that were very very close but not exactly
the same. This might be due to numerical errors. Increasing the
tolerance to something still very small, precision is less than
a second. It will lead to fewer rebuilds of non-dirty files.

Bug: angleproject:2455
Change-Id: I95dc3214ee91af7a70a20cc625405e0e2bc18698
Reviewed-on: https://chromium-review.googlesource.com/1032855
Reviewed-by: Luc Ferron <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-04-30 14:55:45 +00:00
Geoff Lang 8ceea819c6 Refactor packed enum generation to support EGL enums.
Convert the very simple EGL texture type enum.

BUG=angleproject:1618

Change-Id: Ieea382a282a8f2544f2982627e8445e6e5cea826
Reviewed-on: https://chromium-review.googlesource.com/1019386
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-04-20 17:58:27 +00:00
Lingfeng Yang 010744365b GLES1: gl(Enable|Disable)ClientState
+ Introduce the GL_OES_point_size_array extension for point size array
support.

BUG=angleproject:2306

Change-Id: Ib1a60b7dcd0497eb807f0d3c80bc95b4748d9a96
Reviewed-on: https://chromium-review.googlesource.com/1014282
Commit-Queue: Lingfeng Yang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2018-04-17 15:15:57 +00:00
Courtney Goeltzenleuchter ed8d5ec733 Add json build file generation
gen_angle_gn_info_json.py can be used to generate a json description
of the build for given targets. This information can then be used
to generate build files for other tool chains (e.g. Android blueprint)

Bug: angleproject:2418
Change-Id: Ief8f43e30ae1f469e3fcfa795306675e29a90a2f
Reviewed-on: https://chromium-review.googlesource.com/967225
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2018-04-12 22:19:56 +00:00
Brandon Jones 416aaf95d4 Autogenerate ANGLE extension entry points
Modify autogeneration script to pull data from gl_ext.xml and generate
entry_points_gles_2_0_ext_autogen.cpp/h as a replacement for
entry_points_gles_2_0_ext.cpp/h

Bug:angleproject:2263
Bug:angleproject:1309
Change-Id: Ie21079f8ec5f85c657b891f6d6d59306a4c3b5fe
Reviewed-on: https://chromium-review.googlesource.com/1005409
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-04-12 17:22:07 +00:00
Olli Etuaho 5fec7ab262 Identify functions by unique id in BuiltInFunctionEmulator
Now that unique ids of all builtins are compile-time constants, we can
use them to look up functions in BuiltInFunctionEmulator. This is
simpler than using a custom struct with the name and parameters for
identifying functions.

This requires that we store a reference to a TFunction in those
TIntermUnary nodes that were created based on a function.

This decreases shader_translator binary size by about 6 KB on Windows.

BUG=angleproject:2267
BUG=chromium:823856
TEST=angle_unittests

Change-Id: Idd5a00c772c6f26dd36fdbbfbe161d22ab27c2fe
Reviewed-on: https://chromium-review.googlesource.com/995372
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-04-05 14:14:47 +00:00
Lingfeng Yang 00af463e03 GLES1: Add MatrixType packed enum to entry points
(It's not called MatrixMode because that collides with the MatrixMode
entry point name)

BUG=angleproject:2306

Change-Id: I9a192701f6248f1e7d4f202c7d1ddfcdbe1b0089
Reviewed-on: https://chromium-review.googlesource.com/990585
Commit-Queue: Lingfeng Yang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2018-04-04 20:11:13 +00:00
Olli Etuaho 89398b6534 Avoid mangled name comparisons of 3-parameter functions
The hash values used for looking up built-ins now encode whether the
mangled name contains arrays, structs or interface blocks in its
parameters list. This is written in the most significant bit of the
hash value.

We check this bit at the start of built-in lookup and if the bit is
set we exit early. After that we know that the lookup name doesn't
contain array, struct or interface block parameters.

When we find a hash that matches a hash of a built-in function, we now
know 3 things:
1) the length of the mangled name matches
2) the open parentheses in the mangled name matches
3) the lookup doesn't contain array, struct or block parameters.

Additionally, we have an if statement checking whether the function
name matches. Collisions are only possible with functions that
1) have the same name
2) have the same number of parameters

With these preconditions we can check beforehand whether collisions
are possible for 3-parameter functions. If there are no collisions, we
don't need to compare the full mangled name. This is similar to what
was already being done with functions that had 0 to 2 parameters.

This reduces shader_translator binary size by around 4 KB on Windows.

Besides increased complexity, the tradeoff is that an exhaustive
search of hash values for possible 3-parameter combinations is costly,
so the gen_builtin_functions.py code generation script now takes
around one minute to run on a high-end workstation. Due to this, the
script now exits early if it detects it has already been run with the
same inputs based on a hash value stored in
builtin_symbols_hash_autogen.txt.

BUG=angleproject:2267
BUG=chromium:823856
TEST=angle_unittests

Change-Id: I3ff8c6eb85b90d3c4971ac8d73ee171a07a7e55f
Reviewed-on: https://chromium-review.googlesource.com/973372
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-04-03 17:35:57 +00:00
Lingfeng Yang 13b708f2ca GLES1: glAlphaFunc
BUG=angleproject:2306

Change-Id: I0bf229d3ab8a4a1217c12b434dcd8fa67d7cbadc
Reviewed-on: https://chromium-review.googlesource.com/973897
Commit-Queue: Lingfeng Yang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-03-27 16:45:28 +00:00
Jiawei Shao 385b3e03cc Use packed enums on shader types in ANGLE renderer
This patch uses a packed internal enum ShaderType everywhere we
need a shader type instead of the GLenum value of the shader type.

This patch also uses program::getAttachedShader(type) everywhere
we need to get gl::Shader from a program in ANGLE.

BUG=angleproject:2169
Change-Id: I28a7fa1cfe35622c57a486932911110688eaadec
Reviewed-on: https://chromium-review.googlesource.com/972844
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2018-03-27 13:15:13 +00:00
Olli Etuaho c26214de3f Move AST utilities to a subdirectory
Move AST related utilities to compiler/translator/tree_util.

BUG=angleproject:2409
TEST=angle_unittests

Change-Id: I7567c2f6f2710292029263257c7ac26e2a144ac8
Reviewed-on: https://chromium-review.googlesource.com/966032
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-03-22 12:06:15 +00:00
Lingfeng Yang a0648780be GLES1: Revise entry points
- Move the entry points common to GLES1/2 to GLES2 since GLES2 is the
primary use case and we want to isolate the GLES1-only bits.
- Update entry points with all the wanted extensions for Android.
- Auto-generate GLES1-specific entry points and use them as a macro in
Context.h.
- Move all GLES1-specific renderer implementations to ContextGLES1.cpp

+ Fix getting pointer params in generate_entry_points.py

BUG=angleproject:2306

Change-Id: If32bfd2b63657acecaec6adb10cabf39f06c4832
Reviewed-on: https://chromium-review.googlesource.com/959630
Reviewed-by: Lingfeng Yang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Lingfeng Yang <[email protected]>
2018-03-20 20:58:29 +00:00
Olli Etuaho b391ec4083 Generate code for looking up built-ins
Instead of storing built-ins in a std::unordered_map, we now generate
a series of switch statements using the hash value of the look-up
string. This works similarly to earlier implementation of looking up
unmangled built-ins.

Those built-ins that need to be initialized at run-time are stored as
member variables of TSymbolTable.

This increases compiler init performance significantly, as well as
increasing compiler perf test scores around 1-2%. Binary size is
larger than before though.

BUG=angleproject:2267
TEST=angle_unittests

Change-Id: If1dcd36f0d2b30c2ed315cdcf6e831ae9fe70c94
Reviewed-on: https://chromium-review.googlesource.com/960031
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-03-20 09:59:54 +00:00
Olli Etuaho 2bfe9f6b93 Use function id to group functions in ParseContext
This way we can do numeric comparisons instead of string comparisons.

The effect on compiler perf test scores is fairly marginal, but
this reduces binary size by a few kilobytes, and there may be a larger
effect on shaders calling a lot of texture functions.

BUG=angleproject:2267
TEST=angle_unittests

Change-Id: I077db97b16b16b70b7e18ee037e06d7450d08dc9
Reviewed-on: https://chromium-review.googlesource.com/947952
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-03-14 08:32:15 +00:00
Luc Ferron 4ea3b4505a run_code_generation.py: Add gen_load_functions_table.py to the list
Bug:angleproject:2358

Change-Id: I93bdbbe65ac8109a5a506d88202715c51918613b
Reviewed-on: https://chromium-review.googlesource.com/960574
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2018-03-13 16:57:27 +00:00
Olli Etuaho 391bda23b5 Generate code for initializing built-in variables
gen_builtin_symbols.py now generates code for initializing built-in
variable symbols as well. Some of the variable symbols are static, but
some of them also get initialized dynamically based on values in
ShBuiltInResources.

The static symbols have get functions in a header file so they can be
referenced from AST traversers as well without doing a lookup.

BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests

Change-Id: Ida7f3aeb06d2bce0f737f1483b1bd5833aeddd2e
Reviewed-on: https://chromium-review.googlesource.com/911768
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-03-12 08:02:05 +00:00
Olli Etuaho 7618eaf9ad Fix incorrect path in run_code_generation.py
Adding missing "src".

BUG=angleproject:2267
TEST=python scripts/run_code_generation.py

Change-Id: I89d981c8f09e6d0839d0b796a2ea14a8466f98a7
Reviewed-on: https://chromium-review.googlesource.com/952925
Reviewed-by: Olli Etuaho <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2018-03-07 10:06:49 +00:00
Olli Etuaho 065aa863f7 Generate code for unmangled name lookup
Instead of using an std::map at each symbol table level, use the
gen_builtin_symbols.py script to build a function to query unmangled
names.

BUG=angleproject:2267
TEST=angle_unittests

Change-Id: I4f1cf1df1f50fe9d909f3249150ee002ee6efb61
Reviewed-on: https://chromium-review.googlesource.com/931885
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2018-03-07 08:39:29 +00:00