-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cannot use switch on legacy ESSL, fallback to plain branches.
- Loading branch information
1 parent
bae76d7
commit 4d79d63
Showing
5 changed files
with
244 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#version 100 | ||
precision mediump float; | ||
precision highp int; | ||
|
||
varying highp float vIndexF; | ||
|
||
void main() | ||
{ | ||
int _13 = int(vIndexF); | ||
highp vec4 _65; | ||
highp vec4 _66; | ||
highp vec4 _68; | ||
for (int SPIRV_Cross_Dummy = 0; SPIRV_Cross_Dummy < 1; SPIRV_Cross_Dummy++) | ||
{ | ||
if (_13 == 2) | ||
{ | ||
_68 = vec4(0.0, 2.0, 3.0, 4.0); | ||
break; | ||
} | ||
else if ((_13 == 4) || (_13 == 5)) | ||
{ | ||
_68 = vec4(1.0, 2.0, 3.0, 4.0); | ||
break; | ||
} | ||
else if ((_13 == 8) || (_13 == 9)) | ||
{ | ||
_68 = vec4(40.0, 20.0, 30.0, 40.0); | ||
break; | ||
} | ||
else if (_13 == 10) | ||
{ | ||
_65 = vec4(10.0); | ||
highp vec4 _45 = _65 + vec4(1.0); | ||
_66 = _45; | ||
highp vec4 _48 = _66 + vec4(2.0); | ||
_68 = _48; | ||
break; | ||
} | ||
else if (_13 == 11) | ||
{ | ||
_65 = vec4(0.0); | ||
highp vec4 _45 = _65 + vec4(1.0); | ||
_66 = _45; | ||
highp vec4 _48 = _66 + vec4(2.0); | ||
_68 = _48; | ||
break; | ||
} | ||
else if (_13 == 12) | ||
{ | ||
_66 = vec4(0.0); | ||
highp vec4 _48 = _66 + vec4(2.0); | ||
_68 = _48; | ||
break; | ||
} | ||
else | ||
{ | ||
_68 = vec4(10.0, 20.0, 30.0, 40.0); | ||
break; | ||
} | ||
} | ||
highp vec4 _70; | ||
for (int SPIRV_Cross_Dummy = 0; SPIRV_Cross_Dummy < 1; SPIRV_Cross_Dummy++) | ||
{ | ||
if ((_13 == 10) || (_13 == 20)) | ||
{ | ||
_70 = vec4(40.0); | ||
break; | ||
} | ||
else | ||
{ | ||
_70 = vec4(20.0); | ||
break; | ||
} | ||
} | ||
gl_FragData[0] = _68 + _70; | ||
} | ||
|
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,78 @@ | ||
#version 100 | ||
precision mediump float; | ||
precision highp int; | ||
|
||
varying highp float vIndexF; | ||
|
||
void main() | ||
{ | ||
int vIndex = int(vIndexF); | ||
highp vec4 v = vec4(0.0); | ||
for (int SPIRV_Cross_Dummy = 0; SPIRV_Cross_Dummy < 1; SPIRV_Cross_Dummy++) | ||
{ | ||
if (vIndex == 2) | ||
{ | ||
v = vec4(0.0, 2.0, 3.0, 4.0); | ||
break; | ||
} | ||
else if ((vIndex == 4) || (vIndex == 5)) | ||
{ | ||
v = vec4(1.0, 2.0, 3.0, 4.0); | ||
break; | ||
} | ||
else if ((vIndex == 8) || (vIndex == 9)) | ||
{ | ||
v = vec4(40.0, 20.0, 30.0, 40.0); | ||
break; | ||
} | ||
else if (vIndex == 10) | ||
{ | ||
v = vec4(10.0); | ||
highp vec4 _43 = v; | ||
highp vec4 _44 = vec4(1.0); | ||
highp vec4 _45 = _43 + _44; | ||
v = _45; | ||
highp vec4 _46 = v; | ||
highp vec4 _47 = vec4(2.0); | ||
highp vec4 _48 = _46 + _47; | ||
v = _48; | ||
break; | ||
} | ||
else if (vIndex == 11) | ||
{ | ||
highp vec4 _43 = v; | ||
highp vec4 _44 = vec4(1.0); | ||
highp vec4 _45 = _43 + _44; | ||
v = _45; | ||
highp vec4 _46 = v; | ||
highp vec4 _47 = vec4(2.0); | ||
highp vec4 _48 = _46 + _47; | ||
v = _48; | ||
break; | ||
} | ||
else if (vIndex == 12) | ||
{ | ||
highp vec4 _46 = v; | ||
highp vec4 _47 = vec4(2.0); | ||
highp vec4 _48 = _46 + _47; | ||
v = _48; | ||
break; | ||
} | ||
else | ||
{ | ||
v = vec4(10.0, 20.0, 30.0, 40.0); | ||
break; | ||
} | ||
} | ||
highp vec4 w = vec4(20.0); | ||
for (int SPIRV_Cross_Dummy = 0; SPIRV_Cross_Dummy < 1; SPIRV_Cross_Dummy++) | ||
{ | ||
if ((vIndex == 10) || (vIndex == 20)) | ||
{ | ||
w = vec4(40.0); | ||
break; | ||
} | ||
} | ||
gl_FragData[0] = v + w; | ||
} | ||
|
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,43 @@ | ||
#version 450 | ||
|
||
layout(location = 0) out vec4 FragColor; | ||
layout(location = 0) in float vIndexF; | ||
|
||
void main() | ||
{ | ||
int vIndex = int(vIndexF); | ||
vec4 v = vec4(0.0); | ||
switch (vIndex) | ||
{ | ||
case 2: | ||
v = vec4(0, 2, 3, 4); | ||
break; | ||
case 4: | ||
case 5: | ||
v = vec4(1, 2, 3, 4); | ||
break; | ||
case 8: | ||
case 9: | ||
v = vec4(40, 20, 30, 40); | ||
break; | ||
case 10: | ||
v = vec4(10.0); | ||
case 11: | ||
v += 1.0; | ||
case 12: | ||
v += 2.0; | ||
break; | ||
default: | ||
v = vec4(10, 20, 30, 40); | ||
break; | ||
} | ||
|
||
vec4 w = vec4(20.0); | ||
switch (vIndex) | ||
{ | ||
case 10: | ||
case 20: | ||
w = vec4(40.0); | ||
} | ||
FragColor = v + w; | ||
} |
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