Merge pull request #2849 from jeremy-lunarg/hayes-fix-issue-2848

Fix seg fault
This commit is contained in:
Greg Fischer 2022-01-03 16:39:45 -07:00 committed by GitHub
commit 950c6ddc11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 3 deletions

View file

@ -0,0 +1,52 @@
noMatchingFunction.frag
ERROR: 0:17: 'func' : no matching overloaded function found
ERROR: 1 compilation errors. No code generated.
Shader version: 330
ERROR: node is still EOpNull!
0:8 Function Definition: func(struct-S-f11; ( global float)
0:8 Function Parameters:
0:8 's' ( in structure{ global float a})
0:10 Sequence
0:10 Branch: Return with expression
0:10 a: direct index for structure ( global float)
0:10 's' ( in structure{ global float a})
0:10 Constant:
0:10 0 (const int)
0:15 Function Definition: main( ( global void)
0:15 Function Parameters:
0:17 Sequence
0:17 Sequence
0:17 move second child to first child ( temp float)
0:17 'c' ( temp float)
0:17 Constant:
0:17 0.000000
0:18 move second child to first child ( temp 4-component vector of float)
0:18 'o_color' (layout( location=0) out 4-component vector of float)
0:18 Construct vec4 ( temp 4-component vector of float)
0:18 'c' ( temp float)
0:? Linker Objects
0:? 'o_color' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 330
ERROR: node is still EOpNull!
0:15 Function Definition: main( ( global void)
0:15 Function Parameters:
0:17 Sequence
0:17 Sequence
0:17 move second child to first child ( temp float)
0:17 'c' ( temp float)
0:17 Constant:
0:17 0.000000
0:18 move second child to first child ( temp 4-component vector of float)
0:18 'o_color' (layout( location=0) out 4-component vector of float)
0:18 Construct vec4 ( temp 4-component vector of float)
0:18 'c' ( temp float)
0:? Linker Objects
0:? 'o_color' (layout( location=0) out 4-component vector of float)

View file

@ -0,0 +1,19 @@
#version 330
struct S
{
float a;
};
float func(S s)
{
return s.a;
}
layout(location = 0) out vec4 o_color;
void main()
{
float c = func(1.0f); // ERROR: no matching function
o_color = vec4(c);
}