OSDN Git Service

android-x86/external-swiftshader.git
7 years agoImplement Pointer<> support for Subzero.
Nicolas Capens [Tue, 27 Sep 2016 18:18:07 +0000 (14:18 -0400)]
Implement Pointer<> support for Subzero.

Bug swiftshader:11

Change-Id: I794ef54a7c2ecde71ee6344c63955d2f838ff189
Reviewed-on: https://swiftshader-review.googlesource.com/7331
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoImplement initial Subzero based Reactor.
Nicolas Capens [Mon, 26 Sep 2016 19:09:10 +0000 (15:09 -0400)]
Implement initial Subzero based Reactor.

Bug swiftshader:6

Change-Id: I1de2fe8983c7b8d29e0295e5b4705697e5dd6df1
Reviewed-on: https://swiftshader-review.googlesource.com/7292
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdd LLVM dependencies for Subzero.
Nicolas Capens [Mon, 26 Sep 2016 19:02:51 +0000 (15:02 -0400)]
Add LLVM dependencies for Subzero.

Change-Id: I5ab054a5622c9f9dee099f5a3a30c3bb4079ffeb
Reviewed-on: https://swiftshader-review.googlesource.com/7291
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdd Subzero as submodule.
Nicolas Capens [Mon, 26 Sep 2016 19:02:08 +0000 (15:02 -0400)]
Add Subzero as submodule.

Change-Id: I7eb124ce596d2c7e2419a01a995ea6fa871c8a88
Reviewed-on: https://swiftshader-review.googlesource.com/7290
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoDon't return values from terminator instructions.
Nicolas Capens [Wed, 28 Sep 2016 14:36:57 +0000 (10:36 -0400)]
Don't return values from terminator instructions.

All LLVM instructions are LLVM values, but in the case of terminator
instructions their value is meaningless, and we don't use them.

Bug swiftshader:10

Change-Id: I9eb71e1dcea2614cb810021dfbf3c8908a7e2510
Reviewed-on: https://swiftshader-review.googlesource.com/7355
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoReduce header dependencies.
Nicolas Capens [Tue, 27 Sep 2016 14:49:52 +0000 (10:49 -0400)]
Reduce header dependencies.

This removes all Common headers from Reactor headers, making it
easier to use Reactor outside of SwiftShader.

Bug swiftshader:10

Change-Id: I35c5d138e781d4e911d206954d38e392714d4659
Reviewed-on: https://swiftshader-review.googlesource.com/7330
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoRename Nucleus.cpp to LLVMReactor.cpp.
Nicolas Capens [Mon, 26 Sep 2016 17:44:20 +0000 (13:44 -0400)]
Rename Nucleus.cpp to LLVMReactor.cpp.

Bug swiftshader:10

Change-Id: I258fc7d66988c5bb9a20f98ac33e87ae26379855
Reviewed-on: https://swiftshader-review.googlesource.com/7280
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoMove Reactor type definitions to Reactor.hpp.
Nicolas Capens [Mon, 26 Sep 2016 17:30:14 +0000 (13:30 -0400)]
Move Reactor type definitions to Reactor.hpp.

Just a refactoring, to make it clearer that Reactor types are the
higher level abstraction, with Nucleus the intermediate interface.

Bug swiftshader:10

Change-Id: I87d8a03cd05d7847511692c5ac9862e77d670801
Reviewed-on: https://swiftshader-review.googlesource.com/7279
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAbstract the Routine class.
Nicolas Capens [Wed, 28 Sep 2016 20:56:36 +0000 (16:56 -0400)]
Abstract the Routine class.

Bug swiftshader:10

Change-Id: I29b1de8c1adb67449a380c307d12e2aea21f32cc
Reviewed-on: https://swiftshader-review.googlesource.com/7251
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoDeprecate DLL precaching support.
Nicolas Capens [Thu, 22 Sep 2016 17:20:57 +0000 (13:20 -0400)]
Deprecate DLL precaching support.

It has bitrotted and should be reimplemented with support from the
Reactor back-end if needed again.

Bug swiftshader:10

Change-Id: Ie926903ccd8117e91b9d13bf031a7b88287e7276
Reviewed-on: https://swiftshader-review.googlesource.com/7250
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoRemove createCall() from the interface.
Nicolas Capens [Mon, 26 Sep 2016 15:45:17 +0000 (11:45 -0400)]
Remove createCall() from the interface.

It's only used for creating intrinsics calls, which is an
implementation detail.

Bug swiftshader:10

Change-Id: Ieac1303e08571e265e239e74c6ea84ece99b53e1
Reviewed-on: https://swiftshader-review.googlesource.com/7278
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoAbstract llvm::Value usage.
Nicolas Capens [Mon, 26 Sep 2016 14:32:29 +0000 (10:32 -0400)]
Abstract llvm::Value usage.

Bug swiftshader:10

Change-Id: Ide80a6d97f67ae04d9118307984235f8f4c2e3ad
Reviewed-on: https://swiftshader-review.googlesource.com/7277
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAbstract llvm::Constant usage.
Nicolas Capens [Sun, 25 Sep 2016 19:42:58 +0000 (15:42 -0400)]
Abstract llvm::Constant usage.

Bug swiftshader:10

Change-Id: Iaed1c9a078b82516db67fe0de287e7ea0362dc03
Reviewed-on: https://swiftshader-review.googlesource.com/7276
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAbstract llvm::BasicBlock usage.
Nicolas Capens [Sun, 25 Sep 2016 19:02:52 +0000 (15:02 -0400)]
Abstract llvm::BasicBlock usage.

Bug swiftshader:10

Change-Id: Ib45d459aa4f68e572b1deaa03e0aaf83002b7881
Reviewed-on: https://swiftshader-review.googlesource.com/7275
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAbstract llvm::Type usage.
Nicolas Capens [Tue, 20 Sep 2016 18:30:06 +0000 (14:30 -0400)]
Abstract llvm::Type usage.

Bug swiftshader:10

Change-Id: I86b80cb03ff48ff7273aaf23a8e4995b3436f825
Reviewed-on: https://swiftshader-review.googlesource.com/7274
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoEliminate llvm::ConstantInt and llvm::GlobalValue exposure.
Nicolas Capens [Fri, 23 Sep 2016 21:37:27 +0000 (17:37 -0400)]
Eliminate llvm::ConstantInt and llvm::GlobalValue exposure.

Use only llvm::Constant in the interface instead.

Bug swiftshader:10

Change-Id: Ideb2ed1ee083e4e6896c4bc8e8830ea02972b487
Reviewed-on: https://swiftshader-review.googlesource.com/7273
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoMove Nucleus statics to implementation side globals.
Nicolas Capens [Fri, 23 Sep 2016 20:45:13 +0000 (16:45 -0400)]
Move Nucleus statics to implementation side globals.

Bug swiftshader:10

Change-Id: I69105d8287e52f0f0573c45c59958994a56fc0af
Reviewed-on: https://swiftshader-review.googlesource.com/7214
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoMove MMX class to the implementation side.
Nicolas Capens [Tue, 20 Sep 2016 19:46:16 +0000 (15:46 -0400)]
Move MMX class to the implementation side.

Bug swiftshader:10

Change-Id: I24fc66248bd2f66d2e8bc2b2a15e6c8fadc47efb
Reviewed-on: https://swiftshader-review.googlesource.com/7213
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAndroid build fix
Alexis Hetu [Wed, 28 Sep 2016 19:52:21 +0000 (15:52 -0400)]
Android build fix

"false" could not be converted to a pointer type. Changed it to nullptr.
Also changed a few other "return 0" to "return nullptr".

Change-Id: Idd4573d4627bb89f1b79e3b21de5af5bd6063916
Reviewed-on: https://swiftshader-review.googlesource.com/7357
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
7 years agoFixed array constructors
Alexis Hetu [Wed, 28 Sep 2016 00:50:45 +0000 (20:50 -0400)]
Fixed array constructors

Fixed first class array constructors by allowing basic type
arrays and structure arrays to be handled properly for the
EOpConstruct* operations.

This fixes all dEQP.functional.shaders.arrays.* tests.

Change-Id: I4fe99ec5256abf6483d3595890ba9c426abc97f8
Reviewed-on: https://swiftshader-review.googlesource.com/7351
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixing Linux build
Alexis Hetu [Wed, 28 Sep 2016 18:16:44 +0000 (14:16 -0400)]
Fixing Linux build

There was an ambiguous type warning between Float4 and RValue<Float4>.

Change-Id: I526fc2430a66b8545e81fe5ae97fb423e7f01aec
Reviewed-on: https://swiftshader-review.googlesource.com/7356
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
7 years agoFixed Float4 -> UInt4 conversion
Alexis Hetu [Wed, 28 Sep 2016 12:44:22 +0000 (08:44 -0400)]
Fixed Float4 -> UInt4 conversion

It appears the Nucleus::createFPToUI function is broken and does
not yield the correct values for one pixel out of 4 when the f2u
operation is used. By manually rewriting the conversion using
signed int conversion and some arithmetic, the issue is solved.

This fixes at least 130 failures and also fixes many other tests
which were passing only due to the threshold being too lenient,
but which were showing obvious visual artefacts.

This affects, to the very least:
dEQP.functional.fbo.blit.conversion
dEQP.functional.shaders.functions.datatypes
dEQP.functional.shaders.operator.binary_operator
... and any other test using the f2u operation.

Change-Id: If38dad6b6ae8198f40e863d0847fa5080a2997e3
Reviewed-on: https://swiftshader-review.googlesource.com/7354
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdded missing types to PixelProgram::clampColor
Alexis Hetu [Wed, 28 Sep 2016 01:06:00 +0000 (21:06 -0400)]
Added missing types to PixelProgram::clampColor

A few types were missing: 8b/16b, signed/unsigned integers

Change-Id: I1c168b5df941f6c01801406ba7879221b682fb96
Reviewed-on: https://swiftshader-review.googlesource.com/7353
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix for the remaining vertex array issues
Alexis Hetu [Thu, 22 Sep 2016 19:36:45 +0000 (15:36 -0400)]
Fix for the remaining vertex array issues

Fixes all failures in dEQP.functional.vertex_arrays.*

In OpenGL ES 3.0, vertex attributes streams can be of a
different type from the vertex attribute in the shader.
For this reason, some conversion may be required. This
cl solves this issue by:
1) Sending the information about the vertex attribute's
   type in the shader to the vertex routine.
2) Handling this information by adding conversion where
   appropriate.

Change-Id: I04a5a34aea12684209e584aa5f15a3edfd57f956
Reviewed-on: https://swiftshader-review.googlesource.com/7254
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoGive SwiftShader libraries a unique name on Mac
Alexis Hetu [Fri, 23 Sep 2016 18:49:35 +0000 (14:49 -0400)]
Give SwiftShader libraries a unique name on Mac

It appears that some bundling operations on Mac actually
require that all libraries have a unique name, since
output_dir is effectively ignored and overwritten in that
scenario, so I have to remove that renaming code on Mac so
that SwiftShader doesn't clash with Angle.

Change-Id: I3d36df525ad9229da0c35f27d367e7deef7e430d
Reviewed-on: https://swiftshader-review.googlesource.com/7271
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdded constructor Int4(RValue<Byte4>) and Int4(RValue<SByte4>) to Nucleus.
Meng-Lin Wu [Fri, 10 Jun 2016 18:18:41 +0000 (14:18 -0400)]
Added constructor Int4(RValue<Byte4>) and Int4(RValue<SByte4>) to Nucleus.

To avoid duplicating code, Float4(RValue<Byte4>) and Float4(RValue<SByte4>) now call Int4(RValue<Byte4>) and Int4(RValue<SByte4>) respectively.

Change-Id: Ic49fdd151d15cc1c2753f535d3654028e7a1910a
Reviewed-on: https://swiftshader-review.googlesource.com/5560
Tested-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoKeeping only the data_deps change to BUILD.gn files
Alexis Hetu [Wed, 21 Sep 2016 17:47:42 +0000 (13:47 -0400)]
Keeping only the data_deps change to BUILD.gn files

It appears this issue might be fixable directly in chromium:
(https://codereview.chromium.org/2359913002/)
For now, removing the mac specific change.

BUG=31645700

Change-Id: I3d43c01f2d6500d67a298a047e8d98153f06dfb4
Reviewed-on: https://swiftshader-review.googlesource.com/7230
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoFixed a uniform buffer regression
Alexis Hetu [Wed, 21 Sep 2016 13:11:44 +0000 (09:11 -0400)]
Fixed a uniform buffer regression

The following cl had broken all fragment uniform buffers:
https://swiftshader-review.googlesource.com/6950

Since the null pointer check was only made on the vertex
uniform buffer, it was preventing the fragment uniform
buffer from being set, which was causing a crash when this
happened.

There was a second issue  with this cl, which was allowing
'uniformBuffers[-1].get()' to be called, which should not
have been allowed.

Also, it is safer to call VertexProcessor::setUniformBuffer
and PixelProcessor::setUniformBuffer unconditionally in order
to set the null pointers correctly when no buffers are set.

Change-Id: I275b0bca6173ee3df4e0e369926ed0a94500e1ba
Reviewed-on: https://swiftshader-review.googlesource.com/7216
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixed how SwiftShader is compiled on different platforms
Alexis Hetu [Wed, 21 Sep 2016 14:16:42 +0000 (10:16 -0400)]
Fixed how SwiftShader is compiled on different platforms

Since the swiftshader libraries are loaded at runtime
by chromium, the correct way to add swiftshader as a
dependency is to use 'loadable_module' for mac and
'data_deps' for other platforms.

BUG=31645700

Change-Id: Ic393a4132fbfc44e71247fc0294cca2cb57d35c8
Reviewed-on: https://swiftshader-review.googlesource.com/7217
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdded RG8 fragment output format
Alexis Hetu [Tue, 13 Sep 2016 22:41:27 +0000 (18:41 -0400)]
Added RG8 fragment output format

Tying up loose ends from the new output formats project.
One of the missing outputs was the RG8 format, which I added here.

Change-Id: I865ad4c462e892dbc3a7820003b2390b54453ee9
Reviewed-on: https://swiftshader-review.googlesource.com/7171
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixed R8I and R8UI fragment output formats
Alexis Hetu [Thu, 15 Sep 2016 21:54:05 +0000 (17:54 -0400)]
Fixed R8I and R8UI fragment output formats

There was a silly mistake in the code that I just found.
Instead of being ordered (1,2,3,4), the 4 pixels being
outputted were ordered (3,4,1,2), which was within the
tolerance threshold for most of the image, but exhibited
weird sparse diagonal lines of errors (values outside of
threshold). Reordered the pixels properly to fix the issue.

Change-Id: I082463d22e585e5ee98836a87ef60efca05e58f0
Reviewed-on: https://swiftshader-review.googlesource.com/7192
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdd Direct3D 8 implementation.
Nicolas Capens [Thu, 15 Sep 2016 13:32:16 +0000 (09:32 -0400)]
Add Direct3D 8 implementation.

Bug swiftshader:5

Change-Id: I6aec7237f2db6222702e828a2b9dae1a1a6ac9af
Reviewed-on: https://swiftshader-review.googlesource.com/7191
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixed default alpha value for integer types
Alexis Hetu [Thu, 15 Sep 2016 18:47:56 +0000 (14:47 -0400)]
Fixed default alpha value for integer types

The default alpha value for integer types is 1 and not the
largest representable value for that type, as it was
previously implemented. A value of 1 still means that the
texture is opaque. This fixes ~60 fragment output tests.

Change-Id: I96650fc8ba4812dcb8a2787979c6829f14f0960e
Reviewed-on: https://swiftshader-review.googlesource.com/7190
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoUpgrade to Visual Studio 2015 project files
Alexis Hetu [Mon, 11 Jul 2016 20:50:32 +0000 (16:50 -0400)]
Upgrade to Visual Studio 2015 project files

Change-Id: I5e8424e7150d1aaede8f5a23c34c7fb023959f0c
Reviewed-on: https://swiftshader-review.googlesource.com/5790
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoAllow all output to be written to in the vertex shader
Alexis Hetu [Tue, 5 Apr 2016 21:31:32 +0000 (17:31 -0400)]
Allow all output to be written to in the vertex shader

For transform feedback, any vertex shader output can be read from
and which outputs will be read by transform feedback buffers is not
known at compile time. For that reason, any output being written to
in the vertex shader code shouldn't be optimized out.

Change-Id: Ia4322c43b7e3308ec5d930650e70aacf032dc6ec
Reviewed-on: https://swiftshader-review.googlesource.com/5051
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoMade SwiftShader compile on Mac in Chromium
Alexis Hetu [Mon, 12 Sep 2016 21:45:55 +0000 (17:45 -0400)]
Made SwiftShader compile on Mac in Chromium

Fixed a few things in the BUILD.gn files:
1) Style guide mentions single entries should be on single lines
2) Changed "host_os == ..." for the is_... equivalent values
3) Added missing Mac libs and include dirs

Change-Id: I28d35fd86a8cf9c9157a397370a385fe3e5e958b
Reviewed-on: https://swiftshader-review.googlesource.com/7152
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoRe-enabling SwiftShader/Reactor warnings
Alexis Hetu [Fri, 9 Sep 2016 18:52:31 +0000 (14:52 -0400)]
Re-enabling SwiftShader/Reactor warnings

I've found no occurrence of warning 4530 being triggered and
only 3 conversion warning 4244, so I fixed them and re-enabled
them.

Change-Id: I06647466a12faf57c866f88f9124041324fc2490

7 years agoFix indexing with instance ID.
Nicolas Capens [Mon, 15 Aug 2016 19:33:58 +0000 (15:33 -0400)]
Fix indexing with instance ID.

BUG=swiftshader:3

Change-Id: I070059f3b4e9e431c7667b98017912b72d9d66a4
Reviewed-on: https://swiftshader-review.googlesource.com/6952
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoImplement Int to Int4 conversion.
Nicolas Capens [Mon, 15 Aug 2016 19:33:14 +0000 (15:33 -0400)]
Implement Int to Int4 conversion.

BUG=swiftshader:3

Change-Id: I114384fc0e25ee1f7874f726b85ef5bcaf01ed36
Reviewed-on: https://swiftshader-review.googlesource.com/6951
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixed alignment warnings
Alexis Hetu [Thu, 8 Sep 2016 17:59:50 +0000 (13:59 -0400)]
Fixed alignment warnings

Some alignment warnings were popping up on some windows bots.
Rather than silencing them, I just fixed them.

Change-Id: I21bc558e04498357c5d76a9caf9bd86f0a5cb540
Reviewed-on: https://swiftshader-review.googlesource.com/7131
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixed libGLESv2 conversion warnings
Alexis Hetu [Thu, 8 Sep 2016 20:40:59 +0000 (16:40 -0400)]
Fixed libGLESv2 conversion warnings

There were only a handful of integer conversion warnings in
libGLESv2, so I fixed them rather than silencing them.

Change-Id: I94a7f2d4e4c34a48a8f128e6303778ef23ac45c9
Reviewed-on: https://swiftshader-review.googlesource.com/7132
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoAdd TransGaming contributors.
Nicolas Capens [Wed, 7 Sep 2016 14:32:33 +0000 (10:32 -0400)]
Add TransGaming contributors.

Change-Id: I3e3207280ae4b7c66811c9ec11140ece2335112a
Reviewed-on: https://swiftshader-review.googlesource.com/7092
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix null pointer access by older Chrome versions.
Nicolas Capens [Tue, 6 Sep 2016 18:58:10 +0000 (14:58 -0400)]
Fix null pointer access by older Chrome versions.

Older Chrome branches still need the Register() function.

Bug chromium:644329

Change-Id: I6b07aea6e069604f3e5d9e08c97c287df31c0dd6
Reviewed-on: https://swiftshader-review.googlesource.com/7090
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
(cherry picked from commit 95db80e4269db8ee31432590defa699d6dd36f6b)
Reviewed-on: https://swiftshader-review.googlesource.com/7091
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixing intrinsics for Windows clang
Alexis Hetu [Wed, 31 Aug 2016 21:10:36 +0000 (17:10 -0400)]
Fixing intrinsics for Windows clang

Windows clang requires that intrinsics be properly declared
through intrin.h, otherwise, intrinsics were getting
manually declared through a pragma instruction from winnt.h
and clang returned an error.

Change-Id: Iddfa4e3d6c76388e986dc445e40fd05359c2763c
Reviewed-on: https://swiftshader-review.googlesource.com/7050
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoRenaming functions named after operator names
Alexis Hetu [Wed, 31 Aug 2016 21:22:13 +0000 (17:22 -0400)]
Renaming functions named after operator names

Windows clang has no option to do anything similar to
"-fno-operator-names", so it generates errors without
any way to silence them. Renaming these functions is
easy enough, so it was done here. Also removed the
now useless flag from the code blocks project files.

Change-Id: I9e25e25a72bf24567e3be928e07b187df87398bc
Reviewed-on: https://swiftshader-review.googlesource.com/7051
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFixed build files for Windows clang
Alexis Hetu [Wed, 31 Aug 2016 21:25:40 +0000 (17:25 -0400)]
Fixed build files for Windows clang

Made Windows files work for Windows clang.
Verified on Linux and Windows Visual Studio
compiler to make sure nothing was broken.

Change-Id: I82815491579cdfca602660279f6831c8820249f6
Reviewed-on: https://swiftshader-review.googlesource.com/7052
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
7 years agoFix uniform block binding.
Nicolas Capens [Fri, 12 Aug 2016 20:59:04 +0000 (16:59 -0400)]
Fix uniform block binding.

Bug swiftshader:2

Change-Id: I43c55f948a0816cf062b9b2e9d158c9a52fafdbc
Reviewed-on: https://swiftshader-review.googlesource.com/6930
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix accessing null pointer when no uniform buffer is bound.
Nicolas Capens [Mon, 15 Aug 2016 19:23:10 +0000 (15:23 -0400)]
Fix accessing null pointer when no uniform buffer is bound.

Bug b/30838145

Change-Id: I06aeafa6e7a8aefbc1d4447a9d2607895d07a096
Reviewed-on: https://swiftshader-review.googlesource.com/6950
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoMake memory for generated routines non-writable.
Anthony Vallee-Dubois [Mon, 17 Aug 2015 18:12:32 +0000 (14:12 -0400)]
Make memory for generated routines non-writable.

This change also fixes a missing include for memcmp().

Bug 14642677

Change-Id: I4207d259b9d7b20e0cb35ded65bacd5c2d882087
Reviewed-on: https://swiftshader-review.googlesource.com/3884
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoAdd a CMake option to toggle building extra programs.
Chinmay Garde [Thu, 11 Aug 2016 00:01:21 +0000 (17:01 -0700)]
Add a CMake option to toggle building extra programs.

Change-Id: I6b63d75ee2b18be92544227ff0162936f5a2328f
Reviewed-on: https://swiftshader-review.googlesource.com/6910
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Chinmay Garde <chinmaygarde@google.com>
7 years agoAdd link to prebuilt binaries.
Nicolas Capens [Thu, 11 Aug 2016 16:48:23 +0000 (12:48 -0400)]
Add link to prebuilt binaries.

Change-Id: I8b07e0a649abe5bc0580d8f2c8f43b0a398c5369
Reviewed-on: https://swiftshader-review.googlesource.com/6911
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoFix resetting the current context on thread/process detach.
Nicolas Capens [Thu, 23 Jun 2016 02:29:07 +0000 (22:29 -0400)]
Fix resetting the current context on thread/process detach.

Bug 29540271

Change-Id: I0a5a63ad74339aec31e73b4a95c8978696e95782
Reviewed-on: https://swiftshader-review.googlesource.com/5670
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoClarify the need for project and bias shader instruction flags.
Nicolas Capens [Thu, 4 Aug 2016 15:03:40 +0000 (11:03 -0400)]
Clarify the need for project and bias shader instruction flags.

Change-Id: I6efbb5b138d7fe1611c235c5062823a6386f9180
Reviewed-on: https://swiftshader-review.googlesource.com/5880
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
7 years agoShader cleanup
Alexis Hetu [Tue, 2 Aug 2016 15:18:14 +0000 (11:18 -0400)]
Shader cleanup

A couple of class members from PixelShader and VertexShader
were still public. Fixed that in this cleanup.

Change-Id: I2dfaac7fd4cecdc791f1ef7236148e74c4b5b486
Reviewed-on: https://swiftshader-review.googlesource.com/5850
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoRemoving unused file
Alexis Hetu [Tue, 2 Aug 2016 15:31:53 +0000 (11:31 -0400)]
Removing unused file

GLES/egl.h was unused.
EGL/egl.h is already used everywhere EGL is needed.

Change-Id: I1b8a6fc72a8eb9b63edfad73f29be6f8b1d210c1
Reviewed-on: https://swiftshader-review.googlesource.com/5851
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
7 years agoFix googlegroups link.
Nicolas Capens [Mon, 1 Aug 2016 19:36:23 +0000 (15:36 -0400)]
Fix googlegroups link.

Change-Id: I7b97d153187a108ef2953c39db77af8a4de962e6
Reviewed-on: https://swiftshader-review.googlesource.com/5840
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoChanged SwiftShader output
Alexis Hetu [Wed, 20 Jul 2016 21:05:17 +0000 (17:05 -0400)]
Changed SwiftShader output

To avoid having a library name mismatch between the LIBRARY lines of
the .def files and the output from the GN files, the output names
were restored to libEGL and libGLESv2, but the output directories
were changed to avoid clashing with the ANGLE libraries.

Also removed the warning silencing that's no longer required.

Change-Id: Ifa13d302ffa19acc04e46e4c772fa407a1c818bc
Reviewed-on: https://swiftshader-review.googlesource.com/5810
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
8 years agoFixed building SwiftShader libraries within Chromium on Windows
Alexis Hetu [Fri, 15 Jul 2016 17:58:14 +0000 (13:58 -0400)]
Fixed building SwiftShader libraries within Chromium on Windows

With this fix, SwiftShader libraries can successfully be built
on Windows using Chromium's build system and produce fully
functional libraries. Main issue was: the .rc files had not been
included in the 'sources' section.

Change-Id: Iec77f09c10af19828c52f10d01b405a7e352afab
Reviewed-on: https://swiftshader-review.googlesource.com/5800
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
8 years agoUpdate to BUILD.gn files
Alexis Hetu [Wed, 6 Jul 2016 21:43:22 +0000 (17:43 -0400)]
Update to BUILD.gn files

- Now compiles for all combinations of "component"/"not component",
  debug/release on Linux/Windows
- Cleaned up dependencies
- Added some Windows specific flags

Change-Id: I09c2eaec096ac7f73fdd5b9ab0d407fa29369b4c
Reviewed-on: https://swiftshader-review.googlesource.com/5785
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
8 years agoImprove documentation.
Nicolas Capens [Sun, 3 Jul 2016 03:41:30 +0000 (23:41 -0400)]
Improve documentation.

Change-Id: Iab20bde3fdf1fee5c6b47c748baae0266769e333
Reviewed-on: https://swiftshader-review.googlesource.com/5782
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFix support for routines taking no arguments.
Nicolas Capens [Sun, 3 Jul 2016 03:17:40 +0000 (23:17 -0400)]
Fix support for routines taking no arguments.

Change-Id: I678f4c94d140bb5cd66569336b2813b8c7c0e075
Reviewed-on: https://swiftshader-review.googlesource.com/5781
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFix Visual Studio 2015 compilation issues.
Nicolas Capens [Sat, 2 Jul 2016 03:12:12 +0000 (23:12 -0400)]
Fix Visual Studio 2015 compilation issues.

Change-Id: I1ec7075cbc53318a0e788672501519f302278298
Reviewed-on: https://swiftshader-review.googlesource.com/5780
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFix libGL compilation (missing spaces)
Michele Bissacco [Wed, 29 Jun 2016 20:44:08 +0000 (22:44 +0200)]
Fix libGL compilation (missing spaces)

Change-Id: Ic1748fefb6778a4eeab8a41f81803586025a60ee
Signed-off-by: Michele Bissacco <mirh@protonmail.ch>
Reviewed-on: https://swiftshader-review.googlesource.com/5740
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoEnable Short8 and UShort8 construction from pointer dereference.
Nicolas Capens [Thu, 30 Jun 2016 19:34:40 +0000 (15:34 -0400)]
Enable Short8 and UShort8 construction from pointer dereference.

Change-Id: I09efd94974a520b790ab1d3fe9e8dc91295948f9
Reviewed-on: https://swiftshader-review.googlesource.com/5762
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoEnable building SwiftShader for any Android target.
Nicolas Capens [Thu, 30 Jun 2016 17:15:27 +0000 (13:15 -0400)]
Enable building SwiftShader for any Android target.

Change-Id: Ifcfb673ed5f4c0eec0c24c829002aaf1b9870ad5
Reviewed-on: https://swiftshader-review.googlesource.com/5751
Reviewed-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Bo Hu <bohu@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFragment output RG, RGBA 16-bit formats.
Meng-Lin Wu [Mon, 20 Jun 2016 19:08:42 +0000 (15:08 -0400)]
Fragment output RG, RGBA 16-bit formats.

Relevant dEQP tests:
dEQP-GLES3.functional.fragment_out.basic.int.rg16i*
dEQP-GLES3.functional.fragment_out.basic.uint.rg16ui*
dEQP-GLES3.functional.fragment_out.basic.int.rgba16i*
dEQP-GLES3.functional.fragment_out.basic.uint.rgba16ui*

Change-Id: If57f6edb895c576f78cb4cdf6048c2063d884a6f
Reviewed-on: https://swiftshader-review.googlesource.com/5651
Tested-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFragment output R, RG, RGBA 8-bit formats.
Meng-Lin Wu [Thu, 16 Jun 2016 20:56:15 +0000 (16:56 -0400)]
Fragment output R, RG, RGBA 8-bit formats.

Relevant dEQP tests:
dEQP-GLES3.functional.fragment_out.basic.int.r8i*
dEQP-GLES3.functional.fragment_out.basic.uint.r8ui*
dEQP-GLES3.functional.fragment_out.basic.int.rg8i*
dEQP-GLES3.functional.fragment_out.basic.uint.rg8ui*
dEQP-GLES3.functional.fragment_out.basic.int.rgba8i*
dEQP-GLES3.functional.fragment_out.basic.uint.rgba8ui*

Change-Id: I2cfb79339830e2ae22ac902ce97b6c81559e0f53
Reviewed-on: https://swiftshader-review.googlesource.com/5630
Tested-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix casting a pointer to an integer safely.
Nicolas Capens [Thu, 30 Jun 2016 14:38:12 +0000 (10:38 -0400)]
Fix casting a pointer to an integer safely.

Only casting from an integer (any size) to a pointer using reinterpret_cast<>
is well-defined. Casting a pointer to an integer needs a large enough integer.

Bug 29894961

Change-Id: I51cf6923f4feeaf1860ca0565aa7d40b61918e67
Reviewed-on: https://swiftshader-review.googlesource.com/5750
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoSuppress macro redefinition warnings treated as error.
Nicolas Capens [Wed, 29 Jun 2016 16:20:00 +0000 (12:20 -0400)]
Suppress macro redefinition warnings treated as error.

Bug 29869215

Change-Id: Iedc281676fa6befd458c3a96a904024ec69d9741
Reviewed-on: https://swiftshader-review.googlesource.com/5730
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoTreat unsized RGBA/RGB textures as renderable.
Nicolas Capens [Wed, 29 Jun 2016 04:33:52 +0000 (00:33 -0400)]
Treat unsized RGBA/RGB textures as renderable.

Bug 29770672

Change-Id: I11472a3a1aa5a6e0cd28a846cd182350abd0da89
Reviewed-on: https://swiftshader-review.googlesource.com/5720
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoTurning on warnings as error in Visual Studio
Alexis Hetu [Tue, 28 Jun 2016 19:48:35 +0000 (15:48 -0400)]
Turning on warnings as error in Visual Studio

Disabled a few warnings and fixed a few warnings to enable
turning 'warnings as errors' on in Visual Studio.

Change-Id: I91e8e2d4d71794b73178f8d59c2f6fc872ad3085
Reviewed-on: https://swiftshader-review.googlesource.com/5710
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoShort4 warnings fixed
Alexis Hetu [Mon, 27 Jun 2016 15:50:40 +0000 (11:50 -0400)]
Short4 warnings fixed

Switched the Short4 constructor from 'short' to 'unsigned short'
in order to accept hexadecimal values, which is generally how
Short4 values are initialized.

Change-Id: I89eb41bfd65f9071ba42dbb6a06d4349cbb89d67
Reviewed-on: https://swiftshader-review.googlesource.com/5701
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoRe fixed minor warning
Alexis Hetu [Mon, 27 Jun 2016 20:04:31 +0000 (16:04 -0400)]
Re fixed minor warning

Turns out switching from 'size_t' to 'int' created different warnings.
Using 'unsigned int' solves all warnings.

Change-Id: I2c6c96fe6ed881bb6ce63717d53c8c5864273157
Reviewed-on: https://swiftshader-review.googlesource.com/5702
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImplement Reactor pointer subscript operator.
Nicolas Capens [Sat, 25 Jun 2016 06:39:23 +0000 (02:39 -0400)]
Implement Reactor pointer subscript operator.

Change-Id: I8f4604a0cd81f004d46172d286286722b6198dd5
Reviewed-on: https://swiftshader-review.googlesource.com/5700
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFixed more windows warnings
Alexis Hetu [Thu, 23 Jun 2016 15:32:07 +0000 (11:32 -0400)]
Fixed more windows warnings

- Fixed uninitialized variables in default cases
- Fixed truncation of values to float with static_cast

Change-Id: I81f3a243e66eaeb24cd92646c6ef1ca6cb0de9ce
Reviewed-on: https://swiftshader-review.googlesource.com/5682
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix retaining the processing routines when no update.
Nicolas Capens [Thu, 23 Jun 2016 20:23:13 +0000 (16:23 -0400)]
Fix retaining the processing routines when no update.

Change-Id: I891c320662b046a1a4a94cf24b86b386f2fdf66e
Reviewed-on: https://swiftshader-review.googlesource.com/5690
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFixed Windows warnings
Alexis Hetu [Thu, 23 Jun 2016 15:24:00 +0000 (11:24 -0400)]
Fixed Windows warnings

- Removed unused variables
- Removed unreachable code
- Fixed size_t <-> int conversions
- Fixed uninitialized variables

Change-Id: Ifc3912e92b8f0710094e939bd0da4757148b559a
Reviewed-on: https://swiftshader-review.googlesource.com/5681
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoUpdate to gn files for Windows
Alexis Hetu [Thu, 23 Jun 2016 15:06:46 +0000 (11:06 -0400)]
Update to gn files for Windows

This cl allows SwiftShader to be built on Windows within Chromium

Change-Id: I0fc9ec1dfc5012cc310695e13edc64c639b23fda
Reviewed-on: https://swiftshader-review.googlesource.com/5680
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoClarify Reactor arguments syntax.
Nicolas Capens [Mon, 20 Jun 2016 16:43:14 +0000 (12:43 -0400)]
Clarify Reactor arguments syntax.

Change-Id: I081fd1bf7334d8a2209b467f053b123a27627c27
Reviewed-on: https://swiftshader-review.googlesource.com/5650
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoAdditional Reactor documentation.
Nicolas Capens [Fri, 17 Jun 2016 17:47:28 +0000 (13:47 -0400)]
Additional Reactor documentation.

Change-Id: I6a55ee025662958921d51e28fdc37ececed827da
Reviewed-on: https://swiftshader-review.googlesource.com/5632
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoAdd bug tracker link.
Nicolas Capens [Fri, 17 Jun 2016 17:39:18 +0000 (13:39 -0400)]
Add bug tracker link.

Change-Id: Ib9165c2f5af911d78b55e68195af68059791e135
Reviewed-on: https://swiftshader-review.googlesource.com/5631
Reviewed-by: Shannon Woods <shannonwoods@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoEnabled pixel unpack buffers
Alexis Hetu [Fri, 17 Jun 2016 18:08:06 +0000 (14:08 -0400)]
Enabled pixel unpack buffers

Setting pixel unpack buffers was already supported, but they were still
unused. This cl enables them to be used as data when loading a texture.

This fixes ~200 pbo related dEQP tests.

Change-Id: Ibada594185dab4f14bebf892e4df817a7dfe8401
Reviewed-on: https://swiftshader-review.googlesource.com/5640
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT query for OpenGL ES 2.0.
Nicolas Capens [Tue, 14 Jun 2016 05:08:12 +0000 (01:08 -0400)]
Fix GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT query for OpenGL ES 2.0.

It is part of GL_EXT_color_buffer_half_float.

Change-Id: Icaba1efed8b4e5ad97e583ebdad7b777cf4c7ad8
Reviewed-on: https://swiftshader-review.googlesource.com/5596
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoCombine sampler method and option into a structure.
Nicolas Capens [Wed, 15 Jun 2016 20:45:53 +0000 (16:45 -0400)]
Combine sampler method and option into a structure.

Change-Id: Ie3caecf275ffb51fbd512560cb66fcf2a32b3bbe
Reviewed-on: https://swiftshader-review.googlesource.com/5595
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Meng-Lin Wu <marleymoo@google.com>
Tested-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoPerform texture coordinate projection early.
Nicolas Capens [Tue, 14 Jun 2016 02:02:36 +0000 (22:02 -0400)]
Perform texture coordinate projection early.

Change-Id: Ia907ff073bf00114b2a3e72c495bf96c5a57154e
Reviewed-on: https://swiftshader-review.googlesource.com/5592
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoPack texelFetch LOD as sampling coordinate's w component.
Meng-Lin Wu [Tue, 14 Jun 2016 15:11:25 +0000 (11:11 -0400)]
Pack texelFetch LOD as sampling coordinate's w component.

One less argument is emitted.

Vertex/PixelProgram sampleTexture function signature simplified.

Change-Id: I7aef3eb100ccb51a8bd9d5fd600c73b4843d30d9
Reviewed-on: https://swiftshader-review.googlesource.com/5600
Tested-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed writing to FORMAT_A8 and FORMAT_R8
Alexis Hetu [Wed, 15 Jun 2016 17:06:50 +0000 (13:06 -0400)]
Fixed writing to FORMAT_A8 and FORMAT_R8

Change-Id: Ia704d2c15f46effc534ae0c51fc82bf78be9428b
Reviewed-on: https://swiftshader-review.googlesource.com/5620
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdd Reactor documentation.
Nicolas Capens [Tue, 14 Jun 2016 19:36:01 +0000 (15:36 -0400)]
Add Reactor documentation.

Change-Id: Ib1b73a21dc2c3a23071e4817f24d32ad3a80c9ad
Reviewed-on: https://swiftshader-review.googlesource.com/5610
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFix Clang compilation.
Nicolas Capens [Tue, 14 Jun 2016 03:31:26 +0000 (23:31 -0400)]
Fix Clang compilation.

non-const lvalue reference cannot bind to a temporary.

Change-Id: I561cc8cfcedace6aab949e6e496203f39af77e2e
Reviewed-on: https://swiftshader-review.googlesource.com/5594
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoMinor constant cleanup
Alexis Hetu [Mon, 13 Jun 2016 21:22:08 +0000 (17:22 -0400)]
Minor constant cleanup

In order to make the code a bit more readable and a little
less error prone, constants that are the bitwise inverted
version of other constants are computed from those constants
rather than being recomputed from scratch.

Change-Id: I27759d23e9c72b683eeafe4583b76a62e8132f19
Reviewed-on: https://swiftshader-review.googlesource.com/5590
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoR8 fragment output format
Alexis Hetu [Wed, 4 May 2016 20:23:50 +0000 (16:23 -0400)]
R8 fragment output format

Related tests pass, modulo the current masking issue.

Change-Id: Iac1103e74a9cf18c480289210dd2bd957cc41069
Reviewed-on: https://swiftshader-review.googlesource.com/5300
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agotexelFetch implementation
Meng-Lin Wu [Tue, 7 Jun 2016 20:15:12 +0000 (16:15 -0400)]
texelFetch implementation

Passes all texelFetch and texelFetchOffset tests in dEQP.

Change-Id: Ic212d326d1c062f1947696e6963fef300b7737f1
Reviewed-on: https://swiftshader-review.googlesource.com/5512
Tested-by: Meng-Lin Wu <marleymoo@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoDelete thread data at eglReleaseThread.
Nicolas Capens [Mon, 13 Jun 2016 18:35:11 +0000 (14:35 -0400)]
Delete thread data at eglReleaseThread.

Bug 29279831

Change-Id: If5dbcb3e32e88d1e574d45d3368ed114fd4f85b7
Reviewed-on: https://swiftshader-review.googlesource.com/5581
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoRefactor process/thread attach/detach.
Nicolas Capens [Sun, 12 Jun 2016 20:11:25 +0000 (16:11 -0400)]
Refactor process/thread attach/detach.

These functions looked too much like EGL entry functions.

Change-Id: I29dda78a34d3eb53aad002bec83ea7a77cfac1c8
Reviewed-on: https://swiftshader-review.googlesource.com/5580
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix lvalue output parameter assignment.
Nicolas Capens [Sat, 11 Jun 2016 04:41:49 +0000 (00:41 -0400)]
Fix lvalue output parameter assignment.

Output parameters can be any kind of lvalue, such as struct members or
array elements.

Change-Id: I4dce9dddfa95f58275fe3f6a4acf55532330a8f7
Reviewed-on: https://swiftshader-review.googlesource.com/5570
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed warnings casting int to void*
Alexis Hetu [Thu, 9 Jun 2016 20:34:46 +0000 (16:34 -0400)]
Fixed warnings casting int to void*

Change-Id: I4be5d80931689d1ac66b58b316c24b16ab6fd761
Reviewed-on: https://swiftshader-review.googlesource.com/5550
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
8 years agoGN files, initial check in
Alexis Hetu [Tue, 7 Jun 2016 23:53:42 +0000 (19:53 -0400)]
GN files, initial check in

First version of Chromium build files for SwiftShader.
Works for Linux only at this point.
Other platforms are there, but untested at the moment.

Change-Id: I8f389db9937feda74c7009cf7a22938dab9e69d5
Reviewed-on: https://swiftshader-review.googlesource.com/5520
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed some virtual function related warnings
Alexis Hetu [Thu, 2 Jun 2016 14:53:13 +0000 (10:53 -0400)]
Fixed some virtual function related warnings

Some virtual functions with common names had different signature,
which generates warnings. These functions didn't need to be virtual,
so they are no longer virtual in order to fix the warnings.

Change-Id: I4d8f5a9fdb3f4f520efe1aea0ce5d179b519bf8b
Reviewed-on: https://swiftshader-review.googlesource.com/5461
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFix error code on invalid shader/program operation
Nicolas Capens [Thu, 9 Jun 2016 14:01:58 +0000 (10:01 -0400)]
Fix error code on invalid shader/program operation

The spec states that GL_INVALID_OPERATION is generated when a shader or
program function is called on the wrong object type. GL_INVALID_VALUE is
generated when there's no shader nor program object by that name.

Change-Id: Ia819857b533f226a90d9a9805b254b127da8c667
Reviewed-on: https://swiftshader-review.googlesource.com/5540
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoSilence unused private member warning
Alexis Hetu [Wed, 8 Jun 2016 19:04:56 +0000 (15:04 -0400)]
Silence unused private member warning

Removed mConfig from Context and related functions.

Change-Id: I91eba6a4dbbd8ff48f212a246b1894009d513436
Reviewed-on: https://swiftshader-review.googlesource.com/5531
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>