src/compiler


Log

Author Commit Date CI Message
alokp@chromium.org 16efbbae 2011-09-13T04:10:41 Complete implementation for handling #define directive. Review URL: http://codereview.appspot.com/4963062 git-svn-id: https://angleproject.googlecode.com/svn/trunk@752 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com f420c424 2011-09-12T18:27:59 Add/remove more functions to use shims. Remove normalize and add cos instead to avoid a crash in Mac with ATI cards (angle bug 193, 202). Also add atan and mod as it's also buggy on Mac/Win with NVIDIA cards. Also, trying to minimize emulated functions by adding masks for fragment/vertex shaders. ANGLEBUG=196 Review URL: http://codereview.appspot.com/4992047 git-svn-id: https://angleproject.googlecode.com/svn/trunk@748 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com f5450910 2011-09-09T01:37:19 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
alokp@chromium.org 3a01d1bc 2011-08-30T05:10:53 Preparation for macro expansion. Review URL: http://codereview.appspot.com/4919045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@741 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com e4eb9911 2011-08-29T21:13:12 Fix a bug introduced in r738. ANGLEBUG=201 TEST=chrome gpu bots green, no complaint from Firefox/Benoit Review URL: http://codereview.appspot.com/4956050 git-svn-id: https://angleproject.googlecode.com/svn/trunk@740 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 32e97315 2011-08-24T01:03:11 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
alokp@chromium.org b81c401d 2011-08-21T06:53:11 Modified Token class to store various types of data. Added debug code to dump token to an output stream. Review URL: http://codereview.appspot.com/4920041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@737 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 71c14ff8 2011-08-17T20:24:24 Fix the standalone translator_common.vcproj BUG=none TEST=build fine with that .vcproj TBR=daniel@transgaming.com Review URL: http://codereview.appspot.com/4902049 git-svn-id: https://angleproject.googlecode.com/svn/trunk@735 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 0c6bb7a6 2011-08-17T19:39:58 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
kbr@chromium.org 57f7ce00 2011-08-15T23:13:05 Output the precision for the return type in function declarations. Tested with GLSL ES conformance suite (which doesn't test this) and the WebGL conformance suite, which now contains tests to ensure that these constructs compile correctly. Chromium bug: http://crbug.com/86952 Review URL: http://codereview.appspot.com/4897045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@731 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 75fe6b76 2011-08-14T05:31:22 General cleanup of compiler directory and ParseHelper. Review URL: http://codereview.appspot.com/4801084 git-svn-id: https://angleproject.googlecode.com/svn/trunk@730 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 09c323a4 2011-08-12T18:22:25 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
alokp@chromium.org 4e4b807d 2011-08-07T05:36:04 Beginnings of a new preprocessor. Review URL: http://codereview.appspot.com/4830050 git-svn-id: https://angleproject.googlecode.com/svn/trunk@718 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 5a0a8dd3 2011-08-03T20:57:52 Remove unnecessary Visit function overloading. BUG=none TEST=build ok, run as before Review URL: http://codereview.appspot.com/4814063 git-svn-id: https://angleproject.googlecode.com/svn/trunk@715 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 651abd8d 2011-08-02T15:29:03 Fixed standalone visual studio projects by adding DetectRecursion files. Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@713 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com b1762df4 2011-07-30T02:04:23 Detect function recursion and reject a shader if detected. ANGLEBUG=191 TEST=shaders with function recursion are rejected. Review URL: http://codereview.appspot.com/4808061 git-svn-id: https://angleproject.googlecode.com/svn/trunk@711 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 0f87e7fd 2011-06-24T14:03:32 Fix GrowAtomTable() on out-of-memory. Issue=173 Signed-off-by: Daniel Koch Author: Benoit Jacob git-svn-id: https://angleproject.googlecode.com/svn/trunk@699 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 5bf210b2 2011-06-21T14:22:03 Add x86-64 project settings. Bug=55 TRAC #15606 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@698 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 216aa5ed 2011-06-17T22:31:32 Map long for-loop control variable names in shaders. Look at TIntermLoop::traverse() in IntermTraverse.cpp, the control init part is not handled explicitly there (unlike the other two parts). It is expected hat visitLoop will cover the init part. The bug in the MapLongVariableNames is that the visitLoop doesn't do anything. This CL fixes it. BUG=171 TEST=conformance/glsl-long-variable-names.html passing. Review URL: http://codereview.appspot.com/4644045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@696 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com dc4b4f85 2011-06-17T00:42:53 Always emit precision in shader variable declarations. After the shader compile (and before code output), the precision scopes are already lost. In order to correctly output precisions, we need to emit precision in each variable declaration, therefore, each variable should have its precision set. This CL fixes the bugs that the precisions are lost for variables using default precsions and struct fields. Also, this CL fixes a bug in the grammar: constructors are not type_specifier and they shouldn't have precisions. BUG=168 TEST=webgl conformance tests, gles2 conformance tests. Review URL: http://codereview.appspot.com/4617041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@695 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 189be2f1 2011-06-16T18:28:53 Emit precisions in function arguments and return type for GLES2. BUG=none TEST=Translator with GLES2 output backend emit precisions for function arguments and return type. Review URL: http://codereview.appspot.com/4643042 git-svn-id: https://angleproject.googlecode.com/svn/trunk@694 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 5601ea0d 2011-06-10T18:23:25 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
baustin@google.com 8ab69840 2011-06-02T21:53:45 Insert a new-line ('\n') before the #line directive in HLSL source. Without this, sometimes the #line directive shows up at the end of the previous line of shader source. This was causing syntax errors when trying to compile shaders during a PIX session. Review URL: http://codereview.appspot.com/4561059 git-svn-id: https://angleproject.googlecode.com/svn/trunk@667 736b8ea6-26fd-11df-bfd4-992fa37f6226
kbr@chromium.org 04277b82 2011-06-02T18:41:26 Generate an error in the parser for unsized array declarations. BUG=164 TEST=none Review URL: http://codereview.appspot.com/4539101 git-svn-id: https://angleproject.googlecode.com/svn/trunk@666 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 24c08c4e 2011-05-27T17:40:48 Fix the bug that long varying varibales are mapped into different names in fragment/vertex shaders. ANGLEBUG=144 TEST=the same long varying variable name in fragment/vertex shaders map to the same shortened name if using the same translator. Review URL: http://codereview.appspot.com/4547063 git-svn-id: https://angleproject.googlecode.com/svn/trunk@660 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 5cb728c5 2011-05-17T18:34:24 Add missing newlines to source files Issue=154 git-svn-id: https://angleproject.googlecode.com/svn/trunk@653 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 424bb49d 2011-05-11T15:36:59 Validate shaders so they don't exceed the texture unit counts. Issue=95 TRAC #16568 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@641 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 15795192 2011-05-11T15:36:20 Translate vertex texture lookup functions. Issue=95 TRAC #16568 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@635 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com a129765f 2011-04-26T18:36:43 Add MapLongVariableNames files to standalone vcproj git-svn-id: https://angleproject.googlecode.com/svn/trunk@620 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com fd747b86 2011-04-23T01:30:07 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
zmo@google.com 0b8d4eb2 2011-04-04T19:17:11 Unroll for-loop if sampler array uses loop index as its index. If inside a for-loop, sampler array index is the loop index, Mac cg compiler will crash. This CL unroll the loop in such situation. The behavior is: 1) If the for-loop index is a float, we reject the shader. 2) If it is an integer, we unroll the for-loop. Things that should be done in the future are: 1) Add line number macros. 2) Add a limit to unroll iteration count. anglebug=94 Review URL: http://codereview.appspot.com/4331048 git-svn-id: https://angleproject.googlecode.com/svn/trunk@606 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com f02c9e62 2011-04-04T14:03:20 Fix resizing the string buffer. Issue=117 TRAC #15793 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@605 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com b969cc52 2011-03-15T18:23:59 Fix clang warnings in PoolAlloc.cpp Issue=127 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Part 4 of 5: <http://webkit.org/b/56337> Enable -Werror on ANGLE Upstream bug: <http://code.google.com/p/angleproject/issues/detail?id=127> Fixes the following static analyzer warnings: src/compiler/PoolAlloc.cpp:154:26:{154:24-154:25}{154:28-154:42}: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare,2] for (size_t x = 0; x < guardBlockSize; x++) { ~ ^ ~~~~~~~~~~~~~~ src/compiler/PoolAlloc.cpp:159:55:{159:54-159:56}{160:30-160:34}: warning: conversion specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat,7] sprintf(assertMsg, "PoolAlloc: Damage %s %u byte allocation at 0x%p\n", ~^ %lu fix-it:"src/compiler/PoolAlloc.cpp":{159:54-159:56}:"%lu" * src/compiler/PoolAlloc.cpp: (TAllocation::checkGuardBlock): Changed '%u' to '%lu' for size_t variable. Put for loop inside #ifdef GUARD_BLOCKS/#endif macros to fix tautological-compare warning. (TAllocation::checkAllocList): Added newline to end of file. Author: David Kilzer <ddkilzer@apple.com> git-svn-id: https://angleproject.googlecode.com/svn/trunk@575 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com ea993576 2011-03-15T18:23:55 Fix clang warnings: Intermediate.cpp: warning: '&&' within '||' Issue=126 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Part 3 of 5: <http://webkit.org/b/56337> Enable -Werror on ANGLE Upstream bug: <http://code.google.com/p/angleproject/issues/detail?id=126> Fixes the following static analyzer warnings: src/compiler/Intermediate.cpp:1008:55:{1008:17-1008:54}: warning: '&&' within '||' [-Wlogical-op-parentheses,2] if (left->isMatrix() && right->isVector() || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ src/compiler/Intermediate.cpp:1008:55: note: place parentheses around the '&&' expression to silence this warning [2] if (left->isMatrix() && right->isVector() || ^ ( ) fix-it:"src/compiler/Intermediate.cpp":{1008:17-1008:17}:"(" fix-it:"src/compiler/Intermediate.cpp":{1008:54-1008:54}:")" src/compiler/Intermediate.cpp:1008:55:{1009:17-1009:54}: warning: '&&' within '||' [-Wlogical-op-parentheses,2] if (left->isMatrix() && right->isVector() || ^ src/compiler/Intermediate.cpp:1008:55: note: place parentheses around the '&&' expression to silence this warning [2] if (left->isMatrix() && right->isVector() || ^ fix-it:"src/compiler/Intermediate.cpp":{1009:17-1009:17}:"(" fix-it:"src/compiler/Intermediate.cpp":{1009:54-1009:54}:")" src/compiler/Intermediate.cpp:1020:55:{1020:17-1020:54}: warning: '&&' within '||' [-Wlogical-op-parentheses,2] if (left->isMatrix() && right->isVector() || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ src/compiler/Intermediate.cpp:1020:55: note: place parentheses around the '&&' expression to silence this warning [2] if (left->isMatrix() && right->isVector() || ^ ( ) fix-it:"src/compiler/Intermediate.cpp":{1020:17-1020:17}:"(" fix-it:"src/compiler/Intermediate.cpp":{1020:54-1020:54}:")" src/compiler/Intermediate.cpp:1020:55:{1021:17-1021:54}: warning: '&&' within '||' [-Wlogical-op-parentheses,2] if (left->isMatrix() && right->isVector() || ^ src/compiler/Intermediate.cpp:1020:55: note: place parentheses around the '&&' expression to silence this warning [2] if (left->isMatrix() && right->isVector() || ^ fix-it:"src/compiler/Intermediate.cpp":{1021:17-1021:17}:"(" fix-it:"src/compiler/Intermediate.cpp":{1021:54-1021:54}:")" * src/compiler/Intermediate.cpp: (TIntermBinary::promote): Added parnetheses. Author: David Kilzer <ddkilzer@apple.com> git-svn-id: https://angleproject.googlecode.com/svn/trunk@574 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 0eb64c3a 2011-03-15T18:23:51 Fix clang warning: ParseHelper.cpp:264:13: warning: 8 enumeration values not handled in switch Issue=125 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Part 2 of 5: <http://webkit.org/b/56337> Enable -Werror on ANGLE Upstream bug: <http://code.google.com/p/angleproject/issues/detail?id=125> Fixes the following static analyzer warning: src/compiler/ParseHelper.cpp:264:13: warning: 8 enumeration values not handled in switch: 'EbtVoid', 'EbtBool', 'EbtGuardSamplerBegin'... [-Wswitch-enum,2] switch( type ){ ^ * src/compiler/ParseHelper.cpp: (TParseContext::precisionErrorCheck): Added a default case. Author: David Kilzer <ddkilzer@apple.com> git-svn-id: https://angleproject.googlecode.com/svn/trunk@573 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com cd3a1b94 2011-03-15T18:23:46 Fix clang warning: ConstantUnion.h:56:17: warning: 7 enumeration values not handled in switch Issue=124 Part 1 of 5: <http://webkit.org/b/56337> Enable -Werror on ANGLE Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Upstream bug: <http://code.google.com/p/angleproject/issues/detail?id=124> Fixes the following static analyzer warning: In file included from src/compiler/debug.cpp:14: In file included from src/compiler/ParseHelper.h:10: In file included from src/compiler/localintermediate.h:11: In file included from src/compiler/intermediate.h:21: src/compiler/ConstantUnion.h:56:17: warning: 7 enumeration values not handled in switch: 'EbtVoid', 'EbtGuardSamplerBegin', 'EbtSampler2D'... [-Wswitch-enum,2] switch (type) { ^ * src/compiler/ConstantUnion.h: (ConstantUnion::operator==): Added a default case. Author: David Kilzer <ddkilzer@apple.com> git-svn-id: https://angleproject.googlecode.com/svn/trunk@572 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 0b53fc05 2011-03-09T15:12:12 Fix NULL dereference for empty constructors. Issue=123 Patch by Jacob Benoit. git-svn-id: https://angleproject.googlecode.com/svn/trunk@570 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 62f20f9d 2011-03-09T15:10:18 Newlines in multi-line comments don't count as a newline. TRAC #15791 Issue=114 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@569 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 3829f80c 2011-02-28T15:06:59 Fixed a floating-point parsing assert. TRAC #15790 Issue=99,112 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@567 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 3b5643cf 2011-02-28T15:06:55 Avoid division by zero in the preprocessor Trac #15792 Issue=115 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@566 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com e90a0d5a 2011-02-18T02:52:06 Minor refactoring. TRAC #15551 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@563 736b8ea6-26fd-11df-bfd4-992fa37f6226
apatrick@chromium.org 05a5d8e0 2011-02-16T19:07:20 Added new line after generated HLSL break, continue and kill statements. This is consistent with return statements. It means that when PIX is attached, the #line directive lands on a new line. Review URL: http://codereview.appspot.com/4179054 git-svn-id: https://angleproject.googlecode.com/svn/trunk@562 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com b31f35ab 2011-02-11T13:19:35 Fix invalid compare operation asserts. TRAC #15551 Issue=116 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@559 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com f1f538ef 2011-02-09T16:30:01 Fix loop splitting. Trac #15446 Issue=98 Signed-off-by: Daniel Koch git-svn-id: https://angleproject.googlecode.com/svn/trunk@555 736b8ea6-26fd-11df-bfd4-992fa37f6226
zmo@google.com 7cfb2cff 2011-02-01T01:24:29 Allow variable names with length of up to 256 characters (this is required by WebGL spec). BUG=109 TEST=the 256-character variable test in glsl-conformance.html passes Review URL: http://codereview.appspot.com/3981050 git-svn-id: https://angleproject.googlecode.com/svn/trunk@552 736b8ea6-26fd-11df-bfd4-992fa37f6226
kbr@chromium.org 55d0be04 2011-01-28T22:05:31 Reject non-ASCII characters in shader source at the preprocessor level. Review URL: http://codereview.appspot.com/4094047 git-svn-id: https://angleproject.googlecode.com/svn/trunk@545 736b8ea6-26fd-11df-bfd4-992fa37f6226
apatrick@chromium.org 0f4cefe9 2011-01-26T19:30:57 Map D3D calls and HLSL shaders back to GLES2 calls and GLSL ES shaders in PIX. This makes debugging and profiling using PIX a lot more convenient. The top level of events are the GLES calls with their arguments. Those can be expanded to see the D3D calls that were issued for a particular GLES call. When PIX is attached, the shaders are saved out to temporary files and referenced from the translated HLSL shaders via #line directives. This enabled source level debugging of the original GLSL from PIX for pixel and vertex shaders. The HLSL is also saved to a temporary file so that intrinsic functions like texture2D can be stepped into. It also avoids creating a text file in the current working directory, which has continued to be an issue. I made the dependency on d3d9.dll static again so it can be accessed by GetModuleHandle witihin DllMain. I added an EVENT macro that issues D3DPERF_BeginEvent and D3DPERF_EndEvent around a C++ block. I replaced TRACE with EVENT for all the entry points. I removed the tracing of shader source since the source is visible in PIX. The means by which the filename of the temporary shader file is passed into the shader compiler is a little clunky. I did it that way to avoid changing the function signatures and breaking folks using the translator. I plan to make the compiler respect #pragma optimize so that optimization can be disabled for debugging purposes. For now it just disables shader optimization in debug builds of ANGLE. Review URL: http://codereview.appspot.com/3945043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@541 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com e9874058 2011-01-26T17:32:26 Fix issues with preprocessor on very malformed shaders Trac #15236,#15237,#15238,#15239 Error out instead of continued processing when we already know the preprocessor directives are bungled. Generally be more careful about the order in which cpp->elsetracker and cpp->ifdepth are checked/operated on. Validate all accesses of cpp->elsedepth to ensure no out of bounds accesses occur. Also slipped in a few indentation/spacing fixes. Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@540 736b8ea6-26fd-11df-bfd4-992fa37f6226
apatrick@chromium.org b31f532d 2011-01-19T19:02:52 All surfaces follow D3D Y convention, i.e. (0, 0) is "top-left" rather than GL's "bottom-left". This eliminates the need to flip the default FBO to the D3D convention using additional blits when presenting and reduces VRAM usage for redundant window sized surfaces. I took out the gl_Position.y flip from the vertex shader so FBOs are rendered according to D3D conventions. Texture lookups are flipped on Y to compensate. Cube map +Y and -Y faces are swapped. Y is now flipped in various other places, including uploading and reading back texture data from / to system memory, functions that take pixel space coordinates, winding order for culling, the implementation of ddy, the calculation of gl_Position and gl_FragCoord in fragment shaders and the flipping of compressed texture tiles. Review URL: http://codereview.appspot.com/3265041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@536 736b8ea6-26fd-11df-bfd4-992fa37f6226
kbr@chromium.org 3bd9d90f 2011-01-19T03:27:39 Build fix needed on certain platforms. Explicitly cast away const. BUG=none TEST=built within WebKit on Mac OS X in release mode TBR=daniel Review URL: http://codereview.appspot.com/4043042 git-svn-id: https://angleproject.googlecode.com/svn/trunk@535 736b8ea6-26fd-11df-bfd4-992fa37f6226
kbr@chromium.org e26cb5e4 2011-01-18T21:27:02 Increase GLSL version to 1.20 if the shader contains any matrix constructor calls taking a matrix as argument; these were reserved in GLSL 1.10. This makes http://sio29.sakura.ne.jp/tmp/webgl/index_eruru.html load correctly once https://bugs.webkit.org/show_bug.cgi?id=52390 is fixed. BUG=103 TEST=none Review URL: http://codereview.appspot.com/4034041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@534 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 83921386 2011-01-08T05:46:00 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
daniel@transgaming.com ac369f3d 2010-12-15T15:46:00 Fix structure parsing regression. TRAC #14717 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@511 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 5efd8b45 2010-12-13T14:48:03 Fix infinite loops in preprocessor when EOF encountered while scanning for newlines. Trac #14837 Issue=42 Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@506 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 9a76b814 2010-12-12T08:53:34 Fix memory leak in float literal parsing Issue=93 Contributed by Benoit Jacob git-svn-id: https://angleproject.googlecode.com/svn/trunk@504 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 7b17facf 2010-12-12T08:52:58 fix comparison between signed and unsigned integer expressions in TParseContext::constructorErrorCheck Issue=78 Contributed by timeless git-svn-id: https://angleproject.googlecode.com/svn/trunk@502 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 90d57a3f 2010-12-12T08:52:49 Fix TType::TType constructors to initialize members in correct order Issue=77 Contributed by timeless git-svn-id: https://angleproject.googlecode.com/svn/trunk@501 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com d32941b9 2010-11-28T02:03:07 Add missing files to the Visual Studio project. Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@498 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 3175496d 2010-11-28T02:02:52 Implement gl_DepthRange using a single uniform vector. TRAC #14504 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@495 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org b59a778c 2010-11-24T18:38:33 Implemented validation for loop and indexing limitations specified by GLSL ES spec 1.0 Appendix A Section 4 and 5. A couple of things to note: - This CL only validates the "form" of loop and indexing. It does not detect number-of-iterations or out-of-bound access. This will require more involved analysis/heuristics. - I haved combined SH_VALIDATE_CONTROL_FLOW and SH_VALIDATE_INDEXING into one flag - SH_VALIDATE_LOOP_INDEXING. Validating both together is much easier. BUG=48 Review URL: http://codereview.appspot.com/3225041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@491 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org bafcbaa3 2010-11-23T19:07:43 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
alokp@chromium.org b3abc78b 2010-11-17T21:31:59 Fixed compile error introduced in r482. git-svn-id: https://angleproject.googlecode.com/svn/trunk@484 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 52813558 2010-11-16T18:36:09 Replaced TIntermLoop::testFirst with TIntermLoop::loopType to clearly indicate which type of loop it is. In some cases it is not possble to differentiate between a for-loop and while-loop. BUG=48 Review URL: http://codereview.appspot.com/3123041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@482 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com bdfb2e50 2010-11-15T16:41:20 Only initialize through a temporary variable if the same symbol name is used in the initialization expression. TRAC #13627 The previous patch can generate a lot of unnecessary temporary variables. By first checking whether the same symbol name is reused the clutter is reduced to an absolute minimum (typical shaders won't rely on this odd GLSL semantic behavior so the workaround is hardly ever needed). Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@479 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com b6ef8f11 2010-11-15T16:41:14 Define new variables after evaluating the initialization expression. TRAC #13627 GLSL allows to write things like "float x = x;" where a new variable x is defined and the value of an existing variable x is assigned. HLSL uses C semantics (the new variable is created before the assignment is evaluated), so we need to convert this to "float t = x, x = t;". Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@478 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 1f29954d 2010-11-12T15:50:23 Added API to enforce GLSL limitations mandated by WebGL. BUG=48 Review URL: http://codereview.appspot.com/3005042 git-svn-id: https://angleproject.googlecode.com/svn/trunk@476 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 044a5cf8 2010-11-12T15:42:16 Refactored glslang grammar files to make: - lexer and parser reentrant - line number handling automatic Caveats: - The preprocessor is still not thread-safe and full of bugs. I have another not-yet-ready patch to replace the preprocessor. - The grammar files use options that are not supported by the old versions of flex and bison checked into compiler/tools. So I need to check-in the generated lexer-parser along with a shell script to generate them. Review URL: http://codereview.appspot.com/2992041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@475 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 2dfc47e3 2010-11-08T13:45:24 Fix ternary operator unfolding TRAC #14155 Issue=70 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@474 736b8ea6-26fd-11df-bfd4-992fa37f6226
daniel@transgaming.com 91ed1494 2010-10-29T03:11:43 Use C locale for atof to ensure using a dot as decimal mark. TRAC #14055 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@470 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 8860909e 2010-10-27T19:42:44 Fixed infinite loops and buffer overflow in byte_scan when scanning for integers and floating-point numbers. - The byte_scan and associated functions are not very well written. I tried to clean them as much as possible without re-writing the whole thing. - Replaced lBuildFloatValue function with atof. lBuildFloatValue was returning incorrect value anyway. The only reason it was working so far because we never used that value. BUG=59623(crbug.com), 603333(bugzilla.mozilla.org) Review URL: http://codereview.appspot.com/2655042 git-svn-id: https://angleproject.googlecode.com/svn/trunk@469 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org f5855c5e 2010-10-21T16:31:18 We were not reporting anything in the info-log for empty shader. This CL reports "unexpected EOF". BUG=66 Review URL: http://codereview.appspot.com/2619041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@466 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 43668cd0 2010-10-20T20:55:53 Fixed stack overflow in CPPextension function. An arbitrary size buffer was being used for extension name. Changed it to use MAX_SYMBOL_NAME_LEN. - Also formalized the values for MAX_SYMBOL_NAME_LEN and MAX_STRING_LEN. They were being used as if there was a confusion whether it included the NULL terminator or not. - Fixed some minor issues with code releated to the usage of MAX_SYMBOL_NAME_LEN and MAX_STRING_LEN. BUG=59625 (crbug.com) Review URL: http://codereview.appspot.com/2585042 git-svn-id: https://angleproject.googlecode.com/svn/trunk@464 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org fafd033e 2010-10-14T18:20:24 Added NSPR support for thread-local storage. Patch submitted by vladimirv. I have slightly modified the patch to still define ANGLE_OS_WIN and ANGLE_OS_POSIX. BUG=54 Review URL: http://codereview.appspot.com/2497041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@454 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org d300f5b0 2010-10-14T16:10:20 Removed redundant null-check. Patch submitted by timeless. BUG=58 Review URL: http://codereview.appspot.com/2470042 git-svn-id: https://angleproject.googlecode.com/svn/trunk@453 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 18895cb1 2010-10-14T16:09:57 Initialized TPoolAllocator::totalBytes. Patch submitted by timeless. BUG=60 Review URL: http://codereview.appspot.com/2494041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@452 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 95447df0 2010-10-14T16:09:37 GLSL backend was assuming that a for-loop will always have a condition. But according to GLSL ES 1.0, the condition is optional. BUG=50 Review URL: http://codereview.appspot.com/2489042 git-svn-id: https://angleproject.googlecode.com/svn/trunk@451 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org ac23189b 2010-10-14T16:09:09 Removed redundant dereference. Patch submitted by timeless. BUG=64 Review URL: http://codereview.appspot.com/2495041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@450 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 6c82cafe 2010-10-14T16:08:56 Replaced delete with delete[]. Patch submitted by timeless. BUG=59 Review URL: http://codereview.appspot.com/2493041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@449 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 9ecf3950 2010-10-13T19:28:25 GLSL backend now emits "#version 120" to legally access invariant keyword and gl_PointCoord built-in variable. BUG=35 Review URL: http://codereview.appspot.com/2341043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@448 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 4888ceb6 2010-10-01T21:13:12 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
alokp@chromium.org 10e6e9e3 2010-09-27T21:03:45 Handled case when variable declaration contains initialization. BUG=26 Review URL: http://codereview.appspot.com/2213049 git-svn-id: https://angleproject.googlecode.com/svn/trunk@441 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org ee76f6af 2010-09-27T19:28:55 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
alokp@chromium.org 570bfc7c 2010-09-24T17:19:25 Built-in string for vertex shaders can be empty. Nicolas handled this case in r433 but r437 overwrote it. Review URL: http://codereview.appspot.com/2233046 git-svn-id: https://angleproject.googlecode.com/svn/trunk@439 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 07620a58 2010-09-23T17:53:56 - 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
daniel@transgaming.com ecd7cf35 2010-09-22T17:13:50 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
alokp@chromium.org 7beea408 2010-09-15T21:18:34 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
alokp@chromium.org 8815d7f2 2010-09-09T17:30:03 Added support for associating functions with extensions and performing validation when those functions are used in a shader. BUG=25 Review URL: http://codereview.appspot.com/2141046 git-svn-id: https://angleproject.googlecode.com/svn/trunk@415 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org b19403a1 2010-09-08T17:56:26 Removed unnecessary member variables from TIntermAggregate. Replaced operator overloading with a proper function in TFunction. Review URL: http://codereview.appspot.com/2137043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@414 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org ad771eb2 2010-09-07T17:36:23 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
alokp@chromium.org 8f0f24a0 2010-09-01T21:06:24 Removed support for unused/deprecated extension - GL_3DL_array_object. TEST=conformance tests. Review URL: http://codereview.appspot.com/2043043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@412 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 06098890 2010-08-26T19:36:42 Allow derivative functions if derivative extension is enabled. I still need to add validation for "#extension GL_OES_standard_derivatives : enable". BUG=25 Review URL: http://codereview.appspot.com/1965045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@403 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 94a86ad8 2010-08-25T20:02:11 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
alokp@chromium.org 58e54298 2010-08-24T21:40:03 Cleanup TType and related classes: 1. Removed unused functions 2. Removed unnecessary virtuality of functions 3. Grouped related functions together TEST=conformance tests Review URL: http://codereview.appspot.com/1984047 git-svn-id: https://angleproject.googlecode.com/svn/trunk@400 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 32cfaf4b 2010-08-23T21:01:13 TIntermBinary::promote() was incorrectly marking the type of result as const in some cases. The result can only be const if both operands are const. Also cleaned up the function to remove redundant/repeated checks. BUG=24 TEST=OpenGL ES 2.0 Conformance tests Review URL: http://codereview.appspot.com/1938047 git-svn-id: https://angleproject.googlecode.com/svn/trunk@385 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org c7b6eba9 2010-08-09T22:33:53 Fixed warnings about deprecated conversion from string constant to char*. Submitted by timeless. BUG=18 Review URL: http://codereview.appspot.com/1936041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@381 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org b416e70e 2010-08-09T22:32:56 Some compilers do not support standard STL allocator interface. Also removed _Charalloc function only needed by VC++6.0, which we do not support. Submitted by Eagle.Lu. BUG=19 Review URL: http://codereview.appspot.com/1913048 git-svn-id: https://angleproject.googlecode.com/svn/trunk@380 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 434fdf21 2010-08-09T22:31:36 Fix warnings about unused variables. Submitted by timeless. BUG=15 Review URL: http://codereview.appspot.com/1916046 git-svn-id: https://angleproject.googlecode.com/svn/trunk@379 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org bcfba4c3 2010-08-09T22:30:49 Fix warnings about comparison/assignement between signed and unsigned types. Submitted by timeless. BUG=13 Review URL: http://codereview.appspot.com/1895051 git-svn-id: https://angleproject.googlecode.com/svn/trunk@378 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org 6eed5eb2 2010-08-09T22:29:59 ret = yyparse(...) is dropped in PaParseStrings. Submitted by timeless. BUG=16 Review URL: http://codereview.appspot.com/1868056 git-svn-id: https://angleproject.googlecode.com/svn/trunk@377 736b8ea6-26fd-11df-bfd4-992fa37f6226
alokp@chromium.org b2dfd8ea 2010-08-09T22:28:19 Fix warnings about initialization order in the class initialization list. Submitted by timeless. BUG=14 Review URL: http://codereview.appspot.com/1850054 git-svn-id: https://angleproject.googlecode.com/svn/trunk@376 736b8ea6-26fd-11df-bfd4-992fa37f6226