OSDN Git Service

android-x86/external-swiftshader.git
9 years agoRemoving the EGL_OPENGL_ES3_BIT from Android entirely
Alexis Hetu [Thu, 2 Jul 2015 18:17:00 +0000 (14:17 -0400)]
Removing the EGL_OPENGL_ES3_BIT from Android entirely

Bug 21323928

Change-Id: I51addf7a354d3abac34807d60e8dc5fc67dddd1a
Reviewed-on: https://swiftshader-review.googlesource.com/3623
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoglGetInternalformativ implementation
Alexis Hetu [Mon, 29 Jun 2015 21:10:50 +0000 (17:10 -0400)]
glGetInternalformativ implementation

Change-Id: Ic8e80810ee6846b66543e6a5dbdae044fdd02a99
Reviewed-on: https://swiftshader-review.googlesource.com/3600
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoProper usage of pixel pack buffer
Alexis Hetu [Tue, 30 Jun 2015 15:46:58 +0000 (11:46 -0400)]
Proper usage of pixel pack buffer

The pixel pack buffer was ignored, but should be
used whenever it is set when doing a glReadPixels.
When this is the case, pixels becomes an offset.
From the GLES 3.0 spec, section 4.3.1, subsection
"Placement in Pixel Pack Buffer or Client Memory":

"If a pixel pack buffer is bound, data is an offset
into the pixel pack buffer and the pixels are
packed into the buffer relative to this offset;
otherwise, data is a pointer to a block of client
memory and the pixels are packed into the client
memory relative to the pointer"

WebGL conformance tests passed.

Change-Id: I7539f1ce705cfd2072ed679815676c0b18887272
Reviewed-on: https://swiftshader-review.googlesource.com/3604
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFixed Program::getAttachedShaders
Alexis Hetu [Tue, 30 Jun 2015 17:40:32 +0000 (13:40 -0400)]
Fixed Program::getAttachedShaders

It was possible to have "count" larger than "maxCount"
since "total" was incremented regardless of whether or
not the shader was added to the "shaders" output
argument. Simplified the function to fix it.

Change-Id: I403e6c100580fb8f5f1c6fe170af1a796e936828
Reviewed-on: https://swiftshader-review.googlesource.com/3605
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded missing validation to CopyBufferSubData
Alexis Hetu [Tue, 30 Jun 2015 15:06:34 +0000 (11:06 -0400)]
Added missing validation to CopyBufferSubData

Missing validation for mapped buffers and overlap
was added to CopyBufferSubData.

Change-Id: If1f3f9901f039f5737d41ca46d98ce4c188274d6
Reviewed-on: https://swiftshader-review.googlesource.com/3603
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoglBufferSubData fix
Alexis Hetu [Mon, 29 Jun 2015 21:55:33 +0000 (17:55 -0400)]
glBufferSubData fix

According to the OpenGL ES 3.0 spec
(section 2.9.2 Creating Buffer Object Data Stores)

"If data is NULL, then the contents of the buffer
 object’s data store are undefined."

So the function should behave the same way, perform
the same checks, but simply skip the copy.

Change-Id: If49e37a8e836618389e105b5377ff183ac3e3107
Reviewed-on: https://swiftshader-review.googlesource.com/3601
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded proper size/offset checks
Alexis Hetu [Tue, 30 Jun 2015 15:03:03 +0000 (11:03 -0400)]
Added proper size/offset checks

glTexSubImage3D and glCopyTexSubImage3D were missing
some validity checks for size and offset parameters.

Change-Id: Iff1aa034318c1fc58f9bb433c61bd8623493604a
Reviewed-on: https://swiftshader-review.googlesource.com/3602
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoglProgramParameteri API implementation
Alexis Hetu [Tue, 23 Jun 2015 15:08:51 +0000 (11:08 -0400)]
glProgramParameteri API implementation

This function is simply used to notify the
program that the binary may be queried later
on by the application. For now, this hint is
stored in the program, but otherwise ignored,
as querying the binary is still unimplemented.

Change-Id: Ie59f21d7b803111ce6091718b84ecfbe78c03bdd
Reviewed-on: https://swiftshader-review.googlesource.com/3545
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded Primitive Restart Index and Rasterizer Discard to IsEnabled
Alexis Hetu [Tue, 23 Jun 2015 15:24:48 +0000 (11:24 -0400)]
Added Primitive Restart Index and Rasterizer Discard to IsEnabled

Change-Id: I63f7324139ff4f337996c14380ef2862dbd8465b
Reviewed-on: https://swiftshader-review.googlesource.com/3547
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFix for glGetActiveUniformBlockiv
Alexis Hetu [Mon, 29 Jun 2015 17:45:30 +0000 (13:45 -0400)]
Fix for glGetActiveUniformBlockiv

glGetActiveUniformBlockiv was using the current program
instead of using the program passed as an argument to
the function, causing it to misbehave.

Change-Id: I69b640b20793bd8e7e0c4142a1ff74d0ea796747
Reviewed-on: https://swiftshader-review.googlesource.com/3583
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
9 years agoFix the light position transformation.
Nicolas Capens [Mon, 29 Jun 2015 17:26:28 +0000 (13:26 -0400)]
Fix the light position transformation.

OpenGL transforms the light position by the model-view matrix
at the time when that position is specified.

Bug 22124687

Change-Id: Ia6bb711c9eb20348faec45c46e45ee9f6ef92112
Reviewed-on: https://swiftshader-review.googlesource.com/3524
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoImplement float4 transform.
Nicolas Capens [Mon, 29 Jun 2015 14:48:30 +0000 (10:48 -0400)]
Implement float4 transform.

Bug 22124687

Change-Id: I88ea87bbf7785d61a2ca61db2855d07c0347f719
Reviewed-on: https://swiftshader-review.googlesource.com/3582
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoImplement materials and lights.
Nicolas Capens [Mon, 15 Jun 2015 16:40:11 +0000 (12:40 -0400)]
Implement materials and lights.

Bug 22124687

Change-Id: Ic8a458962e370f372c2e97052c9c86f9b5c6dede
Reviewed-on: https://swiftshader-review.googlesource.com/3511
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFix support for colorbuffer formats in the texture env.
Nicolas Capens [Fri, 12 Jun 2015 18:34:53 +0000 (14:34 -0400)]
Fix support for colorbuffer formats in the texture env.

Bug 21766174

Change-Id: Id53882a7738fab8669d355fd2f32e420a93cbae6
Reviewed-on: https://swiftshader-review.googlesource.com/3500
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFix texture sampling buffer overrun.
Nicolas Capens [Fri, 26 Jun 2015 17:00:48 +0000 (13:00 -0400)]
Fix texture sampling buffer overrun.

Sampling byte4 data currently reads 8 bytes for unpacking purposes.
Allocate 4 more bytes to prevent reading outside the image, even
though it's unused data.

Bug 21935792

Change-Id: I162fb3f3575131cedb008f82ef5170e773719e41
Reviewed-on: https://swiftshader-review.googlesource.com/3572
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoRemove image size rounding to 4x4 multiple.
Nicolas Capens [Fri, 26 Jun 2015 15:15:58 +0000 (11:15 -0400)]
Remove image size rounding to 4x4 multiple.

Bug 21935792

Surface::size() already takes into account that compressed images
need their dimensions rounding up to whole 4x4 tiles.

Change-Id: Ie6b7b5d23294e8d3c85b3b362670cfe0c569585d
Reviewed-on: https://swiftshader-review.googlesource.com/3571
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFix some warnings
Greg Hartman [Thu, 11 Jun 2015 23:24:48 +0000 (16:24 -0700)]
Fix some warnings

I sheilded a MSVC pragma, silenced some classes of warnings.

One of the classes involves an overload that hides a member function. I filed a
bug to make certain that this isn't masking a coding error:

https://b.corp.google.com/issues/22117892

Change-Id: I7090cddc78880c9ee7814aecc72cc107003dfede
Reviewed-on: https://swiftshader-review.googlesource.com/3483
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
9 years agoMoving format conversion functions from aggregate to unary
Alexis Hetu [Mon, 22 Jun 2015 19:28:54 +0000 (15:28 -0400)]
Moving format conversion functions from aggregate to unary

Change-Id: Icd05628204b831ddeefffaec2274fa6661624740
Reviewed-on: https://swiftshader-review.googlesource.com/3540
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFix vertex attribute count constant.
Nicolas Capens [Thu, 25 Jun 2015 19:25:29 +0000 (15:25 -0400)]
Fix vertex attribute count constant.

Change-Id: Ic0e4831bf3459d54b51e63ebe50b7394fb54e14c
Reviewed-on: https://swiftshader-review.googlesource.com/3562
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoRemove an unused method.
Nicolas Capens [Fri, 26 Jun 2015 14:03:55 +0000 (10:03 -0400)]
Remove an unused method.

Change-Id: Id212644a19443434ca14f78555e3d159ac4266e8
Reviewed-on: https://swiftshader-review.googlesource.com/3570
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdding support for GL_DEPTH_STENCIL_ATTACHMENT
Alexis Hetu [Tue, 23 Jun 2015 15:18:17 +0000 (11:18 -0400)]
Adding support for GL_DEPTH_STENCIL_ATTACHMENT

ES3 supports set/get for both stencil and depth
attachments simultaneously though
GL_DEPTH_STENCIL_ATTACHMENT, so support for it
was added in FramebufferRenderbuffer and
GetFramebufferAttachmentParameteriv.

Change-Id: I09b077de1f31899a20baacbd651c65dfa9e7fc5d
Reviewed-on: https://swiftshader-review.googlesource.com/3546
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded new GLES3.0 compressed format checks to TexImage2D
Alexis Hetu [Tue, 23 Jun 2015 15:28:27 +0000 (11:28 -0400)]
Added new GLES3.0 compressed format checks to TexImage2D

Change-Id: I2bfb2072028de66aa89306e51a164ba90bfb9114
Reviewed-on: https://swiftshader-review.googlesource.com/3548
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFixed crash using uniforms as indices
Alexis Hetu [Tue, 23 Jun 2015 18:47:42 +0000 (14:47 -0400)]
Fixed crash using uniforms as indices

Uniforms can now legally be used as indices in
OpenGL ES 3.0, so they now have to be handled
properly in the dynamic indexing analysis.

Change-Id: I971aa55edcbc73796c30e0acc99156b513a78b80
Reviewed-on: https://swiftshader-review.googlesource.com/3550
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded proper transform feedback checks to glDrawRangeElements
Alexis Hetu [Tue, 23 Jun 2015 15:33:20 +0000 (11:33 -0400)]
Added proper transform feedback checks to glDrawRangeElements

It is illegal to start a new draw operation while a transform
feedback is active.

Change-Id: I5ebb01889ce5154162a51f5e6cfbc8431554c879
Reviewed-on: https://swiftshader-review.googlesource.com/3549
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFixed recursion analysis
Alexis Hetu [Tue, 23 Jun 2015 20:06:50 +0000 (16:06 -0400)]
Fixed recursion analysis

Recursion analysis was broken, because assigning
the error value UINT_MAX was then automatically
increased by 1 at the caller site, resulting in
a 0, and recursions would go undetected.

Change-Id: I8ab9990c12d827d8eac2d6084f9170096ad2aef2
Reviewed-on: https://swiftshader-review.googlesource.com/3552
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFixed infinite loop crash
Alexis Hetu [Tue, 23 Jun 2015 20:37:15 +0000 (16:37 -0400)]
Fixed infinite loop crash

Writing for(;;) in a shader was crashing because
a NULL condition was dereferenced. Added the
NULL pointer check to fix the crash.

Change-Id: I2be7a4594029c928ff83221f65503636bc28f4a9
Reviewed-on: https://swiftshader-review.googlesource.com/3553
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoUsed proper getBuffer function
Alexis Hetu [Tue, 23 Jun 2015 14:44:07 +0000 (10:44 -0400)]
Used proper getBuffer function

There was a switch/case left that hadn't
yet been replaced by Context::getBuffer,
so I fixed that.

Change-Id: I71bca410322e1cfc130a2753d738c3b64fb271c5
Reviewed-on: https://swiftshader-review.googlesource.com/3544
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdding unsized arrays to the glsl parser
Alexis Hetu [Thu, 18 Jun 2015 16:34:52 +0000 (12:34 -0400)]
Adding unsized arrays to the glsl parser

Unsized arrays declare with an empty [] without
a specified size are now supported properly in
the glsl parser.

Also moved the construction code from the parser
into TParseContext.

Change-Id: Ic7b3efeee51da1a264e26af4d7908e7d2fccebd9
Reviewed-on: https://swiftshader-review.googlesource.com/3520
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoLog the switch value when reaching an UNREACHABLE().
Nicolas Capens [Mon, 22 Jun 2015 14:41:54 +0000 (10:41 -0400)]
Log the switch value when reaching an UNREACHABLE().

Bug 20025568

Change-Id: I37d2c7171e0704b4064e56e8ca8799f930038d87
Reviewed-on: https://swiftshader-review.googlesource.com/3481
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoBinary math cleanup
Alexis Hetu [Tue, 16 Jun 2015 16:19:50 +0000 (12:19 -0400)]
Binary math cleanup

Moved functionality related to binary math
into TParseContext.

No WebGL tests were hurt in the making of this CL.

Change-Id: I51b9aa8f98ceedc4e4a93b4b907d264086157c18
Reviewed-on: https://swiftshader-review.googlesource.com/3512
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoSupport for @ in the parser
Alexis Hetu [Fri, 19 Jun 2015 01:10:09 +0000 (21:10 -0400)]
Support for @ in the parser

Added support for @ in the parser and
replaced all instances of $N.line by
@N.

Change-Id: I7a18278ee0cd5deb90609508abbda2af656daaa4
Reviewed-on: https://swiftshader-review.googlesource.com/3526
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFix point rendering.
Nicolas Capens [Tue, 16 Jun 2015 20:56:37 +0000 (13:56 -0700)]
Fix point rendering.

Change-Id: I8262fa4bc527d719680d83bf9a1b8e88bdae07f8
Reviewed-on: https://swiftshader-review.googlesource.com/3514
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFix light position transformation.
Nicolas Capens [Mon, 15 Jun 2015 16:09:59 +0000 (12:09 -0400)]
Fix light position transformation.

Change-Id: Ia12819357406c6ee98f0af2909d793cb62bfa62f
Reviewed-on: https://swiftshader-review.googlesource.com/3510
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoReplacing int by TSourceLoc for lines
Alexis Hetu [Tue, 16 Jun 2015 16:43:32 +0000 (12:43 -0400)]
Replacing int by TSourceLoc for lines

Lines should be identified by a TSourceLoc object,
which is currently typedefed to an int, but should
be changed to a struct soon, so making sure the
parser functions can handle the change.

Change-Id: Iaafad862dd1078591757695bf205279e7c4202cf
Reviewed-on: https://swiftshader-review.googlesource.com/3513
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoSimplify int4 and float4 types.
Nicolas Capens [Fri, 12 Jun 2015 21:19:31 +0000 (17:19 -0400)]
Simplify int4 and float4 types.

Change-Id: Id0d55c1364fc3db05821eb6ef666aed8c5713e31
Reviewed-on: https://swiftshader-review.googlesource.com/3503
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoAdding switch case default keywords
Alexis Hetu [Thu, 4 Jun 2015 21:21:22 +0000 (17:21 -0400)]
Adding switch case default keywords

This adds switch/case keywords to glsl.
This makes the shaders that include these
keywords compile, but they don't run
properly yet, partly because the "break"
statement only handles loops currently.

Change-Id: I1f52b445e1124ed3931843c46e27ecc1d9ce3d11
Reviewed-on: https://swiftshader-review.googlesource.com/3400
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
9 years agoAdding Interface Blocks to glsl parser
Alexis Hetu [Thu, 11 Jun 2015 21:11:06 +0000 (17:11 -0400)]
Adding Interface Blocks to glsl parser

Added code to parse interface blocks and the
corresponding layout qualifiers to the glsl parser.

Change-Id: Idfcbf08f3f877ea9641ae611e6bddd2be1ffb952
Reviewed-on: https://swiftshader-review.googlesource.com/3480
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFixed some warnings
Alexis Hetu [Fri, 12 Jun 2015 19:19:20 +0000 (15:19 -0400)]
Fixed some warnings

- Changing "char*" to "const char*" when a
  function can receive string literals
- Removed some unused variables and members
- Fixed some signed vs unsigned comparisons
- Added braces for safety on code like:
  if(...) if(...) ... else ...
  to make it:
  if(...) { if(...) ... else ... }
  otherwise the else is ambiguous
- Reordered some member initializations to
  fit the declaration order in the class
- OutDir must end with a backslash in VS

Change-Id: I903bd7afac882090841da0c0f4ebb30db0a5dd37
Reviewed-on: https://swiftshader-review.googlesource.com/3501
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAddressing a FIXME
Alexis Hetu [Fri, 12 Jun 2015 19:27:15 +0000 (15:27 -0400)]
Addressing a FIXME

I added a FIXME in the code because EvqFragmentOut
hadn't been added yet, since this has now been done,
I can remove the comment to address the FIXME.

Change-Id: I67f4371802eb0e30278b3eaafab238a20798ae69
Reviewed-on: https://swiftshader-review.googlesource.com/3502
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoUniform Buffers API implementation
Alexis Hetu [Fri, 1 May 2015 18:16:47 +0000 (14:16 -0400)]
Uniform Buffers API implementation

Implemented the necessary functions
for the API level implementation of
glBindBufferBase and glBindBufferRange.
Also cleaned up the TransformFeedback
API functions a little for uniformity
with uniform buffers.

Change-Id: Iccc835f175d4e8bc4ee030343936714b7ff224ac
Reviewed-on: https://swiftshader-review.googlesource.com/3030
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
9 years agoInitializer cleanup
Alexis Hetu [Thu, 11 Jun 2015 12:25:30 +0000 (08:25 -0400)]
Initializer cleanup

Cleaned up the initialer methods in the parser
and added first-class array initializers.

Passes all WebGL tests.

Change-Id: Ia73db8bfd461f36b717444a8ba4c9ec77d1cee36
Reviewed-on: https://swiftshader-review.googlesource.com/3473
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
9 years agoFix unintended switch case fall-through.
Nicolas Capens [Thu, 11 Jun 2015 20:44:39 +0000 (16:44 -0400)]
Fix unintended switch case fall-through.

Bug 21766174

Change-Id: I1428bcceb2fbf6c649632112f773c3a0625e3775
Reviewed-on: https://swiftshader-review.googlesource.com/3479
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFix support for BGRA formats in the texture environment.
Nicolas Capens [Thu, 11 Jun 2015 20:21:15 +0000 (16:21 -0400)]
Fix support for BGRA formats in the texture environment.

Bug 21766174

Change-Id: If2fbb543303db27a2a2bd13e1a75cb7f7310d6eb
Reviewed-on: https://swiftshader-review.googlesource.com/3478
Reviewed-by: Greg Hartman <ghartman@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoEliminating warnings from SwifShader
Alexis Hetu [Thu, 11 Jun 2015 17:06:58 +0000 (13:06 -0400)]
Eliminating warnings from SwifShader

SwiftShader had over 270 warnings and this
reduces the count to about 90, some of which
can be addressed later, since some are less
trivial to remove. The changes include:
- Making sure we don't build any project with
  RTTI enabled, otherwise, we get some
  vftable size mismatch warnings
- Making sure exception handling is the same
  for all configurations
- Changing minus <unsigned> to the equivalent,
  and valid, ~<unsigned> + 1
- Explicitly casting types to bool by adding
  "!= 0" or "!= nullptr", depending on the case
- Making sure no #define overrules another one
  without first doing the proper #undef of that
  #define
- Removing signed VS unsigned comparisons
- Making sure WinMain is __stdcall

WebGL tests passed.

Change-Id: I8d8d80adc862633b656d7e99c8ea461924fc0ef4
Reviewed-on: https://swiftshader-review.googlesource.com/3475
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoouterProduct/transpose/determinant/inverse for const
Alexis Hetu [Wed, 27 May 2015 15:21:37 +0000 (11:21 -0400)]
outerProduct/transpose/determinant/inverse for const

Initial implementation of outerProduct, transpose,
determinant and inverse. This is for const objects
only. The dynamic implementation will follow. Note
that the 4x4 determinant and inverse is not optimal
(some multiplications are repeated), and will have
to be implemented properly for the dynamic case.

Change-Id: If3b38d8cfe5d2d49835ae3823ceda10e286dd9b9
Reviewed-on: https://swiftshader-review.googlesource.com/3282
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoNew FenceSync object API implementation
Alexis Hetu [Wed, 22 Apr 2015 15:46:24 +0000 (11:46 -0400)]
New FenceSync object API implementation

- Added new FenceSync object and related
  API functions implementations
- Added FenceSync to ResourceManager
- Moved Sampler to ResourceManager

Change-Id: Ia3d42b749811a4e1ed087b41f0c871beb8fdb8d4
Reviewed-on: https://swiftshader-review.googlesource.com/2931
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoIncreasing the number of vertex texture units allowed
Alexis Hetu [Wed, 10 Jun 2015 18:13:09 +0000 (14:13 -0400)]
Increasing the number of vertex texture units allowed

Technically, the rest of the code *should* already
support changing this value and all related changes
should propagate properly. This allows a few dEQP
tests that were "unsupported" to now pass.

Change-Id: Ie99e1fba88e7642be447a380b78969365194ca5f
Reviewed-on: https://swiftshader-review.googlesource.com/3461
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoTransform feedback varyings API
Alexis Hetu [Wed, 10 Jun 2015 20:03:17 +0000 (16:03 -0400)]
Transform feedback varyings API

Implemented the API functions to set and get
the varyings used for transform feedback.

Change-Id: I0d6451cfbd4a4b1b96dd9c064bb9b310b46764c4
Reviewed-on: https://swiftshader-review.googlesource.com/3462
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAllow an optional supplemental commit message on builds
Greg Hartman [Thu, 11 Jun 2015 18:23:06 +0000 (11:23 -0700)]
Allow an optional supplemental commit message on builds

Change-Id: I8a9cd32b50121f6c02b78b1f97eb78d6946cd71e
Reviewed-on: https://swiftshader-review.googlesource.com/3476
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
9 years agoMore ground work for Uniform blocks
Alexis Hetu [Tue, 9 Jun 2015 20:15:30 +0000 (16:15 -0400)]
More ground work for Uniform blocks

Moved some of the struct / indexing code
from glslang.y to the ParserHelper class
and prepared it for uniform blocks.

Change-Id: I2d5d380f662f36f04d74783fd542c4b258d3f3a5
Reviewed-on: https://swiftshader-review.googlesource.com/3441
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoCompile fixes for JBMR2.
Nicolas Capens [Thu, 11 Jun 2015 02:51:05 +0000 (19:51 -0700)]
Compile fixes for JBMR2.

Change-Id: I121abb32d898f5887586680b52c4283ee6e58f96
Reviewed-on: https://swiftshader-review.googlesource.com/3472
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFix Linux compilation.
Nicolas Capens [Thu, 11 Jun 2015 13:53:40 +0000 (08:53 -0500)]
Fix Linux compilation.

INT_MAX is defined in limits.h

Change-Id: Ic7e223aebae594e1ed18e1185edc573114d851ff
Reviewed-on: https://swiftshader-review.googlesource.com/3474
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoRemove unnecessary RGB565 conversion.
Nicolas Capens [Tue, 9 Jun 2015 21:06:31 +0000 (17:06 -0400)]
Remove unnecessary RGB565 conversion.

Bug 21716622

Change-Id: I60a90b91371276f512befb9c1b809a3c4d388eb2
Reviewed-on: https://swiftshader-review.googlesource.com/3447
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFix texture uploads using different formats.
Nicolas Capens [Tue, 9 Jun 2015 21:01:52 +0000 (17:01 -0400)]
Fix texture uploads using different formats.

Bug 21716622

Change-Id: I3154fc0c3da5c9f2f280101e8e5840ca45eb144e
Reviewed-on: https://swiftshader-review.googlesource.com/3446
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoMake back buffers non-lockable.
Nicolas Capens [Tue, 9 Jun 2015 20:59:22 +0000 (16:59 -0400)]
Make back buffers non-lockable.

Bug 21716622

Change-Id: I041fd37d461114a52a3b3dfa57e4aee6c01e5ee5
Reviewed-on: https://swiftshader-review.googlesource.com/3445
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoSupport creating a Surface from a user pointer.
Nicolas Capens [Tue, 9 Jun 2015 20:47:29 +0000 (16:47 -0400)]
Support creating a Surface from a user pointer.

Bug 21716622

Change-Id: Ifa5940c17932066b3860ff148be8b6b2bec726c0
Reviewed-on: https://swiftshader-review.googlesource.com/3444
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoAdd support for OpenGL ES 2.0 image formats to Surface.
Nicolas Capens [Tue, 9 Jun 2015 20:42:56 +0000 (16:42 -0400)]
Add support for OpenGL ES 2.0 image formats to Surface.

Bug 21716622

Change-Id: Ie416118676c984ebdd2f153b35c6f60fa616e4c7
Reviewed-on: https://swiftshader-review.googlesource.com/3443
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFix color component defaults.
Nicolas Capens [Tue, 9 Jun 2015 20:33:50 +0000 (16:33 -0400)]
Fix color component defaults.

Bug 21716622

Change-Id: I1e07ee9b8ccfd0bd34af9b1f1d76802f3398f7ca
Reviewed-on: https://swiftshader-review.googlesource.com/3442
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoLock the external buffer when dirty.
Nicolas Capens [Wed, 10 Jun 2015 17:52:24 +0000 (13:52 -0400)]
Lock the external buffer when dirty.

Optimize blitting by avoiding locking the internal buffer
when the external one is dirty.

Bug 21424351

Change-Id: Ib798418d0fa93ae5049102ca767dadc2806cd224
Reviewed-on: https://swiftshader-review.googlesource.com/3439
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoUse only external surface dimensions.
Nicolas Capens [Wed, 10 Jun 2015 17:43:52 +0000 (13:43 -0400)]
Use only external surface dimensions.

They should always be identical to the internal ones.

Bug 21424351

Change-Id: Iafa18c14cc4d2e16f20238dac0208a8159cbaa6a
Reviewed-on: https://swiftshader-review.googlesource.com/3460
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFix potential null pointer dereference.
Nicolas Capens [Wed, 10 Jun 2015 20:09:20 +0000 (16:09 -0400)]
Fix potential null pointer dereference.

Change-Id: I12249cc2e647296eb45f9e7f9082fe3b477b9011
Reviewed-on: https://swiftshader-review.googlesource.com/3463
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoCreate a global and thread-safe Blitter.
Nicolas Capens [Wed, 10 Jun 2015 15:06:16 +0000 (11:06 -0400)]
Create a global and thread-safe Blitter.

Bug 21716622

Change-Id: I090154cdfbb6f8781df578b3f493d3ecd297c847
Reviewed-on: https://swiftshader-review.googlesource.com/3437
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoMove blit routine generation to a method.
Nicolas Capens [Wed, 10 Jun 2015 15:03:20 +0000 (11:03 -0400)]
Move blit routine generation to a method.

Bug 21716622

Change-Id: Ida62ad1f1f51f035969754f2c5ff800a0afc6fd5
Reviewed-on: https://swiftshader-review.googlesource.com/3452
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoAdding Struct related types
Alexis Hetu [Wed, 10 Jun 2015 15:48:40 +0000 (11:48 -0400)]
Adding Struct related types

Added TField, TFieldListCollection, TStructure
and TInterfaceBlock for structures and uniform
blocks.

In the TType class, changed structure's type
from TTypeList to TStructure and made related
changes in other files to reflect this change.

Change-Id: Ided4c535651a566952c3314c8c4f31c2d0ccdcca
Reviewed-on: https://swiftshader-review.googlesource.com/3451
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoglGetActiveUniformsiv implementation
Alexis Hetu [Tue, 9 Jun 2015 18:20:30 +0000 (14:20 -0400)]
glGetActiveUniformsiv implementation

Added proper structures to implement
glGetActiveUniformsiv and added it to
the Program class.

Change-Id: I41b8fd17b6e533ad2638778de9854206d10fe13d
Reviewed-on: https://swiftshader-review.googlesource.com/3435
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded proper number suffixes in GLSL parser
Alexis Hetu [Tue, 9 Jun 2015 15:37:45 +0000 (11:37 -0400)]
Added proper number suffixes in GLSL parser

Numbers like "1.0f" or "10u" are now allowed
in GLSL, so I added code to do proper parsing
of these numbers.

Change-Id: Ia4635ab2b449399bd4adea2c5c94567b5b8a5f8e
Reviewed-on: https://swiftshader-review.googlesource.com/3434
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFixing some warnings in libGLESv3.cpp
Alexis Hetu [Tue, 9 Jun 2015 18:28:06 +0000 (14:28 -0400)]
Fixing some warnings in libGLESv3.cpp

A missing & was causing an uninitialized
parameter issue and a missing return in
glGetUniformBlockIndex, in the case where
the context is NULL, were causing warnings.

Change-Id: Ifb40583c6d08d185d2e60f96066f1436398318ac
Reviewed-on: https://swiftshader-review.googlesource.com/3436
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoRemove the Radiance prototype.
Nicolas Capens [Tue, 9 Jun 2015 14:50:51 +0000 (10:50 -0400)]
Remove the Radiance prototype.

Change-Id: Ife60e89ac857e103138a139c01be68f761d6dc3c
Reviewed-on: https://swiftshader-review.googlesource.com/3432
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoUniform Blocks API
Alexis Hetu [Thu, 30 Apr 2015 19:48:23 +0000 (15:48 -0400)]
Uniform Blocks API

Implemented API level functionality for
Uniform Blocks all the way down to the
Program, without actually linking the
uniforms, which will require more work
in shaders to interpret these properly.

Change-Id: I503a9bca63adb5160be7ff7597d3996d356fc1e3
Reviewed-on: https://swiftshader-review.googlesource.com/3015
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFixed instanced rendering
Alexis Hetu [Mon, 8 Jun 2015 20:22:57 +0000 (16:22 -0400)]
Fixed instanced rendering

Instanced rendering only requires a
single attribute per instance, which
was handled properly everywhere except
in the streaming buffer, so that had to
be fixed. All related dEQP tests pass.

Change-Id: I9b9bd6cd790dfe7ecf7f5d2ed84623bfa4da4b6f
Reviewed-on: https://swiftshader-review.googlesource.com/3430
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
9 years agoglInstanceID implementation
Alexis Hetu [Fri, 5 Jun 2015 21:08:39 +0000 (17:08 -0400)]
glInstanceID implementation

Implementation attempt for glInstanceID.
Related dEQP tests pass.

Change-Id: I6391699a127cc7c159a2a64e3ffeaa528b611f97
Reviewed-on: https://swiftshader-review.googlesource.com/3412
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoShaderCore const inputs
Alexis Hetu [Fri, 5 Jun 2015 17:42:05 +0000 (13:42 -0400)]
ShaderCore const inputs

Made all inputs const in ShaderCore.

Change-Id: I56792cea564f40e6f5b096349447b22439606e43
Reviewed-on: https://swiftshader-review.googlesource.com/3410
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdd proper in/out shader types
Alexis Hetu [Wed, 3 Jun 2015 20:03:48 +0000 (16:03 -0400)]
Add proper in/out shader types

Fragment and Vertex inputs and outputs were treated as OpenGL ES2.0
attributes and varyings, but OpenGL ES3.0 inputs and outputs have
different limitations and must be treated differently. This cl simply
introduces the new types, without modifying the ES2.0 behavior and
only modifying ES3.0 to allow integer varyings when they are flat.

Change-Id: I965cb576bab3f505602af9e055438bcc7c18cdfd
Reviewed-on: https://swiftshader-review.googlesource.com/3371
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoUse a non-blocking lock for the streaming vertex buffer
Maxime Grégoire [Fri, 5 Jun 2015 20:17:46 +0000 (16:17 -0400)]
Use a non-blocking lock for the streaming vertex buffer

Change-Id: I85f6306434f5810dd8357eeeedfb764bf2318668
Reviewed-on: https://swiftshader-review.googlesource.com/3411
Tested-by: Maxime Grégoire <mgregoire@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdding base type changes related to Uniform Blocks
Alexis Hetu [Mon, 1 Jun 2015 17:48:07 +0000 (13:48 -0400)]
Adding base type changes related to Uniform Blocks

This cl should be a NOOP. It simply adds some basic
functionality in BaseTypes.h that will be useful in
eventually enabling Uniform Blocks in the parser.

Change-Id: I0c2b3200e0ae95ddce86367663081c2aef751308
Reviewed-on: https://swiftshader-review.googlesource.com/3311
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoRoundEven implementation
Alexis Hetu [Thu, 4 Jun 2015 15:30:54 +0000 (11:30 -0400)]
RoundEven implementation

Implementation for the roundEven glsl intrinsic function.
All dEQP roundEven tests pass.

Change-Id: I8b6f3704f03eea32b08a6c2dc318ecb99a01957d
Reviewed-on: https://swiftshader-review.googlesource.com/3382
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdding more built-in function definitions
Alexis Hetu [Thu, 4 Jun 2015 17:04:17 +0000 (13:04 -0400)]
Adding more built-in function definitions

Defined more derivatives and texture functions
for glsl. By itself, this enables a few hundred
dEQP tests to pass for derivatives, which were
already implemented properly in some cases.

Change-Id: I84063205447ee4813409a3eb52aeb2ad79793a88
Reviewed-on: https://swiftshader-review.googlesource.com/3383
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoSupport different component orders for decoding RGB565.
Nicolas Capens [Thu, 4 Jun 2015 19:34:04 +0000 (15:34 -0400)]
Support different component orders for decoding RGB565.

Bug 21635916

Change-Id: I1216a96d17228e53155aaaf24d43365afb5cead7
Reviewed-on: https://swiftshader-review.googlesource.com/3392
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoPass the internal format to the image data loading functions.
Nicolas Capens [Thu, 4 Jun 2015 19:11:19 +0000 (15:11 -0400)]
Pass the internal format to the image data loading functions.

Bug 21635916

Change-Id: Ib6836cbc42fa4ceebf0af66b9891dde1491594c3
Reviewed-on: https://swiftshader-review.googlesource.com/3391
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFix infinite loop when using EGL_DONT_CARE.
Nicolas Capens [Thu, 4 Jun 2015 12:59:09 +0000 (08:59 -0400)]
Fix infinite loop when using EGL_DONT_CARE.

Change-Id: I27471691cc0d0d475c089483c560ca5e00f5d64a
Reviewed-on: https://swiftshader-review.googlesource.com/3380
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoglFramebufferTextureLayer API implementation
Alexis Hetu [Wed, 29 Apr 2015 18:29:49 +0000 (14:29 -0400)]
glFramebufferTextureLayer API implementation

Implemented API level of glFramebufferTextureLayer.
All functions should now be adapted to handle level
and layer, all the way to RenderbufferTexture3D,
where layer is still unimplemented.

Change-Id: Id5fe94f998ee517ae84cb0d6e60d535cc7891fe3
Reviewed-on: https://swiftshader-review.googlesource.com/3320
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoUse the last triangle vertex for flat shading on OpenGL.
Nicolas Capens [Wed, 3 Jun 2015 20:33:02 +0000 (16:33 -0400)]
Use the last triangle vertex for flat shading on OpenGL.

Bug 21559270

Change-Id: I4c2b5eb7076cc459422fbbb397a684c19bd643c2
Reviewed-on: https://swiftshader-review.googlesource.com/3372
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoSort config IDs by smaller color component depth.
Nicolas Capens [Wed, 3 Jun 2015 18:54:38 +0000 (14:54 -0400)]
Sort config IDs by smaller color component depth.

This helps select configs without alpha component.
Also fixed handling of EGL_DONT_CARE and EGL_BUFFER_SIZE.

Bug 21538709

Change-Id: I432a71e5df2a0da19a0c38195edf6c42c2d8b9aa
Reviewed-on: https://swiftshader-review.googlesource.com/3370
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoDon't restrict format combinations on CopyTexSubImage.
Nicolas Capens [Wed, 3 Jun 2015 18:00:55 +0000 (14:00 -0400)]
Don't restrict format combinations on CopyTexSubImage.

CopyTexSubImage does not have the format combination restriction
that CopyTexImage has. The destination may have components not
present in the source image.

Bug 21610276

Change-Id: I90f4c0679ceb1061b05a404aa6ca817205b5077f
Reviewed-on: https://swiftshader-review.googlesource.com/3361
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFix choosing configs with 0 alpha bits.
Nicolas Capens [Sun, 31 May 2015 05:38:47 +0000 (01:38 -0400)]
Fix choosing configs with 0 alpha bits.

Configs with 0 alpha bits were not being stored in the set because
the sorting functor did not compare alpha and thus did not achieve
strict ordering. Having separate functors for strict comparison and
sorting by EGL rules fixes it, and also allows to control config ID
assignment. Android expects a config with alpha bits even though not
explicitly requested.

Bug 21538709

Change-Id: I76472e0eb2a8ad9ca39c6e8ce08225d0ce5cef45
Reviewed-on: https://swiftshader-review.googlesource.com/3310
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Keun Soo Yim <yim@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agogl_InstanceID implementation
Alexis Hetu [Tue, 21 Apr 2015 21:06:14 +0000 (17:06 -0400)]
gl_InstanceID implementation

I need some help connecting the dots here.
I can see a few ways of doing it, but it
isn't trivial for me to see which one
would be right. Could you tell me how the
value should go from the VertexProcessor to
being assigned a value in the actual shader.

Change-Id: Ie0bc2024f51a904ab8144c435b623cfefe8e6704
Reviewed-on: https://swiftshader-review.googlesource.com/2920
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoUpdate to RenderbufferStorage's supported format list
Alexis Hetu [Wed, 27 May 2015 20:58:29 +0000 (16:58 -0400)]
Update to RenderbufferStorage's supported format list

Added OpenGL ES 3.0 supported formats to the list
of formats supported by glRenderbufferStorage().

Change-Id: Ifc73de17b678e2a5b782d2fe239d5442b98edd95
Reviewed-on: https://swiftshader-review.googlesource.com/3290
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoRemoving a D3D limitation from SwiftShader
Alexis Hetu [Mon, 1 Jun 2015 21:08:57 +0000 (17:08 -0400)]
Removing a D3D limitation from SwiftShader

The limitation of not being able to have
different values for stencil and stencilBack
was put in place in Angle because of a D3D
limitation, which we do not have in Swift
Shader, so I doubt we need the same limitation.

FYI, this fixes about 600 dEQP tests.

Change-Id: I74d1786c612e817fb5ef46f233751e6f2581c33f
Reviewed-on: https://swiftshader-review.googlesource.com/3321
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoouterProduct implementation
Alexis Hetu [Wed, 27 May 2015 19:18:29 +0000 (15:18 -0400)]
outerProduct implementation

outerProduct is now implemented for dynamic
variables. All outerProduct dEQP tests pass.

Change-Id: I81e29640347844bd9548030aa69ffbb2eb060fdf
Reviewed-on: https://swiftshader-review.googlesource.com/3283
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
9 years agotranspose implementation
Alexis Hetu [Wed, 27 May 2015 19:22:18 +0000 (15:22 -0400)]
transpose implementation

transpose is now implemented for dynamic
variables. All NxN transpose dEQP tests pass.
There's still an issue with some NxM matrices,
but it seems to be unrelated to this code.

Change-Id: Ie422706d0085c85fa6fc9a95dc21bb441dcddfe8
Reviewed-on: https://swiftshader-review.googlesource.com/3284
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
9 years agoFixed NxM matrix construction and minor issues
Alexis Hetu [Thu, 23 Apr 2015 15:45:35 +0000 (11:45 -0400)]
Fixed NxM matrix construction and minor issues

Fixed NxM matrix construction by
properly checking for these types in
TIntermOperator::isConstructor. Also
fixed a few areas of the code where
the secondary size wasn't properly
taken into account.

Change-Id: I646a41e37460255316f5712f1d744c3a06d8a64d
Reviewed-on: https://swiftshader-review.googlesource.com/3195
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoRemove direct references to stlport. These break the M branch.
Greg Hartman [Thu, 28 May 2015 05:16:36 +0000 (22:16 -0700)]
Remove direct references to stlport. These break the M branch.

Change-Id: I044e252115993acf91d79daae78cccbd5ea97f74
Reviewed-on: https://swiftshader-review.googlesource.com/3300
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
9 years agoRemove reference to M-incompatible format
Greg Hartman [Thu, 28 May 2015 06:43:38 +0000 (23:43 -0700)]
Remove reference to M-incompatible format

Change-Id: Ia8053af04c687894dfcf3b03e2001678e194b058
Reviewed-on: https://swiftshader-review.googlesource.com/3302
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
9 years agoAdd a fix for LLVM for late versions of clang
Greg Hartman [Thu, 28 May 2015 06:43:16 +0000 (23:43 -0700)]
Add a fix for LLVM for late versions of clang

Change-Id: Id32b0b975af8bdff31c822cf5a67792fe7f785b1
Reviewed-on: https://swiftshader-review.googlesource.com/3301
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
9 years agoAdd a missing break.
Ping-Hao Wu [Tue, 26 May 2015 23:16:00 +0000 (16:16 -0700)]
Add a missing break.

Change-Id: I459bb15a59dbdae7619b108099f49c2a0c89ecc8
Reviewed-on: https://swiftshader-review.googlesource.com/3281
Tested-by: Ping-Hao Wu <pinghao@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoFix R5G6B5 blend.
Nicolas Capens [Tue, 26 May 2015 20:36:35 +0000 (16:36 -0400)]
Fix R5G6B5 blend.

blend() unpacks to ARGB order.

Bug 20891368

Change-Id: I9a505631ee0751d4ef4b01b82c8617f155e95ca5
Reviewed-on: https://swiftshader-review.googlesource.com/3280
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoOptimize R5G6B5 conversion.
Nicolas Capens [Tue, 26 May 2015 15:20:46 +0000 (11:20 -0400)]
Optimize R5G6B5 conversion.

Bug 20891368

Change-Id: I876e4dab9ab5ba7df5887d4b184e9750f9563edc
Reviewed-on: https://swiftshader-review.googlesource.com/3261
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoImplement R5G6B5 framebuffer present.
Nicolas Capens [Tue, 26 May 2015 03:47:18 +0000 (23:47 -0400)]
Implement R5G6B5 framebuffer present.

Bug 20891368

Change-Id: If4b0b84d141eb16c96600b7ade98a552e5f2ad0e
Reviewed-on: https://swiftshader-review.googlesource.com/3251
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoReplace if/else with switch.
Alexis Hetu [Thu, 7 May 2015 15:41:43 +0000 (11:41 -0400)]
Replace if/else with switch.

Change-Id: I970a64ffdc18b240239092615f87a59b84c5e364
Reviewed-on: https://swiftshader-review.googlesource.com/3071
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoImplement R5G6B5 write masking.
Nicolas Capens [Tue, 26 May 2015 05:11:26 +0000 (01:11 -0400)]
Implement R5G6B5 write masking.

Bug 20891368

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