|
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>
|
|
a905cbcd
|
2019-09-19T23:05:39
|
|
Compact built-in symbol table.
Should reduce the binary size bloat from the perfect hashing. Local
testing on Windows shows a significant size reduction.
Bug: chromium:998535
Change-Id: I411cc5a917036d2239d15353d760f44e40faa26c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814725
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
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>
|
|
d7d42540
|
2019-08-21T15:22:49
|
|
Don't build symbol table for GLSL built-ins if on Android
The GLSL + ESSL autogenerated symbol table is too large for
android, and android also doesn't need desktop GL functionality
If on android, compile the ESSL only symbol table
Bug: chromium:996286
Change-Id: I14dfc7748dae389e78c35f82a390c67962665356
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1757372
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@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>
|
|
213ad6bd
|
2019-08-16T16:31:32
|
|
Get rid of gl_ViewID_OVR for ESSL1
Only use UInt gl_ViewID_OVR from ESSL3
OVR multiview should not be exposed in ESSL1
Bug: angleproject:3822
Change-Id: Ia9d6247e3a717b06db26f1d436e2b33336b12a7d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1759143
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Clemen Deng <clemendeng@google.com>
|
|
bcae3828
|
2019-08-19T09:37:18
|
|
Auto-generated variables detected as mutable constants
Need to rename kVar* variables to just var
Bug: angleproject:3823
Change-Id: I34b9f4eec4ee7829d47dcac2f06f1acc6b35f867
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1758601
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Clemen Deng <clemendeng@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>
|
|
1d742ce8
|
2019-08-13T10:33:36
|
|
Deleted unnecessary built-in conditions
A few built-in variables are checking against overly complicated
extension conditions, deleting these will make the array lookup
easier to implement.
Also changed functionality to always enable GL_OVR_multiview
when GL_OVR_multiview2 is enabled
Bug: angleproject:3805
Change-Id: I10fc7db0fa8b496fbba8b2c27a7311ac3c24dbe4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1752082
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
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>
|
|
ebab670c
|
2019-04-19T14:36:45
|
|
Adding new extension GL_OVR_multiview
GL_OVR_multiview functions exactly the same as GL_OVR_multiview2.
All GL_OVR_multiview2 tests now also repeat the same test using GL_OVR_multiview
Bug: angleproject:3341
Change-Id: I7e5294fb6bbf7692535174a15da6a42e1b5fc4e2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575904
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
7d64c486
|
2019-03-12T14:27:40
|
|
GL_ANGLE_multiview has been renamed to GL_OVR_multiview2.
changes include:
1) GL_OVR_multiview to GL_OVR_multiview2 extension directive change
2) Removal of all references to side by side. We no longer support multiple views in a single 2DTexture. Only 2DTextureArray's are supported
3) WebGL 2 (ES3) is required for multiview
Bug: angleproject:3341
Change-Id: Ie0c1d21d7610f8feebdb2e4d01c6947f57e69328
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552023
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
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>
|
|
fefaba5b
|
2018-10-26T16:16:53
|
|
Regenerate hashes for the builtin symbol table.
BUG=chromium:890539
Change-Id: Ia5bdf652dc37a466560071b4fe2cdc7d89ff941f
Reviewed-on: https://chromium-review.googlesource.com/c/1302837
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Geoff Lang <geofflang@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>
|
|
64b7c4ff
|
2018-10-19T11:38:04
|
|
Use angle::Result in front-end (Part 3)
Handles the gl::Framebuffer class and its implementation.
Bug: angleproject:2491
Change-Id: I3b9c0609e9277264ccdb370596500562df3b7d15
Reviewed-on: https://chromium-review.googlesource.com/c/1280743
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
c4533eae
|
2018-09-19T15:23:29
|
|
Enable ANGLE_texture_multisample in glsl in es 3.0
Enable gsampler2dMS, texelFetch, textureSize in glslang in
es 3.0 if ANGLE_texture_multisample is supported.
Bug: angleproject:2275
TEST=SamplerMultisampleEXTTest.TextureMultisampleEXTEnabled
Change-Id: Ibfa367970db3ae790f3822e57eb50090843dc6db
Reviewed-on: https://chromium-review.googlesource.com/c/867521
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
|
|
f0d0408a
|
2018-08-28T16:02:13
|
|
Use OES_texture_storage_multisample_2d_array
There's an OES extension for multisample texture arrays,
OES_texture_storage_multisample_2d_array. Change references from
ANGLE_texture_multisample_array to the native extension in the shader
compiler.
ANGLE still needs to have robust behavior for out-of-range texel
fetches that's not found in the original extension, but this does not
need to be spelled out in the extension spec.
BUG=angleproject:2775
TEST=angle_unittests
Change-Id: Ie80ae767cc92ccaf7389af28789f45547f86978f
Reviewed-on: https://chromium-review.googlesource.com/1193266
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@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>
|
|
a6a7842f
|
2018-06-28T08:32:54
|
|
ES31: Support atomic functions on D3D11 - Part I
This patch is the first one of the implementation of atomic
functions in D3D11.
There are mainly two differences in the usage of GLSL and HLSL
atomic functions:
1. All GLSL atomic functions have return values, which all
represent the original value of the shared or ssbo variable;
while all HLSL atomic functions don't, and the original value
can be stored in the last parameter of the function call.
2. For HLSL atomic functions, the last parameter that stores the
original value is optional except for InterlockedExchange and
InterlockedCompareExchange. Missing original_value in the call
of InterlockedExchange and InterlockedCompareExchange results
in a compile error from HLSL compiler.
To handle these differences, we plan to implement the translation
in two steps:
1. Support direct translations from GLSL atomic functions to HLSL
ones.
Direct translation can only handle the following two situations:
(1) The sentence is a GLSL atomic function call without requesting
a return value and it is not atomicExchange or atomicCompSwap:
e.g.
GLSL: atomicAdd(mem, value);
-> HLSL: InterlockedAdd(mem, value);
(2) The sentence is a simple assignment expression: its right is
a GLSL atomic function call and its left is a declared variable.
e.g.
GLSL: oldValue = atomicAdd(mem, value);
-> HLSL: InterlockedAdd(mem, value, oldValue);
2. Support atomic functions in the situations that don't support
direct translations.
We will modify the intermediate tree to make direct translation work
on all these situations.
e.g.
atomicExchange(mem, value);
-> int oldValue;
oldValue = atomicExchange(mem, value);
int oldValue = atomicAdd(mem, value);
-> int oldValue;
oldValue = atomicAdd(mem, value);
return atomicAdd(mem, value);
-> int temp;
temp = atomicAdd(mem, value);
return temp;
for (i = 0; i < atomicAdd(mem, value); ++i)
-> int temp;
temp = atomicAdd(mem, value);
for (i = 0; i < temp; ++i)
{
...
temp = atomicAdd(mem, value);
}
int result = isTrue ? atomicAdd(mem, value) : 0;
-> int result;
if (isTrue)
{
result = atomicAdd(mem, value);
}
else
{
result = 0;
}
This patch completes Step 1 which mainly focus on the translation
from GLSL atomic functions to HLSL ones.
BUG=angleproject:2682
TEST=angle_end2end_tests
Change-Id: I3b655b6e286dad4fd97f255f7fe87521c94db30c
Reviewed-on: https://chromium-review.googlesource.com/1121835
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
4da0d315
|
2018-06-20T11:46:38
|
|
Vulkan: Handle embedded struct uniforms.
Also known as nameless structs. Uniform structs without a struct name
would not be parsed correctly. This fixes the bug by adding a tree
transformation. The transformation gives an internally scoped name to
the embedded struct.
Bug: angleproject:2665
Change-Id: I43e4dad7d9ad64a40e382066bb136e4f8f719797
Reviewed-on: https://chromium-review.googlesource.com/1101566
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
f5557acc
|
2018-06-15T09:46:58
|
|
translator: Store symbol type in TField.
This allows us to keep a separate symbol type for each field in a
struct. This can allow us to assign internal names to struct types.
It could also allow us to add internal fields to user defined stucts.
Bug: angleproject:2665
Change-Id: I6a129107d9db66c54b98b07684c3ead5801712ba
Reviewed-on: https://chromium-review.googlesource.com/1101565
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
5fec7ab2
|
2018-04-04T11:58:33
|
|
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 <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
4ba4a82b
|
2018-03-19T11:28:48
|
|
Only refer to built-in function mangled names in lookup
TFunction entries for built-ins don't need to store mangled names.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ia88e8bfa5357719c98d725dc3d00885dd59c9f59
Reviewed-on: https://chromium-review.googlesource.com/973241
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
8574357f
|
2018-03-19T14:45:53
|
|
Share parameter arrays more between built-in functions
The parameters of some built-ins are a subarray of the parameters of
another built-in. In this kind of case they can point to the same
parameters array, and just use a different parameter count. This
shaves a few kilobytes from the binary size.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Id166340b4bf5be966bf8c62ce6cd88e5409f647a
Reviewed-on: https://chromium-review.googlesource.com/968601
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@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>
|
|
d4bd963f
|
2018-03-08T16:32:44
|
|
Don't use TIntermSymbol nodes for function parameters
Parameter nodes are not needed - it's simpler to just create a
TVariable object for each parameter when the TFunction is initialized.
With this change we also store only one object per each parameter type
used in built-in functions, instead of one array of TConstParameter
entries for each unique parameter sequence.
This simplifies code and reduces binary size and compiler memory use.
Compiler perf does not seem to be significantly affected.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I2b82400dd594731074309f92a705e75135a4c82c
Reviewed-on: https://chromium-review.googlesource.com/955589
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
e600c0aa
|
2018-03-02T11:23:29
|
|
Use non-human-readable mangled names for types
The new mangled name format is as follows:
The first character is a hex digit from 0 to F that encodes vector or
matrix size. For scalars, structs etc. the character is 0.
Then, if it's a struct, the mangled name continues with "{s", followed
by mangled names of fields, and ends with "}".
If it's an interface block, the mangled name continues with "{i",
followed by mangled names of fields, and ends with "}".
If it's anything else, the second alphabetic character encodes the
basic type. Characters are assigned to basic types in the enumeration
order.
If it's an array, the mangled name has a suffix [array_size].
This saves a few kilobytes from the binary size. The effect on symbol
lookup speed seems mostly marginal.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I26e65dcb48c3478df9a719ffff9c15f2fd12e293
Reviewed-on: https://chromium-review.googlesource.com/945910
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
391bda23
|
2018-02-23T11:43:14
|
|
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 <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
24180607
|
2018-03-02T14:12:13
|
|
Allow rectangle textures to be sample with texture() in ESSL3
This makes them consistent with the other texture types. Also adds a
test for using texture(sampler2DRect, ...).
BUG=chromium:757974
BUG=angleproject:1650
Change-Id: Ie966da928ae0c83850da1e530e72c0d501909394
Reviewed-on: https://chromium-review.googlesource.com/946675
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: 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>
|
|
140152e7
|
2018-02-08T14:46:44
|
|
Statically allocate built-in function symbols
A script gen_builtin_symbols.py now generates code for initializing
built-in function symbols. The TFunction objects are initialized at
C++ compile time.
The source file used for the functions is in a format that's similar
to how functions are given out in the GLSL spec, so it is easy to
maintain.
The function symbols are still inserted to the symbol table levels
same as before. Getting rid of inserting the symbols at runtime is
intended to be done as follow-up.
This speeds up angle_unittests on Linux in release mode by a bit less
than half, and in debug mode by more than half.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I11c9de98c74d28e7e8cdf024516e2f6ee30ca33e
Reviewed-on: https://chromium-review.googlesource.com/924155
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|