Граф коммитов

9420 Коммитов

Автор SHA1 Сообщение Дата
Jamie Madill 4163c0146c Skip Texture2DArrayCopy.UnsignedByteFormats on D3D11.
This test appears to be flaky.

Bug: angleproject:2896
Change-Id: Ib0c0ac9ab170edf0f31506f847307bee9b78f770
Reviewed-on: https://chromium-review.googlesource.com/c/1286913
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2018-10-18 15:51:42 +00:00
Joonatan Saarhelo 945dea36ab Clamp glClearDepthf and glDepthRangef
BUG=angleproject:2884

Change-Id: Ib1867fbd4c2ea3c3b29d2f987d384762f5851e8f
Reviewed-on: https://chromium-review.googlesource.com/c/1276585
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2018-10-18 14:42:40 +00:00
Yuly Novikov 25843dd651 Align memory access in Copy32FixedTo32FVertexData
Bug: angleproject:2895

Change-Id: Idfe379e34c4f165b91babcb1990df28fa151d807
Reviewed-on: https://chromium-review.googlesource.com/c/1286373
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2018-10-18 00:04:27 +00:00
Jamie Madill 4024e2179e perftests: Record trace events to JSON file.
This allows us to view the timeline of events in the trace event
browser. We can extend this to do GPU timestamp queries and analyze
when work is actually in flight.

The trace is enabled in standalone ANGLE only using the flag
--enable-trace with angle_perftests. You can also optionally specify
the trace output file with --trace-file <blah>. The default file is
ANGLETrace.json.

Bug: angleproject:2781
Change-Id: I871f28545d9bf18220b55aaf69e9554dcb4c834d
Reviewed-on: https://chromium-review.googlesource.com/c/1259763
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2018-10-17 20:03:18 +00:00
Shahbaz Youssefi 3a482179de Vulkan: Implement glFlush
A semaphore pool is implemented to allow dynamic allocation of
semaphores as needed when breaking up a frame with flushes.  The pool is
used both for acquiring the next image and for chaining mid-frame
submissions.

RendererVk::flush() is changed so that instead of taking the wait/signal
semaphores as parameters, it would use the last known signaled semaphore
as wait semaphore and allocates a semaphore for signaling.  It would
additionally wait for any extra semaphore provided externally (i.e. the
surface's image acquire semaphore).

Bug: angleproject:2504
Change-Id: Iecd2d5535230c48b26a6b7d078710af8730121da
Reviewed-on: https://chromium-review.googlesource.com/c/1276805
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2018-10-17 18:34:39 +00:00
Shahbaz Youssefi 6f1dc51bd9 Vulkan: Use a specialized macro for wrapped vulkan calls
Vulkan wrapper functions are fairly straightforward.  They call the
Vulkan function and return immediately.  The specialized macros
introduced in this commit take care of the final return for brevity of
the warpper.

Additionally, this commit gets rid of ANGLE_EMPTY_STATEMENT in favor of
the more robust macro definition using do {} while (0).

Bug: none
Change-Id: Ia7c68962d1aeee2c06ef210122b345b1a2e54f08
Reviewed-on: https://chromium-review.googlesource.com/c/1262020
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2018-10-17 17:07:55 +00:00
Shahbaz Youssefi 957e9b8222 Roll clang and other chromium deps
A bug in clang is preventing the use of link time optimization.

Bug: angleproject:2892
Change-Id: Ibe845e82f0db48233f8590189163fd8a5a8df634
Reviewed-on: https://chromium-review.googlesource.com/c/1263905
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2018-10-17 16:45:24 +00:00
Takuto Ikuta c20ead32ad Remove unused lambda capture
This is a preparation CL to remove -Wno-unused-lambda-capture warning suppression.

Bug: chromium:681136
Change-Id: Ib5c1c4eeeed3b7406ede2dea33066c54e5fc3da0
Reviewed-on: https://chromium-review.googlesource.com/c/1286172
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2018-10-17 15:05:30 +00:00
Jamie Madill 78bcd2bec3 Vulkan: Fix deleting in-use descriptor sets.
Sequences of many frames with uniform updates could lead to a bug where
we attempt to delete descriptor sets that are still in use. To trigger
the bug we need to write enough uniform data to trigger a descriptor
set to be freed. This would correctly trigger refresh sets in the
Program. But if there was a second program idle in the background that
also allocated descriptors from the old pool, the bug would manifest.

Fix this by storing a shared handle to the descriptor pool in the
Program. The dynamic descriptor pool won't recycle descriptor pools
internally unless there are zero outstanding references to the pool.

We could also improve this in a resource sharing situation by keeping
a single shared dynamic descriptor pool per share group.

Includes a contribution from tobine@google.com that adds a test to
cover the bug.

Bug: angleproject:2863
Change-Id: Id585b85f33f8cfa3772ceff3af512d1e4fb0b75a
Reviewed-on: https://chromium-review.googlesource.com/c/1271919
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-17 14:01:49 +00:00
Qin Jiajia 1d8a783c9d Re-land: "ES31: Add vector and matrix support in SSBO for D3D"
Re-land skips ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11 to pass
the bots. In fact, ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11 is
not a regression. The reverted CL added more SSBO features and triggered the
failure. To enable ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11,
we should support SSBO in render pipeline. This needs to bind SSBO to UAV
registers in link time instead of compile time since output variables also
occupies the UAVs. Let's enable this test when we support SSBO in render
pipeline. Currently, we shouldn't block the SSBO implementation in some common
features.

Bug: angleproject:1951
Change-Id: Ic339e8327e79335e6db1d86bedf0072635976f5f
Reviewed-on: https://chromium-review.googlesource.com/c/1282277
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
2018-10-17 01:12:31 +00:00
Jamie Madill a8a25d1746 Vulkan: Update Android expectations.
Bug: angleproject:2606
Bug: angleproject:2609
Bug: angleproject:2895
Change-Id: Iab71cfff2317d7283db69c3f8c82db8d94f7cafc
Reviewed-on: https://chromium-review.googlesource.com/c/1283854
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-16 21:21:34 +00:00
Frank Henigman d633b1569a Get rid of VertexFormatType.
The enum VertexFormatType is redundant with angle::FormatID.  The Vulkan
back end has already eschewed VertexFormatType, this change updates the
D3D back ends.

BUG=angleproject:2531

Change-Id: I67ea2203ca80be828f4c757a37810fe67a279364
Reviewed-on: https://chromium-review.googlesource.com/c/1263899
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
2018-10-16 20:44:11 +00:00
Shahbaz Youssefi 6eba3c6104 Vulkan: Distinguish query operations in GraphViz output
The query nodes now output BeginQuery or EndQuery based on the node's
function, instead of just Query.

Bug: angleproject:2379
Change-Id: I6ba38031c40b88e8927b31cdf14e4fdc2474624e
Reviewed-on: https://chromium-review.googlesource.com/c/1277485
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2018-10-16 03:31:31 +00:00
Jiawei Shao a1ac3fe806 ES31: Support textureGather[Offset] on int/uint formats on D3D11
This patch implements the translation of textureGather[Offset] on
integer and unsigned integer format textures on D3D11.

According to MSDN, Gather[Red|Green|Blue|Alpha] can be used on integer
and unsigned integer format textures with float texture coordinates:
https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-to-gather

Currently the dEQP tests on TextureGather[Offset] on cube map textures
in integer or unsigned formats still cannot pass. This issue is under
investigation.

Bug: angleproject:2826
Test: dEQP-GLES31.functional.texture.gather.basic.2d.*
      dEQP-GLES31.functional.texture.gather.basic.2d_array.*
      dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d.*
      dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d_array.*
      dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.*
      dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.*

Change-Id: If049dc395fb17cd34dec902630e3a1154e5d4806
Reviewed-on: https://chromium-review.googlesource.com/c/1271926
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2018-10-16 01:23:58 +00:00
Joonatan Saarhelo bbd532d164 Fix querying large vertex attrib divisors
glGetVertexAttribIuiv previously returned an incorrect value
for GL_VERTEX_ATTRIB_ARRAY_DIVISOR, because the divisor was
treated as an integer even though it is an unsigned integer.

BUG=angleproject:2281

Change-Id: I4d1c9df15244db855c6a000fc8fb6cc786bfcb85
Reviewed-on: https://chromium-review.googlesource.com/c/1273300
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2018-10-15 17:01:17 +00:00
Geoff Lang 79b914075c Add an extension for querying esimated GPU memory size of resources.
BUG=892288

Change-Id: I56fc3ab00c06d711e1a21eb1ad4b2224126730dc
Reviewed-on: https://chromium-review.googlesource.com/c/1262021
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2018-10-12 20:04:34 +00:00
Jamie Madill c97e3f6684 Revert "ES31: Add vector and matrix support in SSBO for D3D"
This reverts commit 671809e62e.

Reason for revert: Regresses angle_end2end_test:

ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11

Warning: compileToBinary(232):
C:\fakepath(36,21-40): error X4509: UAV registers live in the same name space as outputs, so they must be bound to at least u1, manual bind to slot u0 failed

The new test and this CL landed at nearly the same time. This CL breaks the test but it wasn't run on the CQ.

Failure link:

https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Win10%20FYI%20Release%20%28NVIDIA%29/2717

Original change's description:
> ES31: Add vector and matrix support in SSBO for D3D
> 
> Bug: angleproject:1951
> 
> Change-Id: I19d4218b28770464e4cb38027cce694e2a817b5b
> Reviewed-on: https://chromium-review.googlesource.com/c/1269827
> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>

TBR=geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org,jiajia.qin@intel.com

Change-Id: I54cda962e1361372f06e9e3bd667fa9c0ecf38dc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:1951
Reviewed-on: https://chromium-review.googlesource.com/c/1278102
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-12 15:49:24 +00:00
Qin Jiajia 671809e62e ES31: Add vector and matrix support in SSBO for D3D
Bug: angleproject:1951

Change-Id: I19d4218b28770464e4cb38027cce694e2a817b5b
Reviewed-on: https://chromium-review.googlesource.com/c/1269827
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2018-10-12 03:24:06 +00:00
Qin Jiajia 3026f1152e ES31: Collect shader storage blocks info for d3d.
This change collects shader storage blocks info for d3d backend. With this
change, program interface APIs can get correct SSBO information for D3D.

Bug: angleproject:1920

Change-Id: I6e2414494d0e8240bcb1d0ddc3d9a292eb7158ee
Reviewed-on: https://chromium-review.googlesource.com/c/1269824
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
2018-10-12 01:43:35 +00:00
Yizhou Jiang c4533eae08 Enable ANGLE_texture_multisample in glsl in es 3.0
Enable gsampler2dMS, texelFetch, textureSize in glslang in
es 3.0 if ANGLE_texture_multisample is supported.

Bug: angleproject:2275
TEST=SamplerMultisampleEXTTest.TextureMultisampleEXTEnabled

Change-Id: Ibfa367970db3ae790f3822e57eb50090843dc6db
Reviewed-on: https://chromium-review.googlesource.com/c/867521
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
2018-10-12 01:40:05 +00:00
Olli Etuaho f2ed299569 Add support for EXT_texture_compression_bptc
After validation, the enums are simply forwarded to the native
drivers. The BPTC formats are supported on both OpenGL and D3D.

The included test coverage covers the API quite well, but only has
basic coverage for correct decoding of texture data. More coverage for
texture data could be added later.

BUG=angleproject:2869
TEST=angle_end2end_tests

Change-Id: I3de37972dcf13c6fa3fc1bc429a2627523a4a082
Reviewed-on: https://chromium-review.googlesource.com/c/1261675
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2018-10-11 22:25:21 +00:00
Jamie Madill 956ab4d9fa Optimize several functions for the Program perf test.
This gives the same or slightly better performance in the ProgramDraw
perf test. Also only set the Program object as dirty when there are
dirty bits set in the Program itself.

Bug: angleproject:2877
Change-Id: I07b428b40d3e3c24e0a42c970524756b6dc3a30e
Reviewed-on: https://chromium-review.googlesource.com/c/1271475
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-10 21:33:33 +00:00
Jamie Madill a139f01ab8 Inline ValidateBindBuffer.
This method is only called in one place. Inlining reduces the need to
make a jump and push/pop variables from the stack.

It also adds a specialized error handler for validation errors. This
reduces the amount of code generated for errors. The prior method
generates a lot of code when dealing with string streams.

Improves performance of the binding performance test.

Bug: angleproject:2763
Change-Id: I52af7046b398072975bf5bda583efac9a9b9a8cb
Reviewed-on: https://chromium-review.googlesource.com/c/1270219
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-10 20:53:32 +00:00
Jamie Madill 1c7f08c3e2 Inline RefCountObject::release.
Also don't return errors from the object release methods. Not returning
errors reduces the amount of code generated. Also we shouldn't be
exiting early from destructor type functions.

Increases object binding performance.

Bug: angleproject:2877
Change-Id: Ieb8120d885b946915e355419825e1f52f31d7b49
Reviewed-on: https://chromium-review.googlesource.com/c/1270218
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-10 20:39:33 +00:00
Shahbaz Youssefi f955bdac1c Fix vulkan_null perftests on Linux
//build/config/gcc:rpath_for_built_shared_libraries was supposed to be
used to add . to rpath (which affected only release.  I didn't
investigate how it was affecting debug).  This resulted in
libVkICD_mock_icd.so not being found and vulkan_null tests being
ignored.

Change-Id: I71fb8578f873e4bed602b2c3dcf6d93240dcf30e
Reviewed-on: https://chromium-review.googlesource.com/c/1272496
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2018-10-10 14:20:37 +00:00
Jamie Madill 9d0bb3d4d5 Pass bit mask to ContextImpl::syncState.
This can be used to mask out inappropriate local dirty bits.

Bug: angleproject:2763
Change-Id: Ie46e464df0dc719c963ff9f7066d42eb5a028262
Reviewed-on: https://chromium-review.googlesource.com/c/1264062
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
2018-10-10 03:42:29 +00:00
Jiawei Shao 3209937075 ES31: Enable dEQP cases on texture gathering on swizzled 2d array textures
The following dEQP cases can pass with
https://chromium-review.googlesource.com/c/1207216:

dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8.texture_swizzle.*
dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8.texture_swizzle.*

Bug: angleproject:2826
Test: dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8.texture_swizzle.*
      dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8.texture_swizzle.*

Change-Id: Iaf6c4ca5abff1a7ae97d47a0d323bead38a7d8c1
Reviewed-on: https://chromium-review.googlesource.com/c/1267659
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2018-10-10 00:33:13 +00:00
Jamie Madill ac66f9822f Optimize ValidateBindTexture type check.
This switch can be cached in a very fast packed map. The map contents
only change if different extensions are exposed. This reduces the
number of instructions we hit in ValidateBindTexture.

Bug: angleproject:2763
Change-Id: I6ba8a4124d85e4c193d0dee3e03e50713d51b1f4
Reviewed-on: https://chromium-review.googlesource.com/c/1262739
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
2018-10-09 23:56:34 +00:00
Jamie Madill 31116738ad Inline many more hotspots for the Texture draw test.
Bug: angleproject:2763
Change-Id: Ib8193e7ff5ee7763b92f4775fb7e9adaa51c9305
Reviewed-on: https://chromium-review.googlesource.com/c/1262738
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
2018-10-09 23:17:17 +00:00
Qin Jiajia fcf10b62f7 Fix the regression bug for ComputeBoids
The old implementation missed considering compute program would also enter
into applyActiveAttribLocationsMask. However, there was no bindVertexArray
before updateAttribEnabled which resulted the previous VAO state was modified
in unknown. And that's why ComputeBoids example wouldn't work correctly.

This change adds a checking to not enter propagateProgramToVAO if it's a
compute program since compute shader doesn't have vertex attributes. And
an ASSERT is added to make sure that the right VAO is bound when
updateAttribEnabled is called in applyActiveAttribLocationsMask.

Bug: angleproject:2810

Change-Id: I6e77853498a527ef3b755bbb1da5826a9134b164
Reviewed-on: https://chromium-review.googlesource.com/c/1226227
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
2018-10-09 22:24:45 +00:00
Jamie Madill 6f755b210f Use angle::Result in front-end. (Part 1)
This covers most of the hot paths used in draw calls. Gives in the
order of a 5% reduction in draw call overhead.

Bug: angleproject:2491
Change-Id: I2d53afb1163eaceed61fb9cd9ce6c1267c85c0fa
Reviewed-on: https://chromium-review.googlesource.com/c/1258149
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-09 20:27:56 +00:00
Jamie Madill abfbc0fe4e Use angle::Result in allocation and math check macros.
Replace these with ANGLE_CHECK_*_ALLOC and ANGLE_CHECK_*_MATH depending
on the specific error type.

Bug: angleproject:2491
Change-Id: Ic4395101fe701c563ae2b92aa2c55c93b934a7de
Reviewed-on: https://chromium-review.googlesource.com/c/1262737
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-09 20:08:07 +00:00
Courtney Goeltzenleuchter 7d81ae7177 Put feature utility into it's own library
To minimize system impact, have feature configuration utility
live in it's own library.

Bug=angleproject:2418

Change-Id: Ic8e3862965e515ded7e1a6078a7b9f8b92878818
Reviewed-on: https://chromium-review.googlesource.com/c/1269822
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
2018-10-09 19:52:11 +00:00
Shahbaz Youssefi 563fbaa046 Vulkan: Implement occlusion queries
Begin and end queries insert an execution barrier in the command graph
to ensure the commands around them are not reordered w.r.t to the query.

Also, these commands cannot be recorded in separate secondary command
buffers.  Therefore, special-function nodes are created to perform the
begin and end query calls on the final primary command buffer.

Bug: angleproject:2855
Change-Id: Ie216dfdd6a2009deaaf744fd15d2db6899dd93e9
Reviewed-on: https://chromium-review.googlesource.com/c/1259762
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2018-10-09 19:04:00 +00:00
Jamie Madill 120b13f894 Add more draw buffer related tests.
Some of these are targeting our workaround for a mac bug. The bug was
that the driver was somehow modifying output attachments that the
program wasn't writing to. A new test shows a bug where we wouldn't
re-sync the state properly after a clear.

Also adds more pretty printing for GLColor.

Bug: angleproject:2872
Change-Id: I5485893b5f1b269c5407678db27978a789f7acc6
Reviewed-on: https://chromium-review.googlesource.com/c/1269255
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2018-10-09 16:04:21 +00:00
Courtney Goeltzenleuchter e7ece9e22c Do not include ALOGV in release builds
To match behavior of ALOGV in Android system code, disable output
in release builds.

Bug=angleproject:2418

Change-Id: I657ec366249f9d5defe9b05fe298099c47389580
Reviewed-on: https://chromium-review.googlesource.com/c/1269819
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
2018-10-09 15:06:27 +00:00
Courtney Goeltzenleuchter 3f21fcb9bd Set ANGLE default backend to Vulkan
If the Vulkan backend is available, use it on Android.
This way ANGLE built for the ANGLE apk always uses Vulkan.
ANGLE built for use in Chrome keeps GL. At least for now.

Bug=angleproject:2418

Change-Id: Ic7796c74821a44b856a596d31b3de09e7ca47ede
Reviewed-on: https://chromium-review.googlesource.com/c/1265504
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
2018-10-08 14:33:47 +00:00
Olli Etuaho 6f591c9706 Clean up TCompiler members and style
Some dead code and duplicate data are cleaned up from the compiler.
Several parameters can be accessed directly from ShBuiltInResources
instead of creating a copy in TCompiler.

This also encapsulates some TCompiler member functions as private and
changes the remaining unprefixed TCompiler member variable names to
start with the m prefix.

BUG=angleproject:2068
TEST=angle_unittests

Change-Id: I6690aaf538b17e0f45460660272a21f82f1808a0
Reviewed-on: https://chromium-review.googlesource.com/c/1267503
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2018-10-08 12:59:19 +00:00
Qin Jiajia 6d765b07f8 ES31: Fix some bugs in ShaderStorageBlockOutputHLSL
When EOpIndexDirect/EOpIndexIndirect/EOpIndexDirectStruct/TIntermSwizzle
appear in [] in ssbo access chain, we should transfer the process of them to
OutputHLSL.

For example:
    instance.v[gl_GlobalInvocationID.x] = data;
    // becomes
    float_Store(dx_instance, 0 + 16 * gl_GlobalInvocationID.x, _data);

    instance.v[s.index[0].x] = data;
    // becomes
    float_Store(dx_instance, 0 + 16 * _s.index[0].x, _data);

Bug: angleproject:1951
Change-Id: I333e238400a10a799a6294f8759cf9c4ef2451c8
Reviewed-on: https://chromium-review.googlesource.com/c/1250661
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
2018-10-08 02:32:03 +00:00
Jiawei Shao 19b51d2983 ES31: Support textureGather[Offset] on shadow samplers
This patch implements translating textureGather[Offset] into HLSL
when the sampler is a shadow sampler. The related HLSL function
should be GatherCmp().

According to the definition of textureGatherOffset():
([ESSL 3.1] Chapter 8.9.3 Page 138)
- gvec4 textureGatherOffset(gsampler2D sampler, vec2 P,
  ivec2 offset, [,int comp])
- vec4 textureGatherOffset(sampler2DShadow sampler, vec2 P,
  float refZ, ivec2 offset)
We need to add parameter "refZ" before "offset" when the sampler
is a shadow sampler.

Bug: angleproject:2826
Test: dEQP-GLES31.functional.texture.gather.basic.2d.depth32f.*
     dEQP-GLES31.functional.texture.gather.basic.2d_array.depth32f.*
     dEQP-GLES31.functional.texture.gather.basic.cube.depth32f.*
     dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d.depth32f.*
     dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d_array.depth32f.*
     dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.depth32f.*
     dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.depth32f.*

Change-Id: I9a7d095dd3cfa41aaefd14d012ed1f309abfc6d5
Reviewed-on: https://chromium-review.googlesource.com/c/1244081
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-10-08 01:14:01 +00:00
Yuly Novikov 450bf36f79 Workaround Adreno driver not supporting unsized EXT_texture_rg formats
Bug: angleproject:2567

Change-Id: Ia7dfa54f7201866b9d7c0ce5d9cccae06c785542
Reviewed-on: https://chromium-review.googlesource.com/c/1265500
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Commit-Queue: Yuly Novikov <ynovikov@google.com>
2018-10-05 21:16:28 +00:00
Olli Etuaho 78df3362ac Fix clearing out-of-range default FB drawbuffer
The default framebuffer is initialized with just one drawbuffer slot
so the number of drawbuffers needs to be validated before checking if
a buffer is attached.

BUG=angleproject:2831
TEST=angle_end2end_tests

Change-Id: I960c39357853d1cd4575b06a992cff33223ab3df
Reviewed-on: https://chromium-review.googlesource.com/c/1264518
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2018-10-05 18:24:13 +00:00
Geoff Lang 8efa341839 Suppress EXTBlendFuncExtendedDrawTestES3.FragmentArrayOutputLocationsAP on MacOS
Example failure:
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac%20FYI%20Experimental%20Retina%20Release%20(NVIDIA)/2115

BUG=angleproject:1085

Change-Id: Ifc07282b7ca586bd6346831e08cee963c9eaab54
Reviewed-on: https://chromium-review.googlesource.com/c/1263903
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2018-10-05 14:57:40 +00:00
Jamie Madill e39e8f46c3 GL back-end error refactor.
Adds explicit error handling to a few scoped state handler classes.
Otherwise mostly mechanical refactoring.

Bug: angleproject:2753
Change-Id: I2bf969a68f45880902b6e7902297c1340a76a1c4
Reviewed-on: https://chromium-review.googlesource.com/c/1255647
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-05 14:51:40 +00:00
Shahbaz Youssefi 06270c9eac Vulkan: Safer struct initialization
Using x = {}; before filling out each field, we can be sure any missing
field is 0 initialized.  This in turn helps us not have to specify
certain fields that are generally unused (at the moment), such
as pNext.

Bug: angleproject:2860
Change-Id: Ia1fa2db3ecfb316673a02ac0c5e13e47e055a19f
Reviewed-on: https://chromium-review.googlesource.com/c/1259764
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2018-10-05 14:40:54 +00:00
Olli Etuaho 5476e805a3 Fix constructing void array zero nodes
Correctly sized void arrays can be needed after parsing has recovered
from an error and the code is trying to evaluate the constant value of
a node. Since now we just have a generic EOpConstruct op instead of
different ops for different types, we can simply remove the special
handling for void arrays in CreateZeroNode to create the arrays in the
correct size.

BUG=chromium:890581
TEST=angle_unittests

Change-Id: I48d96c9ef1d695cd8583a845fd4bd24a7aaf535c
Reviewed-on: https://chromium-review.googlesource.com/c/1264515
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2018-10-05 12:14:45 +00:00
Jamie Madill 2343836c42 Remove gl::ErrorOrResult.
Bug: angleproject:2491
Change-Id: Ief728b9c50ee2e1925a9b286c52c8ccda6b14fd2
Reviewed-on: https://chromium-review.googlesource.com/c/1255646
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
2018-10-05 11:24:52 +00:00
Jamie Madill 785e8a0b7d Remove gl::LinkResult.
Instead of returning a small struct from LinkProgram calls we use
angle::Result. Linking can have 3 cases:

- the link was successful -> angle::Result::Continue
- the link failed -> angle::Result::Incomplete
- there was an internal error -> angle::Result::Stop

Note that any unexpected Incomplete is still an error. Each function
that accepts Incomplete must check explicitly.

This is the last user of ErrorOrResult.

Bug: angleproject:2491
Change-Id: Idba23be27efe4b561720a4bdd8fe486b40779497
Reviewed-on: https://chromium-review.googlesource.com/c/1255645
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
2018-10-05 11:14:22 +00:00
Olli Etuaho 0ca0975339 Add GLES3 support for EXT_blend_func_extended
This adds GLES3 API support for EXT_blend_func_extended. The patch
includes the API entrypoints, validation and also implementation on
the desktop GL backend.

Instead of having built-in fragment color variables, ESSL 3.00 has
custom output variables, which can now be bound to either primary or
secondary output color locations. The "index" set to a custom output
variable determines whether it's used a primary or secondary blending
source color.

The shader layout qualifier takes precedence over the bind call. This
is not specified in the EXT spec, but is specified in desktop OpenGL
specs.

BUG=angleproject:1085
TEST=angle_end2end_tests

Change-Id: Ia24e8e5dadcc165e5e8fbd7c653c7fab6217db88
Reviewed-on: https://chromium-review.googlesource.com/c/1249361
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2018-10-05 09:12:42 +00:00
Jamie Madill 14246813a1 Update sampler directly on Texture change.
This saves a lot of extra work when updating a Texture.

Bug: angleproject:2763
Change-Id: I87e310ef4f847713123bd24711e1166949ff95d2
Reviewed-on: https://chromium-review.googlesource.com/c/1254043
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-10-04 21:04:08 +00:00