Add --no-link option
Adds the --no-link option which outputs the compiled shader binaries without linking them. This is a first step towards allowing users to create SPIR-v binary, non-executable libraries. When using the --no-link option, all functions are decorated with the Export linkage attribute.
This commit is contained in:
parent
a4aceb57de
commit
4c57db1595
24 changed files with 1671 additions and 1454 deletions
36
Test/baseResults/spv.exportFunctions.comp.out
Normal file
36
Test/baseResults/spv.exportFunctions.comp.out
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
spv.exportFunctions.comp
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 8000b
|
||||
// Id's are bound by 22
|
||||
|
||||
Capability Shader
|
||||
Capability Linkage
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
Source GLSL 450
|
||||
Name 7 "add(f1;f1;"
|
||||
Name 5 "a"
|
||||
Name 6 "b"
|
||||
Name 11 "foo("
|
||||
Decorate 7(add(f1;f1;) Linkage Attributes 6579297 0
|
||||
Decorate 11(foo() Linkage Attributes 7303014 0
|
||||
2: TypeFloat 32
|
||||
3: TypePointer Function 2(float)
|
||||
4: TypeFunction 2(float) 3(ptr) 3(ptr)
|
||||
9: TypeInt 32 1
|
||||
10: TypeFunction 9(int)
|
||||
17: TypeVoid
|
||||
19: 9(int) Constant 0
|
||||
7(add(f1;f1;): 2(float) Function None 4
|
||||
5(a): 3(ptr) FunctionParameter
|
||||
6(b): 3(ptr) FunctionParameter
|
||||
8: Label
|
||||
13: 2(float) Load 5(a)
|
||||
14: 2(float) Load 6(b)
|
||||
15: 2(float) FAdd 13 14
|
||||
ReturnValue 15
|
||||
FunctionEnd
|
||||
11(foo(): 9(int) Function None 10
|
||||
12: Label
|
||||
ReturnValue 19
|
||||
FunctionEnd
|
||||
9
Test/spv.exportFunctions.comp
Normal file
9
Test/spv.exportFunctions.comp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#version 450
|
||||
|
||||
float add(float a, float b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
int foo() {
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue