Commit f57aa7bd by John Kessenich

Add missing precision qualifier checks to function formal parameter declarations.

parent 758c1572
#version 300 es #version 300 es
void nodef1(float f); // ERROR, no default precision
uniform sampler2D s2D; uniform sampler2D s2D;
uniform lowp sampler3D s3D; uniform lowp sampler3D s3D;
uniform samplerCube sCube; uniform samplerCube sCube;
......
#version 310 es #version 310 es
highp float nodef3(float); // ERROR, no default precision
precision mediump float; precision mediump float;
precision highp usampler2D; precision highp usampler2D;
precision highp sampler2D; precision highp sampler2D;
......
300.frag 300.frag
ERROR: 0:2: 'float' : type requires declaration of default precision qualifier
ERROR: 0:30: 'noperspective' : Reserved word. ERROR: 0:30: 'noperspective' : Reserved word.
ERROR: 0:30: 'noperspective' : not supported with this profile: es ERROR: 0:30: 'noperspective' : not supported with this profile: es
ERROR: 0:31: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: bads ERROR: 0:31: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: bads
...@@ -37,7 +38,7 @@ ERROR: 0:148: 'qualifier' : cannot use auxiliary, memory, interpolation, or prec ...@@ -37,7 +38,7 @@ ERROR: 0:148: 'qualifier' : cannot use auxiliary, memory, interpolation, or prec
ERROR: 0:150: 'early_fragment_tests' : not supported for this version or the enabled extensions ERROR: 0:150: 'early_fragment_tests' : not supported for this version or the enabled extensions
ERROR: 0:152: 'imageBuffer' : Reserved word. ERROR: 0:152: 'imageBuffer' : Reserved word.
ERROR: 0:152: '' : syntax error ERROR: 0:152: '' : syntax error
ERROR: 38 compilation errors. No code generated. ERROR: 39 compilation errors. No code generated.
Shader version: 300 Shader version: 300
......
310.frag 310.frag
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
ERROR: 0:2: 'float' : type requires declaration of default precision qualifier
ERROR: 0:8: 'origin_upper_left' : not supported with this profile: es ERROR: 0:8: 'origin_upper_left' : not supported with this profile: es
ERROR: 0:8: 'pixel_center_integer' : not supported with this profile: es ERROR: 0:8: 'pixel_center_integer' : not supported with this profile: es
ERROR: 0:8: 'gl_FragCoord' : identifiers starting with "gl_" are reserved ERROR: 0:8: 'gl_FragCoord' : identifiers starting with "gl_" are reserved
...@@ -28,7 +29,7 @@ ERROR: 0:102: 'out' : cannot be bool ...@@ -28,7 +29,7 @@ ERROR: 0:102: 'out' : cannot be bool
ERROR: 0:103: 'image2D' : sampler/image types can only be used in uniform variables or function parameters: imageOut ERROR: 0:103: 'image2D' : sampler/image types can only be used in uniform variables or function parameters: imageOut
ERROR: 0:103: '' : image variables not declared 'writeonly' must have a format layout qualifier ERROR: 0:103: '' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:104: 'out' : cannot be a matrix ERROR: 0:104: 'out' : cannot be a matrix
ERROR: 28 compilation errors. No code generated. ERROR: 29 compilation errors. No code generated.
Shader version: 310 Shader version: 310
......
...@@ -811,6 +811,7 @@ parameter_declarator ...@@ -811,6 +811,7 @@ parameter_declarator
parseContext.error($2.loc, "illegal use of type 'void'", $2.string->c_str(), ""); parseContext.error($2.loc, "illegal use of type 'void'", $2.string->c_str(), "");
} }
parseContext.reservedErrorCheck($2.loc, *$2.string); parseContext.reservedErrorCheck($2.loc, *$2.string);
parseContext.precisionQualifierCheck($1.loc, $1);
TParameter param = {$2.string, new TType($1)}; TParameter param = {$2.string, new TType($1)};
$$.loc = $2.loc; $$.loc = $2.loc;
...@@ -825,7 +826,8 @@ parameter_declarator ...@@ -825,7 +826,8 @@ parameter_declarator
parseContext.arrayDimCheck($2.loc, $1.arraySizes, $3.arraySizes); parseContext.arrayDimCheck($2.loc, $1.arraySizes, $3.arraySizes);
parseContext.arraySizeRequiredCheck($3.loc, $3.arraySizes->getSize()); parseContext.arraySizeRequiredCheck($3.loc, $3.arraySizes->getSize());
parseContext.reservedErrorCheck($2.loc, *$2.string); parseContext.reservedErrorCheck($2.loc, *$2.string);
parseContext.precisionQualifierCheck($1.loc, $1);
$1.arraySizes = $3.arraySizes; $1.arraySizes = $3.arraySizes;
...@@ -880,6 +882,7 @@ parameter_type_specifier ...@@ -880,6 +882,7 @@ parameter_type_specifier
$$.param = param; $$.param = param;
if ($1.arraySizes) if ($1.arraySizes)
parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getSize()); parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getSize());
parseContext.precisionQualifierCheck($1.loc, $1);
} }
; ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment