34 Commits
Author SHA1 Message Date
[email protected] 7f694d92f2 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
2013-05-28 22:15:20 +00:00
[email protected] 42988edd3d 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/trunk@1984 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-03-04 20:03:09 +00:00
[email protected] ca23ae5224 Add support for extension EXT_draw_buffers.
Review URL: https://codereview.appspot.com/7308107

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1830 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-02-20 17:29:15 +00:00
[email protected] 8e77853d4d 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

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1826 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-02-12 03:08:38 +00:00
[email protected] 7bc1d59f61 Fix a memory out-of-bound visit bug.
So len could equal = max_len, and at this point name[len] is out of the range.

BUG=
TEST=
Review URL: https://codereview.appspot.com/7223045

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1803 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-01-26 00:51:59 +00:00
[email protected] 1ba403c8f8 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/trunk@1733 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-01-25 00:01:11 +00:00
[email protected] b417815bdf Interface design for user-defined name hashing.
1) We use BuiltInResources to pass the hash function to 
   ANGLE, deciding whether we applies hash function or not.
2) We use 64 bits hashing function, because 64 bits is 16
   bytes using hex representation, plus the "webgl_" prefix,
   we can keep the names under 128 (WebGL allows 5 levels of
   nesting in structures).  If chooseing 128 bits, we will
   go beyond 128 characters, and some drivers can't handle
   that safely.

ANGLEBUG=315
Review URL: https://codereview.appspot.com/6822077

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1384 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-11-07 00:36:14 +00:00
[email protected] b45306b795 Ensure that strings produced by getVariableInfo are always null-terminated
Issue 326



git-svn-id: https://angleproject.googlecode.com/svn/trunk@1070 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-05-07 02:12:34 +00:00
[email protected] 205fef3389 Added support for GL_ARB_texture_rectangle to shader validator.
Parser was regenerated with the flex/bison shipped with Ubuntu 10.04.

BUG=251
TEST=tested with new Core Animation plugin rendering path on Mac OS X
Review URL: http://codereview.appspot.com/5432044

git-svn-id: https://angleproject.googlecode.com/svn/trunk@888 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-11-22 20:50:02 +00:00
[email protected] 221521178e Limit copied uniform and vertex attribute names to the implicit size of the
buffers passed in. Increase the size of the buffer the client will allocate
for mapped names to be equal to the maximum token length.

BUG=http://code.google.com/p/angleproject/issues/detail?id=234
TEST=WebGL conformance test to be checked in soon
Review URL: http://codereview.appspot.com/5306063

git-svn-id: https://angleproject.googlecode.com/svn/trunk@804 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-10-26 01:18:28 +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] fd747b8611 Implement shader identifier name mapping.
The name mapping happens when an identifier is longer than 32 characters.  The name mapping is behind a flag, so it won't happen by default.  Also, functions to query the mapped names are added.

The purpose of this CL is for the drivers that can't handle long names.  For example, linux NVIDIA driver can't handle 256 character name, whereas WebGL spec requires that.

This CL also fixes the issue that some of the TIntermSymbols' ids are 0s.

ANGLEBUG=144
TEST=test manually with shaders with long identifier names.
Review URL: http://codereview.appspot.com/4428058

git-svn-id: https://angleproject.googlecode.com/svn/trunk@619 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-04-23 01:30:07 +00:00
[email protected] 8392138636 rewrite buffers implementation to support static buffers more efficiently
Bug=89
Trac #13565

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

git-svn-id: https://angleproject.googlecode.com/svn/trunk@526 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-01-08 05:46:00 +00:00
[email protected] bafcbaa3a3 Moved the global-pool-allocator to TCompiler so that all memory allocated by the compiler can be de-allocated. Earlier the global-pool-allocator kept accumulating memory from all compilers (symbol-table in particular). The memory was only de-allocated when gpu-process exited or ShFinalize() was called. This was a problem for Chromium which keeps the GPU process around for the browser session. Now the memory is de-allocated as soon as the compiler is deleted, which happens when a tab is closed.
BUG=58808 (crbug.com)
Review URL: http://codereview.appspot.com/3280041

git-svn-id: https://angleproject.googlecode.com/svn/trunk@489 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-11-23 19:07:43 +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] 07620a585a - Moved the implementation for ShCompile to the compiler class so that internal details about compiler can be encapsulated. Now we do not need to expose built-in symbol table.
- Fixed a few const violations.
- Added CollectAttribsUniforms class.
BUG=26
Review URL: http://codereview.appspot.com/2263041

git-svn-id: https://angleproject.googlecode.com/svn/trunk@437 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-09-23 17:53:56 +00:00
[email protected] ecd7cf354d Define vertex texture sampling intrinsics only when supported
TRAC #12245
This ensures that the shader will fail to compile when using VTF when it's not supported.
Previously an error was generated only at link time and it was not very descriptive.
Signed-off-by: Daniel Koch

Author:    Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@433 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-09-22 17:13:50 +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] ad771eb2cf Added mechanism to predefine associated macros for extensions. Also refactored the way extension behavior is initialized and updated.
Please note that I still need to add validation that appropriate extensions are enabled before using an extension function.
BUG=25
Review URL: http://codereview.appspot.com/2139042

git-svn-id: https://angleproject.googlecode.com/svn/trunk@413 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-09-07 17:36:23 +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] 34b99cdf6c De-allocate memory in ShFinalize(). There still seems to be a bug here if the translator is used in a multi-threaded environment. It seems memory local to only one thread is being deallocated - the thread from which ShFinalize() is called. I will look into it closely in the next CL.
Review URL: http://codereview.appspot.com/1878044

git-svn-id: https://angleproject.googlecode.com/svn/trunk@353 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-07-27 18:37:55 +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] 613ef31a9f Added checks for webgl_ and _webgl_ reserved identifiers. This currently only checks variable and function names. Struct names and field names will be added in the another CL.
BUG=11
Review URL: http://codereview.appspot.com/1674050

git-svn-id: https://angleproject.googlecode.com/svn/trunk@346 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-07-21 18:54:22 +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] 90033b9eb5 ShInitialize/ShFinalize is designed to be called once per process, or it would crash at random locations. I changed ShFinalize() to properly cleanup and reset global variables so that they can be called multiple times. I think that the compiler setup is much more complicated than it needs to be. It unnecessarily uses global variables. A custom pool allocator is overkill too.
Review URL: http://codereview.appspot.com/1238045

git-svn-id: https://angleproject.googlecode.com/svn/trunk@316 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-05-24 15:02:43 +00:00
[email protected] bbf56f755e Use directory qualified #include files
Trac #11408
Signed-off-by: Andrew Lewycky
Signed-off-by: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@165 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-04-20 18:52:13 +00:00
[email protected] bb2e963617 Fail compilation on empty source string
TRAC #11814
Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch

Author:    Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@145 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-04-13 19:53:50 +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
[email protected] ea0e1af4c3 Minor reshuffling of directory structure in preparation of ESSL to GLSL compiler work.
1. Added include/GLSLANG which includes compiler API
2. Deleted src/include and moved the header files to the same directory as the corresponding source files
3. Modied include path to be relative to src/. I have only fixed paths for files I moved. We should fix it for all new files at least. It is much easier to see where an included file is coming from.

I noticed that a few libGLESv2 source files include headers from libEGL project, which seems wrong. I think we should address this issue. Next step: move compiler source files to compiler/frontend and create two new projects compiler/glsl_backend and compiler/hlsl_backend.

Review URL: http://codereview.appspot.com/662042

git-svn-id: https://angleproject.googlecode.com/svn/trunk@62 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-03-22 19:33:14 +00:00
[email protected] acc5113033 mv Compiler/* -> src/compiler/*
Trac #11406
Signed-off-by: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@37 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-03-17 13:12:17 +00:00