Commit Graph
48 Commits
Author SHA1 Message Date
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
Geoff Lang 9cd1915c96 Fix warnings about unreferenced local variables.
BUG=skia:2272

Change-Id: Ibf03efedc662fea2a389ad2dc5af5b7b014181a8
Reviewed-on: https://chromium-review.googlesource.com/201900
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-05-28 21:07:53 +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
Geoff Lang 9a2e5b9490 Fix incorrect function forward declaration.
Change-Id: I135c4457fdc95f2d331e2924104a30f90a40bd1a
Reviewed-on: https://chromium-review.googlesource.com/189456
Reviewed-by: Shannon Woods <[email protected]>
Reviewed-by: Nicolas Capens <[email protected]>
Tested-by: Shannon Woods <[email protected]>
2014-03-14 19:10:33 +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
Jamie Madill e78603b585 Fix standalone Linux build.
We can include Makefiles in the ignore list, and need a few extra
flags to fix the GCC build on Linux.

BUG=angle:563

Change-Id: Iacd386359f0c0d9bb87ddc544dd8b4da2cb8fee0
Reviewed-on: https://chromium-review.googlesource.com/186902
Reviewed-by: Shannon Woods <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/186989
2014-02-20 14:17:23 +00:00
Geoff Lang 512a7b7b04 Regenerate project files.
TRAC #24020

Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
2013-10-22 14:30:12 -04:00
Geoff Lang 036aa49b62 Disable warnings about size_t conversion and fix ambiguous template parameters in 64 bit builds.
TRAC #23409

Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
2013-10-18 17:01:53 -04:00
Geoff Lang 7c69720176 Deleted manually maintained visual studio projects and replaced them with gyp generated ones. 2013-10-17 09:52:07 -04:00
Jamie Madill b41ebf5798 Fix compile errors in the essl to hlsl standalone translator.
ANGLEBUG=469
[email protected]

Review URL: https://codereview.appspot.com/13281043
2013-09-24 15:13:06 -04:00
Jamie Madill ba615196a8 Normalize line endings of tracked files in the repository.
TRAC #23896

Signed-off-by: Shannon Woods
2013-09-24 14:21:28 -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] 06e0df0b7a Fixed plain integer pointers being passed to ShGetInfo which expects size_t pointers.
TRAC #22678

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

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1976 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-02-28 23:21:14 +00:00
[email protected] e688e651ea Remove the ResourceLimits.h reference, which was causing the translator_common to always rebuild.
Also tinker with the deps a bit to allow for more parallelism during the build process.

TRAC #22437

Signed-off-by: Nicolas Capens
Signed-off-by: Daniel Koch
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1754 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-01-25 21:51:36 +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
[email protected] c60c15c095 Add filter files for VS2010 Solution browser
Trac #21647

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1300 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-10-17 18:15:14 +00:00
[email protected] 2187b4a36c Delete old .vcproj files that were replaced by .vcxproj files
Trac #21647
Signed-off-by: Shannon Woods
Signed-off-by: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1298 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-10-17 18:12:07 +00:00
[email protected] d99f9a45eb Adjust dependencies for samples
Trac #21647
Signed-off-by: Shannon Woods
Signed-off-by: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1296 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-10-17 18:11:55 +00:00
[email protected] e9b408bfc1 Add auto converted .vxcproj files for VC++ 2010 Express
Trac #21647
Signed-off-by: Shannon Woods
Signed-off-by: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1295 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-10-17 18:11:40 +00:00
[email protected] 8b8f02dcd3 [SH_TIMING_RESTRICTIONS] Restrict sampler dependent values from the tex coord and bias parameters of all sampling operations, not just texture2D.
Issue: 335
Review URL: https://codereview.appspot.com/6305049/


git-svn-id: https://angleproject.googlecode.com/svn/trunk@1167 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-06-25 20:39:58 +00:00
[email protected] 430f5e0c75 Add the SH_CSS_SHADERS_SPEC flag.
Review URL: https://codereview.appspot.com/6270050/


git-svn-id: https://angleproject.googlecode.com/svn/trunk@1145 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-06-08 17:47:59 +00:00
[email protected] 66ebd0143e Add the SH_TIMING_RESTRICTIONS compile flag and dependency graph implementation.
Description of the algorithm:
http://code.google.com/p/mvujovic/wiki/ShaderControlFlowAnalysis

This flag is one potential solution to timing attacks on textures containing cross-domain content
or user agent data.
This kind of analysis could be useful for both WebGL and CSS Shaders.

The SH_TIMING_RESTRICTIONS flag will reject a shader if it uses texture dependent data to affect
control flow.

Other ways of affecting shader timing such as using NaNs in basic arithmetic operations or using
built-in functions (e.g. atan) with different inputs are still under investigation.

Issue=329
Review URL: http://codereview.appspot.com/6195062/



git-svn-id: https://angleproject.googlecode.com/svn/trunk@1101 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-05-30 22:18:11 +00:00
[email protected] 4a02078ac0 Fixed compile warnings on linux.
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1090 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-05-17 21:19:16 +00:00
[email protected] a1d8059d67 Increase MSVC warning level to 4.
There are some exceptions, a subset of the exceptions used by Chromium. They didn't seem to be useful warnings.

In code which we don't change much, like the preprocessor, I just suppressed the warnings in the specific files rather than changing the code.

There should be no functional changes in this patch.
Review URL: https://codereview.appspot.com/5570066

git-svn-id: https://angleproject.googlecode.com/svn/trunk@964 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-01-25 21:52:10 +00:00
[email protected] 6575602ea6 Finished off the GLSL compiler's support for parsing shaders using OES_EGL_image_external.
The GLSL to HLSL translator work is not done yet so the extension is disabled in Shader.cpp.
Review URL: https://codereview.appspot.com/5530081

git-svn-id: https://angleproject.googlecode.com/svn/trunk@946 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-01-17 21:45:38 +00:00
[email protected] 7f02008ad8 Fix compiler warnings in translator.cpp
Bug=227
Author: Mark Callow

git-svn-id: https://angleproject.googlecode.com/svn/trunk@790 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-10-12 16:19:54 +00:00
[email protected] 876f47ad0d Fix essl_to_hlsl project configurations
Bug=226
Author: Mark Callow

git-svn-id: https://angleproject.googlecode.com/svn/trunk@789 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-10-12 16:19:48 +00:00
[email protected] f54509100e Fix extension behavior in shader validation.
If an extension is not specified, it is disabled by default, thus a shader should fail compiling if features from that extension are used.

ANGLEBUG=204
TEST=webgl conformance/extensions/oes-standard-derivatives.html
Review URL: http://codereview.appspot.com/4974071

git-svn-id: https://angleproject.googlecode.com/svn/trunk@745 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-09-09 01:37:19 +00:00
[email protected] 32e97315e2 Emulate certain buil-in functions to work around driver bugs.
This is implemented by adding a new compile option SH_EMULATE_BUILT_IN_FUNCTIONS.  The emulated functions are names as webgl_originalName_emu so there will never be naming conflicts.

At the moment only three functions are emulated: normalize, abs, sign.  Also, the compile option will emulate all three.  However, the mechanism to emulate only a selected subset is also imeplemented.  It can be turned on easily.

ANGLEBUG=196
TEST=with this option, the failed test with abs.frag passes.
Review URL: http://codereview.appspot.com/4916043

git-svn-id: https://angleproject.googlecode.com/svn/trunk@738 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-08-24 01:03:11 +00:00
[email protected] 0c6bb7a653 Add an compile option to unroll for-loops with integer indices.
ANGLEBUG=193
TEST=with this option, for-loops with integer indices will be unrolled.
Review URL: http://codereview.appspot.com/4899047

git-svn-id: https://angleproject.googlecode.com/svn/trunk@734 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-08-17 19:39:58 +00:00
[email protected] 09c323a40a Add an option to support for GL_OES_EGL_image_external.
Comes with this extension is the new sampler type samplerExternalOES.

ANGLEBUG=175
TEST=compile the attached shader file
Review URL: http://codereview.appspot.com/4809076

git-svn-id: https://angleproject.googlecode.com/svn/trunk@728 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-08-12 18:22:25 +00:00
[email protected] 5601ea0d66 Implement ES2 backend for Angle translator.
With this CL, we have the option to select a code output backend: GLSL, GLSL ES, or HLSL.

Note that we always emit the highest supported float precision for fragment shader due to anglebug 168.  Although this is a temporary solution, it's not against GLSL ES spec, because it's ok for implementation to upgrade precision.

Tested with WebGL conformance test suite, GLES2 conformance test suite (only failed 2/1198), and a few webgl demos, including worlds of webgl, aquarium, etc.

anglebug=81
test=translator emitting correct GLSL ES code when ES2 backend is selected.
Review URL: http://codereview.appspot.com/4550129

git-svn-id: https://angleproject.googlecode.com/svn/trunk@687 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-06-10 18:23:25 +00:00
[email protected] fe2aff1094 Redid gyp changes in last commit to support debugging of samples on
Linux. Fixed bug in translator sample where it was confusing arguments
and filenames on POSIX platforms.
Review URL: http://codereview.appspot.com/4532108

git-svn-id: https://angleproject.googlecode.com/svn/trunk@665 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-06-02 00:23:44 +00:00
[email protected] d7468be16f Add long name mapping option to the translator test.
Review URL: http://codereview.appspot.com/4529091

git-svn-id: https://angleproject.googlecode.com/svn/trunk@658 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-05-26 21:26:14 +00:00
[email protected] e0a384d781 Fix compilation errors in translator.cpp.
Review URL: http://codereview.appspot.com/4445073

git-svn-id: https://angleproject.googlecode.com/svn/trunk@626 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-04-29 00:24:23 +00:00
[email protected] d1e10e602e Refactored ReadFileData() function in the translator sample to fix many issues:
- Memory leaks
- Made compiling using multiple strings default. This was not getting exercised.
- Removed redundant copies of file data
- Handled empty files properly which were getting ignored
BUG=66
Review URL: http://codereview.appspot.com/2579041

git-svn-id: https://angleproject.googlecode.com/svn/trunk@465 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-10-20 20:58:55 +00:00
[email protected] 4888ceb668 Made the API of shader translator library consistent.
- We recently started using OpenGL-type enums. This CL makes all old enums consistent with the new scheme.
- Renamed TBuiltInResource to ShBuiltInResources to have a consistent prefix

BUG=46
Review URL: http://codereview.appspot.com/2328041

git-svn-id: https://angleproject.googlecode.com/svn/trunk@443 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-10-01 21:13:12 +00:00
[email protected] ee76f6af45 Implemented functionality to collect and return info for attributes and uniforms.
BUG=26
Review URL: http://codereview.appspot.com/2206046

git-svn-id: https://angleproject.googlecode.com/svn/trunk@440 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-09-27 19:28:55 +00:00
[email protected] 7beea4084f Added API to query for active attribs and uniforms. These functions are modeled after glGetShaderiv, glGetProgramiv, glGetActiveAttrib, and glGetActiveUniform. The main difference between this and OpenGL API is that we do not have programs - just shaders.
BUG=26
Review URL: http://codereview.appspot.com/2183041

git-svn-id: https://angleproject.googlecode.com/svn/trunk@425 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-09-15 21:18:34 +00:00
[email protected] 94a86ad8f1 Adding support for OES_standard_derivatives extension. This is not the complete implementation. Sending it to get feedback on the API. Is it OK to add extension support into TBuiltInResource? I could create a new struct for extensions but that would lead to API change.
BUG=25
Review URL: http://codereview.appspot.com/1953047

git-svn-id: https://angleproject.googlecode.com/svn/trunk@402 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-08-25 20:02:11 +00:00
[email protected] e4249f0217 Refactored the way symbol tables are initialized and stored. This was done in response to the addition of EShSpec.
Symbol table entries depend on three things - language, spec (not now but may eventually), and built-in resources.
We used to build two global symbol-tables - one for each language. During each compile, one of the symbol table was
copied and resource-specific stuff was added. I have moved the symbol table to TCompiler that gets initilized when
compiler is created and reused for each compile. This makes it much cleaner and extensible in case a spec requires
special entries to be added to the symbol table.

PS: Sorry for the long CL, but all of it needed to be done in one CL. I have verified that everything still compiles
and passes all conformance tests.
Review URL: http://codereview.appspot.com/1864044

git-svn-id: https://angleproject.googlecode.com/svn/trunk@351 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-07-26 18:13:52 +00:00
[email protected] c54bf507cd Further cleanup of ShaderLang.h. Removed redundant/unused macros and enum fields.
Review URL: http://codereview.appspot.com/1842046

git-svn-id: https://angleproject.googlecode.com/svn/trunk@349 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-07-22 16:49:09 +00:00
[email protected] 774d70630a Cleaned up translator API. Deleted unsupported dead code.
BUG=9
Review URL: http://codereview.appspot.com/1665050

git-svn-id: https://angleproject.googlecode.com/svn/trunk@348 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-07-21 18:55:45 +00:00
[email protected] 29cd91af30 Added an option for specifying language specification in preparation for supporting WebGL in addition to GLES2. This CL just replaces unused debugOptions variable with EShSpec variable.
BUG=11
Review URL: http://codereview.appspot.com/1692051

git-svn-id: https://angleproject.googlecode.com/svn/trunk@344 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-07-16 19:30:45 +00:00
[email protected] 76b820852b Added GLSL backend for ESSL translator.
Review URL: http://codereview.appspot.com/698041

git-svn-id: https://angleproject.googlecode.com/svn/trunk@69 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-03-24 17:59:39 +00:00