OSDN Git Service
Nicolas Capens [Mon, 2 Oct 2017 19:26:11 +0000 (15:26 -0400)]
Fix vector packing regression.
When SSE4.1 isn't available, we were infinitely calling PackUnsigned()
recursively.
Bug b/
37496082
Change-Id: Ie1fa8150d64740776c5b80baf07d997dde9d51be
Reviewed-on: https://swiftshader-review.googlesource.com/12929
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Casey Dahlin <sadmac@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Casey Dahlin [Fri, 29 Sep 2017 23:32:32 +0000 (16:32 -0700)]
Add test for PackSigned/PackUnsigned in Reactor
Test: New tests pass
Bug: b/
37496082
Change-Id: I4a0aae14318f03b5ce59f12f7542db13270f52ab
Reviewed-on: https://swiftshader-review.googlesource.com/12848
Tested-by: Casey Dahlin <sadmac@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Mon, 2 Oct 2017 17:48:19 +0000 (13:48 -0400)]
Fix for integer modulo operations
Integer division already had this modification, to avoid
division by 0, but integer modulo hadn't been modified
to match the other fix, which is now done here.
Bug chromium:763435
Change-Id: I40f4ed9f1c4b5889ddf47abc1bb7c70c21cbd7b8
Reviewed-on: https://swiftshader-review.googlesource.com/12908
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Nicolas Capens [Wed, 27 Sep 2017 19:06:35 +0000 (15:06 -0400)]
Implement vector intrinsics for ARM32.
MultiplyAddPairs is implemented using VMULL+VPADD.
MultiplyHighSigned/Unsigned is implemented using VMULL+VSHRN.
SubVectorLoad/Store is implemented using VLDR/VLD1/VSTR/VST1.
VectorPackSigned/Unsigned is implemented using two VQMOVN.
Bug b/
37496078
Bug b/
37496856
Bug b/
37496321
Bug b/
37496082
Change-Id: I141fd901d53da24ce780f503dc7ad17b94fc6ba8
Reviewed-on: https://chromium-review.googlesource.com/693049
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Reviewed-on: https://swiftshader-review.googlesource.com/12709
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Casey Dahlin [Fri, 29 Sep 2017 20:43:18 +0000 (13:43 -0700)]
Add test for Unpack in Reactor
Test: New test passes
Bug: b/
67106219
Change-Id: Ib21f73d312d39cf2b3aa15a11d2a207885a58978
Reviewed-on: https://swiftshader-review.googlesource.com/12828
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Casey Dahlin <sadmac@google.com>
Alexis Hetu [Wed, 27 Sep 2017 18:43:38 +0000 (14:43 -0400)]
Prevent division by 0
If imageSize is 0, inputPitch may be 0, which would cause a division
by 0. In any case, if imageSize is 0, there's no work to perform, so
we just skip loadCompressedData() entirely in that case.
Bug:765094
Change-Id: Iedc6516ef6d025d24a8827597045cb3b83599e4a
Reviewed-on: https://swiftshader-review.googlesource.com/12648
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Fri, 29 Sep 2017 17:13:14 +0000 (13:13 -0400)]
Handle WindowSurface::checkForResize() errors gracefully
WindowSurface::checkForResize() contained an assert which got
triggered in some tests. In order to avoid this issue, this cl
gracefully handles an invalid window handle.
Change-Id: I6bace88370980e94676d4af9de0d88e561175835
Reviewed-on: https://swiftshader-review.googlesource.com/12808
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Casey Dahlin [Fri, 29 Sep 2017 00:18:41 +0000 (17:18 -0700)]
Add tests for AddSat/SubSat in Reactor
Bug b/
37495545
Test: New tests pass
Change-Id: Icc81729d8c65aadccdd685490218d298e671b638
Reviewed-on: https://swiftshader-review.googlesource.com/12768
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Casey Dahlin <sadmac@google.com>
Casey Dahlin [Wed, 28 Jun 2017 20:58:58 +0000 (13:58 -0700)]
Support saturating vector add and subtract on ARM32.
Bug b/
37495545
Change-Id: I1d025f894bb7cf08dcaafd950605781633596ab3
Reviewed-on: https://chromium-review.googlesource.com/689098
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Reviewed-on: https://swiftshader-review.googlesource.com/12748
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 27 Sep 2017 18:33:11 +0000 (14:33 -0400)]
Support vector shift by constant for ARM32.
This also fixes the encoding of right shifts with unsigned elements.
Bug b/
37496338
Change-Id: I9a1dc91359daea5f4391a137b7f9e03bd941146b
Reviewed-on: https://chromium-review.googlesource.com/688057
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Reviewed-on: https://swiftshader-review.googlesource.com/12668
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 18 Apr 2017 19:14:16 +0000 (15:14 -0400)]
Add intrinsic lowering stubs for ARM.
Change-Id: I24a2ac536c24732538cc5c7f2aad4e7763989f9e
Reviewed-on: https://chromium-review.googlesource.com/568673
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Reviewed-on: https://swiftshader-review.googlesource.com/12690
Tested-by: Nicolas Capens <nicolascapens@google.com>
Aaron Gable [Wed, 26 Jul 2017 22:11:04 +0000 (15:11 -0700)]
Upload pnacl-subzero changes to Gerrit by default
R=bradnelson@chromium.org
Bug: 665593
Change-Id: I1b9a5fd31c5e426bd193a32a2feb291eb17af5a6
Reviewed-on: https://chromium-review.googlesource.com/587993
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Reviewed-on: https://swiftshader-review.googlesource.com/12689
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Lei Zhang [Tue, 23 May 2017 22:08:59 +0000 (15:08 -0700)]
Do not inline GlobalContext TLS methods.
The gold linker thinks that causes an ODR violation.
BUG=chromium:449754
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
2896133003 .
Patch from Lei Zhang <thestig@chromium.org>.
Change-Id: I7f39b1f6e638ad3462b9b462ebdb6348473b9fc5
Reviewed-on: https://swiftshader-review.googlesource.com/12688
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 27 Sep 2017 15:47:35 +0000 (11:47 -0400)]
Refactor vector packing.
x86 vector packing instructions always treat the input as having signed
integer components, but can perform signed or unsigned saturation on
the output. In Reactor the Pack() intrinsic has overloads which
differentiate between them based on the signedness of the input, but
this is confusing.
Also simplify emulation of saturating add/subtract.
Bug b/
37496082
Change-Id: I0625fff429ffb40f42baf9600c7760d9858b5d89
Reviewed-on: https://swiftshader-review.googlesource.com/12548
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 27 Sep 2017 16:56:26 +0000 (12:56 -0400)]
Break on gtest failures in debug mode.
Google Test by default disables breaking into the debugger to be able
to run to completion without interaction. Enable it for debug builds
within Visual Studio.
Change-Id: If36e3d74ab1ec98eefa221761e02a33bd8117151
Reviewed-on: https://swiftshader-review.googlesource.com/12588
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 27 Sep 2017 14:44:13 +0000 (10:44 -0400)]
Build before debugging with Visual Studio Code.
Call make before launching a debug session. Also move from the 'build'
subdirectory to the 'debug' subdirectory to allow for a separate
release build or other configuration.
Change-Id: I6db00a5bb0a707ebbf9c160897852526a8bb73e1
Reviewed-on: https://swiftshader-review.googlesource.com/12528
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 27 Sep 2017 14:22:08 +0000 (10:22 -0400)]
Fix initial framerate and show maximum.
We don't start timing until after the first frame finished rendering
and is presented, so the frame count has to be 0 at that point.
Change-Id: Ic242bb5625c6c50694e7625008565ee421859624
Reviewed-on: https://swiftshader-review.googlesource.com/12488
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 27 Sep 2017 17:15:59 +0000 (13:15 -0400)]
Fixed crash in Renderer
The problem was at line 827, where "(qHead - qSize) % 32" could give
unexpected results if qSize > gHead (which wasn't a problem with
unsigned values). Also removed other % operations which could have
cause some issues.
Change-Id: Ia443e05ce1add3879720e90f7dbac771e712d2ab
Reviewed-on: https://swiftshader-review.googlesource.com/12568
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Alexis Hetu [Wed, 27 Sep 2017 14:31:28 +0000 (10:31 -0400)]
Linux build fix
The copy constructor of std::atomic is not allowed, so initialization
through operator= is not allowed. Explicitly using the AtomicInt
constructor to fix this issue.
Change-Id: If77763e89e0d958d8a4b5a83d5d7bd9e3ba08ff6
Reviewed-on: https://swiftshader-review.googlesource.com/12508
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Alexis Hetu [Mon, 25 Sep 2017 19:56:44 +0000 (15:56 -0400)]
Properly initializing image's memory
MSAN detected uninitialized memory which caused many test failures.
This can be easily fixed by zeroing out the memory before calling
XCreateImage.
Change-Id: I913c818ef38446055af7fd6aa885028e5f3f8bfb
Reviewed-on: https://swiftshader-review.googlesource.com/12388
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Fri, 22 Sep 2017 21:02:24 +0000 (17:02 -0400)]
More data races fixed
A few more variables were causing possible data races,
so they were changed to AtomicInt variables.
Change-Id: Icf233482528e086fc58f6919232ab2e3f0784689
Reviewed-on: https://swiftshader-review.googlesource.com/12368
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 20 Sep 2017 15:24:52 +0000 (11:24 -0400)]
Use atomic operations to specify shared memory access order
TSAN detected many data race errors in the SwiftShader Renderer
class. x86 has a strong memory ordering model which guarantees
that changes are observed in the same order by other threads.
However, C++ does not provide such guarantees unless specified
using atomic operations. In order to fix these, a new AtomicInt
class was added which is a basically a wrapper class for
std::atomic<int> and which only exposes the portion of the API
required by SwiftShader.
Since std::atomic isn't available on older versions of Android,
a fallback class was implemented without using std::atomic, which
is closer to the previous implementation. Both classes appear to
work properly after performing a few dEQP tests. Both also perform
similarly.
A few minor changes were made in order to attempt to reduce the use
of atomic integer operations when possible.
Change-Id: Ife6d3a2b6113346f8f8163b692e79c2a0e03b22f
Reviewed-on: https://swiftshader-review.googlesource.com/12308
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 20 Sep 2017 19:55:08 +0000 (15:55 -0400)]
Enable more checks on Chromium trybots
In order to catch errors faster, this change enables asserts on
Chromium trybots.
Change-Id: Ifdc4c9e0ec7d54aa7f6f333d992054c4e0062efe
Reviewed-on: https://swiftshader-review.googlesource.com/12328
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 15 Sep 2017 18:59:38 +0000 (14:59 -0400)]
Implement X11 onscreen framerate counter.
This FPS counter is disabled by default.
Change-Id: Ida04352dece25a212cb678c9ceca4c31d654f373
Reviewed-on: https://swiftshader-review.googlesource.com/12128
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Mon, 18 Sep 2017 15:33:59 +0000 (11:33 -0400)]
Fix implementation format for default renderbuffer.
The spec defines that the initial state for a newly bound renderbuffer
has a format of RGBA4. However, when querying the number of red/green/
blue/alpha/depth/stencil bits, we should report the actual number of
bits allocated (0), and not assert.
Bug chromium:765912
Bug b/
25351344
Change-Id: Icc3eb59e76bcbd6f0f2f16a2a75ace706ae17251
Reviewed-on: https://swiftshader-review.googlesource.com/12148
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 15 Sep 2017 15:49:31 +0000 (11:49 -0400)]
Fix polygon offset depth clamp and units resolution.
OpenGL requires depth values to be clamped to the [0, 1] range. Due to
frustum clipping already limiting the range, this can only happen when
non-zero polygon offset parameters are active.
Also fix the 'minimum resolvable difference' for the 32-bit floating-
point internal depth format that we use.
Bug swiftshader:82
Change-Id: Ic9ebcac182a2bc81ab51d79cfe0bb451d340bd1e
Reviewed-on: https://swiftshader-review.googlesource.com/12108
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 14 Sep 2017 15:11:07 +0000 (11:11 -0400)]
Fix libGL build.
This does not fix the OGLSimpleCube sample. See swiftshader:81.
Change-Id: I4bb5755d8b63f234965c3d12f774706968f2d34e
Reviewed-on: https://swiftshader-review.googlesource.com/12088
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 12 Sep 2017 20:39:42 +0000 (16:39 -0400)]
Free thread-local storage implicitly on thread termination.
Some applications may not call eglReleaseThread() before terminating a
thread, which can cause a minor memory leak. pthread_key_create()
supports specifying a destructor callback to implicitly free the
thread-local storage on thread termination. On Windows we use the
DLL_THREAD_DETACH signal to free it explicitly. This change also
simplifies TLS management by removing the ability to set a new value.
Bug swiftshader:80
Change-Id: I249ca519c1c9ab722e570516d0931cb17ea081bb
Reviewed-on: https://swiftshader-review.googlesource.com/12068
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Mon, 11 Sep 2017 16:19:51 +0000 (12:19 -0400)]
Fix sign-correcting of masked stencil reference.
The stencil test compares the unsigned masked reference value against
the unsigned masked stencil value. But because x86 vector instructions
only support signed comparison, we have to add 0x80 to both sides.
However, this offset was incorrectly added before the masking.
Bug b/
64683344
Change-Id: I49748e25d8d99e1c2b3c87d3dbe74a9dba75fb1c
Reviewed-on: https://swiftshader-review.googlesource.com/12028
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 5 Sep 2017 18:06:06 +0000 (14:06 -0400)]
Fix thread-local storage memory leak.
eglReleaseThread() was leaking some memory because even though it
deletes the 'current' thread state, it was inadvertently getting
re-allocated when recording the success error state.
Change-Id: I92efb1b34e62a21998b4fc19aaeba6473b06548b
Reviewed-on: https://swiftshader-review.googlesource.com/11968
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 1 Sep 2017 15:08:44 +0000 (11:08 -0400)]
Fix constant vector construction for emulated types.
Emulated vectors have fewer elements than their underlying type, e.g.
v4i16 is stored in the lower half of a v8i16 vector, but for constant
vector construction we need to provide values for all the elements of
the underlying vector.
Bug b/
65124545
Change-Id: Iaf942c4d517b1d4d464894ec501f7d339ae86438
Reviewed-on: https://swiftshader-review.googlesource.com/11908
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 31 Aug 2017 16:41:40 +0000 (12:41 -0400)]
Clarify new dependencies since project Treble.
Change-Id: Ia4feb6791c6da8dc4beef86aab7eb4fa06af461b
Reviewed-on: https://swiftshader-review.googlesource.com/11869
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Jiyong Park [Fri, 18 Aug 2017 10:07:26 +0000 (19:07 +0900)]
Build lib*_swiftshader with BOARD_VNDK_VERSION
When BOARD_VNDK_VERSION is set, a vendor lib cannot link against a
platform lib and is not provided with global include path. So, some
internal libraries such as swiftshader_top_[release|debug] were also
marked as vendor module and dependency to some header libs
(libhardware_headers, libnativebase_headers, etc.) were added
explicitly.
Bug:
64704866
Test: lunch sdk_gphone_x86-user, BOARD_VNDK_VERSION=current m -j
libEGL_swiftshader libGLESv1_CM_swiftshader libGLESv2_swiftshader
successful
Change-Id: I37851c9876f7f7c247bbc5d6e18946cb5bf72fa2
Reviewed-on: https://swiftshader-review.googlesource.com/11868
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 16 Aug 2017 21:15:48 +0000 (17:15 -0400)]
Allow Chromium to create an OpenGL ES3 context
Removing the "STRICT_CONFORMANCE" restriction from Chromium.
This allows OpenGL ES3 context creation when using the flag
"--use-gl=swiftshader", which is the case when running layout
tests.
This does not allow WebGL 2 content to be used when using the
flag "--disable-gpu". This will require extra validation on the
Chromium side.
Change-Id: Ic4770c1acbc454a954e1ce813ebed9ed3aee5cd2
Reviewed-on: https://swiftshader-review.googlesource.com/11750
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Alexis Hetu [Wed, 16 Aug 2017 20:37:19 +0000 (16:37 -0400)]
glGetFragDataLocation implementation
Implemented glGetFragDataLocation. There's very little coverage for
this function in dEQP, but the one test that uses it passes.
Change-Id: I6cfc93d7eaad54f23c922e45dafee9cba3401c83
Note: Chromium's ES3 path requires this function to be implemented.
Reviewed-on: https://swiftshader-review.googlesource.com/11728
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 16 Aug 2017 17:43:33 +0000 (13:43 -0400)]
Implement GL_MAX_PROGRAM_TEXEL_OFFSET and GL_MAX_TEXTURE_LOD_BIAS
- GL_MAX_PROGRAM_TEXEL_OFFSET and GL_MIN_PROGRAM_TEXEL_OFFSET were
technically already properly implemented, since the spec mentions
that the behavior outside of these limits is undefined, and
SwiftShader has no actual hard limit for these parameters.
- GL_MAX_TEXTURE_LOD_BIAS also has no hard limit in SwiftShader,
other than the limit imposed on LOD itself, so that limit was
used for GL_MAX_TEXTURE_LOD_BIAS.
Change-Id: I60b15b7f7a0febbc3e6582caff6c6a414a5d4964
Reviewed-on: https://swiftshader-review.googlesource.com/11709
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Robert Liao [Mon, 14 Aug 2017 17:51:58 +0000 (10:51 -0700)]
Remove /RTC1 for Windows Debug Builds
SwiftShader requests the optimized flags for debug buidls for
performance. This leads to an incompatible use of /O1 and /RTC1.
BUG=chromium:755195
Change-Id: I53b6f99a67d0b8d5fc5932b677ee278aca300702
Reviewed-on: https://swiftshader-review.googlesource.com/11594
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Robert Liao <robliao@chromium.org>
Nicolas Capens [Sat, 12 Aug 2017 12:49:04 +0000 (08:49 -0400)]
Build with a newer version of XCode.
Travis CI by default uses XCode 7.3 on Mac OS X, which does not support
the C++11 thread_local keyword expected by Subzero. Request XCode 8 GM
instead.
Change-Id: I0afa7804997ff5b5a6bbfe7829ba6134fe3d54ca
Reviewed-on: https://swiftshader-review.googlesource.com/11548
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Sat, 12 Aug 2017 03:21:29 +0000 (23:21 -0400)]
Restrict the Travis CI Linux distro to Trusty.
matrix.include adds to the default builds which use Ubuntu Precise
which doesn't come with C++11 support by default.
Change-Id: I3c009bedc62aefd3363f749bb3cb22e9bc36fb9a
Reviewed-on: https://swiftshader-review.googlesource.com/11528
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 11 Aug 2017 21:07:51 +0000 (17:07 -0400)]
Enable Travis CI builds on Mac OS X.
Change-Id: I36a39720b34ccc58276f9943bf6ef289b1af9b1e
Reviewed-on: https://swiftshader-review.googlesource.com/11511
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 10 Aug 2017 20:57:25 +0000 (16:57 -0400)]
Restrict building Subzero to Marshmallow and up.
Subzero requires full C++11 support, which isn't available on Android
versions prior to Marshmallow.
Change-Id: Icf09a51b525a1503f72441c969a9e364306096bd
Reviewed-on: https://swiftshader-review.googlesource.com/11488
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Thu, 10 Aug 2017 17:52:42 +0000 (13:52 -0400)]
Always produce an optimized library on Chromium
The SwiftShader library, when used to render Layout Tests in Debug,
causes too many timeouts. For that reason, we need the Debug version
of the library have better overall performance. In Debug, the
"default_optimization" defaults to "no_optimization". See:
https://cs.chromium.org/chromium/src/build/config/compiler/BUILD.gn?l=1698
In Release, "default_optimization" defaults to "optimize", so in
order to at least use the same optimization flags in both case, we
replace "default_optimization" by "optimize" in Debug.
The Win 7 (dbg) bot ran successfully with this change (the
telemetry_tests were failing when building the full Release version
of the SwiftShader library with the Debug version of Chromium).
Change-Id: I3529160b539319e26f9898d2588536d378c3ee01
Reviewed-on: https://swiftshader-review.googlesource.com/11469
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Nicolas Capens [Thu, 7 Apr 2016 05:03:14 +0000 (01:03 -0400)]
Restrict GLSL globals to be initialized with constant expressions.
This follows the GLSL ES 1.0 and 3.0 specs more strictly.
Change-Id: I323e90ef0a1588109e2cb7988136a9520e501a6d
Reviewed-on: https://swiftshader-review.googlesource.com/5065
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 26 May 2015 06:09:27 +0000 (02:09 -0400)]
Eliminate unnecessary inverse masks.
~mask[i % size] is the same as mask[~i % size] because it's just an
expansion of i, so there's no need for invMask[] to store the former.
Change-Id: I754732a2c4978281d35037941ecb74448ab78a8e
Reviewed-on: https://swiftshader-review.googlesource.com/3258
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Branimir Karadžić [Fri, 1 Jul 2016 16:34:28 +0000 (09:34 -0700)]
Fixed D3DQUERYTYPE_TIMESTAMP behaviour.
A timestamp query records the current time when it's issued, not when
the data is being retrieved.
Change-Id: Idb6e7fe6736a5b54bd23ef1613eaf953da86aa08
Reviewed-on: https://swiftshader-review.googlesource.com/5771
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Tue, 8 Aug 2017 15:31:11 +0000 (11:31 -0400)]
Skeleton for Ozone FrameBuffer implementation
This cl simply makes the code compile on Ozone. It does not implement
the FrameBufferOzone class, but provides a skeleton for it, which can
be implemented by people on the ChromeOS team.
Change-Id: Ib77e20b00e8208d992c80f47b5ba55e00254c812
Reviewed-on: https://swiftshader-review.googlesource.com/11348
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Tue, 8 Aug 2017 12:31:13 +0000 (08:31 -0400)]
Rollback debug specific changes to build files
There's an issue with the new debug specific path in the build files.
Rolling back these changes in order to do the DEPS roll while the
investigation on this issue continues.
Change-Id: I9c2174d3ec2ab4e8f817c7cae32f69af1728c6c2
Reviewed-on: https://swiftshader-review.googlesource.com/11328
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Nicolas Capens [Fri, 20 Jan 2017 16:34:37 +0000 (11:34 -0500)]
Generalize 4x32-bit vector swizzling.
This enables swizzling of Int4 and UInt4 types using swizzle operators.
Change-Id: I83fe5b472433d84a7b092e18eb78a919fb39b03b
Reviewed-on: https://swiftshader-review.googlesource.com/8530
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 4 Aug 2017 21:19:08 +0000 (17:19 -0400)]
Log an error when unsupported Android pixel formats are used.
Known projects avoid using HAL_PIXEL_FORMAT_RGB_888 because we have no
immediate desire to support it (for performance reasons), but other
users may run into unexpected issues that previously would leave no
trace.
Change-Id: Idc606809117f8e0b200b4b38c58ba24696e7193c
Reviewed-on: https://swiftshader-review.googlesource.com/11311
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 4 Aug 2017 13:13:37 +0000 (09:13 -0400)]
Check against sRGB formats for eglBindTexImage().
We currently don't support EGL configs/surfaces with sRGB formats.
Change-Id: Ie23a5121bec784fe807c03feae19442fece3f1d7
Reviewed-on: https://swiftshader-review.googlesource.com/11268
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Fri, 4 Aug 2017 17:26:44 +0000 (13:26 -0400)]
EGL header fix for OZONE
This should allow to compile on the OZONE platform
without hitting the X11 include library problem.
The change is imported from:
https://cs.chromium.org/chromium/src/third_party/khronos/EGL/eglplatform.h
Change-Id: I3b3acc139865797ce6c4173991f15840e91f5935
Reviewed-on: https://swiftshader-review.googlesource.com/11308
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Alexis Hetu [Fri, 4 Aug 2017 18:13:01 +0000 (14:13 -0400)]
Update EGL and KHR headers to Khronos's current version
Updated EGL and KHR headers as is, with one minor patch
applied in the ANDROID section of the eglplatform.h files.
Other files are unmodified from their Khronos version.
Change-Id: I2147df6bf36c7ec4c5cd6d32f8863b512a356112
Reviewed-on: https://swiftshader-review.googlesource.com/11310
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Alexis Hetu [Fri, 4 Aug 2017 17:29:28 +0000 (13:29 -0400)]
Enable Subzero on ChromeOS
Switching SwiftShader on ChromeOS from LLVM to Subzero.
Change-Id: Ica9ac278272f99b94d365f03fbd7a4860ad3503d
Reviewed-on: https://swiftshader-review.googlesource.com/11309
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Thu, 2 Jun 2016 15:50:47 +0000 (11:50 -0400)]
Fixed some function signatures
Fixed a few types in function signatures so that base and
derived classes signatures match.
Change-Id: Ide9b9c78ff05be785b512451a36c836f35bd1f3d
Reviewed-on: https://swiftshader-review.googlesource.com/5463
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Fri, 4 Aug 2017 15:48:17 +0000 (11:48 -0400)]
Fixed 'truncation of constant value' warning
Change-Id: I4e0e956bd34f5ec2a3c38208cb99ac476ec26623
Reviewed-on: https://swiftshader-review.googlesource.com/11290
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 3 Aug 2017 19:53:25 +0000 (15:53 -0400)]
Add libnativewindow dependency.
The functions relating to ANativeWindow have been split off from
libandroid into libnativewindow as part of project Treble.
Change-Id: I59850e4ba4145e49735698901dc2ba3480c68509
Reviewed-on: https://swiftshader-review.googlesource.com/11229
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 4 Aug 2017 13:40:46 +0000 (09:40 -0400)]
Suppress attributes warnings.
Older compiler versions warned about unknown attributes with
-Wattributes instead of -Wunknown-attributes. Use both and suppress
warnings about unknown warnings options too.
Change-Id: I22252426e73d4984471b9b8415479bd7b57ba0c5
Reviewed-on: https://swiftshader-review.googlesource.com/11289
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 4 Aug 2017 13:36:32 +0000 (09:36 -0400)]
Refactor Android includes.
Forward declare ANativeWindow, and remove <hardware/gralloc.h> where
GrallocAndroid.hpp already includes it.
Change-Id: Idebd4c40280960ff00cd51b6633c1c84a8cf7de2
Reviewed-on: https://swiftshader-review.googlesource.com/11288
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 4 Aug 2017 13:33:04 +0000 (09:33 -0400)]
Work around stlport build bug.
Older versions of Android using stlport were failing to compile with an
"assert has been defined before inclusion of assert.h header" error.
Change-Id: If8e13eb08c35a34d082d99f8f57188bc55697f59
Reviewed-on: https://swiftshader-review.googlesource.com/11270
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 4 Aug 2017 13:18:52 +0000 (09:18 -0400)]
Update eglplatform.h to match Android NDK.
This change has been part of the Android NDK since API 18, corresponding
with Android 4.3 Jelly Bean MR2.
Change-Id: I6df06f46c286ce89ea56913684e43d558917d1a8
Reviewed-on: https://swiftshader-review.googlesource.com/11269
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nico Weber [Thu, 3 Aug 2017 20:13:45 +0000 (16:13 -0400)]
Merge recent changes from LLVM's lib/Support/Atomic.cpp
In particular, https://reviews.llvm.org/D36281
Bug: chromium:495204
Change-Id: I48afb5b8dd594ce1b43c6ca9fb20638d40119236
Reviewed-on: https://swiftshader-review.googlesource.com/11248
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nico Weber <thakis@google.com>
Alexis Hetu [Thu, 3 Aug 2017 19:15:58 +0000 (15:15 -0400)]
Changed 'optimize_max' for 'optimize' compile option on Chromium
The 'optimize_max' option is not meant to be used by default for
Release builds. These use the 'optimize' config. See comment here
for explanation:
https://cs.chromium.org/chromium/src/build/config/compiler/BUILD.gn?l=1572
Change-Id: I7af8e3e4c7e92c60f38841b75998e2b488a5ffde
Reviewed-on: https://swiftshader-review.googlesource.com/11228
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Nicolas Capens [Thu, 3 Aug 2017 16:53:47 +0000 (12:53 -0400)]
Implement GL_OES_vertex_half_float.
This enables using half-float vertex data for OpenGL ES 2.0.
Note that GL_HALF_FLOAT_OES does not have the same value as
GL_HALF_FLOAT.
Change-Id: I0a7a55b7904fe797cdbb86627c8d0a1cc07d2d0a
Reviewed-on: https://swiftshader-review.googlesource.com/1500
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 2 Aug 2017 21:00:55 +0000 (17:00 -0400)]
Attempt to fix the MacOS build
On the mac_optional_gpu_tests_rel bot, a -Wall flag cancels out the
-Wno-unused-local-typedef warning suppression and causes the build
to fail. Attempting to reorder the configs order to solve the issue.
Change-Id: Ic790f5cb7803be4749616d826e1368ef76e2c889
Reviewed-on: https://swiftshader-review.googlesource.com/11212
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Alexis Hetu [Wed, 2 Aug 2017 20:36:30 +0000 (16:36 -0400)]
GL_R11F_G11F_B10F is a color renderable format in OpenGL ES 3.0
GL_R11F_G11F_B10F was missing from a utility function, causing some
dEQP tests to fail. Simply adding it fixes most R11F_G11F_B10F
related tests in:
functional.fbo.*
functional.fragment_out.*
functional.pbo.*
Change-Id: I0d77f1c9c01aff106e266853e81b4cf45f748bc1
Reviewed-on: https://swiftshader-review.googlesource.com/11211
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 2 Aug 2017 20:06:29 +0000 (16:06 -0400)]
Extra warnings suppression for Chromium
A few more warnings suppression were missing after the last build
file change. Added them here to hopefully fix build issues.
Change-Id: I80371a3ae59920dccf9c64a36c96d0341e7e39f5
Reviewed-on: https://swiftshader-review.googlesource.com/11210
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 2 Aug 2017 17:25:10 +0000 (13:25 -0400)]
Removed extra '-Wall' flag
The '-Wall' flag is already specified in Chromium and this '-Wall'
flag invalidates any previous '-Wno-*' flags. Removing it solves
the compilation issue.
Change-Id: Iceefb63ff7e04c55884cf26bbde0d62ffb74b217
Reviewed-on: https://swiftshader-review.googlesource.com/11208
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Wed, 2 Aug 2017 12:40:37 +0000 (08:40 -0400)]
SwiftShader always builds its release version in Chromium
SwiftShader's debug version was too slow for Chromium's debug
trybots. To solve this issue, SwiftShader now always builds
its release version in Chromium.
'git cl format' was ran in Chromium to ensure proper formatting
of the gn files.
Change-Id: I346045b68b566813ab6ab739aaa6eeb243d51853
Reviewed-on: https://swiftshader-review.googlesource.com/11188
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 1 Aug 2017 21:00:36 +0000 (17:00 -0400)]
Refactor sampleTexel() to use a return value.
We can rely on return value optimization to return Reactor types at the
same cost as passing them by reference.
Change-Id: I9f092bcefd17131a07bef32032c5f2ab98392328
Reviewed-on: https://swiftshader-review.googlesource.com/10569
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Tue, 1 Aug 2017 20:49:17 +0000 (16:49 -0400)]
Fixed loading GL_RGB10_A2UI texture format
The GL_RGB10_A2UI was being unpacked as a double sized version of
GL_UNSIGNED_SHORT_5_5_5_1, which it is not. The channels are not
stored in the same order for these 2 formats.
This fixes all "rgb10_a2ui" related test in:
dEQP-GLES3.functional.texture.format.sized.*
dEQP-GLES3.functional.texture.specification.*
Change-Id: I0d398d0537a440906e9ef3aeb01fe4e782f778b6
Reviewed-on: https://swiftshader-review.googlesource.com/11168
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 4 May 2017 16:09:19 +0000 (12:09 -0400)]
Remove recursive Chromium DEPS file.
Chromium pulled Subzero into third_party/pnacl-subzero using the recursive
DEPS file. We now have the Subzero source code in the SwiftShader repository
using Git subtree.
Bug swiftshader:47
Change-Id: I2c4c5e8c3413ccd187e4da11fbd014fb76ec572f
Reviewed-on: https://swiftshader-review.googlesource.com/9628
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 1 Aug 2017 03:12:19 +0000 (23:12 -0400)]
Use unorderer_map<> for def/use information.
Bug swiftshader:69
Change-Id: Ib4611e2326741688969137f0610980f899b8ee48
Reviewed-on: https://swiftshader-review.googlesource.com/11148
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 28 Jul 2017 21:30:51 +0000 (17:30 -0400)]
Emulate 64-bit vectors using 128-bit vectors.
This effectively eliminates all use of MMX instructions, using SSE ones
instead.
Bug swiftshader:78
Change-Id: I3e519a0c5172688ff711654bf430a9d1dd058d0b
Reviewed-on: https://swiftshader-review.googlesource.com/11049
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Fri, 28 Jul 2017 21:26:14 +0000 (17:26 -0400)]
Assume SSE2 support is available.
Chrome and many other products require SSE2 support as a minimum. Note
that MMX checks are left in place for now. Dead code paths are removed.
Bug swiftshader:78
Change-Id: Iabd8b1dc2092949d5dba29a78e75d014e808f12c
Reviewed-on: https://swiftshader-review.googlesource.com/11068
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 26 Jul 2017 21:26:17 +0000 (17:26 -0400)]
Abstract LLVM types to enable emulation.
This is just a refactoring, where the 'emulated' types still map to
the same types as before. They are represented using small integer
values reinterpret-casted as sw::Type*, while non-emulated types
correspond directly to llvm::Type pointers.
Bug swiftshader:78
Change-Id: I88c0b932a45119ce500821068d8fb5faa2ccbb92
Reviewed-on: https://swiftshader-review.googlesource.com/11048
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 26 Jul 2017 17:34:36 +0000 (13:34 -0400)]
Assume local variables are naturally aligned.
Using alignment = 0 to signify natural alignment will allow to discern
between loads/stores for stack variables, and dereferencing generic
pointers.
Bug swiftshader:78
Change-Id: I6d9c1728fb9858ca57380bc6bfafc7fb2fa5feae
Reviewed-on: https://swiftshader-review.googlesource.com/10968
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 27 Jul 2017 18:21:46 +0000 (14:21 -0400)]
Remove sub-vector load/store address hack.
The Optimizer used to assume that loads and stores using the same
address are of the same tpe. This is false for emulated sub-vector
load/store, and thus we tricked it into thinking the addresses are
different by performing some redundant arithmetic. This is no longer
necessary now that the Optimizer checks the types being loaded/stored.
Bug swiftshader:48
Change-Id: Ic212d67fefd9e8dd902ff576b69458208c3c379d
Reviewed-on: https://swiftshader-review.googlesource.com/11088
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Alexis Hetu [Fri, 28 Jul 2017 17:43:25 +0000 (13:43 -0400)]
GLSL bitwise NOT implementation
The bitwise NOT operation is supported for integer types in GLSL.
All the plumbing was already there, only the actual call was missing.
In dEQP, all shaders.operator.unary_operator.bitwise_not tests pass.
Change-Id: I938104b860441f6b2df6c807d578f651e5cd2516
Reviewed-on: https://swiftshader-review.googlesource.com/11108
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Tue, 25 Jul 2017 21:48:00 +0000 (17:48 -0400)]
gl_VertexID implementation
This cl implements support for gl_VertexID.
Passes the functional.shaders.builtin_variable.vertex_id test.
Change-Id: I5550e3ecba30e29f1e38ace608d730833a1e9598
Reviewed-on: https://swiftshader-review.googlesource.com/10958
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 26 Jul 2017 17:50:04 +0000 (13:50 -0400)]
Fix sign masks of narrow vectors.
The SignMask intrinsic returns the most significant bit of each byte in
a 128-bit vector. For 'emulated' 8-byte vectors we expect the upper
half to be ignored.
Change-Id: I994e35fb9c21710c35a89add42297c3c9bad07a4
Reviewed-on: https://swiftshader-review.googlesource.com/10988
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 21:26:14 +0000 (17:26 -0400)]
Emulate vector square root intrinsic.
Bug b/
64034197
Change-Id: I2d77dcb2f93b21abeb0eac1dcb8ca02ef6e5796b
Reviewed-on: https://swiftshader-review.googlesource.com/10957
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 19:32:12 +0000 (15:32 -0400)]
Emulate MultiplyAddPairs intrinsic.
Bug b/
37496078
Change-Id: I2940cee7a7b174c98f28282831c414c1f524702d
Reviewed-on: https://swiftshader-review.googlesource.com/10933
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 19:32:12 +0000 (15:32 -0400)]
Emulate MultiplyHigh intrinsics.
Bug b/
37496856
Change-Id: Ifea992edcb97d178e079a39d2a1b6b604cfa657e
Reviewed-on: https://swiftshader-review.googlesource.com/10956
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 19:32:12 +0000 (15:32 -0400)]
Emulate vector packing intrinsics.
Bug b/
37496082
Change-Id: I993f34baf6169b0bc3c37742f6238dba38a67d0a
Reviewed-on: https://swiftshader-review.googlesource.com/10955
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 19:32:12 +0000 (15:32 -0400)]
Emulate saturated vector add/subtract.
Bug b/
37495545
Change-Id: I767f7b5555706cd42b80863fe1ae04b36f4f1189
Reviewed-on: https://swiftshader-review.googlesource.com/10932
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 19:32:12 +0000 (15:32 -0400)]
Emulate SignMask intrinsics.
Bug b/
37496809
Change-Id: I34d0d511bd50890c36d292ab431115f5d2e65a58
Reviewed-on: https://swiftshader-review.googlesource.com/9492
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 19:32:12 +0000 (15:32 -0400)]
Emulate vector shift by immediate intrinsics.
Bug b/
37496338
Change-Id: I01e4aaf49e86d9c2f11647a0e84bf1ee388a90cf
Reviewed-on: https://swiftshader-review.googlesource.com/10931
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 26 Apr 2017 17:36:33 +0000 (13:36 -0400)]
Emulate sub-vector load/store intrinsics.
Bug b/
37496321
Change-Id: I173b458a0d1d477ad75deaa33508ae1766c182c0
Reviewed-on: https://swiftshader-review.googlesource.com/9491
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 19:31:45 +0000 (15:31 -0400)]
Default to Subzero for ARM CMake build.
Change-Id: I4eaee73caca1e2552cd63901a6c9107efbeaa2f8
Reviewed-on: https://swiftshader-review.googlesource.com/10930
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 17:56:46 +0000 (13:56 -0400)]
Support bitcasts between scalars and short vectors.
Subzero only supports 128-bit vectors currently, but we need to support
bitcasting between scalars and (emulated) short vectors of the same
size. Subzero implicitly supports it on x86 by using movd instructions,
but on ARM we have to emulate it in Reactor until support for it is
added in Subzero.
Bug swiftshader:48
Change-Id: I95accbc3665815a46dac8e52ce30939ac64aaf44
Reviewed-on: https://swiftshader-review.googlesource.com/10929
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 17:24:40 +0000 (13:24 -0400)]
Replace only loads matching the store type.
If a load uses the same address as a previous store, we can only
replace it with the store's data when their types match. Also,
stores can only be eliminated when all the loads following them have
been replaced.
Bug swiftshader:48
Change-Id: I5968b256cb295243c30df3598e49015bccb5bff1
Reviewed-on: https://swiftshader-review.googlesource.com/10950
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Tue, 25 Jul 2017 16:57:12 +0000 (12:57 -0400)]
Don't eliminate wide store followed by a narrow one.
If the previous store operation is wider than the next one, we can't
eliminate it because there could be a subsequent wide load reading its
non-overwritten data.
Bug swiftshader:48
Change-Id: Iccb9cabad8ab8503140061ec4ce711a2959de33d
Reviewed-on: https://swiftshader-review.googlesource.com/10948
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 26 Jul 2017 15:30:33 +0000 (11:30 -0400)]
Refactor checking for sub-vector intrinsics.
Bug swiftshader:48
Change-Id: I05352fd64cb2e5a929295ff6a8f6196da7fdbb4b
Reviewed-on: https://swiftshader-review.googlesource.com/10949
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Mon, 24 Jul 2017 20:54:44 +0000 (16:54 -0400)]
Fix RValue<T> construction from incorrect types.
When constructing an RValue<T> from a Value, the types should match.
Else a bitcast is required.
Bug swiftshader:48
Change-Id: I5073091524d2f56681dab052c9f84a06b3be7b4f
Reviewed-on: https://swiftshader-review.googlesource.com/10908
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Wed, 26 Jul 2017 17:55:52 +0000 (13:55 -0400)]
Add license badge.
Change-Id: I0d25174bc92b6228f433f5d6840d3d94223c683e
Reviewed-on: https://swiftshader-review.googlesource.com/11008
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Tue, 25 Jul 2017 20:04:45 +0000 (16:04 -0400)]
glGetString fix
glGetString wasn't returning es3 specific extensions.
Change-Id: Ief89eb448b3e821bfb7919ece97c03976569060c
Reviewed-on: https://swiftshader-review.googlesource.com/10954
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Mon, 24 Jul 2017 15:30:55 +0000 (11:30 -0400)]
Suppress UBSan false positives.
Function pointers from exported functions are wrongly flagged as being
of incorrect type. This happens both on libEGL and libGLESv2 entry
functions, as well as functions called between them.
Bug chromium:746914
Change-Id: I2bf5a8f06546c233ede7a4820c0cda3e997f096e
Reviewed-on: https://swiftshader-review.googlesource.com/10868
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Mon, 24 Jul 2017 18:44:33 +0000 (14:44 -0400)]
Added UInt to FP cast
UInt4 -> Float4 already existed, but not UInt -> Float.
Added the scalar conversion code and used it in the
Blitter where appropriate.
Change-Id: I9ebf63fdf8b139b960237b269f2da088f6ecac86
Reviewed-on: https://swiftshader-review.googlesource.com/10888
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Nicolas Capens [Thu, 20 Jul 2017 18:14:09 +0000 (14:14 -0400)]
Fix clearing all samples of multisample render targets.
Only libGLESv2 was clearing all the samples of a multisample buffer.
Since all known APIs always clear all the samples, this could be
handled in the Renderer.
Bug swiftshader:77
Change-Id: Ib9adc3c61d263420ed0a0ae4828a693bd360b076
Reviewed-on: https://swiftshader-review.googlesource.com/10788
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Fri, 21 Jul 2017 15:41:13 +0000 (11:41 -0400)]
Fixed default color values for R and RG types
By default, in D3D, R, G or B channels default to 1 when no
value is assigned to them. In OpenGL, these channels default
to 0. Added an entry to Conventions to fix this issue.
In dEQP, this fixes all R and RG types tests from:
functional.texture.format.*
Change-Id: Ib5552aa36eaf4e3e1132f016f002250b40436227
Reviewed-on: https://swiftshader-review.googlesource.com/10828
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>