|
5a7356ae
|
2020-01-16T23:22:31
|
|
Add support for non-float mix
The non-float variations of the mix builtin were conditioned to desktop
GLSL, but they are present in ESSL 3.1+. This change also implements
constant folding of these builtins as exercised by dEQP.
Bug: angleproject:4300
Change-Id: Iec34de4cf370e00d67fd605148cd7848f9e122f8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2006809
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
|
|
beb33691
|
2019-12-20T16:15:20
|
|
Vulkan: EXT_gpu_shader5: Fix textureGatherOffsets builtin
This function is the only builtin with arrays as parameter. A new
constexpr constructor is added to TType to support this, and
gen_builtin_symbols is changed to emit the correct type for offsets
parameter of this function.
Bug: angleproject:3569
Change-Id: I55af58b43f24cd605c622ee685b359535e11ef85
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1975431
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
4b80fbc8
|
2019-12-18T23:40:15
|
|
Fix textureGatherOffsets classification
sampler2DRect was placed under ESSL while sampler2DArrayShadow was
placed under desktop GLSL. They are swapped.
Bug: angleproject:3569
Change-Id: Ibf39868d4cd702d9d1da7fc286171bb70b80d6df
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1975430
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
17b3c2f3
|
2019-10-14T14:13:59
|
|
Implement SamplerVideoWEBGL for WEBGL_video_texture extension on desktop
WEBGL_video_texture is an extension that will improve uploading video frame to WebGL performance.
(https://www.khronos.org/registry/webgl/extensions/proposals/WEBGL_video_texture/)
This extension introduced a new texture type TEXTURE_VIDEO_IMAGE_WEBGL and a new sampler type
samplerVideoWEBGL to sample it.
In chromium implementation, TEXTURE_VIDEO_IMAGE_WEBGL maps to different native texture type
based on platform. On desktop, it maps to GL_TEXTURE2D(Currently supported). On Android, it
should map to GL_TEXTURE_EXTERNAL(TODO). SamplerVideoWEBGL needs to be mapped to sampler2D or
samplerExternalOES according to TEXTURE_VIDEO_IMAGE_WEBGL implementation.
This patch implements samplerVideoWEBGL in Angle to support WEBGL_video_texture on desktop. In
this case, samplerVideoWEBGL should map to sampler2D.
Bug: chromium:776222, angleproject:3889
Change-Id: Idb0a5fcde37ca75ccc1181226b91f257212e7500
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866274
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
19868b7e
|
2019-12-13T14:29:57
|
|
Restructure textureGatherOffset* builtin declarations
This is in preparation of textureGatherOffsets support.
Bug: angleproject:3569
Change-Id: I4ce5a1e102790181c8f843735961b9c249a69221
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965720
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
9af3e137
|
2019-12-05T15:35:33
|
|
Vulkan: EXT_gpu_shader5 support: fma
Add the fma() builtin function to ESSL.
Bug: angleproject:3569
Change-Id: Ic8419b4c117ecdd8b47aa733bf7aff9ee7579bbf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954484
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
240befe5
|
2019-11-15T14:40:31
|
|
Add support for gl_HelperInvocation
Added HelperInvocation to builtin_variables.json, regenerate the codegen
portions of compiler, and plumb support for HelperInvocation through the
rest of the compiler.
Skipping some fails on Android and Swiftshader for this initial change and
will debug/fix those issues in a follow-on.
Bug: angleproject:4110
Change-Id: I781a2782ace84200bc615a2cc26b908a62e2aa26
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1922061
Commit-Queue: Tobin Ehlis <tobine@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
c37d2370
|
2019-09-19T18:54:40
|
|
Reland "Refactor built-in symbol table."
This is a reland of 59d982c0dcad580ccbf4e29f32ffa3ea9a280122
Original change's description:
> Refactor built-in symbol table.
>
> In preparation for reducing binary size. Shortend a bunch of strings
> and symbol prefixes so the autogen file will be more compact.
>
> Bug: chromium:998535
> Change-Id: If1bedaaacc06dce9678d432055ffa0c9215a8dbd
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814724
> Reviewed-by: Tim Van Patten <timvp@google.com>
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Bug: chromium:998535
Change-Id: Iebc5b1b5e1a084257fba3c50026cc62df5a879b3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1817499
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
|
|
f585c2fb
|
2019-09-21T02:12:37
|
|
Revert "Refactor built-in symbol table."
This reverts commit 59d982c0dcad580ccbf4e29f32ffa3ea9a280122.
Reason for revert: crbug.com/1006501
Original change's description:
> Refactor built-in symbol table.
>
> In preparation for reducing binary size. Shortend a bunch of strings
> and symbol prefixes so the autogen file will be more compact.
>
> Bug: chromium:998535
> Change-Id: If1bedaaacc06dce9678d432055ffa0c9215a8dbd
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814724
> Reviewed-by: Tim Van Patten <timvp@google.com>
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
TBR=timvp@google.com,jonahr@google.com,jmadill@chromium.org
Change-Id: Ie540da8ea4429e075a3284183e5a004cbcf1307b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:998535,chromium:1006501
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1817497
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
|
|
59d982c0
|
2019-09-19T18:54:40
|
|
Refactor built-in symbol table.
In preparation for reducing binary size. Shortend a bunch of strings
and symbol prefixes so the autogen file will be more compact.
Bug: chromium:998535
Change-Id: If1bedaaacc06dce9678d432055ffa0c9215a8dbd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814724
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
cd31f286
|
2019-06-25T14:22:41
|
|
Implement Draw base vertex and base instance functions
This patch implements functionality of glDrawArraysInstancedBaseInstanceANGLE,
glDrawElementsInstancedBaseVertexBaseInstanceANGLE,
glMultiDrawArraysInstancedBaseInstanceANGLE,
and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE
Workaround for OpenGL driver on Mac:
gl_VertexID on Mac with AMD GPU doesn't include baseVertex value.
So replace gl_VertexID with (gl_VertexID + angle_BaseVertex) if any.
Workaround for Vulkan GLSL:
gl_InstanceIndex on Vulkan includes baseInstance. So replace
gl_InstanceIndex with (gl_InstanceIndex - angle_BaseInstance) when
angle_BaseInstance is declared.
Bug: chromium:891861, angleproject:3402
Change-Id: Ia1d94b5d4d7da7e635468c05c962c4f7eb1b1919
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750126
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
56db3789
|
2019-08-01T17:09:53
|
|
Use flat arrays instead of switches for function lookups
Current implementation of built in function lookup uses
autogenerated switch statements. Instead, use the perfect
hash mapping to have the lookup use arrays instead. This
will improve runtime performance.
Bug: angleproject:3805
Change-Id: I6d0ba62d79abd53a7fe818fe675282800781f256
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1756883
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
05744c23
|
2019-08-21T16:21:30
|
|
Change gl_DrawID from level = ESSL1+ESSL3 to COMMON
Built in variable gl_DrawID is exposed to ESSL1 with
a suffix, when the variable is the exact same. No need
to do this.
Bug: angleproject:3805
Change-Id: I63c71791bb6a0e8aa7b644171a3f5a81099eddc0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762359
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Clemen Deng <clemendeng@google.com>
|
|
396527c9
|
2019-08-20T13:48:38
|
|
Autogenerated kFunction* variables detected as mutable constants
The android binary size is increased incorrectly because the autogen
kFunction* variables are detected as mutable constants. Rename them to
function* to workaround this.
Bug: angleproject:3823
Change-Id: Ia335d1ae97ce5276a0ff8b9e432b53181cc36680
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762494
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
|
|
486f381f
|
2019-07-18T15:47:31
|
|
Add desktop GL built-in functions to symbol table
Added GL built-in functions to symbol table autogeneration
Built-in lookup now checks against spec and returns GL
symbols when appropriate.
Bug: angleproject:3719
Change-Id: I74786150f6063b40e13aebcb2eb9ea35e4ecaa53
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1731550
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Clemen Deng <clemendeng@google.com>
|
|
e7970c3e
|
2019-08-07T14:43:17
|
|
BasicMangledName class
Need a class for basic mangled names since
with the addition of GLSL types the number
of basic types is > 52 (a-z, A-Z), so we need
more than one character to represent a type
Bug: angleproject:3719
Change-Id: I98beee9d42a016cb0c017f56ab82538c89212e33
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1742221
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
9031bdd9
|
2019-07-26T14:51:23
|
|
Use perfect-hash module in gen_builtin_symbols.py
The script currently takes ~4 minutes to run
Using this module instead of manually hashing
will improve runtime significantly
Bug: angleproject:3747
Change-Id: I7e2d2ef5bbfd136b0299d571e0acc11f334c80b5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1724667
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
cdab03aa
|
2019-06-18T17:24:54
|
|
Add flags to shader translator to emulate gl_BaseVertex and gl_BaseInstance
Adds support for translating gl_BaseVertex and gl_BaseInstance for implementation of
GL_ANGLE_base_vertex_base_instance.
They will only be available in WebGL 2. Since there's no gl_VertexID and
gl_InstanceID in WebGL 1. It won't be very useful to add them to WebGL
1.
Mostly follow pattern of gl_DrawID of GL_multi_draw
BUG=angleproject:3402,chromium:891861
Change-Id: Ifcd990c52d12f6814127b904e61a779b8d382e0c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1666361
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
4fbbdb15
|
2019-06-28T14:17:13
|
|
texture3D: Compiler changes for sampler3D
Bug: angleproject:3188
Change-Id: Iac1408f8b91c6a6610a63cef236205b7dcdbd2c4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1682781
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
|
|
c09ae15c
|
2019-02-01T14:16:32
|
|
Enable -Wextra-semi and -Wextra-semi-stmt.
This will prevent users from accidentally making semicolon errors in
the future.
Bug: chromium:926235
Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9
Reviewed-on: https://chromium-review.googlesource.com/c/1446493
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
153e0224
|
2018-12-07T13:31:31
|
|
Add gl_DrawID emulation for ESSL3 with ANGLE_multi_draw
Bug: chromium:890539
Change-Id: I3d9a9429608afb454f076013f3ed844e115c56cc
Reviewed-on: https://chromium-review.googlesource.com/c/1368784
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
|
|
7cf9cd24
|
2018-10-09T15:27:32
|
|
Add flags to shader translator to emulate gl_DrawID
Adds support for translating gl_DrawID for implementation of
GL_ANGLE_multi_draw.
Currently the change only supports and allows emulation of the
draw id using a uniform variable named `gl_DrawID`. This uniform is
mapped in the translated shader to a hashed name that does not
use the gl_ namespace
Bug: chromium:890539
Change-Id: I08a246ca911e88e733ccdf22f1ed69dcae948e05
Reviewed-on: https://chromium-review.googlesource.com/c/1271957
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
|
|
8ca60805
|
2018-08-23T14:10:02
|
|
Add 2D MS array sampler support to compiler
This also places textureSize(gsampler2DMS) correctly in the ESSL 3.10
builtins instead of ESSL 3.00 builtins.
BUG=angleproject:2775
TEST=angle_unittests
Change-Id: Ieb0f7a7424a5558a5569af6d4fcbcc9b12ec9840
Reviewed-on: https://chromium-review.googlesource.com/1186466
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
89398b65
|
2018-03-21T17:30:50
|
|
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 <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
3b678745
|
2018-03-21T12:59:19
|
|
Use a specialized hash function for mangled names
The hash values used for looking up built-ins now encode the string
length and the location of parentheses as six-bit values, so that we
don't need to check for these if the hash matches.
This decreases shader_translator binary size on Windows by around 10
KB.
BUG=angleproject:2267
BUG=chromium:823856
TEST=angle_unittests
Change-Id: If8c28e1c8851750633509ec6273f556e06e91cd1
Reviewed-on: https://chromium-review.googlesource.com/973243
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
e79d0f86
|
2018-03-19T11:55:14
|
|
Rely on hash to check for some mangled name matches
When we are looking up a function with only a few parameters, we can
optimize the lookup by relying on the information encoded in the hash
value. There's often only one list of parameters with the same
function name and mangled name length that results in a matching hash,
so we don't actually need to compare the full mangled name. We can
just compare
1) the hash value of the mangled name
2) the mangled name length
3) the function name
to make sure that the mangled name matches the mangled name of the
function.
This decreases the binary size since we don't need store as many
mangled names of built-in functions. Effect on symbol lookup speed is
marginal.
BUG=angleproject:2267
BUG=chromium:823856
TEST=angle_unittests
Change-Id: I3ef41d943209509d4e8e6ece14ebad7e2677abc6
Reviewed-on: https://chromium-review.googlesource.com/973242
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
115b2c4a
|
2018-03-15T17:46:29
|
|
Remove desktop GLSL builtins from symbol lookups
Desktop GLSL builtins can be accessed through functions in
BuiltIn_autogen.h. They don't need to be included in symbol table
lookups.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I8ba188a0d2584353e34159c2732c9e2bd420c168
Reviewed-on: https://chromium-review.googlesource.com/964447
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b391ec40
|
2018-03-12T17:04:59
|
|
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 <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
065aa863
|
2018-02-22T15:30:27
|
|
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 <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|