OSDN Git Service

android-x86/external-swiftshader.git
8 years agoMinor PixelRoutine cleanup
Alexis Hetu [Tue, 11 Aug 2015 14:15:34 +0000 (10:15 -0400)]
Minor PixelRoutine cleanup

- Removed redundant parameters from fogBlend()
- Moved computation registers and color output
  registers from PixelRoutine to PixelProgram.
- Made many PixelRoutine member functions
  private rather than protected when possible.

Change-Id: I748333626d993c0d46b369991d74bc3a22c972c2
Reviewed-on: https://swiftshader-review.googlesource.com/3850
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
8 years agoFloating point parameters should be rounded, not truncated
Alexis Hetu [Thu, 10 Sep 2015 20:57:44 +0000 (16:57 -0400)]
Floating point parameters should be rounded, not truncated

Bug 20724899

Change-Id: I03f858ee3d159cfa2541afa1d8d063ca99701a4c
Reviewed-on: https://swiftshader-review.googlesource.com/3964
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed uint uniforms
Alexis Hetu [Thu, 10 Sep 2015 20:55:03 +0000 (16:55 -0400)]
Fixed uint uniforms

uint uniforms were failing because of a missing condition.
This only affected uint scalars, uint vectors were unaffected.

Change-Id: Ia2338a683f1e6f5f9b6944aae72e2dbec70a8ef2
Reviewed-on: https://swiftshader-review.googlesource.com/3963
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImplement RGB565 multisample resolve.
Nicolas Capens [Fri, 4 Sep 2015 13:18:15 +0000 (09:18 -0400)]
Implement RGB565 multisample resolve.

Bug 20891368

Change-Id: I29054ccc0a91fdc41d26d26dd4f55dfd4dfca7e4
Reviewed-on: https://swiftshader-review.googlesource.com/3952
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImprove color clear precision.
Nicolas Capens [Tue, 22 Sep 2015 16:26:30 +0000 (12:26 -0400)]
Improve color clear precision.

Change-Id: Ib9dadf3d8fee0f63deb10e6754856c0530c928ab
Reviewed-on: https://swiftshader-review.googlesource.com/3995
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoRemove unused readPixel() parameter.
Nicolas Capens [Tue, 22 Sep 2015 14:11:00 +0000 (10:11 -0400)]
Remove unused readPixel() parameter.

Bug 22375329

Change-Id: Ifeb8017d50224b784dedd6197779c6ebfa5cf484
Reviewed-on: https://swiftshader-review.googlesource.com/3994
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 RGB565 rounding.
Nicolas Capens [Tue, 22 Sep 2015 13:53:45 +0000 (09:53 -0400)]
Fix RGB565 rounding.

Bug 20891368

Change-Id: Icc0957db55cf82e42c0ccb2c8881332f71f52f5f
Reviewed-on: https://swiftshader-review.googlesource.com/3993
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoCreate debug builds of more SwiftShader projects
Greg Hartman [Wed, 16 Sep 2015 22:27:27 +0000 (15:27 -0700)]
Create debug builds of more SwiftShader projects

Change-Id: If2fb1ba3ab1428086ec35bc5824e4307156c67a0
Reviewed-on: https://swiftshader-review.googlesource.com/3980
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
8 years agoFixed condition too strict in glBindSampler
Alexis Hetu [Thu, 10 Sep 2015 21:02:54 +0000 (17:02 -0400)]
Fixed condition too strict in glBindSampler

glBindSampler's sampler check was too strict, as the
sampler needed to exist, but not necessarily to have
been allocated yet, so the condition was fixed.

Change-Id: Ia8301028dbf35efa16bfc6cb74a69e105d8a505d
Reviewed-on: https://swiftshader-review.googlesource.com/3965
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed a few issues related to transform feedback buffers
Alexis Hetu [Thu, 10 Sep 2015 20:52:39 +0000 (16:52 -0400)]
Fixed a few issues related to transform feedback buffers

- Transform feedback buffers are now properly cleared when
  the object is deleted
- Transform feedback buffers are now properly detached when
  a buffer is deleted
- Ending a transform feedback now properly sets its PAUSED
  state to false
- Added missing enums to Context::getQueryParameterInfo.
  GL_READ_FRAMEBUFFER_BINDING_ANGLE was also missing, so
  it was also added in this cl.

Change-Id: I286caec119d5ae3adde95c4cce7f0298b8f836c3
Reviewed-on: https://swiftshader-review.googlesource.com/3962
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFixed texture format checks
Alexis Hetu [Fri, 18 Sep 2015 15:44:23 +0000 (11:44 -0400)]
Fixed texture format checks

- Fixed a few typos in the format map
- Added missing OpenGL ES 3.0 types to CheckTextureFormatType

Change-Id: I4a0d8ad67fd85f8c32ef528ce1b3c029fe5f84aa
Reviewed-on: https://swiftshader-review.googlesource.com/3991
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
8 years agoAdded gl_FragDepth
Alexis Hetu [Mon, 21 Sep 2015 12:03:54 +0000 (08:03 -0400)]
Added gl_FragDepth

Change-Id: I9e70cd5e230a86ef3e4bed1884ede14a128c2d67
Reviewed-on: https://swiftshader-review.googlesource.com/3992
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
8 years agoAdd missing stdlib.h, needed for atoi
Greg Hartman [Fri, 11 Sep 2015 04:29:16 +0000 (21:29 -0700)]
Add missing stdlib.h, needed for atoi

Change-Id: I859db3be12c24fc4544dc3780e5fdf5c598412d8
Reviewed-on: https://swiftshader-review.googlesource.com/3970
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
8 years agoAllow 0x0 dimension default framebuffers.
Nicolas Capens [Fri, 28 Aug 2015 21:04:48 +0000 (17:04 -0400)]
Allow 0x0 dimension default framebuffers.

Bug 23041739

Change-Id: I1bec1fa05e8cf81864f8c0c2f49cf9c8093de5e0
Reviewed-on: https://swiftshader-review.googlesource.com/3934
Reviewed-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoEnumerate multisampled EGL configs.
Nicolas Capens [Tue, 1 Sep 2015 05:38:00 +0000 (01:38 -0400)]
Enumerate multisampled EGL configs.

Bug 23535380

Change-Id: I4bc3d9821812253df46262f59d9a55a5802f00b0
Reviewed-on: https://swiftshader-review.googlesource.com/3936
Reviewed-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoSimplify and centralize multisample counts.
Nicolas Capens [Thu, 3 Sep 2015 20:41:09 +0000 (16:41 -0400)]
Simplify and centralize multisample counts.

Change-Id: I012bb669444e28f844c5571ff639b31dd1a35e1d
Reviewed-on: https://swiftshader-review.googlesource.com/3950
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 glGetInternalformativ()
Nicolas Capens [Wed, 2 Sep 2015 20:52:38 +0000 (16:52 -0400)]
Fix glGetInternalformativ()

Change-Id: Id2c07064a68158d3a4d57974244feae1c15e2fa1
Reviewed-on: https://swiftshader-review.googlesource.com/3940
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoHandling ETC2, EAC and ASTC related enums
Alexis Hetu [Tue, 1 Sep 2015 14:58:37 +0000 (10:58 -0400)]
Handling ETC2, EAC and ASTC related enums

Note that no decoding functionality is added here.
This cl merely acknowledges textures of the ETC2, EAC
and ASTC format by handling their related enums in
SwiftShader, and the byte data is then allowed to be
passed down all the way to the Surface object, where
the decoding code will be added. Also note that this
cl does not add the extensions strings required for
ASTC support, so ASTC is still unsupported after this cl.

Change-Id: I1d8aed0fb64b0d4c72846e87410750d1e485c46b
Reviewed-on: https://swiftshader-review.googlesource.com/3938
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoMultisampling value of 1
Alexis Hetu [Thu, 2 Jul 2015 17:46:59 +0000 (13:46 -0400)]
Multisampling value of 1

Setting a multisampling values of 0 or 1 are apparently
2 different cases, so I tried removing the even number
check to fix this. It didn't break any tests, but I'm
not sure how well this is covered by the tests.

Change-Id: I0e7de9b153288f0c07bde9a2f104ea1d2bf230ac
Reviewed-on: https://swiftshader-review.googlesource.com/3622
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImplement support for YV12 texture sampling.
Nicolas Capens [Tue, 1 Sep 2015 18:39:57 +0000 (14:39 -0400)]
Implement support for YV12 texture sampling.

Bug 21572252

Change-Id: Iaf54b4d960dbc243c40f981e1c73c199481e2d28
Reviewed-on: https://swiftshader-review.googlesource.com/3930
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoTest for 8-bit components instead of not 16-bit components.
Nicolas Capens [Tue, 1 Sep 2015 14:23:33 +0000 (10:23 -0400)]
Test for 8-bit components instead of not 16-bit components.

Bug 21572252

Change-Id: I0c5aedf4fec7238544c1d716f65f0fd91cd59b57
Reviewed-on: https://swiftshader-review.googlesource.com/3937
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoEnable glsl integer code
Alexis Hetu [Thu, 20 Aug 2015 18:10:33 +0000 (14:10 -0400)]
Enable glsl integer code

This cl enables true integer support in glsl shaders.
It still uses floating point registers to store all
registers, regardless of the type, so integer and
unsigned integer variables are simply reinterpreted
as integers or unsigned integers and used as such by
the appropriate instructions.

Change-Id: If62213c917b4b0c907e58db9cd36944dd198beaa
Reviewed-on: https://swiftshader-review.googlesource.com/3910
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoHandling new opcodes in PixelProgram and VertexProgram
Alexis Hetu [Fri, 28 Aug 2015 18:24:45 +0000 (14:24 -0400)]
Handling new opcodes in PixelProgram and VertexProgram

The new opcodes related to true int and uint support in
glsl shader are now handled properly in PixelProgram and
VertexProgram.

Change-Id: I62565844f24708b4bd89dd99bbf971b55495c5da
Reviewed-on: https://swiftshader-review.googlesource.com/3932
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoImplement EGL_LARGEST_PBUFFER.
Nicolas Capens [Fri, 28 Aug 2015 18:23:52 +0000 (14:23 -0400)]
Implement EGL_LARGEST_PBUFFER.

Bug 23041720

Change-Id: I9f6bed0a3d239a0adde9cc4e90cc368f078f3662
Reviewed-on: https://swiftshader-review.googlesource.com/3902
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoLog parameters of invalid surface creation.
Nicolas Capens [Tue, 25 Aug 2015 19:14:36 +0000 (15:14 -0400)]
Log parameters of invalid surface creation.

Change-Id: I8be27042263ae80da3e01dce6c84dcf43645a232
Reviewed-on: https://swiftshader-review.googlesource.com/3911
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoBuild fix for Linux
Alexis Hetu [Fri, 28 Aug 2015 18:39:13 +0000 (14:39 -0400)]
Build fix for Linux

Adding the proper #include <limits.h> for Linux when using
INT_MAX and/or UINT_MAX.

Fixed ShaderCore.cpp and preemptively fixed libGLESv3.cpp.

Change-Id: Iedd445157f3de8c08394e6d2c9f99539eb123845
Reviewed-on: https://swiftshader-review.googlesource.com/3933
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoNew integer related core functions
Alexis Hetu [Tue, 18 Aug 2015 19:43:09 +0000 (15:43 -0400)]
New integer related core functions

- Removed float <-> int bit conversion functions, as these
  will not be needed if everything is stored as float.
- Added ineg for the minus (-) sign in from of a value.
- Added f2i/i2f/f2u/u2f for float <-> int conversions
- Added b2i/i2b/b2u/u2b for bool <-> int conversions
- Added iadd, isub, imul, imad, [iu]div, [iu]mod, [iu]min,
  [iu]max for these basic operations as integer operations.
- Added left and right shifts
- Added ucmp to compare unsigned values
- Modified or/xor/and to support vectors instead of only
  scalars.
- Added vector equality comparison functions

Change-Id: I0f138e3707242ec0fffc1c12b95064ddc98f0087
Reviewed-on: https://swiftshader-review.googlesource.com/3888
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoNew opcodes for integer operations
Alexis Hetu [Tue, 18 Aug 2015 19:54:07 +0000 (15:54 -0400)]
New opcodes for integer operations

Opcodes for soon to be added integer operations such as:
- Conversions to/from float
- Negate
- Comparison
- Add, Sub, Mul, Div, Mod
- Left Shift, Right Shift
- Min, Max

Change-Id: I16af0423fdb210a558ad293e0e043176bde1c9ee
Reviewed-on: https://swiftshader-review.googlesource.com/3889
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoETC1 fix for npot textures
Alexis Hetu [Fri, 28 Aug 2015 15:16:13 +0000 (11:16 -0400)]
ETC1 fix for npot textures

Simple fix that replaces width by pitch where needed to avoid misalignment
due to the difference between pitch and width in npot textures.

Change-Id: I7acddc28fae21dddf870a6ef80ac7984cfaf8e0f
Reviewed-on: https://swiftshader-review.googlesource.com/3931
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix bit shift compilation
Alexis Hetu [Tue, 18 Aug 2015 19:28:27 +0000 (15:28 -0400)]
Fix bit shift compilation

Bit shifts compilation was failing when the types were a mismatch,
but shifting a uint by an int (or vice versa) is allowed, so types
may not match, and it's fine, as long as both are integer types.

Change-Id: I86c52a572625b1d09803b0a8b887a63756544101
Reviewed-on: https://swiftshader-review.googlesource.com/3887
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdded missing Nucleus level operations
Alexis Hetu [Tue, 18 Aug 2015 19:22:15 +0000 (15:22 -0400)]
Added missing Nucleus level operations

Very few operations were missing in Nucleus for integer types
support, but there were a few nonetheless, so Int4 and UInt4
now have new operators: divide, modulo, right shift (from non
constant) and left shift (from non constant).

These were simply un-commented out as they were already there,
just commented out.

Change-Id: I4c124c9297cd4d3d755c37f11168a43dcfeee290
Reviewed-on: https://swiftshader-review.googlesource.com/3886
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoFix Android EGL config attribute retrieval.
Nicolas Capens [Wed, 12 Aug 2015 20:36:52 +0000 (16:36 -0400)]
Fix Android EGL config attribute retrieval.

Bug 23017372

Change-Id: I9764e558cdf602ecaf2a8c644fd5e444216b1568
Reviewed-on: https://swiftshader-review.googlesource.com/3860
Reviewed-by: Ping-Hao Wu <pinghao@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFix returning EGL_BAD_ATTRIBUTE on unknown EGL config attributes.
Nicolas Capens [Wed, 12 Aug 2015 21:21:06 +0000 (17:21 -0400)]
Fix returning EGL_BAD_ATTRIBUTE on unknown EGL config attributes.

Bug 23017372

Change-Id: Ie29ca3f67c79b0cb707dda216c256723d3721f28
Reviewed-on: https://swiftshader-review.googlesource.com/3861
Reviewed-by: Ping-Hao Wu <pinghao@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoFix avoiding VBO use in glDrawTex().
Nicolas Capens [Fri, 14 Aug 2015 21:49:01 +0000 (17:49 -0400)]
Fix avoiding VBO use in glDrawTex().

The glDrawTex() implementation intends to use vertex array pointers,
so set the array buffer to null to prevent it from taking precedence.
Also save/restore projection and modelview matrices.

Bug 23021204

Change-Id: I6b3e59d737a9b75180e6f03e9a686871640f7edd
Reviewed-on: https://swiftshader-review.googlesource.com/3880
Tested-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoUse a symbolic constant for the default thread count.
Nicolas Capens [Mon, 10 Aug 2015 18:35:51 +0000 (14:35 -0400)]
Use a symbolic constant for the default thread count.

Bug 23073037

Change-Id: I7da215ceff23f9a5c8188d3566a7c478b9489117
Reviewed-on: https://swiftshader-review.googlesource.com/3841
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 the main thread for draw execution when single-threaded.
Nicolas Capens [Mon, 10 Aug 2015 18:07:45 +0000 (14:07 -0400)]
Use the main thread for draw execution when single-threaded.

Bug 23073037

Change-Id: I47d5a7d80dc48dffae0014fbf619810290c30628
Reviewed-on: https://swiftshader-review.googlesource.com/3840
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoUniform blocks stores as pointers
Alexis Hetu [Mon, 10 Aug 2015 16:42:50 +0000 (12:42 -0400)]
Uniform blocks stores as pointers

Changed UniformBlockArray so that it stores pointers to
UniformBlock objects and adapted the code. Also reverted
a change that had removed constness from some members of
the UniformBlock class.

Bug 22986647

Change-Id: I677a4b2e92da5849e4387e3802dfdfa36dc6b0a4
Reviewed-on: https://swiftshader-review.googlesource.com/3830
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
8 years agoFollow up on Framebuffer Layer query
Alexis Hetu [Wed, 22 Jul 2015 20:49:31 +0000 (16:49 -0400)]
Follow up on Framebuffer Layer query

According to a comment that was added after the cl was landed, depth
and stencil layer queries are valid, so support for it was added.

Here's a link to the original cl:
https://swiftshader-review.googlesource.com/#/c/3541

Change-Id: Ib2eb50fb8cea6537da53bf45b5c7afa1f1a7b61b
Reviewed-on: https://swiftshader-review.googlesource.com/3751
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
8 years agoAdd missing validation for negative GLsizei values.
Nicolas Capens [Mon, 3 Aug 2015 14:49:12 +0000 (10:49 -0400)]
Add missing validation for negative GLsizei values.

Change-Id: Id3022059b3d5c21e5c78c668e21fddf569d920ef
Reviewed-on: https://swiftshader-review.googlesource.com/3760
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 glLoadMatrixx() and glMultMatrixx().
Nicolas Capens [Fri, 7 Aug 2015 21:40:13 +0000 (17:40 -0400)]
Implement glLoadMatrixx() and glMultMatrixx().

Bug 21499847

Change-Id: I245a624cad7c47af9d93844d4ae272c873b42008
Reviewed-on: https://swiftshader-review.googlesource.com/3820
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoImplement OpenGL single-color specular lighting.
Nicolas Capens [Tue, 4 Aug 2015 20:11:24 +0000 (16:11 -0400)]
Implement OpenGL single-color specular lighting.

Change-Id: I40f9ad720bdbd93c44be8fb991dfbf055a3eceba
Reviewed-on: https://swiftshader-review.googlesource.com/3803
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoRefactor ambient lighting.
Nicolas Capens [Wed, 5 Aug 2015 04:05:20 +0000 (00:05 -0400)]
Refactor ambient lighting.

Change-Id: Ibfdf4366920c9b0de1b334b91c4acfcae5d94adf
Reviewed-on: https://swiftshader-review.googlesource.com/3791
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoImplement exponential vertex fog.
Nicolas Capens [Tue, 4 Aug 2015 19:34:26 +0000 (15:34 -0400)]
Implement exponential vertex fog.

Change-Id: I731bb641e00ba9ac880fdb9f721af24906b4850f
Reviewed-on: https://swiftshader-review.googlesource.com/3802
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoImplement several fixed-point entry functions.
Nicolas Capens [Tue, 4 Aug 2015 14:51:10 +0000 (10:51 -0400)]
Implement several fixed-point entry functions.

Change-Id: I7a156a33a6021bc871a902a2b9d050eeaf166fe9
Reviewed-on: https://swiftshader-review.googlesource.com/3801
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoImplement missing vertex element functions.
Nicolas Capens [Tue, 4 Aug 2015 14:49:49 +0000 (10:49 -0400)]
Implement missing vertex element functions.

Change-Id: I54c54838b7140023d902d5cb615eb8509eb6e23a
Reviewed-on: https://swiftshader-review.googlesource.com/3800
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoImplement missing state and queries.
Nicolas Capens [Tue, 4 Aug 2015 14:34:43 +0000 (10:34 -0400)]
Implement missing state and queries.

Change-Id: I4858980fc32df435ffc0fc0917905116bea54aa8
Reviewed-on: https://swiftshader-review.googlesource.com/3790
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoValidate vertex element sizes.
Nicolas Capens [Tue, 4 Aug 2015 14:23:56 +0000 (10:23 -0400)]
Validate vertex element sizes.

Change-Id: I03fabec6a92ef058aa2968418755aca079598cfe
Reviewed-on: https://swiftshader-review.googlesource.com/3781
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoValidate glOrtho() and glFrustum() parameters.
Nicolas Capens [Tue, 4 Aug 2015 14:21:40 +0000 (10:21 -0400)]
Validate glOrtho() and glFrustum() parameters.

Change-Id: Ib041b2c412ea9db7a951e4eea24b7f27d8621cd0
Reviewed-on: https://swiftshader-review.googlesource.com/3780
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoRenamed boolean state variables and setters.
Nicolas Capens [Mon, 3 Aug 2015 20:36:58 +0000 (16:36 -0400)]
Renamed boolean state variables and setters.

Change-Id: Ied1be6434a356ec7315df9d728dc424961f44fd0
Reviewed-on: https://swiftshader-review.googlesource.com/3770
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoSupport homogeneous coordinates with w != 1.
Nicolas Capens [Mon, 3 Aug 2015 19:33:44 +0000 (15:33 -0400)]
Support homogeneous coordinates with w != 1.

Change-Id: Ie5552f7b743ac488a10ef86042088181aa5b797a
Reviewed-on: https://swiftshader-review.googlesource.com/3763
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoImplement texture environment src, operand, and color.
Nicolas Capens [Mon, 3 Aug 2015 17:19:21 +0000 (13:19 -0400)]
Implement texture environment src, operand, and color.

Change-Id: I8c683a783f0a7f8a82206de77ae9d139f4b1bb10
Reviewed-on: https://swiftshader-review.googlesource.com/3762
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoSupport matrix stack overflow/underflow errors.
Nicolas Capens [Mon, 3 Aug 2015 15:03:31 +0000 (11:03 -0400)]
Support matrix stack overflow/underflow errors.

Change-Id: Ie3caee1128c8227397a74378fcefdf9e128fc6bf
Reviewed-on: https://swiftshader-review.googlesource.com/3761
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoUse the gce_x86_tablet config
Greg Hartman [Wed, 5 Aug 2015 19:24:58 +0000 (12:24 -0700)]
Use the gce_x86_tablet config

Change-Id: Ifd5f0bcc466f0ca7815f92285fa8bbd2d3ae2d8d
Reviewed-on: https://swiftshader-review.googlesource.com/3810
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
8 years agoRemove const modifiers that break implicit operator= generation.
Greg Hartman [Wed, 5 Aug 2015 19:59:40 +0000 (12:59 -0700)]
Remove const modifiers that break implicit operator= generation.

This is needed because the object is included by value in STL containers.

Change-Id: I4008aa3b733bdfc6c045a7622a0e40d7eb61b0bf
Reviewed-on: https://swiftshader-review.googlesource.com/3811
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoUniform buffer related fixes
Alexis Hetu [Wed, 22 Jul 2015 20:37:02 +0000 (16:37 -0400)]
Uniform buffer related fixes

- Added an actual offset, in registers, to the Uniform structure to
  take into account that types can have different register sizes.
- Fixed the array check in OutputASM::declareUniform() so that it
  doesn't make an array of blocks when declaring a member as an
  array in the default uniform block.
- Fixed arrayStride and matrixStride in the BlockInfo constructor.
- Fixed memberUniformIndexes to use uniform index instead of
  register index.

Change-Id: Id8ba23b5fef71c772bb45a45bb897ca5e2fae385
Reviewed-on: https://swiftshader-review.googlesource.com/3750
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoSupport for new texture function names
Alexis Hetu [Wed, 22 Jul 2015 20:59:10 +0000 (16:59 -0400)]
Support for new texture function names

There are explicit checks for texture function names in OutputASM,
which fail in ES3 because new function names are available, so some
of the new function names have been added to the checks.

Change-Id: I7ec8302a31c02500514ede4e36610dca1dafd235
Reviewed-on: https://swiftshader-review.googlesource.com/3752
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoSkip half-pixel shift on pre-transformed coordinates.
Nicolas Capens [Tue, 21 Jul 2015 05:29:49 +0000 (01:29 -0400)]
Skip half-pixel shift on pre-transformed coordinates.

Bug 22624951

Change-Id: Ibda5f528212c9a8d503d8d6366cd7a42cd832c89
Reviewed-on: https://swiftshader-review.googlesource.com/3742
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoMove back-tranform of pre-transformed vertices to postTransform.
Nicolas Capens [Tue, 21 Jul 2015 05:28:04 +0000 (01:28 -0400)]
Move back-tranform of pre-transformed vertices to postTransform.

Bug 22624951

Change-Id: Ib8dfda6ed983f385a236b014d9b635a0c343071f
Reviewed-on: https://swiftshader-review.googlesource.com/3741
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 ETC1 decoding writing outside of internal buffer.
Nicolas Capens [Tue, 21 Jul 2015 19:15:30 +0000 (15:15 -0400)]
Fix ETC1 decoding writing outside of internal buffer.

Bug 22632766

Change-Id: Ib2fccdd498a6da43af7bb945179b278026cdba18
Reviewed-on: https://swiftshader-review.googlesource.com/3744
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoUniform blocks implementation
Alexis Hetu [Mon, 6 Jul 2015 19:03:42 +0000 (15:03 -0400)]
Uniform blocks implementation

- Added support for uniform blocks in OutputASM::declareUniform
- Added basic implementation of Program::applyUniformBuffers()
  to be completed later on when uniform buffers are implemented

Change-Id: I919b59d4557bb10bb302e6b6bd0ada79553ca8bb
Reviewed-on: https://swiftshader-review.googlesource.com/3651
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoSplitting PixelRoutine into PixelProgram and PixelPipeline
Alexis Hetu [Mon, 13 Jul 2015 15:08:41 +0000 (11:08 -0400)]
Splitting PixelRoutine into PixelProgram and PixelPipeline

This cl splits PixelRoutine into 2 specialized classes:
PixelProgram and PixelPipeline.
In this cl:
- Moved all specialized behavior of PixelRoutine into the
  PixelProgram and PixelPipeline classes.
- Inverted hierarchical dependency between PixelRoutine and
  QuadRasterizer. QuadRasterizer is now the base class.
- Added a check to PixelProcessor::routine() to either create
  a PixelPipeline object or a PixelProgram object.
- Moved a few interpolation related utility functions from
  PixelRoutine down to QuadRasterizer.
- Added Registers hierarchy. PixelProgram specific Registers
  and PixelPipeline specific Registers are now mutually
  exclusive.
- Made the quad functions virtual
- Added a few virtual functions (setBuiltins, ps, alphaTest,
  rasterOperation) for Program/Pipeline specific implementations

Bug 20257503

Change-Id: I6abe536a5521d9842f757a8bbb52e3947e3c9250
Reviewed-on: https://swiftshader-review.googlesource.com/3634
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdd an attach debugger dialog.
Nicolas Capens [Fri, 17 Jul 2015 17:28:14 +0000 (13:28 -0400)]
Add an attach debugger dialog.

Bug 15759123

Change-Id: I363524a191d319e03ce2b874cfc853c7330b684f
Reviewed-on: https://swiftshader-review.googlesource.com/3735
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoReimplement Direct3D GetFunction().
Nicolas Capens [Fri, 17 Jul 2015 17:17:33 +0000 (13:17 -0400)]
Reimplement Direct3D GetFunction().

Copied from old Shader::GetFunction().

Bug 22533227

Change-Id: I587a4112bc97f75c010b6f572f8f4388d5af9225
Reviewed-on: https://swiftshader-review.googlesource.com/3734
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFix D3D9 shader opcode mapping.
Nicolas Capens [Fri, 17 Jul 2015 15:47:57 +0000 (11:47 -0400)]
Fix D3D9 shader opcode mapping.

Bug 22533227

Change-Id: Idf969cd81fae9f5bc5f3da147ae84fe597d3afa7
Reviewed-on: https://swiftshader-review.googlesource.com/3733
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdapt D3D9 to Renderer changes.
Nicolas Capens [Fri, 17 Jul 2015 15:45:49 +0000 (11:45 -0400)]
Adapt D3D9 to Renderer changes.

Bug 22533227

Change-Id: Ib1b17bcace85bc6204589a48c65f60c94ffbe5cc
Reviewed-on: https://swiftshader-review.googlesource.com/3732
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoAdd the D3D9 project to the solution.
Nicolas Capens [Fri, 17 Jul 2015 15:09:00 +0000 (11:09 -0400)]
Add the D3D9 project to the solution.

Bug 22533227

Change-Id: I7dd953eecb169cb471aa9c1830f91b06f8bcc7ac
Reviewed-on: https://swiftshader-review.googlesource.com/3731
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoAdd back the D3D9 code from before the April 2014 code dump.
Nicolas Capens [Thu, 16 Jul 2015 21:40:10 +0000 (17:40 -0400)]
Add back the D3D9 code from before the April 2014 code dump.

Bug 22533227

Change-Id: Ib669fcd6a644c79b3a9e8f5dcf7da278d75cefef
Reviewed-on: https://swiftshader-review.googlesource.com/3730
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFramebuffer Layer query
Alexis Hetu [Mon, 22 Jun 2015 19:57:27 +0000 (15:57 -0400)]
Framebuffer Layer query

Added implementation for querying
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER in
GetFramebufferAttachmentParameteriv.

Change-Id: Ib25ba51bf68c9d979f80cc65ba7059366b5f1ae4
Reviewed-on: https://swiftshader-review.googlesource.com/3541
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded location to Attribute
Alexis Hetu [Thu, 16 Jul 2015 15:12:38 +0000 (11:12 -0400)]
Added location to Attribute

Program now uses Attribute location.

Change-Id: I005d64509e4b1e2dd977db38b6b2c41d6ba7ddef
Reviewed-on: https://swiftshader-review.googlesource.com/3722
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded missing binary related functions to Program
Alexis Hetu [Tue, 30 Jun 2015 21:03:10 +0000 (17:03 -0400)]
Added missing binary related functions to Program

The spec for GetProgramiv didn't mention anything about
PROGRAM_BINARY_LENGTH, but looking at the OpenGL ES 3.0
spec, section 2.11.4 - "Program Binaries", we have:

"The number of bytes in the program binary can be queried
by calling GetProgramiv with pname PROGRAM_BINARY_LENGTH"

Change-Id: Idf652fec34fa1f3cce6cce0e7302ab8d47a6cf74
Reviewed-on: https://swiftshader-review.googlesource.com/3611
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoChanged default buffer usage type
Alexis Hetu [Fri, 3 Jul 2015 14:30:37 +0000 (10:30 -0400)]
Changed default buffer usage type

dEQP was expecting default buffer usage to be GL_STATIC_DRAW
instead of GL_DYNAMIC_DRAW, so it was changed accordingly.

Change-Id: I5c9e31fc0791955fd32333c1479e76fbc79951a1
Reviewed-on: https://swiftshader-review.googlesource.com/3631
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoFixed Framebuffer attachment checks
Alexis Hetu [Mon, 13 Jul 2015 17:31:05 +0000 (13:31 -0400)]
Fixed Framebuffer attachment checks

Some checks in Framebuffer related functions were still
ES2 only. Made some modification to fix the checks for ES3.

Change-Id: Iaef6133179ea830dd599a5d66bc9698032085569
Reviewed-on: https://swiftshader-review.googlesource.com/3690
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agofwidth fix
Alexis Hetu [Thu, 16 Jul 2015 18:52:51 +0000 (14:52 -0400)]
fwidth fix

Fixed copy-paste error in FWIDTH function

Change-Id: I7562aa29408987839334aa13c7461f69d8ae6a19
Reviewed-on: https://swiftshader-review.googlesource.com/3728
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoNon square matrices related fixes
Alexis Hetu [Wed, 15 Jul 2015 20:55:56 +0000 (16:55 -0400)]
Non square matrices related fixes

- Implemented proper VariableRegisterCount (we were using row
  count instead of column count to get the number of registers)
  and VariableRegisterSize.
- Matrix to matrix copies now clear the correct rows of the
  destination matrix when needed
- Added registerSize helper function to type to help clarify
  this for matrices.
- Added missing member initializations in TType constructor

Change-Id: Ic880815515c7d12ad12e44f1392aa6892caa953f
Reviewed-on: https://swiftshader-review.googlesource.com/3718
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoLOD should be rounded to int
Alexis Hetu [Fri, 3 Jul 2015 19:46:32 +0000 (15:46 -0400)]
LOD should be rounded to int

The queries should round, rather than truncate, LODs to int.

Bug 20724899

Change-Id: I86ddc724545abb80687eb5132cdf8ddd410ee2d1
Reviewed-on: https://swiftshader-review.googlesource.com/3638
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoHandling proper sampler types
Alexis Hetu [Tue, 30 Jun 2015 20:27:50 +0000 (16:27 -0400)]
Handling proper sampler types

Some int/uint/array types weren't properly handled by
the Program class yet, so the missing types were added.

Change-Id: I487bbbdcbf798c7430535745386139632346013f
Reviewed-on: https://swiftshader-review.googlesource.com/3610
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoMake the debug messages more descriptive
Greg Hartman [Mon, 6 Jul 2015 22:27:41 +0000 (15:27 -0700)]
Make the debug messages more descriptive

Change-Id: I43f1675a1c6059cc86eaf84ac768242cfc80b88f
Reviewed-on: https://swiftshader-review.googlesource.com/3652
Tested-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoForward declare struct Constants to fix a compile error.
Greg Hartman [Tue, 7 Jul 2015 17:00:48 +0000 (10:00 -0700)]
Forward declare struct Constants to fix a compile error.

This was breaking the Android build and didn't appear to be used in the code.

It was introduced with I0fe062ea826b73b2bdf28ad3ed6e72e51c576840

Change-Id: Ic2a00c3264263e5608903ee7764f9c8dd8fb2c2a
Reviewed-on: https://swiftshader-review.googlesource.com/3662
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
9 years agoImplementation of glLogicOp
Maxime Grégoire [Wed, 8 Jul 2015 20:43:48 +0000 (16:43 -0400)]
Implementation of glLogicOp

Bug 22375329

Change-Id: Id6684e33bf3cd37fce48e7607e6a65fe64309f72
Reviewed-on: https://swiftshader-review.googlesource.com/2764
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Maxime Grégoire <mgregoire@google.com>
9 years agoReplaced some hardcoded constants
Alexis Hetu [Wed, 8 Jul 2015 19:56:17 +0000 (15:56 -0400)]
Replaced some hardcoded constants

Replaced values that matched with
FRAGMENT_UNIFORM_VECTORS or
VERTEX_UNIFORM_VECTORS where appropriate.

Change-Id: I64a72b6f30a8a553ea44c268e757ee529cff59fd
Reviewed-on: https://swiftshader-review.googlesource.com/3672
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoMinor unary math cleanup
Alexis Hetu [Tue, 7 Jul 2015 20:54:07 +0000 (16:54 -0400)]
Minor unary math cleanup

The unary math related functions were already
added to TParseContext, but a few sections in
the parser hadn't been converted yet.

Change-Id: Idbc96e6e91acce28310f391a50d219e39dfc185b
Reviewed-on: https://swiftshader-review.googlesource.com/3668
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoCompleting the "length()" intrinsic function implementation
Alexis Hetu [Mon, 6 Jul 2015 15:38:53 +0000 (11:38 -0400)]
Completing the "length()" intrinsic function implementation

The implementation of the length() function was already added
to TParseContext::addFunctionCallOrMethod() in a previous cl,
but it was still unused because addFunctionCallOrMethod() was
always called with the 3rd argument as nullptr. This cl adds
the missing code required to get the length function working.

Change-Id: I3339ae8b60f5f577caa0a39f88c6ed0c626879b2
Reviewed-on: https://swiftshader-review.googlesource.com/3641
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdd commands to the Andriod build log.
Greg Hartman [Tue, 7 Jul 2015 16:32:52 +0000 (09:32 -0700)]
Add commands to the Andriod build log.

Change-Id: I045c637eda7449baeeebc0b9b863e8a9af363ec6
Reviewed-on: https://swiftshader-review.googlesource.com/3660
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
9 years agoTreat rebinding the same image as a noop.
Greg Hartman [Tue, 7 Jul 2015 20:05:05 +0000 (13:05 -0700)]
Treat rebinding the same image as a noop.

Bug 22321923

Change-Id: Ib32137a0ac940ab40d375e928e3334b50387c5d5
Reviewed-on: https://swiftshader-review.googlesource.com/3667
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
9 years agoCreateSampler should create a Sampler object by default
Alexis Hetu [Fri, 3 Jul 2015 19:43:53 +0000 (15:43 -0400)]
CreateSampler should create a Sampler object by default

It should be possible to query the default parameters
of a Sampler created with glGenSamplers, so
checkSamplerAllocation() was added to make sure a
created sampler was associated to a Sampler object
where appropriate.

I also cleaned up the API a little to share validation
functions.

Change-Id: I55d95c6663d41e2566b24eb76a431dd4b4da61e3
Reviewed-on: https://swiftshader-review.googlesource.com/3637
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoInvariant keyword support
Alexis Hetu [Tue, 7 Jul 2015 17:31:44 +0000 (13:31 -0400)]
Invariant keyword support

Added support for the invariant keyword in the parser.
Also made sure all in/out types were handled properly
in OutputASM.cpp.

Change-Id: I40f0bc9caf5bccc691aa60dfaa90bed5d1d7d238
Reviewed-on: https://swiftshader-review.googlesource.com/3663
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoCompleted conversion of TSourceLoc into a struct
Alexis Hetu [Tue, 7 Jul 2015 19:12:46 +0000 (15:12 -0400)]
Completed conversion of TSourceLoc into a struct

TSourceLoc was defined as an int, but is meant to be
used as a struct to carry all the information provided
by the parser, so the conversion was made in this cl.

Change-Id: I6015d11aafda96914ec7b2c37883ffbc963a08fe
Reviewed-on: https://swiftshader-review.googlesource.com/3664
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
9 years agoSmall named variable cleanup
Alexis Hetu [Wed, 8 Jul 2015 12:29:36 +0000 (08:29 -0400)]
Small named variable cleanup

- Replaced a few lines of codes in the parser by getNamedVariable
- Deleted unused commented out code in the parser

Change-Id: I34db0c971140a39cd91a32c05ebf866d5fca795b
Reviewed-on: https://swiftshader-review.googlesource.com/3670
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoTernary selection cleanup
Alexis Hetu [Tue, 7 Jul 2015 21:13:30 +0000 (17:13 -0400)]
Ternary selection cleanup

Moved the ternary selection code to TParseContext
where checks were added to make sure arrays and
structs can't use it.

Change-Id: If3c007820870276cdf540005e095d89d54949bc4
Reviewed-on: https://swiftshader-review.googlesource.com/3669
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoSave a log file of build commands and errors
Greg Hartman [Mon, 29 Jun 2015 18:21:17 +0000 (11:21 -0700)]
Save a log file of build commands and errors

Change-Id: I7ad7b5db84e2c33b0340943f7f2b13403e777383
Reviewed-on: https://swiftshader-review.googlesource.com/3587
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
9 years agoTransform feedback varyings gather operation
Alexis Hetu [Thu, 2 Jul 2015 14:59:51 +0000 (10:59 -0400)]
Transform feedback varyings gather operation

A few small things were missing to get the transform
feedback varyings gather operation to work properly:
- A basic implementation of
  Program::gatherTransformFeedbackLinkedVaryings()
  has been made as a first step.
- transformFeedbackBufferMode is now initialized in
  the constructor
- transformFeedbackLinkedVaryings are now properly
  reset

Also:
- Removed useless DirectX semantic information from
  the LinkedVarying class
- ++it is more efficient than it++ in a loop, because
  it++ create a temporary object to return the
  original state of the iterator, so I made the
  changes where applicable in Program.cpp.

Change-Id: I78513f185ef5ef1a17448606b5c598c22d0d217e
Reviewed-on: https://swiftshader-review.googlesource.com/3621
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded more GLES 3.0 specific cases in GetFramebufferAttachmentParameteriv
Alexis Hetu [Fri, 3 Jul 2015 14:42:25 +0000 (10:42 -0400)]
Added more GLES 3.0 specific cases in GetFramebufferAttachmentParameteriv

These new entries will need to be updated once more internal
formats are available, but this will do for now.

Also added the possibility to query the Framebuffer 0 for GL_BACK,
GL_DEPTH and GL_STENCIL, as is allowed by OpenGL ES 3.0.

Finally, added a missing break in the GL_DEPTH_STENCIL_ATTACHMENT case.

Change-Id: Ifc32cc306c762ff58f9a9fe6608f7c19d3901c31
Reviewed-on: https://swiftshader-review.googlesource.com/3632
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoProper handling of Interface Block indexing
Alexis Hetu [Mon, 29 Jun 2015 18:31:19 +0000 (14:31 -0400)]
Proper handling of Interface Block indexing

This is a first step in handling interface blocks
properly by allowing indexing of blocks to be handled
properly. This does not include any interaction with
the Program, which will come in a following step.

No WebGL tests were injured in the making of this cl.

Change-Id: I575b08502f7f4dd63ca7b57f2ca0630367adf0de
Reviewed-on: https://swiftshader-review.googlesource.com/3589
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoAdded more info to ES3 only errors in parser
Alexis Hetu [Fri, 3 Jul 2015 20:20:11 +0000 (16:20 -0400)]
Added more info to ES3 only errors in parser

Added the same info as Angle's for ES3 only errors.

Change-Id: I2f11b34b06f8e1cc1b0a200d568c709ca35469ab
Reviewed-on: https://swiftshader-review.googlesource.com/3639
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoMoved function creation code from glslang.y to TParseContext.
Alexis Hetu [Fri, 3 Jul 2015 22:19:57 +0000 (18:19 -0400)]
Moved function creation code from glslang.y to TParseContext.

Added TParseContext::addFunctionCallOrMethod() to move function
creation functionality out of glslang.y.

Change-Id: Ia23e8c2490ba9d2bb1fcd00a1ef06eab5cf60b80
Reviewed-on: https://swiftshader-review.googlesource.com/3640
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoImplement alpha testing.
Nicolas Capens [Fri, 3 Jul 2015 18:33:14 +0000 (14:33 -0400)]
Implement alpha testing.

Change-Id: I0fe062ea826b73b2bdf28ad3ed6e72e51c576840
Reviewed-on: https://swiftshader-review.googlesource.com/3635
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoReturn correct OpenGL ES version
Alexis Hetu [Fri, 3 Jul 2015 14:57:21 +0000 (10:57 -0400)]
Return correct OpenGL ES version

Since we can create OpenGL ES 3.0 contexts locally now,
we should also be able to retrieve the correct version.

Change-Id: I9154869ddea5951946c8e23e59a00beb042fca8c
Reviewed-on: https://swiftshader-review.googlesource.com/3633
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoProper block size computations
Alexis Hetu [Mon, 29 Jun 2015 17:51:16 +0000 (13:51 -0400)]
Proper block size computations

Interface blocks can now properly return their size from
TType::getElementSize() or TType::elementRegisterCount().

Change-Id: Ief69163088839784cf347160bb49fd64f1a2a395
Reviewed-on: https://swiftshader-review.googlesource.com/3584
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoBetter encapsulation for TParseContext
Alexis Hetu [Mon, 22 Jun 2015 20:52:11 +0000 (16:52 -0400)]
Better encapsulation for TParseContext

Changed 15 public members of TParseContext
so that they are now private and added the
appropriate setters/getters, along with the
required code changes in the parser.

Change-Id: I0a3ea67540d165e9837a3fe8e64fda4843a3cf96
Reviewed-on: https://swiftshader-review.googlesource.com/3543
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
9 years agoImplement user clip planes.
Nicolas Capens [Thu, 2 Jul 2015 21:06:53 +0000 (17:06 -0400)]
Implement user clip planes.

Bug 22123818

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