OSDN Git Service

android-x86/external-swiftshader.git
8 years agoFix Android emulator library loading on Windows.
Nicolas Capens [Tue, 1 Mar 2016 16:37:10 +0000 (11:37 -0500)]
Fix Android emulator library loading on Windows.

Change-Id: I1eb8764c622ffd99a5937fe539bf78dc01d77f23
Reviewed-on: https://swiftshader-review.googlesource.com/4911
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFixed color clear on multisampled rendertargets
Alexis Hetu [Mon, 29 Feb 2016 22:37:24 +0000 (17:37 -0500)]
Fixed color clear on multisampled rendertargets

Only the 1st sample's buffer of multisampled buffers was getting
cleared instead of clearing all the samples' buffers, which led
to incorrect results. Added a loop to fix the behavior.

Change-Id: If22ebf2df61ae6afbc4c2975a9baee3c18a2492b
Reviewed-on: https://swiftshader-review.googlesource.com/4910
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoCorrect reciprocal approximation for power-of-two values.
Nicolas Capens [Fri, 26 Feb 2016 04:58:33 +0000 (23:58 -0500)]
Correct reciprocal approximation for power-of-two values.

Intel's reciprocal approximation instruction is not exact for power-of-two
values. It provides 12 bits of mantissa precision and keeps a balance between
positive and negative errors, but the reciprocal of 2^x is not 2^-x. This
affects conformance tests which expect varyings not to be affected by the
perspective division. Correct for this by multiplying by the inverse.

Bug 27165393

Change-Id: Ie52ec511a14a4f447adc47ce9c875bbad03cd274
Reviewed-on: https://swiftshader-review.googlesource.com/4903
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoParser cleanup
Alexis Hetu [Wed, 24 Feb 2016 21:46:13 +0000 (16:46 -0500)]
Parser cleanup

Ported some changes from Angle. Added 4 new functions to
ParserHelper to remove some code from glslang.y. Added
some extra checks regarding qualifiers and precision.

Change-Id: I2856a764749bef0df500891eb4c003211e634673
Reviewed-on: https://swiftshader-review.googlesource.com/4900
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix evaluating empty loop condition to true.
Nicolas Capens [Thu, 25 Feb 2016 14:45:24 +0000 (09:45 -0500)]
Fix evaluating empty loop condition to true.

Bug 27351438

Change-Id: If15f0f91931f34af6e78ad773036b91ff5d57d01
Reviewed-on: https://swiftshader-review.googlesource.com/4902
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 FenceSync object ref count
Alexis Hetu [Thu, 25 Feb 2016 14:41:50 +0000 (09:41 -0500)]
Fixed FenceSync object ref count

FenceSync objects are ref counted objects, so the are deleted
using the release() method. This means that they need to be
refed at creation (since we only store the pointer inside the
map), otherwise we'll hit the assert at deletion.

FenceSync objects are currently only ever refed once (at creation)
and unrefed once (at deletion), but are not fully implemented yet.

Change-Id: Ie693ace8895b6140ae96f9325d5c48951c7e9730
Reviewed-on: https://swiftshader-review.googlesource.com/4901
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
8 years agoRemove unneeded libraries
Greg Hartman [Wed, 24 Feb 2016 04:08:48 +0000 (20:08 -0800)]
Remove unneeded libraries

Change-Id: I827b663c9e3018162b192f267fc038ada4b5ac36
Reviewed-on: https://swiftshader-review.googlesource.com/4879
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoImplement support for separate minification/magnification filters.
Nicolas Capens [Mon, 15 Feb 2016 15:31:49 +0000 (10:31 -0500)]
Implement support for separate minification/magnification filters.

Bug 22373253

Change-Id: Iaa30a341e5eaa58c2ef531fce503631828c5ee9d
Reviewed-on: https://swiftshader-review.googlesource.com/4757
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 Android build failure
Alexis Hetu [Tue, 23 Feb 2016 13:06:33 +0000 (08:06 -0500)]
Fixed Android build failure

Added missing .c_str() to convert the string object
into a character string.

Change-Id: I3810f67a2462f7717fdec61679e09a191b043adf
Reviewed-on: https://swiftshader-review.googlesource.com/4878
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed GLES3.0 attribute locations
Alexis Hetu [Mon, 22 Feb 2016 20:58:16 +0000 (15:58 -0500)]
Fixed GLES3.0 attribute locations

Previously, it was allowed for multiple attributes to share a
location or overlap, but in ES3.0, it should cause a linking error.

Passes WebGL conformance tests.

Change-Id: I1c65b0cb31a04680a25ac54d20f6ee0d869251b9
Reviewed-on: https://swiftshader-review.googlesource.com/4877
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoDefault framebuffer type fix
Alexis Hetu [Thu, 11 Feb 2016 20:26:40 +0000 (15:26 -0500)]
Default framebuffer type fix

In OpenGL ES 3.0, the default framebuffer should use
GL_FRAMEBUFFER_DEFAULT instead of GL_RENDERBUFFER for
default buffer. I also added the Framebuffer::IsRenderbuffer()
utility function to make the transition easier.

Change-Id: I041e610738a4a656555ae7fa7ba41ba68b1fe9ea
Reviewed-on: https://swiftshader-review.googlesource.com/4763
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoPacking fix
Alexis Hetu [Mon, 8 Feb 2016 16:08:03 +0000 (11:08 -0500)]
Packing fix

Unified and fixed packing and unpacking computations.

Change-Id: I1ea2bcf28945a9f105152a6836f11bcb2859750c
Reviewed-on: https://swiftshader-review.googlesource.com/4715
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed setting Renderbuffer's layer and level
Alexis Hetu [Thu, 11 Feb 2016 20:41:27 +0000 (15:41 -0500)]
Fixed setting Renderbuffer's layer and level

The original code allowed Renderbuffer objects to select
layer and level at construction time, but after that point
these parameters were not modifiable. This cl adds the code
to modify layer and/or level when requested.

Change-Id: Ic694904f83b794879110bd0505a36a011d79a2a5
Reviewed-on: https://swiftshader-review.googlesource.com/4765
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed 2D Array texture binding query
Alexis Hetu [Wed, 10 Feb 2016 18:26:41 +0000 (13:26 -0500)]
Fixed 2D Array texture binding query

The 2D Array texture binding query was stll using
TEXTURE_3D instead of using TEXTURE_2D_ARRAY.

Change-Id: Ib55007995c336e72aaae7fd62918f232a5c1c3fc
Reviewed-on: https://swiftshader-review.googlesource.com/4744
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoDefined uniform block related constants
Alexis Hetu [Wed, 10 Feb 2016 18:11:41 +0000 (13:11 -0500)]
Defined uniform block related constants

A few numbers didn't match between the default value entered
in Context.cpp and the constants from Config.hpp. A few default
values were also erroneously larger than required. Constants were
centralized in Config.hpp to solve the issue.

Change-Id: I60e5d93c43ce61e125c261bdf07ce50e7130a296
Reviewed-on: https://swiftshader-review.googlesource.com/4742
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix disallowing binding to the default framebuffer.
Nicolas Capens [Fri, 12 Feb 2016 22:33:21 +0000 (17:33 -0500)]
Fix disallowing binding to the default framebuffer.

Bug 27166315

Change-Id: Ia9774e6560b326ca963830c53e030487c239164a
Reviewed-on: https://swiftshader-review.googlesource.com/4770
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix multilib module path.
Nicolas Capens [Fri, 12 Feb 2016 16:31:14 +0000 (11:31 -0500)]
Fix multilib module path.

Bug 27157109

Change-Id: Ie477455d0b59a8432224f3956e2ba7a1140182af
Reviewed-on: https://swiftshader-review.googlesource.com/4767
Reviewed-by: Greg Hartman <ghartman@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed detaching a buffer
Alexis Hetu [Wed, 10 Feb 2016 18:58:57 +0000 (13:58 -0500)]
Fixed detaching a buffer

- Quite a few buffers weren't being checked properly when a buffer
  was getting detached from the current context.
- Only current objects (TransformFeedback, VertexArray) should be
  affected by this.

Change-Id: I621c9fa45a951db5634616884cf57d5cb21d9bda
Reviewed-on: https://swiftshader-review.googlesource.com/4748
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdded 32 bit integer output types
Alexis Hetu [Mon, 8 Feb 2016 16:21:16 +0000 (11:21 -0500)]
Added 32 bit integer output types

As long as there's no floating point arithmetic, 32 bit integer
types are computationally equivalent to 32 bit floating point.

Change-Id: I5ab19da440f52617a9bc64dff6fcaf8eff796aeb
Reviewed-on: https://swiftshader-review.googlesource.com/4717
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed mask related state queries
Alexis Hetu [Wed, 10 Feb 2016 18:17:20 +0000 (13:17 -0500)]
Fixed mask related state queries

Mask queries could return negative values when only positive
values are accepted, so a clamp was added to prevent returning
negative values.

Change-Id: Ib151573fff54604567b83736163b8fe748c749f8
Reviewed-on: https://swiftshader-review.googlesource.com/4743
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdded state query for immutable levels
Alexis Hetu [Wed, 10 Feb 2016 19:15:59 +0000 (14:15 -0500)]
Added state query for immutable levels

Added immutable levels info to Texture and added the query.

Change-Id: I900a3c433dcc63b8113b1f623da3518c00680e16
Reviewed-on: https://swiftshader-review.googlesource.com/4751
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed read buffer and draw buffers
Alexis Hetu [Wed, 10 Feb 2016 18:41:00 +0000 (13:41 -0500)]
Fixed read buffer and draw buffers

Specifying a read buffer or draw buffers was set on the context
instead of being set on the Framebuffer object, which led to
multiple Framebuffer objects wrongly sharing this state.

Change-Id: I9d137c52f50e58a48b95f7ed9a44b4dad275e710
Reviewed-on: https://swiftshader-review.googlesource.com/4745
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImplemented missing Transform Feedback queries
Alexis Hetu [Wed, 10 Feb 2016 18:53:07 +0000 (13:53 -0500)]
Implemented missing Transform Feedback queries

Added missing implementations for binding/start/size
related queries for TransformFeedback objects.

Change-Id: Iebfebdc840764755a74d4a3753f72eceb1e6c86e
Reviewed-on: https://swiftshader-review.googlesource.com/4747
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdded version query
Alexis Hetu [Wed, 10 Feb 2016 19:39:52 +0000 (14:39 -0500)]
Added version query

Implemented version query and removed a few unnecessary
UNIMPLEMENTED) calls.

Change-Id: I29bb53a8f8083a1b6fb091916dd156f47aac920c
Reviewed-on: https://swiftshader-review.googlesource.com/4754
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImplemented GL_SAMPLER_BINDING query
Alexis Hetu [Wed, 10 Feb 2016 18:44:47 +0000 (13:44 -0500)]
Implemented GL_SAMPLER_BINDING query

Sampler objects already exist, only the query was missing.

Change-Id: Iea4a65ee4af149a33b262eba4fc0d6256775d1e1
Reviewed-on: https://swiftshader-review.googlesource.com/4746
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoRemoved some unnecessary instructions from programs
Alexis Hetu [Wed, 10 Feb 2016 19:32:34 +0000 (14:32 -0500)]
Removed some unnecessary instructions from programs

Removed a few unnecessary/bad instructions from PixelProgram and
VertexProgram. Also added the proper implementation for printing out
a shader instruction that includes indexing an array with a uniform.

Change-Id: Icd37dd4f70419874bb65c54438409b8b9c3ee836
Reviewed-on: https://swiftshader-review.googlesource.com/4753
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdded uniform buffer queries
Alexis Hetu [Wed, 10 Feb 2016 19:10:55 +0000 (14:10 -0500)]
Added uniform buffer queries

Implemented binding/size/start related queries for uniform buffers.

Change-Id: I9d36c92201a7f0df86b1d882ca6d9f04b372bad6
Reviewed-on: https://swiftshader-review.googlesource.com/4750
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed internal format queries
Alexis Hetu [Wed, 10 Feb 2016 19:25:31 +0000 (14:25 -0500)]
Fixed internal format queries

A few things were missing in internal format queries
- GL_RGB and GL_RGBA are renderable formats
- Integer types have no multisampling
- If bufSize is 0, we should not write to the params output

Change-Id: If6ba2f28b368e780eca8e89ef033deacf9cc523b
Reviewed-on: https://swiftshader-review.googlesource.com/4752
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed texture storage types
Alexis Hetu [Wed, 10 Feb 2016 19:04:46 +0000 (14:04 -0500)]
Fixed texture storage types

Added/fixed missing/bad storage texture types.

Change-Id: I0f489fbd21569114fe30d7291fb718de09cd8974
Reviewed-on: https://swiftshader-review.googlesource.com/4749
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix compile warnings.
Nicolas Capens [Wed, 10 Feb 2016 04:00:21 +0000 (23:00 -0500)]
Fix compile warnings.

Change-Id: I95aff944b1d38c297b3ece475717db4c77b3274d
Reviewed-on: https://swiftshader-review.googlesource.com/4736
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix attempting to load libX11 when rendering headless.
Nicolas Capens [Mon, 8 Feb 2016 20:13:57 +0000 (15:13 -0500)]
Fix attempting to load libX11 when rendering headless.

Bug 26776258

Change-Id: I326e76d2650b3992835d74baea159b13f14b2e3e
Reviewed-on: https://swiftshader-review.googlesource.com/4720
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix Android master build.
Nicolas Capens [Wed, 10 Feb 2016 00:42:03 +0000 (19:42 -0500)]
Fix Android master build.

OpenGL ES 3.0 entry functions are exported in the exports.map version script,
but the source file defining them was not being compiled (ES3 support is still
disabled).

Change-Id: I5e42082304beb2b37de2bcc7ffcf3b2fc65ecc7d
Reviewed-on: https://swiftshader-review.googlesource.com/4732
Reviewed-by: Keun Soo Yim <yim@google.com>
Reviewed-by: Greg Hartman <ghartman@google.com>
Tested-by: Keun Soo Yim <yim@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoDisable LLVM's use of __DATE__ and __TIME__ macros.
Nicolas Capens [Tue, 9 Feb 2016 13:57:41 +0000 (08:57 -0500)]
Disable LLVM's use of __DATE__ and __TIME__ macros.

Timestamp macros make the build unreproducible. This is of particular concern
to Android, but since LLVM only uses them for command line operations which
we don't need at all, they can be disabled on all platforms.

Bug 27079084

Change-Id: I2c4c3dcd06feb3a64936e70ca1535f5a12816e95
Reviewed-on: https://swiftshader-review.googlesource.com/4730
Reviewed-by: Keun Soo Yim <yim@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoRefactor texture coordinate addressing.
Nicolas Capens [Mon, 8 Feb 2016 16:30:56 +0000 (11:30 -0500)]
Refactor texture coordinate addressing.

Unify address() and addressW() by introducing a new addressing mode.

Change-Id: I09f9cbbe7800cfd5ef737322d680327aeddd27f1
Reviewed-on: https://swiftshader-review.googlesource.com/4714
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 array texture LOD computation.
Alexis Hetu [Fri, 5 Feb 2016 02:15:03 +0000 (21:15 -0500)]
Fix array texture LOD computation.

2D array textures use 2D LOD calculations, not 3D.

Change-Id: I0ce834bc4afb63dfeba3d9662105ffdaa07028da
Reviewed-on: https://swiftshader-review.googlesource.com/4716
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years ago2D array filtering crash fix
Alexis Hetu [Fri, 5 Feb 2016 02:15:03 +0000 (21:15 -0500)]
2D array filtering crash fix

2D array textures aren't supposed to filter between layers and the
computation used in the filtering code is meant to work with 3D
textures, not 2D array textures. The 2D array textures now use the
2D texture path instead of the 3D texture path to solve this issue.

Change-Id: Iea8fcfe67cce7ae70e39081af07e67fa59b268ff
Reviewed-on: https://swiftshader-review.googlesource.com/4690
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix reference counting of texture images.
Nicolas Capens [Mon, 8 Feb 2016 03:25:26 +0000 (22:25 -0500)]
Fix reference counting of texture images.

- Only unbind (orphan and release) images when the texture destructs.
- Let images hold just one reference to the parent texture.
- Check if textures and images only reference each other and garbage collect.

Bug 26851951

Change-Id: I2b0bcc283bf545d948e91288c531eac7cc14d122
Reviewed-on: https://swiftshader-review.googlesource.com/4711
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdd utility functions for reference counting.
Nicolas Capens [Mon, 8 Feb 2016 03:19:45 +0000 (22:19 -0500)]
Add utility functions for reference counting.

Bug 26851951

Change-Id: I5494d61927eb4c1faff320aa7cd6cebe81800f29
Reviewed-on: https://swiftshader-review.googlesource.com/4712
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoRefactor Image creation.
Nicolas Capens [Sun, 7 Feb 2016 20:29:12 +0000 (15:29 -0500)]
Refactor Image creation.

Customize construction for each use case.

Bug 26851951

Change-Id: Ic10166bbfeaf11e800fec2a6470446b76e49b825
Reviewed-on: https://swiftshader-review.googlesource.com/4710
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoUse gl::Object to reference count egl::Image.
Nicolas Capens [Thu, 4 Feb 2016 19:53:38 +0000 (14:53 -0500)]
Use gl::Object to reference count egl::Image.

Bug 26851951

Change-Id: I5b594bdd34e6fa1074d5439ee2c09f6731839dee
Reviewed-on: https://swiftshader-review.googlesource.com/4534
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix OpenGL ES 1.1 regression.
Nicolas Capens [Mon, 8 Feb 2016 03:47:00 +0000 (22:47 -0500)]
Fix OpenGL ES 1.1 regression.

Change-Id: I0660f69ea463a117d950e85bc94facb8292a069f
Reviewed-on: https://swiftshader-review.googlesource.com/4713
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoVertex Array Object crash fix
Alexis Hetu [Fri, 5 Feb 2016 22:45:42 +0000 (17:45 -0500)]
Vertex Array Object crash fix

Vertex array objects are not allocated when generated,
but only when bound, so it's legal to have a null
vertex array object internally.

Change-Id: Ib28a388939e285425c09cfbc9f4efef3f4a8cead
Reviewed-on: https://swiftshader-review.googlesource.com/4700
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoEnable klp-emu-dev google x86 to build swiftshader libraries
Nicolas Capens [Fri, 5 Feb 2016 15:05:36 +0000 (10:05 -0500)]
Enable klp-emu-dev google x86 to build swiftshader libraries

The name for google image is "google_sdk_x86" on older Android versions.

Change-Id: If1e9cb368284b91787badf329e558af5d0b9042c
Reviewed-on: https://swiftshader-review.googlesource.com/4692
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoCheck for GL object leaks at termination.
Nicolas Capens [Thu, 23 Jul 2015 14:45:28 +0000 (10:45 -0400)]
Check for GL object leaks at termination.

Change-Id: I8215fabe92d11f0f28cae9ffadd8c48a3fbf1f27
Reviewed-on: https://swiftshader-review.googlesource.com/3890
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 binding offsets for uniform and transform feedback buffers
Alexis Hetu [Fri, 22 Jan 2016 22:28:28 +0000 (17:28 -0500)]
Fixed binding offsets for uniform and transform feedback buffers

There was some confusion between buffer mapping and size and offset
buffer binding arguments, which are distinct, but were represented
by the same Buffer class members. Added OffsetBindingPointer to solve
the issue and removed setOffset/setSize from the Buffer class, which
should not have existed in the first place (only the mapRange/unmap
functions should be allowed to modify these values, for now).

Change-Id: Iacecd17cfb90d0a229d9edf62a463c8acf31f07a
Reviewed-on: https://swiftshader-review.googlesource.com/4590
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoUniform block declaration
Alexis Hetu [Mon, 1 Feb 2016 21:51:07 +0000 (16:51 -0500)]
Uniform block declaration

A few aspects of block declaration are improved upon here:
- Block definitions are computed and stored for later use.
  The data stored are the block member types and a map to
  convert from register offsets, based on the internal
  memory layout, to the std140 layout.
- Declaration of block members is possible. When a block
  member is declared prior to the entire block being
  declared, OutputASM::declareUniform() will first declare
  the whole block and return the index of the block member.
  If the block member is part of an already defined block,
  the function declares no new variables and returns the
  block member's register index.

Change-Id: If1368bc8de20a0f86169361d76858c3f3e34bb07
Reviewed-on: https://swiftshader-review.googlesource.com/4632
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoSwiftshader changes for HAL_PIXEL_FORMAT_YCbCr_420_888
Greg Hartman [Tue, 2 Feb 2016 19:22:08 +0000 (11:22 -0800)]
Swiftshader changes for HAL_PIXEL_FORMAT_YCbCr_420_888

Bug: 26822256

Change-Id: I2d974e1170847786369797d8e9b10ba4ad3663e0
Reviewed-on: https://swiftshader-review.googlesource.com/4660
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
8 years agoRemoved double argument() calls
Alexis Hetu [Wed, 20 Jan 2016 19:09:20 +0000 (14:09 -0500)]
Removed double argument() calls

Some calls to the argument() function were made twice
because the emit() function didn't know what index to
use for each individual input. I added the function
arguments to the emit() function in order to solve that.

WebGL conformance tests pass.

Change-Id: I548b72cadf7247afd103b6be2ddfeaf39a995025
Reviewed-on: https://swiftshader-review.googlesource.com/4575
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoUniform block related fixes
Alexis Hetu [Mon, 1 Feb 2016 20:26:46 +0000 (15:26 -0500)]
Uniform block related fixes

- The rowMajor qualifier should only be set for matrices
- Shared and std140 layouts are always considered active
- Fixed registerSize() for uniform blocks

Change-Id: Id0ccd4f1f1c3342915643d87e166234e61b83f4f
Reviewed-on: https://swiftshader-review.googlesource.com/4631
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoPassing uniform buffers to the vertex/pixel programs
Alexis Hetu [Tue, 27 Oct 2015 20:12:11 +0000 (16:12 -0400)]
Passing uniform buffers to the vertex/pixel programs

This cl contains the necessary changes to make uniform buffers
usable in shaders. A few things to note:
- Uniform buffers can be set, but nothing will attempt to access
  them in this cl.
- While the 'index' of uniforms is expressed in terms of registers,
  uniform buffer 'index' is expressed in bytes in both PixelProgram
  and VertexProgram. This is necessary because of packing which can
  potentially put some variables in the middle of registers.
  Technically, std140 always packs variables in multiples of byte4,
  but other future layouts may not, so using bytes as the unit is
  more future proof.
- The above mentioned 'index' will have to be computed in OutputASM
  and extra operations will need to be added (to fetch a row from a
  row major matrix, for example).

Change-Id: I636cc4bdc6fe90d6f5697e735f4288f48d18a75b
Reviewed-on: https://swiftshader-review.googlesource.com/4151
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoUniform buffer array register fix
Alexis Hetu [Mon, 1 Feb 2016 19:54:46 +0000 (14:54 -0500)]
Uniform buffer array register fix

Register indices were only set for the first instance of the array
when the uniform block array was present in both the fragment and
vertex shaders, so this code takes care of the array case.

Change-Id: I8a98470fedcc67bdc5edfd3b852470f5f911d610
Reviewed-on: https://swiftshader-review.googlesource.com/4630
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImplement glGetPointerv().
Nicolas Capens [Thu, 28 Jan 2016 16:42:36 +0000 (11:42 -0500)]
Implement glGetPointerv().

Bug 26794307

Change-Id: I0aa175f091550d544a33503b602c191353e7a1c5
Reviewed-on: https://swiftshader-review.googlesource.com/4606
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix attribute size queries.
Nicolas Capens [Thu, 28 Jan 2016 15:33:54 +0000 (10:33 -0500)]
Fix attribute size queries.

Bug 26794307

Change-Id: I66a440221435e63574c5da4204a9d2b00ece73f4
Reviewed-on: https://swiftshader-review.googlesource.com/4604
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoDetect all texture sampling shader instructions.
Nicolas Capens [Sat, 16 Jan 2016 04:30:50 +0000 (23:30 -0500)]
Detect all texture sampling shader instructions.

Change-Id: If557db7db89659e6c2b043b21e5712fb34eafd8d
Reviewed-on: https://swiftshader-review.googlesource.com/4561
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoRemove unnecessary friend class declarations.
Nicolas Capens [Mon, 18 Jan 2016 18:42:25 +0000 (13:42 -0500)]
Remove unnecessary friend class declarations.

Change-Id: Ida83136a083642bd6cd651c4cb506723e8ac9a41
Reviewed-on: https://swiftshader-review.googlesource.com/4570
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoMake vertex registers members of routine classes.
Nicolas Capens [Wed, 20 Jan 2016 22:11:53 +0000 (17:11 -0500)]
Make vertex registers members of routine classes.

Bug 22652760

Change-Id: I698ce910ee4302178d7235fa316aaa2b268e71a8
Reviewed-on: https://swiftshader-review.googlesource.com/4560
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoMove loop register usage to relative addressing.
Nicolas Capens [Wed, 20 Jan 2016 22:09:28 +0000 (17:09 -0500)]
Move loop register usage to relative addressing.

Bug 22652760

Change-Id: I50c6935bac91f586953b0dd2abd0d2a859468ee1
Reviewed-on: https://swiftshader-review.googlesource.com/4579
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoMove parameter reading to a prototype constructor.
Nicolas Capens [Fri, 15 Jan 2016 22:35:58 +0000 (17:35 -0500)]
Move parameter reading to a prototype constructor.

Bug 22652760

Change-Id: I317275cd2c15012da3a859735409af07ea9b2923
Reviewed-on: https://swiftshader-review.googlesource.com/4559
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoEliminate redundant register set argument passing.
Nicolas Capens [Fri, 15 Jan 2016 22:02:41 +0000 (17:02 -0500)]
Eliminate redundant register set argument passing.

Bug 22652760

Change-Id: If6bf124c3218847ecc4af0ae16102452a6b344d9
Reviewed-on: https://swiftshader-review.googlesource.com/4558
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoDerive VertexRoutine from Function<>.
Nicolas Capens [Fri, 15 Jan 2016 21:54:13 +0000 (16:54 -0500)]
Derive VertexRoutine from Function<>.

Bug 22652760

Change-Id: I48e9e1f3ff677429eff1aea2f80b1e384a537a14
Reviewed-on: https://swiftshader-review.googlesource.com/4557
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix glBindVertexArray() compilation regression.
Nicolas Capens [Fri, 15 Jan 2016 18:40:19 +0000 (13:40 -0500)]
Fix glBindVertexArray() compilation regression.

Change-Id: I7da54053b3be31b4388dd9c0f4d89298e656bee2
Reviewed-on: https://swiftshader-review.googlesource.com/4556
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoRemove unused return value.
Nicolas Capens [Wed, 13 Jan 2016 05:22:02 +0000 (00:22 -0500)]
Remove unused return value.

Change-Id: I99731b6697a4ae92b1d04c8a8d895a0cf19d580c
Reviewed-on: https://swiftshader-review.googlesource.com/4545
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoRemove redundant shader instructions.
Nicolas Capens [Thu, 15 Oct 2015 04:42:20 +0000 (00:42 -0400)]
Remove redundant shader instructions.

Bool to int and int to bool also work for unsigned int.

Change-Id: I31669d8754a718096381609d13c2e9668599efe5
Reviewed-on: https://swiftshader-review.googlesource.com/4070
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 Clang warnings.
Nicolas Capens [Thu, 14 Jan 2016 15:45:55 +0000 (10:45 -0500)]
Fix Clang warnings.

Change-Id: I9630093a14d0c1b2b6dc60ffb5866c7d2eaf4f02
Reviewed-on: https://swiftshader-review.googlesource.com/4552
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix returning an opaque handle for eglGetCurrentDisplay().
Nicolas Capens [Fri, 15 Jan 2016 16:07:43 +0000 (11:07 -0500)]
Fix returning an opaque handle for eglGetCurrentDisplay().

Change-Id: If7524c5245951ed87bcb8caacda2264db0875dad
Reviewed-on: https://swiftshader-review.googlesource.com/4554
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoAdded some uses of FRAGMENT_UNIFORM_VECTORS and VERTEX_UNIFORM_VECTORS
Alexis Hetu [Wed, 13 Jan 2016 19:40:47 +0000 (14:40 -0500)]
Added some uses of FRAGMENT_UNIFORM_VECTORS and VERTEX_UNIFORM_VECTORS

Replaced a few instances of 224 and 256 that were actually used to
represent FRAGMENT_UNIFORM_VECTORS and VERTEX_UNIFORM_VECTORS.

This cl should not change any behavior.

Change-Id: I4b82341f32223fcee559aaf70df2ee83c9936d11
Reviewed-on: https://swiftshader-review.googlesource.com/4547
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoMove parameter reading to routine constructor.
Nicolas Capens [Thu, 14 Jan 2016 18:43:42 +0000 (13:43 -0500)]
Move parameter reading to routine constructor.

Bug 22652760

Change-Id: If2b41c4d3b24f4b8a9d9dd805a9ab3ce724b7726
Reviewed-on: https://swiftshader-review.googlesource.com/4553
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoDerive Rasterizer from Function<>.
Nicolas Capens [Wed, 13 Jan 2016 13:34:30 +0000 (08:34 -0500)]
Derive Rasterizer from Function<>.

Bug 22652760

Change-Id: I1a8ff978fdc7ad795e469218a931523d624e7cde
Reviewed-on: https://swiftshader-review.googlesource.com/4546
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix Clang errors on Linux.
Nicolas Capens [Thu, 14 Jan 2016 15:45:55 +0000 (10:45 -0500)]
Fix Clang errors on Linux.

Change-Id: I8bc812cd6c25a60dc73abc2177e8eb4a3841af21
Reviewed-on: https://swiftshader-review.googlesource.com/4551
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoMake Function arguments type-safe.
Nicolas Capens [Thu, 14 Jan 2016 14:32:35 +0000 (09:32 -0500)]
Make Function arguments type-safe.

Change-Id: I3d4262ea4be0c7b1128b2ca410e985cc6f58c9c9
Reviewed-on: https://swiftshader-review.googlesource.com/1970
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoMake Function variadic and take a function signature.
Nicolas Capens [Thu, 5 Feb 2015 17:36:46 +0000 (12:36 -0500)]
Make Function variadic and take a function signature.

Change-Id: If36ea6e74311f54bb4c2b0bc1b5b7ccd0e97d74b
Reviewed-on: https://swiftshader-review.googlesource.com/4548
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoDisallow assigning to an RValue.
Nicolas Capens [Wed, 4 Feb 2015 05:16:13 +0000 (00:16 -0500)]
Disallow assigning to an RValue.

Change-Id: I539fcaa5b7853ac618f3d27027d3357bc6e620ba
Reviewed-on: https://swiftshader-review.googlesource.com/1960
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoPorted Angle's std140 encoder to SwiftShader
Alexis Hetu [Thu, 7 Jan 2016 21:53:00 +0000 (16:53 -0500)]
Ported Angle's std140 encoder to SwiftShader

Added Angle's std140 encoder to properly compute sizes and
offsets of uniform blocks for the std140 standard. All
layouts currently use std140 ('packed' and 'shared' are
implementation dependent, so we can choose to have them be
the same as std140).

All uniform blocks made of simple types or arrays of simple
types are properly interpreted by this code.

Structs are still TBD.

Change-Id: I191d7f313db5d409715b1101ea70903a7b958726
Reviewed-on: https://swiftshader-review.googlesource.com/4525
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoProgram cleanup
Alexis Hetu [Fri, 8 Jan 2016 19:41:51 +0000 (14:41 -0500)]
Program cleanup

Working on uniforms, I realized that there was a large
amount of code duplication in the applyUniform* functions,
so I create a basic applyUniform() to contain common code
between all these functions, which reduces the size of
Program.cpp by about 275 lines, or about 10% of that file.

Change-Id: I0f013821e1cc8f507bb4d6829b0097fc41420e6d
Reviewed-on: https://swiftshader-review.googlesource.com/4527
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed uniform block lookup
Alexis Hetu [Tue, 12 Jan 2016 21:09:29 +0000 (16:09 -0500)]
Fixed uniform block lookup

Blocks are also symbols, so when we have a block,
we have to look for blocks instead of symbols.

Change-Id: I683e646c2c63754a0b27b299dfdbc1d87017fb99
Reviewed-on: https://swiftshader-review.googlesource.com/4542
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed uniform block indexing
Alexis Hetu [Tue, 12 Jan 2016 21:13:37 +0000 (16:13 -0500)]
Fixed uniform block indexing

A uniform block's qualifier is generally a uniform, so
we have to change that to a temporary in order to be
able to us it as the result of the indexing operation.

Change-Id: I2f5ba7f966e8eaab314322edfa0483a9f24bfbdb
Reviewed-on: https://swiftshader-review.googlesource.com/4543
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed some types utility functions for uniform blocks
Alexis Hetu [Tue, 12 Jan 2016 21:19:22 +0000 (16:19 -0500)]
Fixed some types utility functions for uniform blocks

Uniform blocks can be neither scalars not registers,
so make sure these never return true for uniform blocks.

Change-Id: Ib00afd175e4df92d45fe1aeaca865ea45fc13b0b
Reviewed-on: https://swiftshader-review.googlesource.com/4544
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix signed/unsigned comparison warnings.
Nicolas Capens [Sat, 2 Jan 2016 04:18:14 +0000 (23:18 -0500)]
Fix signed/unsigned comparison warnings.

Bug 15387371

Change-Id: Id4c9b54c5c0b4115479b6710c4d8c91d34e5c002
Reviewed-on: https://swiftshader-review.googlesource.com/4494
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoEliminate intermediate primitive type translation.
Nicolas Capens [Sun, 3 Jan 2016 03:01:47 +0000 (22:01 -0500)]
Eliminate intermediate primitive type translation.

Bug 21305111

Change-Id: I3803f274f25a25ec60f0f5cbfc4af0151f39ad04
Reviewed-on: https://swiftshader-review.googlesource.com/4505
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 glReadPixels and glClear memory leaks.
Nicolas Capens [Mon, 11 Jan 2016 15:05:36 +0000 (10:05 -0500)]
Fix glReadPixels and glClear memory leaks.

Bug 26486408

Change-Id: Iec34ee0034695950163e8e40082d1ad7128490f8
Reviewed-on: https://swiftshader-review.googlesource.com/4533
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdd ./ to the test app's rpath.
Nicolas Capens [Sat, 9 Jan 2016 18:01:08 +0000 (13:01 -0500)]
Add ./ to the test app's rpath.

Change-Id: If93cfd390846e26348a6f30a85d340d4df57e891
Reviewed-on: https://swiftshader-review.googlesource.com/4532
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFix memory leaks.
Nicolas Capens [Sat, 9 Jan 2016 04:33:22 +0000 (23:33 -0500)]
Fix memory leaks.

Change-Id: I668c4295fd13d028fa53f6aa75ac6c6d4c6de44f
Reviewed-on: https://swiftshader-review.googlesource.com/4531
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoAdd suggested braces for subobject initialization.
Nicolas Capens [Sat, 2 Jan 2016 05:00:35 +0000 (00:00 -0500)]
Add suggested braces for subobject initialization.

Bug 15387371

Change-Id: I771b6e9f30669aade18eba8b3749fcb71ae8ef97
Reviewed-on: https://swiftshader-review.googlesource.com/4501
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 tautological expressions.
Nicolas Capens [Fri, 8 Jan 2016 06:30:48 +0000 (01:30 -0500)]
Fix tautological expressions.

Bug 15387371

Change-Id: I01bf5327f205bf646c51c1bb06560448a09f6c4a
Reviewed-on: https://swiftshader-review.googlesource.com/4526
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 LLVM code warnings.
Nicolas Capens [Sat, 2 Jan 2016 04:31:19 +0000 (23:31 -0500)]
Fix LLVM code warnings.

Bug 15387371

Change-Id: Ic5374735e6ca386e871848c34890272c1259c273
Reviewed-on: https://swiftshader-review.googlesource.com/4496
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 operator precedence warnings.
Nicolas Capens [Sat, 2 Jan 2016 05:23:53 +0000 (00:23 -0500)]
Fix operator precedence warnings.

Bug 15387371

Change-Id: I665ee641932d34abb28f150ba036bbbed9fa1431
Reviewed-on: https://swiftshader-review.googlesource.com/4503
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoAdd default switch cases.
Nicolas Capens [Sat, 2 Jan 2016 05:06:41 +0000 (00:06 -0500)]
Add default switch cases.

Bug 15387371

Change-Id: I97644bfd9dbdc1109630199bc897f8b2572d5e83
Reviewed-on: https://swiftshader-review.googlesource.com/4502
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 potentially uninitialized variables.
Nicolas Capens [Sat, 2 Jan 2016 04:47:52 +0000 (23:47 -0500)]
Fix potentially uninitialized variables.

Bug 15387371

Change-Id: Ie0486feeebc6e4bceba148bea69f2d1ee1d1ffd8
Reviewed-on: https://swiftshader-review.googlesource.com/4499
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 macro redefinition warning.
Nicolas Capens [Sat, 2 Jan 2016 04:24:01 +0000 (23:24 -0500)]
Fix macro redefinition warning.

Bug 15387371

Change-Id: I1d9524b15a62a561508a5cc2b76ba0b1e8d37fdc
Reviewed-on: https://swiftshader-review.googlesource.com/4495
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 initialization order warnings.
Nicolas Capens [Sat, 2 Jan 2016 04:17:42 +0000 (23:17 -0500)]
Fix initialization order warnings.

Bug 15387371

Change-Id: I01da3db7d6bb795c46153dbc12fd41478f4b6416
Reviewed-on: https://swiftshader-review.googlesource.com/4493
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 string format specifiers.
Nicolas Capens [Sat, 2 Jan 2016 03:47:44 +0000 (22:47 -0500)]
Fix string format specifiers.

Bug 15387371

Change-Id: I0f86d5ddcef0c2b6fc45164c730eb55f44c5c490
Reviewed-on: https://swiftshader-review.googlesource.com/4492
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoUse empty initializer lists for zeroing structs.
Nicolas Capens [Fri, 1 Jan 2016 06:21:18 +0000 (01:21 -0500)]
Use empty initializer lists for zeroing structs.

This works around an incorrect Clang warning:
https://llvm.org/bugs/show_bug.cgi?id=21689

Bug 15387371

Change-Id: I2460a4f6dd414f518789be1fcc8ce8b205c6a066
Reviewed-on: https://swiftshader-review.googlesource.com/4491
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoStatically allocate one EGL display.
Nicolas Capens [Wed, 6 Jan 2016 22:34:03 +0000 (17:34 -0500)]
Statically allocate one EGL display.

This reduces support to EGL_DEFAULT_DISPLAY or assumes the
native display handle corresponds with the default display.

Bug 24600445

Change-Id: Ieb5d08beceff1cc46557483e1bed159dd9ab1bee
Reviewed-on: https://swiftshader-review.googlesource.com/4520
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 matrix4x2 and matrix4x3 uniform arrays
Alexis Hetu [Thu, 7 Jan 2016 21:44:01 +0000 (16:44 -0500)]
Fixed matrix4x2 and matrix4x3 uniform arrays

matrix4x2 and matrix4x3 uniform arrays were broken because
the structure allocated to contain them was of the wrong
dimension, causing subsequent array elements to overwrite
a portion of the previous element.

Change-Id: I8129c7352f5470146994a0a89052a75fcfc4e54f
Reviewed-on: https://swiftshader-review.googlesource.com/4524
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix a few missing EGL error resets.
Nicolas Capens [Thu, 7 Jan 2016 16:02:49 +0000 (11:02 -0500)]
Fix a few missing EGL error resets.

Change-Id: I0f28b08b865f85f212beaa74fa75f3b3620d9836
Reviewed-on: https://swiftshader-review.googlesource.com/4522
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImplement glDrawTexfOES.
Nicolas Capens [Thu, 7 Jan 2016 16:31:31 +0000 (11:31 -0500)]
Implement glDrawTexfOES.

Bug 26424655

Change-Id: I24f9b17f5768d457b64fc510bf88f392f02759bc
Reviewed-on: https://swiftshader-review.googlesource.com/4523
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoReturn EGL_BAD_ATTRIBUTE for unsupported HAL formats.
Nicolas Capens [Wed, 6 Jan 2016 03:42:34 +0000 (22:42 -0500)]
Return EGL_BAD_ATTRIBUTE for unsupported HAL formats.

As prescribed by the EGL_ANDROID_image_native_buffer extension spec.

Change-Id: Id4213e245d055971bd687f484dbc5efa7958adda
Reviewed-on: https://swiftshader-review.googlesource.com/4518
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix aligned access regression.
Nicolas Capens [Wed, 6 Jan 2016 18:44:09 +0000 (13:44 -0500)]
Fix aligned access regression.

This fixes commit cd0ea23407fb36528388cd6705f0150c0972963e.

Change-Id: I51c82049fa809f303401b6623dbaa947a50d6d62
Reviewed-on: https://swiftshader-review.googlesource.com/4519
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoEliminate duplicate window size query code.
Nicolas Capens [Wed, 30 Dec 2015 16:42:43 +0000 (11:42 -0500)]
Eliminate duplicate window size query code.

Change-Id: Ibe95427c6b626c308dff41996f636a7dc88f792c
Reviewed-on: https://swiftshader-review.googlesource.com/4444
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix using floating-point exp2()
Nicolas Capens [Thu, 24 Dec 2015 06:39:43 +0000 (01:39 -0500)]
Fix using floating-point exp2()

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