Commit Graph
7110 Commits
Author SHA1 Message Date
Geoff Lang ab4be84fb6 Add newlines when writing original shader source to shader debug output.
Previously, the entire original shader would end up being written to a single
line, not very readable.

Change-Id: I8cdfd498bb47395da2bd11c3d3b2eecf266c914e
Reviewed-on: https://chromium-review.googlesource.com/576064
Reviewed-by: Corentin Wallez <[email protected]>
2017-07-18 17:33:30 +00:00
Olli Etuaho 282847e99b Clean up recording declarations in OutputHLSL
Relying on the AST conforming to known limitations makes the code for
recording referenced varyings easier to understand.

BUG=angleproject:2104
TEST=angle_end2end_tests

Change-Id: Icdcd7602f6ed54fa439f989bf256e261627d11f5
Reviewed-on: https://chromium-review.googlesource.com/568018
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-18 16:31:19 +00:00
Shao dde78e8c47 ES31: Implement Vertex Attrib Binding on OpenGL
This patch intends to implement Vertex Attrib Binding on OpenGL
back-ends:

1. Add supports for updating vertex attributes by Vertex Attrib
Binding APIs.
2. Refactor the process of updating vertex attribtues in class
VertexArray to make it easier to implement this feature.

BUG=angleproject:1593
TEST=dEQP-GLES31.functional.vertex_attribute_binding.*

Change-Id: I800e61518c552b94b84c415895ad31668b0a84b2
Reviewed-on: https://chromium-review.googlesource.com/510251
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-07-18 15:49:20 +00:00
Olli Etuaho ffb35f64d2 Fix broadcasting gl_FragColor at the end of main
Previously, the broadcast step would not get run in case the main()
function returned before reaching its end. Now the broadcast step is
put in a separate function that wraps main() if needed, so that it
gets run even if the main() function in the original shader source
returns in the middle.

DrawBuffersTest is refactored to use ANGLETest::drawQuad() instead of
calling glDrawArrays directly.

BUG=angleproject:2109
TEST=WebGL conformance tests, angle_end2end_tests

Change-Id: Id5f05094e816df03bc9c8ca62b60de914072682c
Reviewed-on: https://chromium-review.googlesource.com/574597
Reviewed-by: Zhenyao Mo <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-18 13:09:39 +00:00
Corentin Wallez 3e5695d1e3 Fix standalone OSX warnings
BUG=

Change-Id: I447900488559622108c0da12a352c88218f9ddc6
Reviewed-on: https://chromium-review.googlesource.com/575201
Commit-Queue: Corentin Wallez <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-07-17 20:46:15 +00:00
Jerome Duval d2e8792981 Enable Haiku in platform-specific headers.
1. src/common/platform.h updated to define ANGLE_PLATFORM_POSIX on Haiku.
2. include/EGL/eglplatform.h updated to add stubs typedefs for
platform-specific primitives for Haiku.

Change-Id: I28775e909ad9cabec1c474ff4fe0a241eb05d6a1
Reviewed-on: https://chromium-review.googlesource.com/573022
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-07-17 17:47:55 +00:00
Martin Radev cf42a7e8c6 Add ANGLE_multiview end-points and tokens
The patch adds the new end-points and tokens introduced
by ANGLE_multiview without implementing them.

BUG=angleproject:2062

Change-Id: I9be175263ab54b4f6d7537f05505b87ad763ee2d
Reviewed-on: https://chromium-review.googlesource.com/570051
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Olli Etuaho <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-17 15:49:25 +00:00
JiangYizhou 4cff8d625c ES31: TexParameter{if} validation for TEXTURE_2D_MULTISAMPLE on OpenGL
When setting parameters by TexParameter{if} for TEXTURE_2D_MULTISAMPLE,
an INVALID_ENUM error is generated if target is TEXTURE_2D_MULTISAMPLE,
and pname is any sampler state from table 20.11. An INVALID_OPERATION
error is generated if target is TEXTURE_2D_MULTISAMPLE, and pname
TEXTURE_BASE_LEVEL is set to a value other than zero.

BUG=angleproject:1590
TEST=angle_deqp_gles31_tests.exe --deqp-case=dEQP-GLES31.functional.texture.multisample.negative.texture*

Change-Id: I5d71731c11fb6e114a57e753e439e180695a7c79
Reviewed-on: https://chromium-review.googlesource.com/560607
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Yunchao He <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-07-17 14:16:23 +00:00
Olli Etuaho 0f68463f00 Clean up inserting variables to symbol table
This makes the TSymbolTable interface cleaner and prepares for making
unique id counting thread-safe.

BUG=angleproject:624
TEST=angle_unittests

Change-Id: Ief99c9fc777603de28ba1517e351bc8a00633590
Reviewed-on: https://chromium-review.googlesource.com/570418
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-07-16 09:33:07 +00:00
Olli Etuaho daaff1cc83 Set correct symbol ids when referring to GLSL built-ins
The symbol ids are fetched from the symbol table. A new utility
function is added to make this more convenient.

BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests

Change-Id: I780430e3386f6599503d8290c568ca9bc9cad147
Reviewed-on: https://chromium-review.googlesource.com/559535
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-07-15 18:40:14 +00:00
Geoff Lang c7ba85c937 TexutreD3D: Only update storage level if it exists.
This was causing an assertion failure in updateStorageLevel when the
storage didn't contain the requested level.  Gate the call behind an
isValidLevel check.

TEST=conformance/misc/type-conversion-test.html

BUG=angleproject:1815

Change-Id: Iadf46d232d5a117ae1ae74c6e71677b1e06a5321
Reviewed-on: https://chromium-review.googlesource.com/572705
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-07-15 03:21:44 +00:00
Jamie Madill a0016b7fc9 Check depth-stencil attachment sample count.
Currently we would only check for the color attachment sample count,
which could return incorrect results for depth or stencil-only
Framebuffers.

BUG=angleproject:2108

Change-Id: I378349c91c0139ee507d88fa6a36a86234fea0d4
Reviewed-on: https://chromium-review.googlesource.com/571064
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-07-14 20:34:56 +00:00
Martin Radev b50ccd3670 Use FindMainBody to retrieve node of main()'s body
The patch addresses code duplication in cases in which main()'s body node
has to be retrieved from the AST.

TEST=angle_unittests

Change-Id: I0ccee41821a5ecb2cdf09f5a928b178d6c037587
Reviewed-on: https://chromium-review.googlesource.com/561521
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Olli Etuaho <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2017-07-14 15:28:04 +00:00
Martin Radev 318f9aa5e8 Initialize ANGLE_multiview caps and workaround state
The patch checks whether ANGLE_multiview can be supported in the OpenGL
renderer, updates the caps and adds a workaround field to enable
multiview support through the NV_viewport_array2 extension.

BUG=angleproject:2062
TEST=angle_end2end_tests

Change-Id: I99dae10564db7bcca41d7624f8de272c1d996e09
Reviewed-on: https://chromium-review.googlesource.com/567934
Reviewed-by: Olli Etuaho <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-14 14:38:53 +00:00
Martin Radev e71afb877d Add specification for ANGLE_multiview
The patch adds the specification for the ANGLE_multiview extension
which enables efficient multiview rendering. The views can be laid
out side-by-side onto a 2D texture or rendered on separated layers of
a 2D texture array.

BUG=angleproject:2062

Change-Id: I4edd3ab0cfbb3906d90c2a5667d8d1f99f291f1c
Reviewed-on: https://chromium-review.googlesource.com/559089
Reviewed-by: Olli Etuaho <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-14 13:30:03 +00:00
Olli Etuaho 4cafb867cb Sanitize AST nodes created by UseInterfaceBlockFields
Don't add the same node pointer to the AST more than once, and assign
the right symbol ids to symbol nodes.

BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests

Change-Id: I3f00e9234245fe4b81a2388df3f83e13c4c24856
Reviewed-on: https://chromium-review.googlesource.com/559534
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-14 11:24:23 +00:00
Martin Radev cca63f2ea7 Fix compilation error in RobustResourceInitTest.cpp
The patch fixes a compilation bug caused from having local variable
names clash with the variables names from a parent scope.

BUG=angleproject:1815

Change-Id: I3d23faaafdea9be503da99512b204d7a50a3b228
Reviewed-on: https://chromium-review.googlesource.com/571000
Reviewed-by: Olli Etuaho <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-14 09:10:23 +00:00
Jamie Madill c43be720af Implement ANGLE_program_cache_control extensions.
This will give the browsers the ability to control the cache size,
query and populate the contents, and trim cache contents on memory
pressure.

BUG=angleproject:1897

Change-Id: I6edaa7d307b890223db98792d5b074e4a7fdfaa4
Reviewed-on: https://chromium-review.googlesource.com/563606
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-07-13 21:32:54 +00:00
Jiajia Qin bc58515eb6 ES31: Add 'buffer' qualifier support in shader
This change added 'buffer' qualifier support in shader which
corresponds to ESSL 3.1 spec, session 4.3.7 'Buffer Variables'.

BUG=angleproject:1951
TEST=angle_unittests:BufferVariablesTest

Change-Id: I2ecb5317d5ea9d378a60b03f86bdae04dbd89e9f
Reviewed-on: https://chromium-review.googlesource.com/534960
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-07-13 20:53:47 +00:00
Geoff Lang c5af8ba6eb D3D11: Make sure to resolve the storage for CopyTexImage3D.
TextureD3D_3D::copySubImage worked around missing functionality in D3D11
for copying a framebuffer directly to a texture storage but didn't handle
the case of a texture storage already existing.  This caused the image to
have out-of-date data before the new data was copied into it.  Simply copy
the data from the storage back into the image before performing the copy
from the framebuffer and then copy back to the storage afterwards.

TEST=conformance2/textures/misc/copy-texture-image-webgl-specific.html

BUG=angleproject:1815

Change-Id: I308d6a1d3ecbc738f7d0e232bece433e6b353638
Reviewed-on: https://chromium-review.googlesource.com/567199
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-07-13 20:20:39 +00:00
Geoff Lang d90b214fc2 D3D11: If an image is dirty, copy it to the storage before copying from a FB.
If a storage already existed, it may have old data in it.  Check if the
image is dirty and copy the initialized memory into the storage before
copying data from the framebuffer.

TEST=conformance/textures/misc/copy-tex-image-and-sub-image-2d

BUG=angleproject:1815

Change-Id: Ic69c5519b2e09e4b62025b1bf413d2a71a4a2afb
Reviewed-on: https://chromium-review.googlesource.com/568410
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2017-07-13 20:10:51 +00:00
Olli Etuaho d7ceaa1679 Remove TIntermSymbol::setId
The only place it was being used was when parsing array declarators.
The declarator only needs to be added to the AST when the variable
has successfully been declared, so this usage was not necessary.

BUG=angleproject:1490
TEST=angle_unittests

Change-Id: I05b8851cfdebc9253c9fda8b12733f23da604ca6
Reviewed-on: https://chromium-review.googlesource.com/569160
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-13 19:55:59 +00:00
Martin Radev d178aa46a0 Fix attachment validation bug
Passing COLOR_ATTACHMENTm, where m is greater or equal to
MAX_COLOR_ATTACHMENTS, to a FramebufferTexture* function should
generate an INVALID_OPERATION instead of an INVALID_VALUE error.

BUG=angleproject:2106
TEST=angle_end2end_tests

Change-Id: I99045defcbe5eb2afefac1b45062ee4245f50dd3
Reviewed-on: https://chromium-review.googlesource.com/569966
Reviewed-by: Olli Etuaho <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-13 19:28:30 +00:00
JiangYizhou 34bc315d5c ES31: Implement multisampled Textures for D3D part.
Implement TexStorage2DMultisample api for d3d part.

BUG=angleproject:1590
TEST=angle_end2end_tests --gtest_filter=TextureMultisampleTest*
TEST=angle_deqp_gles31_tests --deqp-case=dEQP-GLES31.functional.texture.multisample.negative.fbo_*

Change-Id: Icbfba45b9c2965af02b54dd4060b7b49970cb74b
Reviewed-on: https://chromium-review.googlesource.com/457161
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-07-13 16:34:00 +00:00
Olli Etuaho 3ec75686fd Collect AST transform utilities to a separate file
Collect static functions that are used to create nodes in AST
transformations into a single file.

BUG=angleproject:1490
TEST=angle_unittests

Change-Id: I6f87422988fa088f2f4b48986e378a2909705cb7
2017-07-13 11:13:13 +03:00
Commit Bot 84db5733d8 Merge "Fix non statically used fragment input structs on HLSL" 2017-07-13 08:00:02 +00:00
Commit Bot e2a728aa9b Merge "Validate uniforms and attributes name conflicts when linking" 2017-07-12 20:39:35 +00:00
Commit Bot d5fbb8b01c Merge "Add tests for the cache control extension." 2017-07-12 19:29:47 +00:00
Commit Bot 59bc668ca1 Merge "Validate the ReadPixels type and format for INVALID_ENUM." 2017-07-12 18:57:24 +00:00
Yuly Novikov caa5cda0dc Validate uniforms and attributes name conflicts when linking
Uniforms and attribute names have global scope, according to:
GLSL 1.017 sections 4.2.6, 4.3.3 and 4.3.4.
Thus, they can't have same names.

BUG=angleproject:2014

Change-Id: Ibeb064aca877e404a67b9e3e9b57a0cc42e86f9f
2017-07-12 18:39:15 +00:00
Geoff Lang 6fc8c9b998 Merge "Validate that the mip level is not too large for CopyTextureCHROMIUM." 2017-07-12 17:14:54 +00:00
Commit Bot 9dd5dbd8b7 Merge "Link atomic counters to buffers" 2017-07-12 16:26:42 +00:00
Jamie Madill 293e114db2 Add tests for the cache control extension.
A first test verifies the validation of the extension, and a second
compiles a simple shader and checks the cache behaviour.

These tests don't currently run since the extension is disabled,
but they will start running as soon as we expose it.

BUG=angleproject:1897

Change-Id: Id4a76b83090712a267576069b711eeee29aa81dd
2017-07-12 12:01:56 -04:00
Geoff Lang 280ba991b1 Validate the ReadPixels type and format for INVALID_ENUM.
GL_INVALID_ENUM should be generated if the type or format arguments were
not valid for any ReadPixels command.  This validation should happen
before validating if the combination of format and type is valid.

TEST=conformance/reading/read-pixels-test

BUG=angleproject:2000

Change-Id: If49d69655f5ab0a3abbde58b49541c84249c1750
2017-07-12 11:59:58 -04:00
Geoff Lang 3847f94d17 Validate that the mip level is not too large for CopyTextureCHROMIUM.
When the mip level was greater than the maximum, it could cause an
out-of-bounds read when trying to query the Texture's size and format
later in the validation.

BUG=740426

Change-Id: Ibd6c977981e5f8b7368c161b7969d9e916c6095b
2017-07-12 11:17:28 -04:00
Commit Bot 1636e1b909 Merge "D3D11: Clip copy rect to the source framebuffer for copyTexImage3D." 2017-07-12 14:29:06 +00:00
Commit Bot f69ac0a5db Merge "Add support for new internalformats in copyTextureCHROMIUM" 2017-07-12 14:18:57 +00:00
Olli Etuaho 06a06f5ecc 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
2017-07-12 14:22:56 +03:00
Commit Bot 2c7c4268fd Merge "Select viewport index in the GLSL/ESSL vertex shader" 2017-07-12 07:53:34 +00:00
jchen10 eaef1e5e23 Link atomic counters to buffers
Gather counters from each shader and group them according the
layout qualifier 'binding' into each buffer.

BUG=angleproject:1729
TEST=angle_end2end_tests:AtomicCounterBufferTest

Change-Id: I8d0cd0d2bf65be37c035b0e1540481c8bee0bae4
2017-07-12 08:39:03 +08:00
Commit Bot b74c769a8b Merge "Fix Clear validation assert for default FBOs" 2017-07-11 19:48:41 +00:00
Geoff Lang bc5d7addb3 D3D11: Clip copy rect to the source framebuffer for copyTexImage3D.
TEST=conformance2/textures/misc/copy-texture-image-webgl-specific.html

BUG=angleproject:1815

Change-Id: I146fcf97a9c90f07d6270672c5e44e05602eecf8
2017-07-11 14:43:42 -04:00
Jamie Madill 315ecd2074 Add entry points for EGL_ANGLE_program_cache_control.
This instruments the plumbing for the extension without adding any
functionality or exposing the extensions string.

The extension text is also updated to reflect the new entry point
design and naming. Also this corrects a few mistakes.

This will be followed up by the tests (which won't run) and then
the extension functionality in ANGLE.

BUG=angleproject:1897

Change-Id: I5b009e23bc27da06b067375525bd6fc574027702
2017-07-11 13:51:04 -04:00
Corentin Wallez 59c41597b4 Fix Clear validation assert for default FBOs
The validation was iterating over maxDrawBuffers attachments when
default framebuffers only have one attachment. Use the framebuffer's
drawBufferCount instead.

Also adds a regression test in the form of a WebGLComptibility test for
glClearBuffer with the default framebuffer.

BUG=angleproject:2091

Change-Id: I07ee524db1fcb8a99dab4043248c0885100fd216
2017-07-11 13:21:49 -04:00
Martin Radev c39a19aa93 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
2017-07-11 18:32:28 +03:00
Olli Etuaho 37d96cce9d Fix accepting arrays as array indices
Previously, arrays were being incorrectly accepted as array indices.
This was because the isScalar() check only checked that the type was
not a vector or matrix, but still returned true for scalar arrays.

This patch changes the isScalar() check so that it returns false for
arrays. This makes usage of the term "scalar" more consistent in the
shader translator. Most of the code using isScalar() was compatible
with this change. Code in util.cpp that used to assume that isScalar()
doesn't care about arrayness is refactored to work with the new
behavior.

BUG=angleproject:2102
TEST=angle_unittests

Change-Id: I2a7f4c30fca7917d1099d0400efe3de859338b2a
2017-07-11 18:03:42 +03:00
Olli Etuaho 56229f1bbe Remove TIntermediate::addConstantUnion
This includes asserts in TConstantUnion to reveal incorrect usage of
union - reading a different field of an union that has last been set
is undefined behavior in C++.

Existing issues with accessing incorrect fields of constant unions
are fixed.

BUG=angleproject:1490
TEST=angle_unittests

Change-Id: Idd6b7a871d73e2928f117a9348c92043612fab82
2017-07-11 12:00:38 +03:00
Olli Etuaho eb7f90fdcc Remove simple Intermediate.h functions
Most of the functions were just simple wrappers around node
constructors. Dropping this extra redirection makes the code simpler.

The fold() functions of node types are simplified, so that if the node
can't be folded the pointer to the node itself is returned. This makes
the code in ParseContext more straightforward.

The few remaining functions in Intermediate are a bit more complex so
they should be handled separately, but they'll be removed eventually
as well.

BUG=angleproject:1490
TEST=angle_unittests

Change-Id: I85e11919d1f62358cfba9c011b841e32bc25402f
Reviewed-on: https://chromium-review.googlesource.com/563393
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-10 15:48:25 +00:00
Brandon Jones 340b7b8baa Add support for new internalformats in copyTextureCHROMIUM
This adds support in blit11::copyTexture for LUMA, LUMA_ALPHA, and ALPHA
formats as destinations. Added is handling for each case to match up
the corresponding shader. This required new premultiply and
unmultiply D3D11 shaders for some cases.

Changed copyTextureCHROMIUM validation to allow new formats.

Tests have been created to demonstrate using copyTextureCHROMIUM with
the new formats with default parameters, as well as with the
unpackPremultiply and unpackUnmultiply parameters.

BUG=:angleproject:2101

Change-Id: Id8cd303a46fe70710bc18172fc938552a6e4cfaf
2017-07-10 08:15:14 -07:00
Martin Radev 70c95fa6ff Add function in MatchOutputCodeTest to find occurrence of a string
The patch adds a function in MatchOutputCodeTest to get the position
of the first occurrence of an expression in the translated output code.
This can help design more complicated tests like a test which checks
for the order of simple expressions.

BUG=angleproject:2062
TEST=angle_unittests

Change-Id: I1249d4762c247848c4eec64ecb8c1357b5e8d40a
Reviewed-on: https://chromium-review.googlesource.com/563659
Reviewed-by: Olli Etuaho <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-07-10 14:44:57 +00:00