|
8e9d2340
|
2018-09-10T13:29:37
|
|
Vulkan: Fix FragCoord scaling when a viewport is applied.
We were using the pivot based on the viewport dimensions which is
only valid if the viewport is the size of the framebuffer. The more
correct pivot size is actually based on the Framebuffer height.
Also updates the driver uniforms block to be a bit simpler.
Bug: angleproject:2598
Change-Id: I1cb500cded7141d10e8db6862b6ed29758cc7fb4
Reviewed-on: https://chromium-review.googlesource.com/1214205
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
|
|
fb19e084
|
2018-09-06T15:39:09
|
|
Vulkan: Correct gl_FragCoord with default FBO.
The viewport flipping we use would give incorrect values. Correct
them using the same logic we do for gl_PointCoord.
Also corrects the viewport scale driver uniform. It was not being
updated after the draw framebuffer setting was adjusted.
Also corrects the naming of the replaced builtin variables so it
can't possibly conflict with a user variable.
This was affecting the OpenGL line raster emulation.
Bug: angleproject:2598
Change-Id: I843b5ac7b02160a5ec81a6f8ed2d937b0937198b
Reviewed-on: https://chromium-review.googlesource.com/1208515
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
fda46aa5
|
2018-08-31T17:19:15
|
|
Vulkan: Enable GLSLTest.ScopedStructsOrderBug.
This was fixed upstream in glslang.
Bug: None
Change-Id: I21751dba101fe39f94c91de6e73853ee9ad8c8f2
Reviewed-on: https://chromium-review.googlesource.com/1200366
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
76301e09
|
2018-07-19T11:48:30
|
|
Vulkan: Fix compound nested sampler struct params.
Replace the struct type of binary and symbol parameter nodes with a
lookup of the struct type in the tree.
Bug: angleproject:2494
Change-Id: I1e892e0f1b1f97302d1cdce1035f51c01d0efd9e
Reviewed-on: https://chromium-review.googlesource.com/1135695
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
06235df9
|
2018-07-20T14:26:07
|
|
Make HLSL shaders use only one main function
Instead of having separate main() and gl_main() functions in HLSL
shaders, add initializing outputs and inputs directly to the main
function that's in the AST.
This works around some HLSL bugs and should not introduce name
conflicts inside main() since all the user-defined variables are
prefixed.
BUG=angleproject:2325
TEST=angle_end2end_tests
Change-Id: I5b000c96aac8f321cefe50b6a893008498eac0d5
Reviewed-on: https://chromium-review.googlesource.com/1146647
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
e835609c
|
2018-07-12T12:36:47
|
|
Vulkan: Implement gl_DepthRange support using driver uniform
Bug: angleproject:2592
Change-Id: Iec3d111df4d8e5cef205c8afb177f0514ffac5c8
Reviewed-on: https://chromium-review.googlesource.com/1135448
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
84c11c53
|
2018-07-11T10:12:39
|
|
Vulkan: Implement sampler structs as function args.
Bug: angleproject:2494
Change-Id: Ia8e374846427b7140ab2565ae5b9b18409a76d96
Reviewed-on: https://chromium-review.googlesource.com/1117323
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
cdf50444
|
2018-06-26T15:05:42
|
|
Add test for sampler struct rewriting indexing.
The concern originally was that rewriting sampler structs could lead to
incorrect behaviour for indexing. The test attempts to cover this but
doesn't repro. It possibly is not an issue.
Bug: angleproject:2494
Change-Id: Ibc34b08b5cee3b6ff82d150a64f1768aae64396f
Reviewed-on: https://chromium-review.googlesource.com/1117321
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Luc Ferron <lucferron@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
e9c0b262
|
2018-06-22T09:50:04
|
|
Vulkan: Add drawQuad to a sampler test
Bug: angleproject:2675
Change-Id: I3774ca4602e9eea7c191e99a95939043ac0d8777
Reviewed-on: https://chromium-review.googlesource.com/1111901
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
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>
|
|
3237f759
|
2018-06-20T14:45:43
|
|
Vulkan: Fix issue when a sampler2D was not used in FS or VS
Bug: angleproject:2675
Change-Id: Idbf2590a763fd7b81d2bcc5850180a1bb931360e
Reviewed-on: https://chromium-review.googlesource.com/1108490
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Luc Ferron <lucferron@chromium.org>
|
|
50cf2be0
|
2018-06-15T09:46:57
|
|
Reformat some style in touched files.
This was triggered by running the code generation script.
Bug: angleproject:2665
Change-Id: Id639c78eb618182ee1859678590cf0f559b572c2
Reviewed-on: https://chromium-review.googlesource.com/1101564
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Luc Ferron <lucferron@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
4cc753e0
|
2018-06-13T13:25:33
|
|
Vulkan: Implement sampler arrays.
Bug: angleproject:2462
Change-Id: If9c9cb69624d6f9f0895f6883e1eed19a27e6cb4
Reviewed-on: https://chromium-review.googlesource.com/1089809
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
|
|
983460e6
|
2018-05-02T17:57:39
|
|
Rewrite repeated assignments to swizzled vectors on NVIDIA
This works around the most common instances of a bug that reproduces
on some NVIDIA OpenGL drivers prior to version 397.31.
BUG=chromium:798117
TEST=angle_end2end_tests
Change-Id: Iafc6a9a64e56fa98b42117149fe6867040e932e5
Reviewed-on: https://chromium-review.googlesource.com/1042190
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
7a8fe156
|
2018-04-28T12:59:58
|
|
ES31: Add link validation on MAX_COMBINED_SHADER_OUTPUT_RESOURCES
This patch adds the link validation on the maximum combined shader
output resources required in OpenGL ES 3.1 SPEC.
OpenGL ES 3.1 SPEC has restrictions on the sum of the number of all
active images, shader storage blocks and fragment shader outputs. A
link error will be generated if this sum exceeds the implementation-
dependent value of MAX_COMBINED_SHADER_OUTPUT_RESOURCES.
In order not to affect the existing image tests, this patch also
sets a temporary value for maxCombinedShaderOutputResources on D3D11
back-ends. We will set more accurate values for all the UAV related
resource limits in the next patch.
BUG=angleproject:2345
TEST=dEQP-GLES31.functional.state_query.integer.max_combined_shader_output_resources_*
Change-Id: Ib83a19ef0ae0b9af3422b5c970c7c07d96b2359d
Reviewed-on: https://chromium-review.googlesource.com/1039155
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
03bb2231
|
2018-05-03T15:21:20
|
|
Add test for D3D11 nested floor() bug
The test fails on D3D11, which seems to ignore floor() calls if
they're nested in a particular way with magic multipliers inside.
BUG=chromium:838885
TEST=angle_end2end_tests
Change-Id: I2c8749defa923553bfee69149da15f8e4ddf5096
Reviewed-on: https://chromium-review.googlesource.com/1041959
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
40786bdf
|
2018-04-18T13:58:57
|
|
ES31: Add validation on geometry shader interface blocks matching
This patch adds the validation on checking if there is any mismatch
among geometry shader interface blocks and the ones defined in other
graphics shaders in the same program.
BUG=angleproject:1941
TEST=angle_end2end_tests
Change-Id: I1f65e3c49390135bbe9f9323098daf28c9b838c7
Reviewed-on: https://chromium-review.googlesource.com/1016175
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
3ec304db
|
2018-04-18T14:14:25
|
|
Vulkan: Support struct initializers in shaders
Also adds a new test in GLSLTest to validate the initialization of
a struct on the same line as its declaration.
Bug: angleproject:2459
Change-Id: Ib37e20378f8ec76541db26392663bcba03390756
Reviewed-on: https://chromium-review.googlesource.com/1017340
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
fe22e23a
|
2018-04-16T14:15:11
|
|
Vulkan: Use SH_INITIALIZE_UNINITIALIZED_LOCALS in ShaderVk
Re-enable the flaky test InitUninitializedStructContainingArrays that
was failing because of this option missing.
Bug: angleproject:2460
Change-Id: Icf794a5fdca48619756d575faa4cb04f0323712e
Reviewed-on: https://chromium-review.googlesource.com/1014271
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
f1d3c20c
|
2018-04-16T07:44:27
|
|
Vulkan: Fix the issue with unused attributes / varyings
When an attribute, a uniform or a varying isn't used, we now remove
their layout and in/out qualifiers so that the shader can still refer
to these var names.
Bug: angleproject:2456
Change-Id: I5f1241d91bd46f663750adfab2562ef87ce69ae5
Reviewed-on: https://chromium-review.googlesource.com/1014009
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
ef2fda72
|
2018-04-18T07:44:14
|
|
Vulkan: Fix issue in GlslWrapper and maxVaryingVectors calculation (2nd try)
The layout needed to also have a component qualifier so that the
registerColumn wouldn't be ignored.
Bug: angleproject:2460
Bug: angleproject:2483
Change-Id: I3adcd6208aca4afebd45311ded93d00087b60a99
Reviewed-on: https://chromium-review.googlesource.com/1016680
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
5804dc8e
|
2018-04-13T14:11:46
|
|
Refactor GL tests to use a shader library
Instead of having the same simple shaders repeated over and over in
the test code, reuse a single shader library.
BUG=angleproject:2474
TEST=angle_end2end_tests
Change-Id: I13f8ca8c0125e6d30f1761639bf8c3f69e0e77d2
Reviewed-on: https://chromium-review.googlesource.com/1012078
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
c97e900c
|
2018-04-17T19:11:39
|
|
Revert "Vulkan: Fix issue in GlslWrapper and maxVaryingVectors calculation"
This reverts commit 1d882aaa0720b0dee0e8fc807d93d0e3f3e6bc67.
Sorry about this Luc. I think there was a missing suppression. You can
even see a flaky failure in the CQ when you landed this - it seems the
flakiness of the failure let it through. This is blocking another fix
from landing which fixes the fact the CQ is on fire. The revert button
is also missing from Gerrit which means this is a manual revert.
Failures:
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/win_angle_rel_ng/361
Original CL Message:
The layout needed to also have a component qualifier so that the
registerColumn wouldn't be ignored.
Bug: angleproject:2460
Bug: angleproject:2483
No-Try: True
Change-Id: I84c38497fbda43d9defbc6d5d3ff0f9c133e6e46
Reviewed-on: https://chromium-review.googlesource.com/1015323
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
1d882aaa
|
2018-04-13T10:12:05
|
|
Vulkan: Fix issue in GlslWrapper and maxVaryingVectors calculation
The layout needed to also have a component qualifier so that the
registerColumn wouldn't be ignored.
Bug: angleproject:2460
Bug: angleproject:2483
Change-Id: Ib5b15c4dc0ce42633f4994648f1eb22d8b63336a
Reviewed-on: https://chromium-review.googlesource.com/1011680
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Luc Ferron <lucferron@chromium.org>
|
|
bfb5df15
|
2018-04-12T12:45:26
|
|
Vulkan: Suppress flaky test in GLSLTest on Windows
Bug: angleproject:2460
Change-Id: I4dba274e29a147c3066848a729f37297951a7f77
Reviewed-on: https://chromium-review.googlesource.com/1010405
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
6d5af92b
|
2018-04-09T14:37:15
|
|
Vulkan: Enable GLSLTest tests for Vulkan
- Suppress tests that don't pass yet.
Bug: angleproject:2460
Change-Id: I7c95ae9504a8d5e112fd9d1bb8536cc9bbf16e7b
Reviewed-on: https://chromium-review.googlesource.com/1003099
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Luc Ferron <lucferron@chromium.org>
|
|
d91c3793
|
2018-04-06T09:36:36
|
|
Vulkan: Implement support for structs in uniforms
- Also enables 174 additional dEQP tests.
Bug: angleproject:2446
Change-Id: I07cce46815d2f7a80fd48e7fd9407f7d528b397f
Reviewed-on: https://chromium-review.googlesource.com/998406
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Luc Ferron <lucferron@chromium.org>
|
|
94bbed1e
|
2018-03-20T14:44:53
|
|
Collect static use information during parsing
We now collect metadata for variables in the symbol table. The
metadata is stored in a map using the variable unique id as a key, so
we can store the variables themselves as constexpr while still having
dynamic metadata.
For now we collect whether a variable is statically read or written.
This can be used to more accurately determine whether a variable is
statically used, but can also enable more optimizations in the future,
such as pruning variables that are never read or folding variables
that are never written after initialization. The collection is done
during parsing, so that nothing is pruned from the AST before the
static use is recorded.
Static writes are flagged in ParseContext::checkCanBeLValue, as that
function is already called for all variables that are written.
Static reads are flagged whenever there's an operation that requires
a variable to be read. This includes:
* Unary and binary math ops
* Comma ops
* Ternary ops
* Assignments
* Returning the variable
* Passing the variable as an in or inout argument to a function
* Using the variable as a constructor argument
* Using the variable as an if statement condition
* Using the variable as a loop condition or expression
* Using the variable as an index
* Using the variable as a switch statement init expression
In case there are statements that simply refer to a variable without
doing operations on it, the variable is being treated as statically
read. Examples of such statements:
my_var;
my_arr[2];
These are a bit of a corner case, but it makes sense to treat them as
static use for validation purposes.
Collecting correct static use information costs us a bit of compiler
performance, but the regression is on the order of just a few percent
in the compiler perf tests.
BUG=angleproject:2262
TEST=angle_unittests, angle_end2end_tests
Change-Id: Ib0d7add7e4a7d11bffeb2a4861eeea982c562234
Reviewed-on: https://chromium-review.googlesource.com/977964
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
9550c603
|
2018-02-13T14:47:05
|
|
Code refactoring for end2end tests.
This change:
1) uses the new style ANGLE_SKIP_TEST_IF to skip tests.
2) replaces compile-time definition for OSX to skip tests by run-time
function IsOSX() to skip tests, in order to align with ANGLE_SKIP_TEST_IF.
3) fixes a couple of typos.
BUG=angleproject:2005
Change-Id: I5af77d82257536b9eb79e26afa502f5b91ff6d31
Reviewed-on: https://chromium-review.googlesource.com/915861
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
2f23f35a
|
2018-02-11T22:11:37
|
|
Clean up end2end tests for Intel OSX.
BUG=angleproject:2205
BUG=angleproject:2041
BUG=angleproject:2155
Change-Id: I26bcbb63e147787cd342ec80a86d60cf230be4c9
Reviewed-on: https://chromium-review.googlesource.com/913108
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
ed04619a
|
2018-02-08T14:57:14
|
|
Fix typo in bug link.
BUG=angleproject:2205
Change-Id: I7ff1c3d0bb380c73c07dad0a30a4a4a19c17e397
Reviewed-on: https://chromium-review.googlesource.com/909577
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
06b95582
|
2018-02-08T13:48:44
|
|
Re-supress VerifyMax*UniformVectors on Ozone Intel.
BUG=angleproject:2205
Change-Id: Icff414dc7a521205fd3e39af4652b0fdef1cb900
Reviewed-on: https://chromium-review.googlesource.com/909291
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
8e5ba8bb
|
2018-02-05T17:52:27
|
|
Clean up end2end tests for Intel Linux platform.
Removed tests can pass on Intel Linux Desktop (Intel KabyLake, Ubuntu 17.04)
with system default mesa and latest upstream mesa.
BUG=angleproject:2205
BUG=chromium:680631
Change-Id: Ie3f0f34b9708a7dab81f66d9ec83a469658deee7
Reviewed-on: https://chromium-review.googlesource.com/901382
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
61d5325e
|
2018-01-31T14:49:24
|
|
D3D9: Improve varying packing failure mode.
D3D9 has a special limitation on varying packing, where each
variable takes up a full register width, and cannot share space
with other packed varyings.
A bug was counting registers incorrectly on D3D9. Fix this by
introducing a new limitation exposed to the ANGLE front-end via
the gl::Limitations structure. Now varying packing will fail
correctly in the ANGLE linking front-end with a more descriptive
error message, as such:
"Could not pack varying blah"
"Note: Additional non-conformant packing restrictions are enforced on D3D9."
Also change the packing so that input built-in variables are
counted towards varying limits (e.g. gl_PointSize), except for
gl_Position. On D3D9 we don't pack gl_PointSize, since it is
used in a special extra PSIZE register.
Also update some tests to be more robust.
Bug: chromium:804799
Change-Id: I9027266a8b66a28626f038f259bff42ebf09dcd2
Reviewed-on: https://chromium-review.googlesource.com/889898
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
881b7bfa
|
2017-12-25T11:18:37
|
|
ES31: Refactor link mismatch error log
This patch intends to refactor the structure of logging link mismatch
errors to meet the new GLES 3.1 program link requirements and support
linking program with geometry shader.
This patch is mainly focusing on the following 4 issues:
1. There are totally 14 places that log the link mismatch errors
in almost same format.
2. A temporary string is created (STRUCT_NAME.FIELD_NAME) before
checking a field of a block, which is of no use if link succeeds.
3. LinkValidateVariablesBase needs to know "shaderTypes" if we support
geometry shader based on current structure. Since uniforms are
checked in the range of the whole program, it is unnecessary to
know in which shader a uniform is defined if link succeeds.
4. GLES 3.1 regards varyings with same location but different names
as matched, so it isn't enough to log errors only by one name.
This patch can solve all these issues by the following 3 changes:
1. Replace "infoLog" and "variableNames" by "mismatchedFieldName" (the
complete field name if the mismatch occurs on a field of a struct
or block).
2. Use enum LinkMismatchError as the return value of all linkValidate*
functions to reflect the detail of the link mismatch error.
3. Log all the link mismatch errors by InfoLog::logLinkMismatch where
we can get shader types instead of passing them into linkValidate*
functions.
BUG=angleproject:1941, angleproject:2144
TEST=angle_end2end_tests
Change-Id: I3ed876d61f812cc7a45a6a3c5fec0b4a88b9cc2c
Reviewed-on: https://chromium-review.googlesource.com/844215
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
4e36db8c
|
2018-01-19T17:35:33
|
|
Skip FindMSBAndFindLSBCornerCases on Android OpenGLES
Due to a bug in Adreno N5X Oreo driver
BUG=angleproject:2304
Change-Id: I209d9b227557571f45a93aa68a003378e12402a1
Reviewed-on: https://chromium-review.googlesource.com/876995
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
|
|
02f15239
|
2017-12-27T10:10:28
|
|
Clear error logs when starting a new link process
This patch intends to fix a bug in logging link errors.
OpenGL ES requires glGetProgramInfoLog return a string
that contains information about last link or validation
attempt on a program object (GLES 2.0 Chapter 6.1.8,
GLES 3.0 Chapter 6.1.12). So all the link error logs
should be cleared when a new link process is begun.
This patch also removes several redundant allocations
of mLazyStream in ProgramD3D::compileProgramExecutables.
Calling "<<" on InfoLog objects will initialize its
member mLazyStream from heap, so we will skip using "<<"
if there is actually nothing to output.
BUG=angleproject:2295
TEST=angle_end2end_tests
Change-Id: Ib81fffd3d05919a8ebccd9145ff780548ca86a70
Reviewed-on: https://chromium-review.googlesource.com/848324
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
b8cb939f
|
2017-12-20T14:23:19
|
|
Fix tracking variables in folded ternary operators
The result of folding a ternary operator may be a TIntermSymbol node
where the qualifier doesn't match the qualifier of the variable that
the node is referring to.
Get the qualifier from the variable instead of directly from
TIntermSymbol when collecting variables in CollectVariables or when
tracking referenced variables in OutputHLSL.
BUG=angleproject:2288
TEST=angle_unittests, angle_end2end_tests
Change-Id: If294a7fe9dca50f2ebcea3feff887e72a521d395
Reviewed-on: https://chromium-review.googlesource.com/836893
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
629a6449
|
2017-12-11T10:55:43
|
|
Fix HLSL integer pow workaround
The exponent should be rounded prior to casting it to an integer.
Also if the exponent has a significant fractional part the expression
should not be turned into a multiplication. The previous code failed
to check this correctly if the exponent's fractional part was greater
than 0.5.
The test case is expanded to cover the previously failing cases.
BUG=chromium:793115
TEST=angle_end2end_tests
Change-Id: Ic72cd6ddc7f3d2495f7c87a3e3cfac5791445e72
Reviewed-on: https://chromium-review.googlesource.com/817299
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
7caa80e7
|
2017-11-14T15:03:14
|
|
Edit tests to reference temporary variables
The shader translator is intended to prune unreferenced variables in
the future. To maintain test coverage when this is done, most tests
that used to have unreferenced GLSL locals and globals are edited to
use built-ins or reference the necessary variables instead.
BUG=angleproject:2166
TEST=angle_unittests, angle_end2end_tests
Change-Id: I3964e7a80d52fc04a95f57e73da6095e433095e8
Reviewed-on: https://chromium-review.googlesource.com/768740
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
703671e9
|
2017-11-08T17:47:18
|
|
Unify extension behavior checks
Some supportsExtension and isExtensionEnabled checks are now turned
into checkCanUseExtension checks. Using checkCanUseExtension is
preferable so that warnings are generated correctly when an extension
is used and a warn directive is present.
isExtensionEnabled is still used in some places where an error message
about the extension could be confusing, particularly when a core spec
version adds support for something that is also present in an
extension.
Also make it possible to disable ARB_texture_rectangle extension using
an extension directive. ARB_texture_rectangle extension functionality
is enabled by default in GLSL when the extension is supported.
BUG=angleproject:2238
TEST=angle_unittests
Change-Id: I7455293412ff469f54bc7da79df146e7bc127379
Reviewed-on: https://chromium-review.googlesource.com/760737
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
661fc487
|
2017-10-16T12:17:05
|
|
Work around NVIDIA GLSL vector-scalar op bug
This adds a new AST transform VectorizeVectorScalarArithmetic. The AST
transform works around incorrect handling of certain types of GLSL
arithmetic operations by NVIDIA's GL driver. It works around only the
most common cases where the bug reproduces, since detecting all the
cases would take more sophisticated analysis of the code than what
is currently easily implementable in ANGLE.
When a float add operator has both vector and scalar operands, the AST
transform turns the scalar operand into a vector operand. Example:
vec4 f;
f += 1.0;
gets turned into:
vec4 f;
f += vec4(1.0);
When a vector constructor contains a binary scalar float
multiplication or division operation as its only argument, the AST
transform turns both operands of the binary operation into vector
operands. Example:
float f, g;
vec4(f * g);
gets turned into:
float f, g;
vec4(vec4(f) * vec4(g));
Another example with compound assignment:
float f, g;
vec4(f *= g);
gets turned into:
float f, g;
vec4 s0 = vec4(f);
(s0 *= g, f = s0.x), s0;
This latter transformation only works in case the compound assignment
left hand expression doesn't have side effects.
BUG=chromium:772651
TEST=angle_end2end_tests
Change-Id: I84ec04287793c56a94845a725785439565debdaf
Reviewed-on: https://chromium-review.googlesource.com/721321
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
bd3cd506
|
2017-11-03T15:48:52
|
|
Clean up HLSL constructor output
Split generating HLSL struct constructors from generating built-in
type constructors, as these didn't have much in common. Struct
constructors are now only generated when they are needed, as opposed
to before, when they were generated on any use of a struct.
This changes built-in constructor naming to include "_ctor" and gets
rid of having special built-in type names just for constructors.
This will make it easier to do changes to constructor output, for
example to add constructors for structs in std140 layout. This might
be needed to implement SSBOs efficiently.
This includes one bug fix for writing out struct declarations for
varyings.
Also improves const-correctness of accessing structs through TType
in general.
BUG=angleproject:2218
TEST=angle_unittests, angle_end2end_tests
Change-Id: If865fb56f86486b9c4a2c31e016ea16427f4a5fa
Reviewed-on: https://chromium-review.googlesource.com/753883
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
c1f14fbe
|
2017-10-28T19:17:23
|
|
Remove empty switch statements from translated shaders
The native HLSL compiler does not accept switch statements with an
empty statement list. The simplest way to accommodate this is to
simply remove them from the AST after parsing and some initial
pruning.
This is done by the new RemoveEmptySwitchStatements traverser. It
preserves init statements of switch statements in case they have side
effects. So for example
switch(++i) {}
gets translated to
++i;
BUG=angleproject:2206
TEST=angle_end2end_tests
Change-Id: I550a3c9b010a3566016bdfd93344ac30fd860604
Reviewed-on: https://chromium-review.googlesource.com/742922
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f6d242ed
|
2017-10-12T17:21:06
|
|
Wrap switch statements in blocks in HLSL
If variables are declared inside a GLSL switch statement, they are
scoped until the end of the switch statement. This is not compatible
with HLSL rules, where the scoping is until the end of the case. To
work around this, wrap switch statements in a block that declares
the variables in HLSL.
This is done after most other transformations done to the AST are
complete, since some of the other transformations may introduce
temporary variables.
BUG=angleproject:2179
TEST=angle_end2end_tests
Change-Id: Id0bb89affe103177fd3d6a6b2f3619b5e1ada0a6
Reviewed-on: https://chromium-review.googlesource.com/716381
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
4bd730c8
|
2017-10-10T14:14:19
|
|
Recognize more non-fallthrough cases in switch/case
RemoveSwitchFallThrough now treats cases where break; or return; is
nested inside a block as non-fallthrough to avoid unnecessary
duplication of code. For example, the case 1 below would previously
get treated as fall-through:
switch(foo)
{
case 1:
{
break;
}
default:
break;
}
Now RemoveSwitchFallThrough doesn't do anything to this code.
BUG=chromium:772695
TEST=angle_end2end_tests
Change-Id: Iafab6d8b05c63bcdb5f54834dbc1f41192c31dd4
Reviewed-on: https://chromium-review.googlesource.com/709197
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
923ecef6
|
2017-10-11T12:01:38
|
|
Fix switch statement validation corner cases
The grammar needs to generate AST nodes even for no-op statements,
since they might be the last statement in a switch statement that is
required for switch statement validity. Change the grammar to generate
nodes from empty blocks and empty declarations.
We also need to do some further processing of the AST. This is because
PruneEmptyDeclarations will still remove empty declarations, and at
least the NVIDIA driver GLSL compiler doesn't accept some types of
no-op statements as the last statement inside a switch statement. So
after parsing has finished we do rudimentary dead code elimination to
remove dead cases from the end of switch statements.
BUG=angleproject:2181
TEST=angle_unittests
Change-Id: I586f2e4a3ac2171e65f1f0ccb7a7de220e3cc225
Reviewed-on: https://chromium-review.googlesource.com/712574
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
852fe873
|
2017-10-10T15:13:59
|
|
Fix HLSL for switch statements that don't end in a branch
In case the last case inside a switch statement is not terminated in
a branch statement, RemoveSwitchFallThrough needs to add it before
calling handlePreviousCase. This ensures that all preceding
fall-through cases will get a copy of the branch statement and so will
not fall through.
This also fixes running RemoveSwitchFallThrough so that it's only
executed once per each switch statement.
The error was not caught by the dEQP tests, so a new ANGLE test is
added.
BUG=angleproject:2178
TEST=angle_end2end_tests
Change-Id: I26b6989aa4d32de2d74cde56d72ee24f61195445
Reviewed-on: https://chromium-review.googlesource.com/709196
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
78507c6e
|
2017-10-10T15:06:45
|
|
Fix statements disappearing from switch statements in HLSL
RemoveSwitchFallThrough now correctly records the existence of
declaration and swizzle statements inside switch statements.
BUG=angleproject:2177
TEST=angle_end2end_tests
Change-Id: I1ef83997db7ae510ded002a9568c29272c00c2fe
Reviewed-on: https://chromium-review.googlesource.com/709195
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
a60d3567
|
2017-10-02T22:10:28
|
|
Re-enable uninitialized-local test that should pass now
Follow up to https://crrev.com/c/669642
Bug: angleproject:2041
Change-Id: I27bf4458f5c8be265b757fd5a3ea10f5ffa9e10e
Reviewed-on: https://chromium-review.googlesource.com/696764
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a20af6d7
|
2017-09-18T13:32:29
|
|
Use C++11 raw string literals instead of SHADER_SOURCE macro
This is better in many ways:
1. It doesn't confuse clang format
2. \n doesn't need to be included after preprocessor directives like
the version directive.
3. It's using built-in functionality instead of something custom.
Raw string literals should be the preferred way to include shader
source in C++ files going forward.
BUG=angleproject:2157
TEST=angle_end2end_tests
Change-Id: I8b236a6e2d5c25d920297e5bc5b5b143eddeba1f
Reviewed-on: https://chromium-review.googlesource.com/671046
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
bb5a7e29
|
2017-08-30T13:03:12
|
|
Allow length() on arbitrary array expressions
This is required to pass some dEQP GLES 3.1 tests for arrays of
arrays, and WebGL conformance tests were also recently fixed to
require this behavior. The intent of the GLSL ES spec was not to
restrict usage of length().
In practice GL drivers don't implement array length() on expressions
with side effects correctly in all cases. HLSL doesn't have an array
length operator either. Because of this we always remove array length
ops from the AST before output.
BUG=angleproject:2142
TEST=angle_unittests, angle_end2end_tests, WebGL conformance tests
Change-Id: I863a92e83ac5315b013af9a5626348482bad72b3
Reviewed-on: https://chromium-review.googlesource.com/643190
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a16a84f3
|
2017-09-12T13:49:18
|
|
GLSL: Fix initializing globals declared after main()
Initialize globals in a separate function instead of a block in the
beginning of main(). This way it works also for globals declared after
main().
BUG=chromium:764036
TEST=angle_end2end_tests
Change-Id: I2fcbb97d046589301287757dc3dde5471172a3f6
Reviewed-on: https://chromium-review.googlesource.com/663158
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
28839f03
|
2017-08-15T11:38:16
|
|
Fix handling sampler arrays in structs as function arguments on HLSL
Some of the code was written under the mistaken assumption that
createSamplerSymbols would be splitting sampler arrays in structs into
individual samplers. Fix it by adding array dimensions to sampler
parameters generated by createSamplerSymbols when necessary.
BUG=angleproject:2128
TEST=angle_end2end_tests
Change-Id: Ie622c777d78ae65b5629d12e0ae574800c1b78f5
Reviewed-on: https://chromium-review.googlesource.com/614882
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
3860b6c0
|
2017-07-19T16:17:24
|
|
Fix arrays of structs containing samplers as parameters on HLSL
In HLSL output, samplers are never passed to functions as arrays, but
rather sampler array arguments are expanded into single sampler and/or
texture arguments. This applies also when the samplers were inside
arrays of structs in the original source.
BUG=angleproject:2103
TEST=angle_end2end_tests
Change-Id: Ib1fcba0c0ab3da592d15272eb56a03c3e536f349
Reviewed-on: https://chromium-review.googlesource.com/576041
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
06a06f5e
|
2017-07-12T12:22:15
|
|
Fix non statically used fragment input structs on HLSL
Add static use information to struct fields that mirrors the static
use information on the struct itself. This way dynamically generated
HLSL doesn't need special handling for initializing fragment inputs
if they are structs.
This fixes a problem with the previous code where dynamically
generated HLSL ended up trying to initialize structs that are not
declared in the HLSL output because they were not being referenced.
BUG=angleproject:2104
TEST=angle_end2end_tests
Change-Id: I21283ce4fe26515d62d95e61f8155dc9a9b44cf1
|
|
088031e6
|
2017-07-03T15:59:33
|
|
HLSL: Disambiguate between struct function parameters
Structs with different names but identical members are treated as
ambiguous by the native HLSL compiler when looking up user-defined
functions. Add the struct name to the function name to work around
this limitation.
BUG=chromium:731324
TEST=angle_end2end_tests
Change-Id: Ie80ac0f1374bc5ac05dfebef3f94e2da7cdfc581
Reviewed-on: https://chromium-review.googlesource.com/558929
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ff526f14
|
2017-06-30T12:26:54
|
|
Fix variable vs. function name conflict in HLSL output
GLSL ES spec accepts the case where an initializer of a variable calls
a function with the same name as the variable. The HLSL compiler
doesn't accept that. Work around this limitation in the HLSL compiler
by disambiguating user-defined functions from variables with a
different prefix.
BUG=angleproject:2095
TEST=angle_end2end_test, angle_unittests
Change-Id: I41b32a3fcc6fd4c548e8dc3aa680d1b07fcf8719
Reviewed-on: https://chromium-review.googlesource.com/557872
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
914b79a6
|
2017-06-19T16:03:19
|
|
Fix parsing GLSL loop conditions that declare a variable
Now the variable declaration is included in the AST, so that the loop
body may refer to the variable. The variable declaration is placed in
a block that wraps the loop. This way we can still only have
TIntermTyped loop conditions in the AST, which keeps the code dealing
with loops fairly simple and type safe.
This change includes reversing the return value of executeInitializer,
so that it returns true on success and false on error. This is more in
line with other ParseContext member functions.
BUG=angleproject:2073
TEST=angle_end2end_tests
Change-Id: I5c4ecbf1b438d3fff6d6237c0dcf191e2a19664c
Reviewed-on: https://chromium-review.googlesource.com/539639
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
bb1e750c
|
2017-06-05T16:40:09
|
|
Validate that structure names match when linking uniforms.
GLSL 1.017 4.2.4:
Structures must have the same name, sequence of type names, and
type definitions, and field names to be considered the same type.
TEST=conformance/glsl/misc/shaders-with-uniform-structs
BUG=angleproejct:2013
Change-Id: Ieedaaca2d28ef4e1cc0b5480f413ebd513c1dc1f
Reviewed-on: https://chromium-review.googlesource.com/524036
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
2f348d2a
|
2017-06-05T10:50:59
|
|
Make gl::Compiler reference-counted.
This is helpful for implementing program binary caching in ANGLE.
in order to maintain the current behaviour in Chrome, we will need
to defer shader compilation until link time. Since WebGL allows the
app layer to enable and disable extensions explicitly, the app can
enable or disable an extension between the calls to glCompileShader
and glLinkProgram. Then, if we're deferring shader compilation, we
will have to preserve the extension settings at the time of the call
to compile, not the current settings at the time of link. Making the
compiler reference-counted gives us a pretty simple and robust
solution.
This also changes the Context class to lazily init the shader
compiler. Lazy init prevents any unexpected nulls, and also ensures
the releaseShaderCompiler does exactly that: just releases the shader
compiler, and does not immediately re-initialize it.
BUG=angleproject:2044
Change-Id: I0f0eeb4eb94dc4eee238f92482804a0921c77df0
Reviewed-on: https://chromium-review.googlesource.com/522868
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
0ffc441e
|
2017-05-19T14:18:55
|
|
Initialize uninitialized globals in GLSL output
Initializing globals is done by the DeferGlobalInitializers AST
transformation, which makes sure that the global variable init
proceeds in the correct order. This is important since some global
variables may use other uninitialized globals in their initializers.
The global variable init is only done in case the WebGL shader spec is
being followed. This avoids adding global initializers twice in case
the same shader goes through multiple translations, assuming only one
of them is a WebGL shader translation.
BUG=angleproject:1966
TEST=angle_end2end_tests, WebGL conformance tests
Change-Id: Iea701d3ae40edc906abd87303f2aa27fd23bf55a
Reviewed-on: https://chromium-review.googlesource.com/509689
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
df7d13eb
|
2017-05-30T13:53:45
|
|
Lift outdated NVIDIA test suppressions
Lift some test suppressions for bugs that have been fixed in the
NVIDIA driver a good while ago.
Also improve code style in some suppressions - prefer IsOSX() and
IsLinux() to using ifdefs.
BUG=angleproject:1305
TEST=angle_end2end_tests
Change-Id: Ia069f5b9696000c901956d2952801d5f5c339a11
Reviewed-on: https://chromium-review.googlesource.com/518168
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
9733ceef
|
2017-05-11T19:14:35
|
|
Initialize uninitialized locals in GLSL output
Guarantee that local variables are initialized before they are used
in GLSL output. In HLSL output all variables were already being
initialized.
Locals are initialized using an AST transform. The local variable init
can only be run after some simplification of the AST, so that it is
able to handle complex cases like:
for (int i[2], j = i[0]; i[0] < 3; ++i[0]) {
}
If we're dealing with ESSL 1.00 which lacks array constructors, in
this kind of case the uninitialized array initialization code needs to
be hoisted out of the loop init statement, and the code also needs to
make sure that j's initializer is run after i is initialized.
Another complex case involves nameless structs. This can be an issue
also in ESSL 3.00 and above:
for (struct { float f; } s; s.f < 1.0; ++s.f) {
}
Since the struct doesn't have a name, its constructor can not be used.
We solve this by initializing the struct members individually,
similarly to how arrays are initialized in ESSL 1.00.
Initializing local variables is disabled on Mac and Android for now.
On Mac, invalid behavior was exposed in the WebGL 2.0 tests when
enabling it. On Android, the dEQP test runs failed for an unknown
reason. Bugs have been opened to resolve these issues later.
BUG=angleproject:1966
TEST=angle_end2end_tests, WebGL conformance tests
Change-Id: Ic06927f5b6cc9619bc82c647ee966605cd80bab2
Reviewed-on: https://chromium-review.googlesource.com/504728
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
f81ce4a3
|
2017-04-24T10:49:17
|
|
Refactoring: replace NULL by nullptr for pointers (3rd CL).
This CL mainly handles passing/returning NULL to/from a function.
BUG=angleproject:2001
Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009
Reviewed-on: https://chromium-review.googlesource.com/485060
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ba992ab5
|
2017-04-19T11:18:14
|
|
Fix HLSL 3 generation of shaders with texture LOD.
BUG=angleproject:2002
Change-Id: If8e6bbaeb5769341f92f05025eafb6a202fec437
Reviewed-on: https://chromium-review.googlesource.com/481680
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
8162926b
|
2017-04-19T11:56:01
|
|
Never add declarations without children to the AST
When block nodes were being created for loop bodies that didn't have
braces in the parsed source, the code didn't check if the loop body
was a declaration node without children. Always use appendStatement()
for adding statements to a block, so that declaration nodes without
children don't end up in the AST.
Similarly make sure that loop init nodes aren't declarations without
children.
BUG=chromium:712550
TEST=angle_end2end_tests
Change-Id: I5e79b700fe6158fa2422fcf4cd13818b2bd24863
Reviewed-on: https://chromium-review.googlesource.com/481660
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
8aeeed6e
|
2017-03-15T18:09:26
|
|
D3D11: Work around compiler nested sampling bug.
We can potentially work around a bug in the HLSL compiler by
omitting the const qualifier from some sampling operations.
BUG=angleproject:1923
Change-Id: I8a5d119707721e9c19f06be4ad808f87bfcdbee5
Reviewed-on: https://chromium-review.googlesource.com/454938
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
6445ddf8
|
2017-03-08T19:00:32
|
|
end2end_tests: Adds more skips for new tests and testers
BUG=angleproject:1924
Change-Id: I3ca25545632c9884eb1a8dba5e8e402b14324f80
Reviewed-on: https://chromium-review.googlesource.com/451877
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|
|
c9da71ff
|
2017-03-06T16:28:54
|
|
Fix translating dynamic indexing of swizzle to HLSL
This was broken due to a simple omission in deep copying swizzle AST
nodes.
It was found that several if not most OpenGL drivers also have some
issue related to this, so the end2end test is suppressed on many
OpenGL platforms. Intel Windows driver seems to be behaving correctly.
BUG=angleproject:1921
TEST=angle_end2end_tests
Change-Id: Ieefcedc2f2e36c3d8b607c28e449b696b8ad6892
Reviewed-on: https://chromium-review.googlesource.com/449717
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
61bd9fe1
|
2017-01-27T14:20:34
|
|
Suppress ESSL 3.10 integer math failure on AMD Linux
Failure was seen on bots since the test was introduced.
BUG=chromium:686105
BUG=angleproject:1730
Change-Id: I60293f17bf5e2498cbfb61f86468c218d58df68d
Reviewed-on: https://chromium-review.googlesource.com/434080
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
9250cb24
|
2017-01-21T10:51:27
|
|
Add ESSL 3.10 integer math built-ins
This adds built-ins found in ESSL 3.10 section 8.8 Integer functions.
This includes constant folding support for functions that may be
constant folded, and support for both GLSL and HLSL output. In HLSL
several of the functions need to be emulated.
The precision qualification for the return value of some of these
functions is determined by special rules, that are now part of type
promotion for TIntermUnary nodes and determining the type of
TIntermAggregate nodes.
BUG=angleproject:1730
TEST=angle_unittests
TEST=dEQP-GLES31.functional.shaders.builtin_functions.integer.*
Change-Id: Ib0056c17671c42b6496c2f0ef059b99f8f25c122
Reviewed-on: https://chromium-review.googlesource.com/431310
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
7e735e48
|
2017-01-12T15:42:01
|
|
Change remaining compile-time folding errors to warnings
The GLES working group has decided to amend the spec so that
implementations are not allowed to generate compile errors on
undefined values detected at compile time. Change the remaining
folding errors to warnings to follow the newly clarified rules.
The end2end_tests covering this are removed, since they're
redundant with the more efficient unit test.
BUG=angleproject:1703
TEST=angle_unittests
Change-Id: I97d2fd532dbe5733581bdc4aa40a5d7d3734fc0d
Reviewed-on: https://chromium-review.googlesource.com/427799
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
8f6eb2ad
|
2017-01-12T17:04:58
|
|
HLSL output: Fix nested dynamic indexing in an l-value
This fixes cases where a matrix is indexed and then the resulting
vector is indexed in the same expression inside an l-value.
BUG=angleproject:1672
TEST=angle_end2end_tests
Change-Id: Ia0593d75da67e0aa582003e1c381f2a1c89f948c
Reviewed-on: https://chromium-review.googlesource.com/427938
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
1a256721
|
2017-01-12T11:52:57
|
|
Skip two unittests on Linux/Intel.
BUG=680631
TEST=angle_end2end_tests on Linux/Intel
Change-Id: I0823b5accc1c1962d7b498bf74d58edcc6971133
Reviewed-on: https://chromium-review.googlesource.com/427285
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
192745a7
|
2016-12-22T15:58:21
|
|
Add varying packing validation for WebGL.
This CL moves the varying packing from the D3D layer up to Program.
This is necessary for WebGL validation, and gives us consistency
for the various back-ends. There may be some additional cleanup work
on the VaryingPacking class, because it does some work that is D3D-
specific.
WebGL requires strict varying packing. Instead of allowing success
unconditionally, it's an explicit error to succeed to pack a set of
varyings that the sample algorithm would fail to pack.
Introduce a new packing mode option to the varying packing class to
handle this different packing style, while keeping our old more
relaxed packing method for ES code.
BUG=angleproject:1675
Change-Id: I674ae685ba573cc2ad7d9dfb7441efa8cb2d55fc
Reviewed-on: https://chromium-review.googlesource.com/423254
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
e1faacb1
|
2016-12-13T12:42:14
|
|
Don't use logging macros in end2end_tests.
Macros like ASSERT and UNREACHABLE call gl::trace, which at some
point we might want to use to call the angle Platform logging code.
Standalone tests won't easily have access to the platform, so for
now just log errors in other ways.
This also corrects some logic in GLSLTest which was calling
internal methods in libANGLE when it didn't have to.
BUG=angleproject:1660
Change-Id: Idecbd97f2de7916b35bd78f5b7cd02b156ea100d
Reviewed-on: https://chromium-review.googlesource.com/419134
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
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>
|
|
36fd100d
|
2016-12-08T11:30:44
|
|
GLSLTest: test interaction of declaration splitting with other passes
In TranslatorHLSL a number of AST simplifications are done, that must
happen in a precise order for things to be correct:
- First for-loops must be split
- Then multideclarations must be split
- Finally comma operators must be split
This adds tests for interaction between this passes to make sure they
are done in the right order.
BUG=668028
Change-Id: I306915b51011bb5467d117352becfd60cbe77be4
Reviewed-on: https://chromium-review.googlesource.com/417989
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
f52fe93d
|
2016-12-07T13:39:15
|
|
Work around unary minus operator float issue on Intel Mac 10.11
Result of -float is wrong on Intel Mac 10.11 drivers. Replace -float
with 0.0 - float to work around this issue.
BUG=308366
BUG=672380
Change-Id: I53bc2eda7259fff5805bec39896fc7b7a6eaf665
Reviewed-on: https://chromium-review.googlesource.com/417169
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
56a2f95f
|
2016-12-08T12:16:27
|
|
Output infinity and NaN literals correctly in shaders
Previously infinity and NaN resulting from constant folding would be
clamped to finite 32-bit float range when they were written in shader
output. Now they are written as a bit pattern in case the shader
version allows it.
This does not guarantee that NaNs work, but this is fine, since ESSL
3.00.6 spec has very loose requirements when it comes to NaNs.
BUG=angleproject:1654
TEST=angle_end2end_tests
Change-Id: I9997000beeaa8ed22523c22d5cf6929cdfc93f60
Reviewed-on: https://chromium-review.googlesource.com/417301
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
2ad1c490
|
2016-12-07T14:46:18
|
|
D3D: Fix overflow in varying packing.
Also add a more robust set of unit tests for this internal class.
Because the GL spec allows for succeess when packing any set of
varyings, it's impossible to write negative end to end tests. This CL
also rewrites our disabled varying packing GLSL tests as unit tests.
BUG=angleproject:1296
BUG=angleproject:1638
Change-Id: I78153742517d5c72ddb13ff59dc44ddc4af42fc2
Reviewed-on: https://chromium-review.googlesource.com/415555
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
1be4d493
|
2016-09-27T11:15:38
|
|
Fix handling integer overflow in constant folding
Integer operations that overflow are defined to wrap in the ESSL
3.00.6 spec. Constant folding that happens inside the shader
translator should also follow the wrapping rules.
The new implementations of wrapping integer addition and subtraction
use unsigned integers to perform calculations. Unsigned integers are
defined to implement arithmetic in modulo 2^n in the C++ spec. This
behavior is also leveraged to implement wrapping unsigned integer
multiplication.
The implementation of wrapping signed integer multiplication is
slightly trickier. The operands are casted to a wider type to perform
the multiplication in a way that doesn't overflow, and then the result
is truncated and casted back to the narrower integer type.
Incorrect tests that expected errors to be generated from integer
overflow in constant folding are removed.
BUG=chromium:637050
TEST=angle_unittests
Change-Id: I0de7e25881d254803455fbf22907c192f49d09ff
Reviewed-on: https://chromium-review.googlesource.com/390252
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
28a97ee1
|
2016-09-22T13:01:26
|
|
Generate unique HLSL texture function names for external textures.
Because 2D and external textures have the same HLSL texture type, they were
generating texture functions with the same name. This causes conflicts when
both 2D and external textures are used in the same shader.
BUG=angleproject:1534
BUG=645532
Change-Id: I4b324014b7d9b4851d358730cf4e31fc8461584c
Reviewed-on: https://chromium-review.googlesource.com/388551
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
44ebf6b4
|
2016-09-22T13:00:02
|
|
ConstantUnion: Error on undefined shift.
BUG=chromium:648135
Change-Id: I41581f63af650564a0f61c1baeeb38017c8513ed
Reviewed-on: https://chromium-review.googlesource.com/387470
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
e292e902
|
2016-09-07T10:49:01
|
|
Workaround the unary minus operator issue on Intel
On some Intel D3D drivers, evaluating unary minor operator on an
integer variable may get wrong answer in vertex shader.
This patch works around this bug by replacing -(int) with ~(int)+1
on Windows Intel.
BUG=chromium:644033
Change-Id: I0af719e84d618a33f25bcb33bde0c381fb462a31
Reviewed-on: https://chromium-review.googlesource.com/381675
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
5db69f57
|
2016-09-15T12:47:32
|
|
Add robust math to constant folding.
Previously our multiplication and other operators could
do overflows, which can lead to security bugs.
BUG=chromium:637050
Change-Id: Icee22a87909e205b71bda1c5bc1627fcf5e26e90
Reviewed-on: https://chromium-review.googlesource.com/382678
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
509e4560
|
2016-08-25T14:55:44
|
|
compiler: Work around a HLSL compiler aliasing opt bug.
BUG=angleproject:1448
Change-Id: I7d5bcbd100069152cea0cb03bc4fa6af1044460b
Reviewed-on: https://chromium-review.googlesource.com/376020
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
ab481645
|
2016-08-26T12:09:10
|
|
Fix splitting nested sequence operators
Make sure that only one sequence operator is split on one iteration
of SplitSequenceOperator. This prevents multiple successive PostVisit
calls to nested sequence operator nodes from adding duplicate nodes
to the AST. The sequence operators are split starting from the
outermost one to preserve execution order.
Note that the shader translator somewhat unexpectedly generates nested
sequence operators in the AST when there is a sequence operator with
more than two operands, so this bug ended up affecting shaders in the
wild. The code around parsing sequence operators could be clarified
separately.
BUG=638313
TEST=angle_end2end_tests
Change-Id: Ic6400a484ceff0c790c2290f7b4b80980f87cd88
Reviewed-on: https://chromium-review.googlesource.com/376678
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
666f65a1
|
2016-08-26T01:34:37
|
|
Revert "Revert "Cover vector dynamic indexing case in SplitSequenceOperator""
This reverts commit d2f59bb6dda4f3548e158a09540829f9ff56bba4.
Change-Id: If2842bce17a0c085e2bc913ff120083fbe90497c
Reviewed-on: https://chromium-review.googlesource.com/376189
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
d2f59bb6
|
2016-08-17T11:50:52
|
|
Revert "Cover vector dynamic indexing case in SplitSequenceOperator"
This CL was causing inverted rendering in a WebGL application.
This reverts commit 7da9850643f55335a13a4663d226c73d0ac4d3b1.
Vectors or matrices that are dynamically indexed as a part of an
l-value generate new statements in the RemoveDynamicIndexing AST
transformation step. SplitSequenceOperator needs to detect this case
and split the sequence operator before statements are generated from
its operands to ensure the correct order of execution.
BUG=angleproject:1341
TEST=angle_end2end_tests
Change-Id: I854f8cce2d46107afa62f48edf3d32c6d5c97eda
Reviewed-on: https://chromium-review.googlesource.com/371643
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
6c9503ec
|
2016-08-16T14:06:32
|
|
D3D11: Improve integer pow workaround.
A slight bug in the problem case detection applied the workaround
overly-broadly. Also included a much more thorough test.
BUG=angleproject:851
Change-Id: I5c09d67eee3622c144401769af85958f23b60c57
Reviewed-on: https://chromium-review.googlesource.com/371380
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
5655b849
|
2016-08-02T11:00:07
|
|
D3D11: Fix integer pow workaround for nested pows.
For some nested pow expressions, queueing two node replacements in the
same tree traversal would mangle tree, resulting in invalid code. Fix
this by iterating over the tree until no replacements are found, and
doing one replacement each iteration.
BUG=angleproject:851
Change-Id: Ie08ab23f4bfe3d5f32726856afc61ff1f3d6c789
Reviewed-on: https://chromium-review.googlesource.com/365400
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
c9bde926
|
2016-07-24T17:58:50
|
|
D3D11: Allow gl_PointCoord when not rendering points.
ANGLE D3D11 uses a geometry shader to expand points into quads.
This led to an edge case with gl_PointCoord. When the user references
gl_PointCoord in the fragment shader but renders with GL_TRIANGLES or
other non-point primitives, gl_PointCoord is undefined, but ANGLE
would produce a link error. This would break some very odd edge-case
shaders (e.g. a shader that is used with both points and triangles).
We can fix this by simply adding a dummy PointCoord value to our
vertex shader is all cases. If the user renders points, we ignore the
PointCoord value passed to the geometry shader. If they render tris
or lines and use PointCoord, the shader signatures will match, and
PointCoord will even have a sane value of (0.5, 0.5).
BUG=angleproject:1380
Change-Id: I322155cd3801d0241cabc9bb639a5aaa502831b3
Reviewed-on: https://chromium-review.googlesource.com/362779
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
|
|
1048e43f
|
2016-07-23T18:51:28
|
|
D3D: Work around HLSL integer pow folding bug.
BUG=angleproject:851
Change-Id: I68a47b8343a29e42c0a69ca3f2a6cb5054d03782
Reviewed-on: https://chromium-review.googlesource.com/362775
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
156d7197
|
2016-07-21T16:11:00
|
|
HLSL: Insert return statements into functions that are missing them.
It's allowed to not have all code paths return a value in ESSL but the HLSL
compiler detects this and generates an error. Work around this by adding
dummy return statements at the end of each function that doesn't have one.
TEST=deqp/data/gles2/shaders/functions.html
BUG=angleproject:1015
BUG=478572
Change-Id: I2913f90f0994d4caf25cc43b16b9fc4e9efb19a5
Reviewed-on: https://chromium-review.googlesource.com/362085
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
7da98506
|
2016-07-20T18:45:09
|
|
Cover vector dynamic indexing case in SplitSequenceOperator
Vectors or matrices that are dynamically indexed as a part of an
l-value generate new statements in the RemoveDynamicIndexing AST
transformation step. SplitSequenceOperator needs to detect this case
and split the sequence operator before statements are generated from
its operands to ensure the correct order of execution.
BUG=angleproject:1341
TEST=angle_end2end_tests
Change-Id: I84e41a59c88fb5d0111669cab60312b930531a22
Reviewed-on: https://chromium-review.googlesource.com/361695
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
e1d199bb
|
2016-07-19T17:14:27
|
|
Split sequence operator when necessary
Split sequence operators if some of their operands generate statements
in subsequent AST transformations to guarantee the right order of
execution. For now, this is supported for expressions that return
arrays and unfolded short-circuiting operators, which is enough to get
WebGL 2 tests passing. A trickier corner case with dynamic indexing of
vectors as an l-value is left to be addressed later.
BUG=angleproject:1341
TEST=angle_end2end_tests, WebGL 2 conformance test:
conformance2/glsl3/array-in-complex-expression.html
Change-Id: I9301edd3366be7607a8aa4c42a5ec13928749e10
Reviewed-on: https://chromium-review.googlesource.com/361694
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
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>
|
|
419bfc91
|
2016-06-28T10:54:45
|
|
On Desktop GL, require index-constant sampler array indexing
BUG=598924
Change-Id: If97dbaa782595997b815c70d14f079e0f0c3d82a
Reviewed-on: https://chromium-review.googlesource.com/356710
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|