-
Notifications
You must be signed in to change notification settings - Fork 830
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SPV: Partially address #2293: correct "const in" precision matching.
Track whether formal parameters declare reduced precision and match that with arguments, and if they differ, make a copy to promote the precision.
- Loading branch information
1 parent
fbb9dc2
commit 4df1033
Showing
6 changed files
with
94 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
spv.precisionArgs.frag | ||
// Module Version 10000 | ||
// Generated by (magic number): 8000a | ||
// Id's are bound by 27 | ||
|
||
Capability Shader | ||
1: ExtInstImport "GLSL.std.450" | ||
MemoryModel Logical GLSL450 | ||
EntryPoint Fragment 4 "main" | ||
ExecutionMode 4 OriginUpperLeft | ||
Source ESSL 310 | ||
Name 4 "main" | ||
Name 10 "fooConst(f1;f1;" | ||
Name 8 "f" | ||
Name 9 "g" | ||
Name 13 "aM" | ||
Name 15 "bM" | ||
Name 17 "arg" | ||
Name 20 "aH" | ||
Name 22 "bH" | ||
Name 24 "arg" | ||
Decorate 8(f) RelaxedPrecision | ||
Decorate 13(aM) RelaxedPrecision | ||
Decorate 14 RelaxedPrecision | ||
Decorate 15(bM) RelaxedPrecision | ||
Decorate 16 RelaxedPrecision | ||
Decorate 24(arg) RelaxedPrecision | ||
Decorate 25 RelaxedPrecision | ||
2: TypeVoid | ||
3: TypeFunction 2 | ||
6: TypeFloat 32 | ||
7: TypeFunction 2 6(float) 6(float) | ||
12: TypePointer Function 6(float) | ||
4(main): 2 Function None 3 | ||
5: Label | ||
13(aM): 12(ptr) Variable Function | ||
15(bM): 12(ptr) Variable Function | ||
17(arg): 12(ptr) Variable Function | ||
20(aH): 12(ptr) Variable Function | ||
22(bH): 12(ptr) Variable Function | ||
24(arg): 12(ptr) Variable Function | ||
14: 6(float) Load 13(aM) | ||
16: 6(float) Load 15(bM) | ||
Store 17(arg) 16 | ||
18: 6(float) Load 17(arg) | ||
19: 2 FunctionCall 10(fooConst(f1;f1;) 14 18 | ||
21: 6(float) Load 20(aH) | ||
23: 6(float) Load 22(bH) | ||
Store 24(arg) 21 | ||
25: 6(float) Load 24(arg) | ||
26: 2 FunctionCall 10(fooConst(f1;f1;) 25 23 | ||
Return | ||
FunctionEnd | ||
10(fooConst(f1;f1;): 2 Function None 7 | ||
8(f): 6(float) FunctionParameter | ||
9(g): 6(float) FunctionParameter | ||
11: Label | ||
Return | ||
FunctionEnd |
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,15 @@ | ||
#version 310 es | ||
|
||
precision mediump float; | ||
|
||
void fooConst(const in float f, const in highp float g) | ||
{ | ||
} | ||
|
||
void main() | ||
{ | ||
float aM, bM; | ||
highp float aH, bH; | ||
fooConst(aM, bM); // must copy bM | ||
fooConst(aH, bH); // must copy aH | ||
} |
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