-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sanely handle current function overloading limitations in inlining (#292
- Loading branch information
1 parent
a9be21f
commit 54e45a7
Showing
7 changed files
with
115 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Generated with (https://github.com/laurentlb/Shader_Minifier/) | ||
#ifndef OVERLOAD_EXPECTED_ | ||
# define OVERLOAD_EXPECTED_ | ||
# define VAR_ZH "t" | ||
# define VAR__V "x" | ||
# define VAR_a_ "i" | ||
# define VAR_stopinlining "v" | ||
|
||
const char *overload_frag = | ||
"#version 330\n" | ||
"uniform sampler2D x;" | ||
"uniform vec2 i;" | ||
"in vec2 t;" | ||
"out float v;" | ||
"float h()" | ||
"{" | ||
"return v+.1;" | ||
"}" | ||
"float f()" | ||
"{" | ||
"return v+.2;" | ||
"}" | ||
"float h(int t)" | ||
"{" | ||
"return v+.3;" | ||
"}" | ||
"float f(float t)" | ||
"{" | ||
"return v+.4;" | ||
"}" | ||
"float f(bool t)" | ||
"{" | ||
"return v+.5;" | ||
"}" | ||
"float f(int t,int f)" | ||
"{" | ||
"return v+.6;" | ||
"}" | ||
"float f(int t,int f,int x,int h)" | ||
"{" | ||
"return v+.7;" | ||
"}" | ||
"float f(sampler2D t,float v)" | ||
"{" | ||
"return texelFetch(t,ivec2(255.*v)%256,0).x;" | ||
"}" | ||
"float f(sampler2D t,vec2 v)" | ||
"{" | ||
"return texelFetch(t,ivec2(255.*v)%256,0).x;" | ||
"}" | ||
"float f(sampler2D t,vec3 v)" | ||
"{" | ||
"float f=texelFetch(t,ivec2(255.*v.yz)%256,0).x;" | ||
"return texelFetch(t,ivec2(255.*v.x,255.*f)%256,0).x;" | ||
"}" | ||
"void main()" | ||
"{" | ||
"float v=0.,r=f(true)+f(0,1)-f(0,1,2,3),C=f(x,i*t);" | ||
"gl_FragColor=vec4(h()+2.*h(0),2.*f(1.2)-f(),r,C+v++);" | ||
"}"; | ||
|
||
#endif // OVERLOAD_EXPECTED_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#version 330 | ||
uniform sampler2D _V; | ||
uniform vec2 a_; | ||
in vec2 ZH; | ||
out float stopinlining; | ||
|
||
float f1() { return stopinlining+0.1; } | ||
float f2(void) { return stopinlining+0.2; } | ||
float f1(int x) { return stopinlining+0.3; } | ||
float f2(float y) { return stopinlining+0.4; } | ||
float f3(bool b) { return stopinlining+0.5; } | ||
float f3(int a, int b) { return stopinlining+0.6; } | ||
float f3(int a, int b, int c, int d) { return stopinlining+0.7; } | ||
|
||
float hashTex(sampler2D _V, float p) | ||
{ | ||
return texelFetch(_V, ivec2(255. * p) % 256, 0).r; | ||
} | ||
float hashTex(sampler2D _V, vec2 p) | ||
{ | ||
return texelFetch(_V, ivec2(255. * p) % 256, 0).r; | ||
} | ||
float hashTex(sampler2D _V, vec3 p) | ||
{ | ||
float h = texelFetch(_V, ivec2(255. * p.yz) % 256, 0).r; | ||
return texelFetch(_V, ivec2(255. * p.x, 255. * h) % 256, 0).r; | ||
} | ||
|
||
void main() | ||
{ | ||
float stopinlining = 0.; | ||
float a = f1() + 2. * f1(0); | ||
float b = 2. * f2(1.2) - f2(); | ||
float c = f3(true) + f3(0, 1) - f3(0, 1, 2, 3); | ||
float d = hashTex(_V, a_ * ZH); | ||
gl_FragColor=vec4(a,b,c,d+stopinlining++); | ||
} |
This file was deleted.
Oops, something went wrong.