Commit Graph
110 Commits
Author SHA1 Message Date
Jamie Madill 9fe25e9eaa Add a uniform register query to the translator.
This returns the uniform index that we assigned for default uniforms.
All the dependent structure offsets can be determined from the base
register, so we won't have to store uniform information in the shader
variable.

BUG=angle:466

Change-Id: I0dd05251e8dba00c20d09fd865dfb150de56738e
Reviewed-on: https://chromium-review.googlesource.com/207254
Tested-by: Jamie Madill <[email protected]>
Reviewed-by: Zhenyao Mo <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
2014-07-23 20:31:01 +00:00
Geoff Lang 591e6afe5a Add support for ANGLE_platform_angle.
BUG=angle:490

Change-Id: If3c897a9ae3d27b96e4b9bf9475a9ac23a1090ba
Reviewed-on: https://chromium-review.googlesource.com/185396
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-07-22 19:43:10 +00:00
Zhenyao Mo cd68fe7989 Add a compiler option to rewrite vec/mat constructors
If one of the parameters is a vec/mat, expand it into scalars.

This is to work around Linux NVIDIA/AMD and Mac NVIDIA driver bugs.

BUG=angle:695
TEST=webgl conformance test

Change-Id: I35e1e25167d99f873dcb03bfb57a30e84b1aeed5
Reviewed-on: https://chromium-review.googlesource.com/207479
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>
2014-07-16 19:51:00 +00:00
Jamie Madill 4e1fd41255 Store a map of interface block registers.
The shader translator can return the assigned register for a
block via a new API. This will let us delete the member variable
in interface blocks for the register -- a nice thing for GLSL.

BUG=angle:466

Change-Id: I9bc38e0cd031e32f90787be42c2324fc7c79dbf9
Reviewed-on: https://chromium-review.googlesource.com/206828
Reviewed-by: Zhenyao Mo <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2014-07-14 13:53:35 +00:00
Jamie Madill 183bde5527 Return shader variable information using GLenum values.
Instead of duplicating GL header define values, explictly return
GLenum for variable queries in the shader inspection API. This
reduces the duplicate defines in the shader compiler header.

BUG=angle:466

Change-Id: Iddaaff597b188251fa2e546f352bf77ab3ac43bc
Reviewed-on: https://chromium-review.googlesource.com/205860
Tested-by: Jamie Madill <[email protected]>
Reviewed-by: Zhenyao Mo <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
2014-07-03 17:22:09 +00:00
Jamie Madill ce50555375 Revert "Return variable type queries using GLenum values."
Breaks the FYI bots until we get Chromium patched.

BUG=angle:466

This reverts commit 53221f5a03.

Change-Id: Ib28548df5c10a6f76f46e4cf8f2013dca5cf0ee2
Reviewed-on: https://chromium-review.googlesource.com/205850
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2014-06-26 19:00:37 +00:00
Jamie Madill 53221f5a03 Return variable type queries using GLenum values.
Instead of duplicating GL header define values, explictly return
GLenum for variable queries in the shader inspection API. This
reduces the duplicate defines in the shader compiler header.

BUG=angle:466

Change-Id: If631b20ce68747297a946e1371def7709027a613
Reviewed-on: https://chromium-review.googlesource.com/204937
Tested-by: Jamie Madill <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
Reviewed-by: Zhenyao Mo <[email protected]>
2014-06-26 18:07:37 +00:00
Jamie Madill f51639a4d1 Use a common include for GL headers.
A common place to define required GL includes gives us a nice
point to centralize GL customizations. In the header currently
are the basic GLES headers with extensions, and a define
carried over from desktop GL.

BUG=angle:466

Change-Id: I6fc61947b4514654ec21355a786904eac04656c0
Reviewed-on: https://chromium-review.googlesource.com/204936
Tested-by: Jamie Madill <[email protected]>
Reviewed-by: Zhenyao Mo <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
2014-06-26 14:36:33 +00:00
Geoff Lang 42a73ad04c Update to the latest EGL headers.
BUG=angle:490

Change-Id: I205e680a40af18f2657096d4219bdac0f613fb11
Reviewed-on: https://chromium-review.googlesource.com/204563
Reviewed-by: Brandon Jones <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-06-20 21:08:28 +00:00
Jamie Madill 68fe74aabb Add a compiler query for the translator output type.
This is useful for determining if we are compiling to a D3D9 or D3D11
shader outside of the internal translator classes.

BUG=angle:656

Change-Id: Ib1c1d3de569edaa2b65c24c09d05aa4dd229d3e4
Reviewed-on: https://chromium-review.googlesource.com/201564
Reviewed-by: Nicolas Capens <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2014-05-28 14:05:38 +00:00
Shannon Woods 2d76e5f665 Adds resource string generation to ANGLE
This will avoid Chrome source having to be updated each time that ANGLE's
ShBuiltInResources changes.

BUG=374942

Change-Id: If54dba8351de9b261ff269e885f231547c08ff0a
Reviewed-on: https://chromium-review.googlesource.com/200171
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
Tested-by: Shannon Woods <[email protected]>
2014-05-20 20:57:58 +00:00
Nicolas Capens 4648508683 Implement EXT_shader_texture_lod
BUG=angle:551

Change-Id: I81d7574a15861f1b24ddf6147cf71adbf20e10f3
Reviewed-on: https://chromium-review.googlesource.com/194960
Tested-by: Nicolas Capens <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
2014-04-16 19:30:22 +00:00
John Bauman 3dc300a592 Allow creating fixed-size window surfaces.
BUG=320021

Change-Id: I97cdd65ac17ee142700dbf0f363891500e967571
Reviewed-on: https://chromium-review.googlesource.com/184205
Reviewed-by: John Bauman <[email protected]>
Tested-by: John Bauman <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/190563
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
Tested-by: Shannon Woods <[email protected]>
2014-03-26 04:57:42 +00:00
Zhenyao Mo 3cdfcce86b Remove SH_MAP_LONG_VARIABLE_NAMES
We use hashing to map all variables/strcuture field names, etc,
so we no longer need this option.

Checked with Firefox and WebKit, they no longer use this option
either. Time to remove it.

Change-Id: Ie3e79b91a05258b04af419a9c42b2fd1b00e67c4
Reviewed-on: https://chromium-review.googlesource.com/189236
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/189568
2014-03-11 18:25:18 +00:00
Zhenyao Mo 550c600b99 Improvement on loop unrolling with loops indexing sampler arrays
1) Before this workaround is hardwired on mac, now we move it behind a compil
    2) Fix the issue where "break" inside the loop isn't handled while unrolled.

    BUG=338474
    TEST=webgl conformance test sampler-array-using-loop-index.html

Change-Id: I4996a42c2dea39a8a5af772c256f8e3cb383f59a
Reviewed-on: https://chromium-review.googlesource.com/188079
Reviewed-by: Zhenyao Mo <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>

Conflicts:
	include/GLSLANG/ShaderLang.h
	src/compiler/translator/ValidateLimitations.cpp
Change-Id: I546197bd7df1634ebccdd380be14c3250cd56151
Reviewed-on: https://chromium-review.googlesource.com/189061
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>
2014-03-07 18:59:18 +00:00
Zhenyao Mo 4a667fe96e Add an option to initialize varyings without static use in vertex shaders
ANGLEBUG=554
TEST=webgl conformance test on mac: shaders-with-varyings.html
[email protected],[email protected]
[email protected],[email protected]

Change-Id: I2e692d43fb15f1cf3ade3e398020d1fedb2b32f0
Reviewed-on: https://chromium-review.googlesource.com/185922
Reviewed-by: Zhenyao Mo <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>

Conflicts:
	src/common/version.h
	src/compiler/translator/Compiler.cpp
Change-Id: If7db13ef345bd6199d4ea0d7786f0de20885f2f3
Reviewed-on: https://chromium-review.googlesource.com/186144
Reviewed-by: Nicolas Capens <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Zhenyao Mo <[email protected]>
Tested-by: Zhenyao Mo <[email protected]>
2014-02-12 23:21:53 +00:00
Zhenyao Mo 7cab38b594 Add an option to unfold short circuiting in AST.
We replace "a || b" with "a ? true : b",
"a && b" with "a ? b : false".

This is to work around short circuiting bug in Mac drivers.

ANGLEBUG=482
TEST=webgl conformance tests
[email protected], [email protected]

Review URL: https://codereview.appspot.com/14529048

Conflicts:

	src/build_angle.gypi
	src/compiler/translator/Compiler.cpp

Change-Id: Ic2384a97d58f54294efcb3a012deb2007a9fc658
Reviewed-on: https://chromium-review.googlesource.com/178996
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
Tested-by: Shannon Woods <[email protected]>
2013-12-09 21:51:57 +00:00
Geoff Lang 31f0dc0a09 Merge a0bd8ef0ac from master.
Use ANGLE_TRANSLATOR_STATIC to enforce a static build of the translator in
chromium.

This prevents strange warnings from defining COMPONENT_BUILD=0.
Also rename COMPILER_IMPLEMENTATION to ANGLE_TRANSLATOR_IMPLEMENTATION
for better consistency in chromium.

ANGLEBUG=477
[email protected]
BUG=
2013-10-17 09:52:41 -04:00
Shannon Woods 93780289a7 Update to most recent khrplatform.h
Signed-off-by: Geoff Lang
Signed-off-by: Jamie Madill
2013-10-04 11:12:49 -04:00
Zhenyao Mo ac44cd2b07 Add an option in ANGLE shader translator to initialize gl_Position to vec4(0.0, 0.0, 0.0, 1.0).
This is to work around driver bugs where shader compile or program link would fail incorrectly if gl_Position is not set in vertex shader.

At the moment at least Linux NVIDIA driver has this bug.

ANGLEBUG=472
[email protected], [email protected]

Review URL: https://codereview.appspot.com/13509043
2013-09-24 15:13:06 -04:00
Zhenyao Mo a15f3e84bf Expose the packing function so we can check varyings packing per program
ANGLEBUG=471
[email protected]

Review URL: https://codereview.appspot.com/13322043
2013-09-24 15:13:06 -04:00
Zhenyao Mo d2d340b0da Add static_use to shader variable info query.
BUG=249018
ANGLEBUG=465
[email protected]

Review URL: https://codereview.appspot.com/13158043
2013-09-24 15:13:05 -04:00
Zhenyao Mo fa3c346fe9 Build fix: not all types support precisions.
Currently Angle translator made the wrong assumption that all variables have a precision, and ASSERT that.

BUG=276031
[email protected]

Review URL: https://codereview.appspot.com/13113044
2013-09-24 15:13:05 -04:00
Zhenyao Mo 74da9f2f24 Expose varying variables and also precision for all variables.
ANGLEBUG=457
[email protected], [email protected]

Review URL: https://codereview.appspot.com/12487043
2013-09-24 15:13:04 -04:00
Jamie Madill 47fdd13e7c Pass varyings to the GLES API from the translator using a direct pointer.
Instead of parsing them indirectly from HLSL, the pointer will allow us to more flexibly
support new types, especially compound types such as structures.

TRAC #23754

Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
2013-09-09 15:27:50 -04:00
Nicolas Capens 2a1d8a381d Add shadow samplers to the compiler front-end.
TRAC #23394
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens
2013-07-19 18:08:12 -04:00
Jamie Madill 2aeb26a4f6 Added support for EXT_frag_depth
This change also required that support be added for associating built-in
variables with an extension, similar to how functions could be associated with
extensions previously.

[email protected]

Review URL: https://codereview.appspot.com/9827044

git-svn-id: https://angleproject.googlecode.com/svn/trunk@2248 736b8ea6-26fd-11df-bfd4-992fa37f6226

TRAC #23333
Authored-by: [email protected]
Signed-off-by: Shannon Woods
Signed-off-by Nicolas Capens
Merged-by: Jamie Madill
2013-07-19 18:08:08 -04:00
Jamie Madill eb1a010f0f Add expression complexity and call stack depth limits.
git-svn-id: https://angleproject.googlecode.com/svn/trunk@2242 736b8ea6-26fd-11df-bfd4-992fa37f6226

TRAC #23333
Authored-by: [email protected]
Signed-off-by: Shannon Woods
Signed-off-by Nicolas Capens
Merged-by: Jamie Madill
Conflicts:

	src/common/version.h
2013-07-19 18:06:52 -04:00
Nicolas Capens 8772b58871 Support sampler2DArray throughout the compiler.
TRAC #23377
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens
2013-07-19 18:05:15 -04:00
Nicolas Capens da07535fa9 Support sampler3D throughout the compiler.
TRAC #23365
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens
2013-07-19 18:05:13 -04:00
Nicolas Capens 2ffe0bbe34 Support usampler throughout the compiler.
TRAC #23360
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens
2013-07-19 18:05:12 -04:00
Nicolas Capens 344e7142ed Support isampler throughout the compiler.
TRAC #23359
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens
2013-07-19 18:05:10 -04:00
Jamie Madill defb674aad Add a new path for querying active attributes from the shader translator, for use with layout qualifier support.
TRAC #23269

Signed-off-by: Geoff Lang
Signed-off-by: Nicolas Capens
Author: Jamie Madill
2013-07-19 18:05:04 -04:00
Jamie Madill 46131a3832 Proper support for fragment output variables for GLSL ES shader version 300.
TRAC #22704

Signed-off-by: Geoff Lang
Signed-off-by: Nicolas Capens
Authored-by: Jamie Madill
2013-07-19 18:05:03 -04:00
[email protected] 6b7099111f Add support for the unsigned integer scalar type to the shader translator.
TRAC #23080

Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2403 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-05-30 00:20:04 +00:00
[email protected] 8da034cc6a Add non-square mat support to the shader language interface.
TRAC #23081

Signed-off-by: Geoff Lang
Signed-off-by: Nicolas Capens
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2397 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-05-30 00:19:15 +00:00
[email protected] 3f68bf0e3b Enable the translator to pass parsed interface blocks back to the ANGLE API via the shader translator layer.
TRAC #22930

Signed-off-by: Nicolas Capens
Signed-off-by: Geoff Lang
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2346 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-05-30 00:12:43 +00:00
[email protected] eff3a1272e Control the creation of DX9 or DX11 renderers through eglGetDisplay.
TRAC #23029
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2328 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-05-30 00:10:04 +00:00
[email protected] 74b86cffad Add new GLSL ES 3.0 built-in constants and split off 1.0 ones.
TRAC #22863
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2274 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-05-30 00:02:58 +00:00
shannon.woods%[email protected] 0bbed38f41 Accept shader version 300 on ES3 contexts.
TRAC #22712
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2121 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-04-13 03:38:07 +00:00
shannon.woods%[email protected] f3c5249109 Updates EGL headers
TRAC #22805

Signed-off-by: Jamie Madill
Signed-off-by: Geoff Lang
Author: Shannon Woods

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2088 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-04-13 03:33:04 +00:00
shannon.woods%[email protected] f26ddae9ac Added the GLES3 headers and updated all locations where the GLES2 headers were included to also include the GLES3 headers.
TRAC #22694

Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Geoff Lang

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2069 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-04-13 03:29:13 +00:00
shannon.woods%[email protected] 5f339332e1 Updated gl2.h and gl2ext.h.
TRAC #22694

Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Geoff Lang

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2068 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-04-13 03:29:02 +00:00
shannon.woods%[email protected] d24fcd7aea Add necessary defines and function prototypes for EXT_draw_buffers and multiple color attachment points to gl2ext.h
TRAC #22656

Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2061 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-04-13 03:28:09 +00:00
shannon.woods%[email protected] fc84e0adfa Bump ANGLE_SH_VERSION to 110.
The bump to 109 in r1984 collided with a similar version change in dx11proto branch (r1738).
Review URL: https://codereview.appspot.com/7446050

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2060 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-04-13 03:28:03 +00:00
shannon.woods%[email protected] cbb6b6a041 Added preprocessor support for GL_FRAGMENT_PRECISION_HIGH.
I will send the tests in a separate patch because I need to refactor the way compiler_tests are setup.
Review URL: https://codereview.appspot.com/7402051

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2058 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-04-13 03:27:47 +00:00
[email protected] 550cd09889 Add support for extension EXT_draw_buffers.
Review URL: https://codereview.appspot.com/7308107

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1963 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-02-28 23:19:54 +00:00
[email protected] d64b3dab06 Fixed 64-bit integer truncation issues in shader translator.
This is an incompatible API change, but one which is necessary in
order to improve correctness of the code. The API version in
ShaderLang.h is updated and, unfortunately, the define renamed to
something less ambiguous due to conflicts on some Android buildbots.
Temporary patches in Chromium and WebKit will be landed separately to
support this upgrade.

BUG=403,404,405,406,407,408,409
Review URL: https://codereview.appspot.com/7300058


Conflicts:
	include/GLSLANG/ShaderLang.h

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1960 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-02-28 23:19:26 +00:00
[email protected] 1d432bb570 Incorporated patch from haixia@ changing the default implementation of
array index clamping to use the clamp intrinsic. This works more
reliably on pure OpenGL ES devices and on Windows.

Added a mechanism in ShBuiltInResources to choose the strategy for
array index clamping.

BUG=none
TEST=various out-of-bounds array indexing tests and various WebGL content
Review URL: https://codereview.appspot.com/7194051

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1798 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-01-25 21:57:28 +00:00
[email protected] 8204334b61 Fix and extend essl_to_hlsl to support DX11 HLSL.
TRAC #22330
Signed-off-by: Daniel Koch
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1740 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-01-25 21:49:34 +00:00