thanpv-lifortevn / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Missing user-defined function arguments are not detected by the translator #936

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following shader is not detected as faulty by ANGLE:

precision highp float;

void fun(float a)
{}

void main()
{
    fun();
    gl_FragColor = vec4(0.0);
}

The shader that's generated by ANGLE from this code typically results in an 
error from the platform shader compiler.

Original issue reported on code.google.com by oetu...@nvidia.com on 5 Mar 2015 at 3:16

GoogleCodeExporter commented 9 years ago

Original comment by cwal...@chromium.org on 12 Mar 2015 at 5:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by oetu...@nvidia.com on 18 Mar 2015 at 12:23

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Olli Etuaho <oetuaho@nvidia.com>
Commit : b2983c9558c5793cdb668fe49f3d5798f95c36d2

Code-Review  0 : Corentin Wallez, Nicolas Capens, Olli Etuaho, Zhenyao Mo
Code-Review  +2: Jamie Madill
Verified     0 : Corentin Wallez, Jamie Madill, Nicolas Capens, Zhenyao Mo
Verified     +1: Olli Etuaho
Commit Queue   : Chumped
Change-Id      : I2dadde9dcc01c7a4a653c1982c36377b89e6d437
Reviewed-at    : https://chromium-review.googlesource.com/260800

Correctly insert unmangled function names to symbol table

This fixes detecting some cases of function parameter mismatch
(previously a mangled function name corresponding to no function
parameters was added to the symbol table for each user-defined function,
and this was returned when doing function lookups with no parameters).

Also fixes detection of reusing a function name as a variable/struct
name.

New unit tests are added to ensure that these fixes don't regress.

BUG=angleproject:936
TEST=angle_unittests, WebGL conformance tests

src/compiler/translator/SymbolTable.cpp
src/compiler/translator/SymbolTable.h
src/compiler/translator/glslang.y
src/compiler/translator/glslang_tab.cpp
src/tests/angle_unittests.gypi
src/tests/compiler_tests/MalformedShader_test.cpp

Original comment by bugdro...@chromium.org on 19 Mar 2015 at 2:37

GoogleCodeExporter commented 9 years ago

Original comment by oetu...@nvidia.com on 19 Mar 2015 at 4:55