|
472c74c6
|
2019-08-19T16:32:13
|
|
Translator: Allow tree validation in children of TCompiler
This is to be able to perform validation inside TranslatorVulkan, even
if it's through ASSERTs.
Additionally, every transformation is changed such that they do their
validation themselves. TIntermTraverser::updateTree() performs the
validation, which indirectly validates many of three tree
transformations. Some of the more ancient transformations that don't
use this function directly call TCompiler::validateAST.
Bug: angleproject:2733
Change-Id: Ie4af029d34e053c5ad1dc8c2c2568eecd625d344
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1761149
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
9d737966
|
2019-08-14T12:25:12
|
|
Standardize copyright notices to project style
For all "ANGLE Project" copyrights, standardize to the format specified
by the style guide. Changes:
- "Copyright (c)" and "Copyright(c)" changed to just "Copyright".
- Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1").
- Fixed a small number of files that had no copyright date using the
initial commit year from the version control history.
- Fixed one instance of copyright being "The ANGLE Project" rather than
"The ANGLE Project Authors"
These changes are applied both to the copyright of source file, and
where applicable to copyright statements that are generated by
templates.
BUG=angleproject:3811
Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
f92fc916
|
2019-07-15T22:39:23
|
|
Vulkan: Compute shader support
A DispatchHelper class is created as the equivalent of FramebufferHelper
as a command graph resource. There's currently a single dispatcher and
all dispatch calls are recorded on that. Context dirty bits are set up
in such a way that graphics and compute workloads are independently
handled, so that issuing a dispatch call wouldn't cause a framebuffer's
render pass to rebind resources.
Bug: angleproject:3562
Change-Id: Ib96db48297074d99b04324e44b067cfbfd43e333
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1688504
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
|
|
d9fa0744
|
2019-04-25T14:57:26
|
|
Emit OVR_multiview2 on ESSL/GLSL outputs.
Add ARB_shader_viewport_layer_array support to
SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER.
Bug: angleproject:3404
Change-Id: Ia89517d0cc92400ce47c9118e8c1abf8285aec41
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1585452
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
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>
|
|
b980c563
|
2018-11-27T11:34:27
|
|
Reformat all cpp and h files.
This applies git cl format --full to all ANGLE sources.
Bug: angleproject:2986
Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f
Reviewed-on: https://chromium-review.googlesource.com/c/1351367
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@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>
|
|
a07b4213
|
2018-03-22T16:13:13
|
|
Move AST transformations to a subdirectory
Move AST transformations to compiler/translator/tree_ops.
BUG=angleproject:2409
TEST=angle_unittests
Change-Id: I9c620e98707d22d005da6192fe7d1b4e8030aadd
Reviewed-on: https://chromium-review.googlesource.com/975550
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
68981eb5
|
2018-01-23T17:46:12
|
|
Track parameter qualifiers of functions in call nodes
We now add a reference to TFunction to all TIntermAggregate nodes
where it is possible, including built-in ops. We also make sure
that internal TFunctions added in traversers have correct parameter
qualifiers.
This makes TLValueTrackingTraverser much simpler. Instead of storing
traversed functions or looking up builtin functions from the symbol
table, determining which function parameters are out parameters can
now be done simply by looking it up from the function symbol
associated with the aggregate node.
Symbol instances are no longer deleted when a symbol table level goes
out of scope, and TFunction destructor no longer clears the
parameters. They're all either statically allocated or pool allocated,
so this does not result in leaks.
TEST=angle_unittests
BUG=angleproject:2267
Change-Id: I57e5570da5b5a69a98a8778da3c2dc82b6284738
Reviewed-on: https://chromium-review.googlesource.com/881324
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
b0accd45
|
2018-01-10T16:31:23
|
|
Flatten "#pragma STDGL invariant(all)" also for ESSL to ESSL translation
Adreno's driver in Android Oreo follows the spec to the letter,
and applies "#pragma STDGL invariant(all)" only to the outputs of
a fragment shader, causing InvariantAllBoth test to fail.
Since the wording of the spec doesn't match the intended usage of this
pragma, ANGLE should flatten it to workaround spec conformant drivers.
BUG=angleproject:1293
Change-Id: I9f8ad44adc3b958204b88805dba8c5b7964b3d9f
Reviewed-on: https://chromium-review.googlesource.com/860920
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
|
|
bd924af1
|
2017-11-16T15:28:04
|
|
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>
|
|
ebe13bb1
|
2017-12-11T13:32:44
|
|
Remove SH_TRANSLATE_VIEWID_OVR_TO_UNIFORM
Instanced multiview is fully implemented and performs much better than
broadcasting draw calls on the CPU. There's no need to maintain
translating ViewID_OVR to a uniform.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: If3a8fa573f37b7926c052aecfcd4271f266751dc
Reviewed-on: https://chromium-review.googlesource.com/819417
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
87c35883
|
2017-10-19T15:19:38
|
|
Prune no-op statements with a single traverser
We put pruning literal statements and pruning empty declarations in
the same traverser, as some of the required logic is the same. This
pruning of no-ops is always done as one of the first processing steps
after parsing, so further processing of the AST is simpler.
Since we now prune pure literals before removing no-op cases from the
end of switch statements, we also don't need any sort of special
handling for switch statements in pruning pure literals.
BUG=angleproject:2181
TEST=angle_unittests
Change-Id: I2d86efaeb80baab63ac3cc803f3fd9e7ec02908a
Reviewed-on: https://chromium-review.googlesource.com/727803
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
89a69a03
|
2017-10-23T12:20:45
|
|
Generate performance warnings in HLSL translation
Generate performance warnings for some code that undergoes heavy
emulation when translated to HLSL:
1. Dynamic indexing of vectors and matrices.
2. Non-empty fall-through cases in switch/case.
The warnings are generated only when code is translated to HLSL.
Generating them in the parsing stage would add too much maintenance
burden.
Improves switch statement fall-through handling in cases where an
empty fall-through case follows a non-empty one so that extra
performance warnings are not generated.
BUG=angleproject:1116
Change-Id: I7c85d78fe7c4f8e6042bda72ceaaf6e37dadfe6c
Reviewed-on: https://chromium-review.googlesource.com/732986
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
2a1e8f95
|
2017-07-14T11:49:36
|
|
Refer to GLSL extensions through TExtension enum
Extensions are now referred to by enum values instead of strings most
of the time. This gets rid of unnecessary copying of strings. The code
is easier to work with than before as typoing the extension enum names
will be caught by the compiler.
BUG=angleproject:2147
TEST=angle_unittests
Change-Id: Ifa61b9f86ef03211188fc23bc23a5ce4e4d8c390
Reviewed-on: https://chromium-review.googlesource.com/571002
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ec3a9cbb
|
2017-09-07T12:18:01
|
|
Only support GL_OVR_multiview extension variant
The WebGL spec proposal was changed so that only GL_OVR_multiview
extension name is supported, instead of having two variants
OVR_multiview and OVR_multiview2. We're only supporting the WebGL
version of the shader extension, so we drop compiler support for
GL_OVR_multiview2. Shader restrictions were also removed from the
WebGL spec, so no special validation for how ViewID_OVR gets used is
needed.
Tests that were testing for the shader restrictions are either removed
or changed from negative tests to positive tests.
BUG=angleproject:1669
TEST=angle_unittests
Change-Id: I83f92b879376d41b727b5aca419fd75fb6f53477
Reviewed-on: https://chromium-review.googlesource.com/654608
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
c634a637
|
2017-05-18T14:09:49
|
|
Remove webgl_ prefix from emulated function names
The prefix is unnecessary now that user-defined names are prefixed in
both GLSL and HLSL output. Removing the prefix makes compiler output
a bit simpler to read.
BUG=angleproject:2038
TEST=angle_unittests
Change-Id: I9ffc508f50d6146a2d85798875c88e2c385b83fe
Reviewed-on: https://chromium-review.googlesource.com/508730
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b5cc1198
|
2017-07-06T10:47:20
|
|
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>
|
|
a5e693af
|
2017-07-13T16:07:26
|
|
Make unique id counter a member of TSymbolTable
This makes unique id counting thread-safe.
BUG=angleproject:624
TEST=angle_unittests
Change-Id: Ie0f2c7e574470b39750d37d2181c790bc874b275
Reviewed-on: https://chromium-review.googlesource.com/570419
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
c39a19aa
|
2017-07-07T18:52:09
|
|
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
|
|
4dd06d5d
|
2017-07-05T12:41:06
|
|
Set proper symbol ids on temporary symbol nodes
Temporary symbols used to all have symbol id 0. Now they get assigned
unique symbol ids. This makes it possible to keep track of them
according to the symbol id instead of their name, paving way to more
robust AST handling in the future.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I292e2e483cc39173524fd30a30b48c4c808442e5
Reviewed-on: https://chromium-review.googlesource.com/559335
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
0cdf3683
|
2017-07-05T14:02:08
|
|
Do not propagate OVR_multiview extension directive
The patch fixes the bug of having the OVR_multiview extension directive
being outputted by the ESSL translator whenever the
SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW option is enabled. The
directive should not be outputted because the extension is emulated
through that option.
BUG=angleproject:2062
TEST=angle_unittests
Change-Id: I95d0a651ace6db42d496de08e774ec7ceca4c197
Reviewed-on: https://chromium-review.googlesource.com/558981
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
5df2b9d2
|
2017-05-18T12:15:28
|
|
Clean up AddDefaultReturnStatements
It doesn't need to use a traverser, since all function definitions can
be found simply by iterating over the children of the root node.
BUG=angleproject:2040
TEST=angle_end2end_tests
Change-Id: I380942f90a0e73152f296b98d1fb027762d913b0
Reviewed-on: https://chromium-review.googlesource.com/508689
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
e839078e
|
2017-04-06T14:34:43
|
|
compiler: Prune literal statements when outputting ESSL
The ESSL output doesn't have a default precision for floats, this causes
float literal statements to not have any precision defined, which is an
error. We fix this by removing literal statements as they are dead code
anyway.
BUG=angleproject:1967
Change-Id: I498f4f8495f854240ee8a2182415bf982c5166a4
Reviewed-on: https://chromium-review.googlesource.com/470268
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|
|
dfa75e87
|
2017-01-23T09:43:06
|
|
Add support for 4-parameter functions to BuiltInFunctionEmulator
New entry points are needed to support built-ins with more parameters.
Also, now that ops that are not function calls don't use the
TIntermAggregate class any more, it's easier to exclude nodes that are
not candidates for built-in emulation using a simple blacklist rather
than to use a whitelist.
Also includes function name style cleanup in BuiltInFunctionEmulator.
This will make it possible to add necessary emulation for built-ins
from ESSL 3.10.
BUG=angleproject:1730
TEST=angle_unittests
Change-Id: If267fc68f5cb9b2ee6703cbcbbe4d157da44a7e0
Reviewed-on: https://chromium-review.googlesource.com/431297
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
2f90a9b5
|
2017-01-10T12:27:56
|
|
Fix shader support of OVR_multiview
Fix up incorrect capitalization of gl_ViewID_OVR in a few places.
Also add extension macro test to compiler unit tests.
BUG=angleproject:1669
TEST=angle_unittests
Change-Id: Ia7fdd747ad08355cdc149db9e2e7911c2e673af5
Reviewed-on: https://chromium-review.googlesource.com/425851
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
09b04a2f
|
2016-12-15T13:30:26
|
|
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>
|
|
da9fb093
|
2016-12-09T17:32:29
|
|
Work around atan(y, x) bug on NVIDIA
atan(y, x) is not always returning expected results on NVIDIA OpenGL
drivers between versions 367 and 375. Work around this by emulating
atan(y, x) using the regular atan(x) function. A fix to the driver is
expected in a future release.
It is most convenient to implement the vector atan(y, x) functions by
using the scalar atan(y, x) function. Support for simple dependencies
between emulated functions is added to BuiltInFunctionEmulator. In the
current implementation one function is allowed to have at most one
other function as its dependency.
BUG=chromium:672380
TEST=angle_end2end_tests
Change-Id: I9eba8b0b7979c7c7eaed353b264932e41830beb1
Reviewed-on: https://chromium-review.googlesource.com/419016
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d7b1ab58
|
2016-12-12T14:42:19
|
|
Fix up translator style.
Using git cl format.
BUG=angleproject:650
Change-Id: I7d3f98d2b0dcfb0a8de6c35327db74e55c28d761
Reviewed-on: https://chromium-review.googlesource.com/419059
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
89dd8f37
|
2016-11-09T12:59:30
|
|
Remove invariant declaration in vertex shader for translation from ESSL 3.00 to GLSL <= 4.1
This is a follow-up patch of
https://chromium-review.googlesource.com/408569. This CL removes
invariant declaration in ESSL 3.00 vertex shader, such like:
"
out vec4 foo;
invariant foo;
"
This CL also adds the workarounds in libANGLE.
BUG=chromium:639760
TEST=webgl2_conformance
Change-Id: I568ab51a9a2f5da10d1aff0b63aae8805097e081
Reviewed-on: https://chromium-review.googlesource.com/409157
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
acb4b81a
|
2016-11-07T13:50:29
|
|
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>
|
|
705a9194
|
2016-08-29T10:05:27
|
|
Reland "Remove invariant qualifier for input in fragment shader"
This relands https://chromium-review.googlesource.com/#/c/400005/.
ESSL and GLSL are not consistent on invariant matching in vertex shader
and fragment shader. See the following rules:
ESSL 1.00 - input and output must match
ESSL 3.00 - only output, inputs cannot be declared as invariant.
GLSL 1.10.59 - does not exist
GLSL 1.20.8 - input and output must match
GLSL 1.30.10 - input and output must match
GLSL 1.40.8 - input and output must match
GLSL 1.50.11 - input and output must match
GLSL 3.30.6 - input and output must match
GLSL 4.00.9 - input and output must match
GLSL 4.10.6 - input and output must match
GLSL 4.20.11 - input can omit invariant
GLSL 4.30.8 - input can omit invariant
GLSL 4.40.9 - input can omit invariant
GLSL 4.50.5 - input can omit invariant
Since GLSL 4.20, invariant qualifier description were changed to:
"
Only variables output from a shader (including those that are then input
to a subsequent shader) can be candidates for invariance. This includes
user-defined output variables and the built-in output variables. As only
outputs need be declared with invariant, an output from one shader stage
will still match an input of a subsequent stage without the input being
declared as invariant.
"
It's not very clear if input in fragment can be declared as invariant.
Mesa driver disallows use of input declared as invariant in fragment
shader, while other drivers may allow it. This CL removes invariant
declaration for input in fragment shader except AMD driver in Linux.
AMD's driver obviously contradicts the spec by forcing invariance to
match between vertex and fragment shaders.
BUG=chromium:639760, chromium:659326
TEST=conformance/glsl/misc/shaders-with-invariance.html and
conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html
Change-Id: I0aa9be14f0cee7a11a249c91fba27c570c52ca1b
Reviewed-on: https://chromium-review.googlesource.com/404228
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
|
|
7ebb97fc
|
2016-09-08T18:01:50
|
|
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>
|
|
e5bb72ff
|
2016-09-01T01:41:27
|
|
Remove SH_EMULATE_BUILT_IN_FUNCTIONS which isn't used
The flag is not used in chrome. We decide to do per emulation per flag.
BUG=chromium:642227
Change-Id: I936d53e5015186e35e672d0cb51c853a941582d2
Reviewed-on: https://chromium-review.googlesource.com/379077
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
4c4c8e72
|
2016-08-04T12:25:34
|
|
Add compute program compilation and linking support
Compute shaders can be now compiled and linked to create programs.
Some tests are added to verify successful and unsuccessful compute
shader linking.
The patch also replaces std::array<int, 3> with a custom struct
WorkGroupSize.
BUG=angleproject:1442
TEST=angle_end2end_tests
TEST=angle_unittests
Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84
Reviewed-on: https://chromium-review.googlesource.com/366740
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
bccc65d3
|
2016-07-19T16:48:43
|
|
Flatten "#pragma STDGL invariant(all)" into varying variables.
This is implemented as a compiler option which is enabled by default
when outputting to desktop GLSL version 130 and greater, which does
not support this #pragma in fragment shaders. As a workaround, and for
better compatibility on desktop OpenGL drivers, this pragma is also
flattened into the outputs of vertex shaders, and the inputs of ESSL
1.00 fragment shaders.
TEST=conformance/glsl/misc/shaders-with-invariance.html with --enable-unsafe-es3-apis
BUG=629622, angleproject:1293
Change-Id: Ib040230915e639971505ed496d26e804c9d64e68
Reviewed-on: https://chromium-review.googlesource.com/361792
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
|
|
802abe01
|
2016-08-04T17:48:32
|
|
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>
|
|
b00dcee4
|
2016-07-11T17:42:58
|
|
TranslatorGLSL/ESSL: Output #pragma before #extension
The Intel Mesa driver considers the #pragma directive to be a
non-preprocessor token which makes shaders fail compilation.
The relevant blurb from the spec is: "the extension directives
must occur before any non-preprocessor tokens"
BUG=627417
Change-Id: Ic22cff49a9f9c1fe5d140302581ca7b36688732c
Reviewed-on: https://chromium-review.googlesource.com/359621
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
|
|
61b81acf
|
2016-06-28T14:15:20
|
|
Support non-square matrices in precision emulation
In case the shader version is greater than ESSL 1.00, the precision
emulation needs to output rounding functions for non-square matrix
types.
Writing emulated compound assignment functions for non-square matrices
already had most of the code in place before this change.
New compound assignment operators like >>= don't need floating point
precision emulation in ESSL 3.00, since all of them only operate on
integers.
BUG=angleproject:1434
TEST=angle_unittests
Change-Id: I4678f511edf4f9f744fe23bb8d7dab4387f07f20
Reviewed-on: https://chromium-review.googlesource.com/358472
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
d4b5054d
|
2015-09-28T12:19:26
|
|
compiler: Rewrite do-while loops as while loops
This works around a Mac driver shader compiler bug that makes many
do-while loops cause GPU-hangs when ran.
BUG=angleproject:891
Change-Id: I29828d6ea9e887ad0ed0c577f1deb41fb632a900
Reviewed-on: https://chromium-review.googlesource.com/302465
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
217fe6ec
|
2015-08-05T13:25:08
|
|
Detect when built-in modf requires an l-value in AST traversal
This fixes an omission that out parameter tracking had inherited from
EmulatePrecision. Accurate tracking of when values are written is
required for converting dynamic indexing of vectors and matrices to
function calls.
A new test covering this is added to angle_unittests.
TEST=angle_unittests
BUG=angleproject:1116
Change-Id: I05c5fd60355117d0053b84110748ae221375a790
Reviewed-on: https://chromium-review.googlesource.com/290562
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
149e6e69
|
2015-08-07T16:18:18
|
|
Fixed compiler warning C4458 'declaration of variable hides class member'.
BUG=angleproject:1119
Change-Id: Ibc7cfdea72abe402cbfa1c10e0ada7576fa1cfa2
Reviewed-on: https://chromium-review.googlesource.com/292052
Tested-by: Cooper Partin <coopp@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
7b9b284b
|
2015-06-15T11:02:49
|
|
Refactor GLSL version calculations for emulated functions.
Pass the target GLSL version to InitBuiltInFunctionEmulatorForGLSL so that
it can be updated to generate emulated functions for multiple versions.
BUG=angleproject:1044
Change-Id: I34c408df52fd0f7d6c2f66d0579ac854afd93b87
Reviewed-on: https://chromium-review.googlesource.com/277700
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
a4aa4e30
|
2015-06-04T15:54:30
|
|
Record precision of constant variables when needed
Add a traverser that checks precision qualifiers of folded constants and
hoists them to separate precision qualified variables if needed.
Fixes sdk/tests/conformance/glsl/bugs/constant-precision-qualifier.html
TEST=WebGL conformance tests, angle_unittests
BUG=angleproject:817
Change-Id: I1639595e0e49470736be93274f0af07ee732e1fe
Reviewed-on: https://chromium-review.googlesource.com/275095
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
1ade24db
|
2015-03-19T16:29:32
|
|
Add #version 300 es to ESSL output when needed
BUG=angleproject:953
Change-Id: Ib9e45fab1d35f8c78abd0ac2209ac4f63afe4465
Reviewed-on: https://chromium-review.googlesource.com/261170
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
8efc5ad5
|
2015-03-03T17:21:10
|
|
Initialize BuiltInFunctionEmulator outside Compiler
This moves GLSL output specific code from the Compiler class to the
GLSL/ESSL translators.
BUG=angleproject:865
Change-Id: I2d552e9cdb41f7d8ddfee7b0249a99d629a6d7d7
Reviewed-on: https://chromium-review.googlesource.com/255471
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
95cd3c68
|
2015-03-03T16:45:32
|
|
Move some output out of BuiltInFunctionEmulator subclasses
This paves the way for getting rid of the BuiltInFunctionEmulator
subclasses in favor of initializing the BuiltInFunctionEmulator
dynamically in Compiler subclasses. The eventual goal is getting rid of
GLSL output specific functionality in Compiler, which should be
language-agnostic.
BUG=angle:865
Change-Id: Ibb114b905785c7343b2726c97699268c982536a0
Reviewed-on: https://chromium-review.googlesource.com/255470
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
05b6b7fc
|
2015-03-02T17:08:09
|
|
Add an SH_GLSL_CORE_OUTPUT profile.
So we could generate shaders for Apple using core GL profile.
By switching to core profile, we still pass most WebGL conformance tests 1.0.2 on Linux, but not all, so apparently more work is needed.
However, I think it's OK to check this CL in because this output profile will be only used behind a chromium switch.
BUG=angleproject:933
TEST=webgl conformance tests
Change-Id: Iad70e1aebf82349d3fc5f4116c1d6bc4448193fd
Reviewed-on: https://chromium-review.googlesource.com/255282
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a3a5cc6a
|
2015-02-13T13:12:22
|
|
Expose the IntermNode tree generated in the compiler for testing
This refactoring makes it possible for tests to access the IntermNode
tree produced by compilation by calling compileTree(). Removing
ParseContext usage from OutputHLSL has the additional benefit of better
separation between parsing and output.
BUG=angle:916
Change-Id: Ib40954832316328772a5c1dcbbe6b46b238e4e65
Reviewed-on: https://chromium-review.googlesource.com/249723
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
3ae6465f
|
2015-01-26T15:51:39
|
|
Fix lots of variable shadowing in ANGLE
BUG=angle:877
Change-Id: I3df0fffb19f5ecbe439fbc2a8d6d239a5dc6b638
Reviewed-on: https://chromium-review.googlesource.com/243334
Tested-by: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
74cafab1
|
2015-01-23T23:17:32
|
|
Revert "Fix lots of variable shadowing in ANGLE"
Caused WebGL CTS failures on the texture-npot test:
https://www.khronos.org/registry/webgl/sdk/tests/conformance/textures/texture-npot.html
This reverts commit c67e6e9fade44ef8938724e82db11db725e9c8e5.
Change-Id: I089e99859231e0d657084ac3647257c650a9da92
Reviewed-on: https://chromium-review.googlesource.com/243041
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
c67e6e9f
|
2015-01-21T16:01:07
|
|
Fix lots of variable shadowing in ANGLE
BUG=angle:877
Change-Id: I15168ae32605b26aee08274464ffe68adb5a7e87
Reviewed-on: https://chromium-review.googlesource.com/242351
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Austin Kinross <aukinros@microsoft.com>
|
|
ea7a2121
|
2014-11-17T16:15:57
|
|
Add GLSL/ESSL validator/translator support for GL_EXT_shader_framebuffer_fetch.
BUG=angle:834
Change-Id: I2d4e25909a8e1266b9bb7f1d4421324143157c8a
Reviewed-on: https://chromium-review.googlesource.com/231032
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Erik Dahlström <ed@opera.com>
|
|
853dc1ab
|
2014-11-06T17:25:48
|
|
Add mediump and lowp precision emulation support for GLSL output
This implements the rounding as specified in WEBGL_debug_shader_precision
extension proposal for desktop GLSL and ESSL output. The bulk of the new
functionality is added in the form of a new EmulatePrecision AST
traverser, which inserts calls to the rounding routines angle_frm and
angle_frl in the appropriate places, and writes the rounding routines
themselves to the shader.
Compound assignments which are subject to emulation are transformed from
"x op= y" to "angle_compound_op_frm(x, y)", a call to a function which
does the appropriate rounding and places the result of the operation to
x.
The angle_ prefixed names should not clash with user-defined names if
name hashing is on. If name hashing is not on, the precision emulation
can only be used if the angle_ prefix is reserved for use by ANGLE.
To support the rounding routines in output, a new operator type is added
for internal helper function calls, which are not subject to name
hashing.
In ESSL output, all variables are forced to highp when precision
emulation is on to ensure consistency with how precision emulation
performs on desktop.
Comprehensive tests for the added code generation are included.
BUG=angle:787
Change-Id: I0d0ad9327888f803a32e79b64b08763c654c913b
Reviewed-on: https://chromium-review.googlesource.com/229631
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
94ac7b78
|
2014-10-15T18:22:08
|
|
Invariant related processing.
* Fix a bug in PreProcessor for STDGL pragma.
* Record all invariant settings and set them in ShaderVariable.
* Write #pragma STDGL invariant(all) in GL
BUG=angle:776
TEST=https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shaders-with-invariance.html
Change-Id: Ie28b75480deed79f0c9f26e3b98f1778d1290182
Reviewed-on: https://chromium-review.googlesource.com/223610
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
e61209af
|
2014-09-26T12:01:17
|
|
Add option to support EXT_draw_buffers with NV_draw_buffers
After this patch, it is possible to set a flag to change
EXT_draw_buffers extension directives to NV_draw_buffers in ESSL.
This enables users of ANGLE to emulate EXT_draw_buffers by using
NV_draw_buffers in combination with GLES3.0.
Change-Id: I5dacdbd6cd0d0362424ea3791557342c42efd4bd
Reviewed-on: https://chromium-review.googlesource.com/219941
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
183bde55
|
2014-07-02T15:31:19
|
|
Return shader variable information using GLenum values.
Instead of duplicating GL header define values, explictly return
GLenum for variable queries in the shader inspection API. This
reduces the duplicate defines in the shader compiler header.
BUG=angle:466
Change-Id: Iddaaff597b188251fa2e546f352bf77ab3ac43bc
Reviewed-on: https://chromium-review.googlesource.com/205860
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
ce505553
|
2014-06-26T14:56:33
|
|
Revert "Return variable type queries using GLenum values."
Breaks the FYI bots until we get Chromium patched.
BUG=angle:466
This reverts commit 53221f5a0382887155d90f7f286e41190d4f5bfb.
Change-Id: Ib28548df5c10a6f76f46e4cf8f2013dca5cf0ee2
Reviewed-on: https://chromium-review.googlesource.com/205850
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
53221f5a
|
2014-06-25T16:04:59
|
|
Return variable type queries using GLenum values.
Instead of duplicating GL header define values, explictly return
GLenum for variable queries in the shader inspection API. This
reduces the duplicate defines in the shader compiler header.
BUG=angle:466
Change-Id: If631b20ce68747297a946e1371def7709027a613
Reviewed-on: https://chromium-review.googlesource.com/204937
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
68fe74aa
|
2014-05-27T12:56:01
|
|
Add a compiler query for the translator output type.
This is useful for determining if we are compiling to a D3D9 or D3D11
shader outside of the internal translator classes.
BUG=angle:656
Change-Id: Ib1c1d3de569edaa2b65c24c09d05aa4dd229d3e4
Reviewed-on: https://chromium-review.googlesource.com/201564
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
17732823
|
2013-08-29T13:46:49
|
|
Moved the compiler source files into directories based on their project and added a compiler.gypi to generate the compiler projects.
|