Commit bed4e4f7 by John Kessenich Committed by GregF

HLSL: Pass opaques by local copy, instead of by interface original.

Also, remove assumption that if something is opaque that it must be in the UniformConstant storage class. This allows function declarations to know all parameters will be in the Function storage class.
parent 15fa7ef5
......@@ -771,33 +771,41 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
{
if (type.getQualifier().isPipeInput())
return spv::StorageClassInput;
else if (type.getQualifier().isPipeOutput())
if (type.getQualifier().isPipeOutput())
return spv::StorageClassOutput;
else if (type.getBasicType() == glslang::EbtAtomicUint)
return spv::StorageClassAtomicCounter;
else if (type.containsOpaque())
return spv::StorageClassUniformConstant;
else if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) {
if (glslangIntermediate->getSource() != glslang::EShSourceHlsl ||
type.getQualifier().storage == glslang::EvqUniform) {
if (type.getBasicType() == glslang::EbtAtomicUint)
return spv::StorageClassAtomicCounter;
if (type.containsOpaque())
return spv::StorageClassUniformConstant;
}
if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) {
builder.addExtension(spv::E_SPV_KHR_storage_buffer_storage_class);
return spv::StorageClassStorageBuffer;
} else if (type.getQualifier().isUniformOrBuffer()) {
}
if (type.getQualifier().isUniformOrBuffer()) {
if (type.getQualifier().layoutPushConstant)
return spv::StorageClassPushConstant;
if (type.getBasicType() == glslang::EbtBlock)
return spv::StorageClassUniform;
else
return spv::StorageClassUniformConstant;
} else {
switch (type.getQualifier().storage) {
case glslang::EvqShared: return spv::StorageClassWorkgroup; break;
case glslang::EvqGlobal: return spv::StorageClassPrivate;
case glslang::EvqConstReadOnly: return spv::StorageClassFunction;
case glslang::EvqTemporary: return spv::StorageClassFunction;
default:
assert(0);
return spv::StorageClassFunction;
}
return spv::StorageClassUniformConstant;
}
switch (type.getQualifier().storage) {
case glslang::EvqShared: return spv::StorageClassWorkgroup;
case glslang::EvqGlobal: return spv::StorageClassPrivate;
case glslang::EvqConstReadOnly: return spv::StorageClassFunction;
case glslang::EvqTemporary: return spv::StorageClassFunction;
default:
assert(0);
break;
}
return spv::StorageClassFunction;
}
// Return whether or not the given type is something that should be tied to a
......@@ -2997,15 +3005,21 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
bool implicitThis = (int)parameters.size() > 0 && parameters[0]->getAsSymbolNode()->getName() ==
glslangIntermediate->implicitThisName;
const auto canPassOriginal = [&](const glslang::TType& paramType, bool firstParam) -> bool {
if (glslangIntermediate->getSource() == glslang::EShSourceHlsl)
return firstParam && implicitThis;
else
return paramType.containsOpaque() || // sampler, etc.
(paramType.getBasicType() == glslang::EbtBlock &&
paramType.getQualifier().storage == glslang::EvqBuffer) || // SSBO
(firstParam && implicitThis); // implicit 'this'
};
paramDecorations.resize(parameters.size());
for (int p = 0; p < (int)parameters.size(); ++p) {
const glslang::TType& paramType = parameters[p]->getAsTyped()->getType();
spv::Id typeId = convertGlslangToSpvType(paramType);
// can we pass by reference?
if (paramType.containsOpaque() || // sampler, etc.
(paramType.getBasicType() == glslang::EbtBlock &&
paramType.getQualifier().storage == glslang::EvqBuffer) || // SSBO
(p == 0 && implicitThis)) // implicit 'this'
if (canPassOriginal(paramType, p == 0))
typeId = builder.makePointer(TranslateStorageClass(paramType), typeId);
else if (paramType.getQualifier().storage != glslang::EvqConstReadOnly)
typeId = builder.makePointer(spv::StorageClassFunction, typeId);
......@@ -3567,8 +3581,10 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
const glslang::TIntermSequence& glslangArgs = node->getSequence();
const glslang::TQualifierList& qualifiers = node->getQualifierList();
// Encapsulate lvalue logic, used in several places below, for safety.
const auto isLValue = [](int qualifier, const glslang::TType& paramType) -> bool {
// Encapsulate lvalue logic, used in multiple places below, for safety.
const auto isLValue = [&](int qualifier, const glslang::TType& paramType) -> bool {
if (glslangIntermediate->getSource() == glslang::EShSourceHlsl)
return qualifier != glslang::EvqConstReadOnly;
return qualifier != glslang::EvqConstReadOnly || paramType.containsOpaque();
};
......@@ -3610,9 +3626,10 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
for (int a = 0; a < (int)glslangArgs.size(); ++a) {
const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType();
spv::Id arg;
if (paramType.containsOpaque() ||
(paramType.getBasicType() == glslang::EbtBlock && qualifiers[a] == glslang::EvqBuffer) ||
(a == 0 && function->hasImplicitThis())) {
if ((a == 0 && function->hasImplicitThis()) ||
(glslangIntermediate->getSource() != glslang::EShSourceHlsl &&
(paramType.containsOpaque() ||
(paramType.getBasicType() == glslang::EbtBlock && qualifiers[a] == glslang::EvqBuffer)))) {
builder.setAccessChain(lValues[lValueCount]);
arg = builder.accessChainGetLValue();
++lValueCount;
......
......@@ -110,12 +110,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 53
// Id's are bound by 59
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 51
EntryPoint Fragment 4 "main" 57
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
......@@ -125,25 +125,27 @@ gl_FragCoord origin is upper left
Name 16 "s.tex"
Name 20 "@main("
Name 35 "os.ss"
Name 36 "gss2"
Name 38 "gss"
Name 40 "os.tex"
Name 41 "gtex"
Name 43 "os.a"
Name 45 "param"
Name 51 "@entryPointOutput"
Decorate 36(gss2) DescriptorSet 0
Decorate 38(gss) DescriptorSet 0
Decorate 41(gtex) DescriptorSet 0
Decorate 51(@entryPointOutput) Location 0
Name 37 "gss2"
Name 39 "gss"
Name 41 "os.tex"
Name 43 "gtex"
Name 45 "os.a"
Name 47 "param"
Name 49 "param"
Name 51 "param"
Name 57 "@entryPointOutput"
Decorate 37(gss2) DescriptorSet 0
Decorate 39(gss) DescriptorSet 0
Decorate 43(gtex) DescriptorSet 0
Decorate 57(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer UniformConstant 6
7: TypePointer Function 6
8: TypeFloat 32
9: TypePointer Function 8(float)
10: TypeImage 8(float) 2D sampled format:Unknown
11: TypePointer UniformConstant 10
11: TypePointer Function 10
12: TypeVector 8(float) 4
13: TypeFunction 12(fvec4) 7(ptr) 9(ptr) 11(ptr)
19: TypeFunction 12(fvec4)
......@@ -152,18 +154,18 @@ gl_FragCoord origin is upper left
28: 8(float) Constant 1045220557
29: 8(float) Constant 1050253722
30: 27(fvec2) ConstantComposite 28 29
35(os.ss): 7(ptr) Variable UniformConstant
36(gss2): 7(ptr) Variable UniformConstant
38(gss): 7(ptr) Variable UniformConstant
40(os.tex): 11(ptr) Variable UniformConstant
41(gtex): 11(ptr) Variable UniformConstant
44: 8(float) Constant 1077936128
50: TypePointer Output 12(fvec4)
51(@entryPointOutput): 50(ptr) Variable Output
36: TypePointer UniformConstant 6
37(gss2): 36(ptr) Variable UniformConstant
39(gss): 36(ptr) Variable UniformConstant
42: TypePointer UniformConstant 10
43(gtex): 42(ptr) Variable UniformConstant
46: 8(float) Constant 1077936128
56: TypePointer Output 12(fvec4)
57(@entryPointOutput): 56(ptr) Variable Output
4(main): 2 Function None 3
5: Label
52: 12(fvec4) FunctionCall 20(@main()
Store 51(@entryPointOutput) 52
58: 12(fvec4) FunctionCall 20(@main()
Store 57(@entryPointOutput) 58
Return
FunctionEnd
17(osCall(struct-OS-p1-f1-t211;): 12(fvec4) Function None 13
......@@ -181,17 +183,25 @@ gl_FragCoord origin is upper left
FunctionEnd
20(@main(): 12(fvec4) Function None 19
21: Label
43(os.a): 9(ptr) Variable Function
45(param): 9(ptr) Variable Function
37: 6 Load 36(gss2)
Store 35(os.ss) 37
39: 6 Load 38(gss)
Store 35(os.ss) 39
42: 10 Load 41(gtex)
Store 40(os.tex) 42
Store 43(os.a) 44
46: 8(float) Load 43(os.a)
Store 45(param) 46
47: 12(fvec4) FunctionCall 17(osCall(struct-OS-p1-f1-t211;) 35(os.ss) 45(param) 40(os.tex)
ReturnValue 47
35(os.ss): 7(ptr) Variable Function
41(os.tex): 11(ptr) Variable Function
45(os.a): 9(ptr) Variable Function
47(param): 7(ptr) Variable Function
49(param): 9(ptr) Variable Function
51(param): 11(ptr) Variable Function
38: 6 Load 37(gss2)
Store 35(os.ss) 38
40: 6 Load 39(gss)
Store 35(os.ss) 40
44: 10 Load 43(gtex)
Store 41(os.tex) 44
Store 45(os.a) 46
48: 6 Load 35(os.ss)
Store 47(param) 48
50: 8(float) Load 45(os.a)
Store 49(param) 50
52: 10 Load 41(os.tex)
Store 51(param) 52
53: 12(fvec4) FunctionCall 17(osCall(struct-OS-p1-f1-t211;) 47(param) 49(param) 51(param)
ReturnValue 53
FunctionEnd
......@@ -166,12 +166,12 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 74
// Id's are bound by 80
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 72
EntryPoint Vertex 4 "main" 78
Source HLSL 500
Name 4 "main"
Name 15 "lookUp(struct-FxaaTex-p1-t211;"
......@@ -183,27 +183,29 @@ Shader version: 500
Name 19 "fillOpaque("
Name 22 "@main("
Name 36 "t.smpl"
Name 37 "g_tInputTexture_sampler"
Name 39 "t.tex"
Name 40 "g_tInputTexture"
Name 43 "t"
Name 47 "flattenTemp"
Name 51 "tex1.smpl"
Name 56 "tex1.tex"
Name 60 "flattenTemp"
Name 62 "tex2.smpl"
Name 65 "tex2.tex"
Name 72 "@entryPointOutput"
Decorate 37(g_tInputTexture_sampler) DescriptorSet 0
Decorate 40(g_tInputTexture) DescriptorSet 0
Decorate 72(@entryPointOutput) Location 0
Name 38 "g_tInputTexture_sampler"
Name 40 "t.tex"
Name 42 "g_tInputTexture"
Name 45 "t"
Name 49 "flattenTemp"
Name 53 "tex1.smpl"
Name 58 "tex1.tex"
Name 62 "flattenTemp"
Name 64 "tex2.smpl"
Name 67 "tex2.tex"
Name 70 "param"
Name 72 "param"
Name 78 "@entryPointOutput"
Decorate 38(g_tInputTexture_sampler) DescriptorSet 0
Decorate 42(g_tInputTexture) DescriptorSet 0
Decorate 78(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer UniformConstant 6
7: TypePointer Function 6
8: TypeFloat 32
9: TypeImage 8(float) 2D sampled format:Unknown
10: TypePointer UniformConstant 9
10: TypePointer Function 9
11: TypeVector 8(float) 4
12: TypeFunction 11(fvec4) 7(ptr) 10(ptr)
17(FxaaTex): TypeStruct 6 9
......@@ -215,27 +217,20 @@ Shader version: 500
30: 8(float) Constant 1053609165
31: 28(fvec2) ConstantComposite 29 30
32: 8(float) Constant 0
36(t.smpl): 7(ptr) Variable UniformConstant
37(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant
39(t.tex): 10(ptr) Variable UniformConstant
40(g_tInputTexture): 10(ptr) Variable UniformConstant
42: TypePointer UniformConstant 17(FxaaTex)
43(t): 42(ptr) Variable UniformConstant
47(flattenTemp): 42(ptr) Variable UniformConstant
51(tex1.smpl): 7(ptr) Variable UniformConstant
52: TypeInt 32 1
53: 52(int) Constant 0
56(tex1.tex): 10(ptr) Variable UniformConstant
57: 52(int) Constant 1
60(flattenTemp): 42(ptr) Variable UniformConstant
62(tex2.smpl): 7(ptr) Variable UniformConstant
65(tex2.tex): 10(ptr) Variable UniformConstant
71: TypePointer Output 11(fvec4)
72(@entryPointOutput): 71(ptr) Variable Output
37: TypePointer UniformConstant 6
38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant
41: TypePointer UniformConstant 9
42(g_tInputTexture): 41(ptr) Variable UniformConstant
44: TypePointer Function 17(FxaaTex)
54: TypeInt 32 1
55: 54(int) Constant 0
59: 54(int) Constant 1
77: TypePointer Output 11(fvec4)
78(@entryPointOutput): 77(ptr) Variable Output
4(main): 2 Function None 3
5: Label
73: 11(fvec4) FunctionCall 22(@main()
Store 72(@entryPointOutput) 73
79: 11(fvec4) FunctionCall 22(@main()
Store 78(@entryPointOutput) 79
Return
FunctionEnd
15(lookUp(struct-FxaaTex-p1-t211;): 11(fvec4) Function None 12
......@@ -250,33 +245,48 @@ Shader version: 500
FunctionEnd
19(fillOpaque(): 17(FxaaTex) Function None 18
20: Label
38: 6 Load 37(g_tInputTexture_sampler)
Store 36(t.smpl) 38
41: 9 Load 40(g_tInputTexture)
Store 39(t.tex) 41
44: 17(FxaaTex) Load 43(t)
ReturnValue 44
36(t.smpl): 7(ptr) Variable Function
40(t.tex): 10(ptr) Variable Function
45(t): 44(ptr) Variable Function
39: 6 Load 38(g_tInputTexture_sampler)
Store 36(t.smpl) 39
43: 9 Load 42(g_tInputTexture)
Store 40(t.tex) 43
46: 17(FxaaTex) Load 45(t)
ReturnValue 46
FunctionEnd
22(@main(): 11(fvec4) Function None 21
23: Label
48: 6 Load 37(g_tInputTexture_sampler)
49: 9 Load 40(g_tInputTexture)
50: 17(FxaaTex) CompositeConstruct 48 49
Store 47(flattenTemp) 50
54: 7(ptr) AccessChain 47(flattenTemp) 53
55: 6 Load 54
Store 51(tex1.smpl) 55
58: 10(ptr) AccessChain 47(flattenTemp) 57
59: 9 Load 58
Store 56(tex1.tex) 59
61: 17(FxaaTex) FunctionCall 19(fillOpaque()
Store 60(flattenTemp) 61
63: 7(ptr) AccessChain 60(flattenTemp) 53
64: 6 Load 63
Store 62(tex2.smpl) 64
66: 10(ptr) AccessChain 60(flattenTemp) 57
67: 9 Load 66
Store 65(tex2.tex) 67
68: 11(fvec4) FunctionCall 15(lookUp(struct-FxaaTex-p1-t211;) 51(tex1.smpl) 56(tex1.tex)
ReturnValue 68
49(flattenTemp): 44(ptr) Variable Function
53(tex1.smpl): 7(ptr) Variable Function
58(tex1.tex): 10(ptr) Variable Function
62(flattenTemp): 44(ptr) Variable Function
64(tex2.smpl): 7(ptr) Variable Function
67(tex2.tex): 10(ptr) Variable Function
70(param): 7(ptr) Variable Function
72(param): 10(ptr) Variable Function
50: 6 Load 38(g_tInputTexture_sampler)
51: 9 Load 42(g_tInputTexture)
52: 17(FxaaTex) CompositeConstruct 50 51
Store 49(flattenTemp) 52
56: 7(ptr) AccessChain 49(flattenTemp) 55
57: 6 Load 56
Store 53(tex1.smpl) 57
60: 10(ptr) AccessChain 49(flattenTemp) 59
61: 9 Load 60
Store 58(tex1.tex) 61
63: 17(FxaaTex) FunctionCall 19(fillOpaque()
Store 62(flattenTemp) 63
65: 7(ptr) AccessChain 62(flattenTemp) 55
66: 6 Load 65
Store 64(tex2.smpl) 66
68: 10(ptr) AccessChain 62(flattenTemp) 59
69: 9 Load 68
Store 67(tex2.tex) 69
71: 6 Load 53(tex1.smpl)
Store 70(param) 71
73: 9 Load 58(tex1.tex)
Store 72(param) 73
74: 11(fvec4) FunctionCall 15(lookUp(struct-FxaaTex-p1-t211;) 70(param) 72(param)
ReturnValue 74
FunctionEnd
......@@ -130,12 +130,12 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 65
// Id's are bound by 70
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 63
EntryPoint Vertex 4 "main" 68
Source HLSL 500
Name 4 "main"
Name 17 "lookUp(struct-FxaaTex-p1-t21-f11;"
......@@ -148,23 +148,25 @@ Shader version: 500
MemberName 34(FxaaTex) 1 "tex"
MemberName 34(FxaaTex) 2 "f"
Name 36 "flattenTemp"
Name 37 "g_tInputTexture_sampler"
Name 39 "g_tInputTexture"
Name 43 "tex.smpl"
Name 48 "tex.tex"
Name 52 "tex.f"
Name 57 "param"
Name 63 "@entryPointOutput"
Decorate 37(g_tInputTexture_sampler) DescriptorSet 0
Decorate 39(g_tInputTexture) DescriptorSet 0
Decorate 63(@entryPointOutput) Location 0
Name 38 "g_tInputTexture_sampler"
Name 41 "g_tInputTexture"
Name 45 "tex.smpl"
Name 50 "tex.tex"
Name 54 "tex.f"
Name 58 "param"
Name 60 "param"
Name 62 "param"
Name 68 "@entryPointOutput"
Decorate 38(g_tInputTexture_sampler) DescriptorSet 0
Decorate 41(g_tInputTexture) DescriptorSet 0
Decorate 68(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer UniformConstant 6
7: TypePointer Function 6
8: TypeFloat 32
9: TypeImage 8(float) 2D sampled format:Unknown
10: TypePointer UniformConstant 9
10: TypePointer Function 9
11: TypePointer Function 8(float)
12: TypeVector 8(float) 4
13: TypeFunction 12(fvec4) 7(ptr) 10(ptr) 11(ptr)
......@@ -173,24 +175,22 @@ Shader version: 500
28: TypeVector 8(float) 2
30: 8(float) Constant 0
34(FxaaTex): TypeStruct 6 9 8(float)
35: TypePointer UniformConstant 34(FxaaTex)
36(flattenTemp): 35(ptr) Variable UniformConstant
37(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant
39(g_tInputTexture): 10(ptr) Variable UniformConstant
41: 8(float) Constant 1056964608
43(tex.smpl): 7(ptr) Variable UniformConstant
44: TypeInt 32 1
45: 44(int) Constant 0
48(tex.tex): 10(ptr) Variable UniformConstant
49: 44(int) Constant 1
53: 44(int) Constant 2
54: TypePointer UniformConstant 8(float)
62: TypePointer Output 12(fvec4)
63(@entryPointOutput): 62(ptr) Variable Output
35: TypePointer Function 34(FxaaTex)
37: TypePointer UniformConstant 6
38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant
40: TypePointer UniformConstant 9
41(g_tInputTexture): 40(ptr) Variable UniformConstant
43: 8(float) Constant 1056964608
46: TypeInt 32 1
47: 46(int) Constant 0
51: 46(int) Constant 1
55: 46(int) Constant 2
67: TypePointer Output 12(fvec4)
68(@entryPointOutput): 67(ptr) Variable Output
4(main): 2 Function None 3
5: Label
64: 12(fvec4) FunctionCall 20(@main()
Store 63(@entryPointOutput) 64
69: 12(fvec4) FunctionCall 20(@main()
Store 68(@entryPointOutput) 69
Return
FunctionEnd
17(lookUp(struct-FxaaTex-p1-t21-f11;): 12(fvec4) Function None 13
......@@ -209,23 +209,32 @@ Shader version: 500
FunctionEnd
20(@main(): 12(fvec4) Function None 19
21: Label
52(tex.f): 11(ptr) Variable Function
57(param): 11(ptr) Variable Function
38: 6 Load 37(g_tInputTexture_sampler)
40: 9 Load 39(g_tInputTexture)
42: 34(FxaaTex) CompositeConstruct 38 40 41
Store 36(flattenTemp) 42
46: 7(ptr) AccessChain 36(flattenTemp) 45
47: 6 Load 46
Store 43(tex.smpl) 47
50: 10(ptr) AccessChain 36(flattenTemp) 49
51: 9 Load 50
Store 48(tex.tex) 51
55: 54(ptr) AccessChain 36(flattenTemp) 53
56: 8(float) Load 55
Store 52(tex.f) 56
58: 8(float) Load 52(tex.f)
Store 57(param) 58
59: 12(fvec4) FunctionCall 17(lookUp(struct-FxaaTex-p1-t21-f11;) 43(tex.smpl) 48(tex.tex) 57(param)
ReturnValue 59
36(flattenTemp): 35(ptr) Variable Function
45(tex.smpl): 7(ptr) Variable Function
50(tex.tex): 10(ptr) Variable Function
54(tex.f): 11(ptr) Variable Function
58(param): 7(ptr) Variable Function
60(param): 10(ptr) Variable Function
62(param): 11(ptr) Variable Function
39: 6 Load 38(g_tInputTexture_sampler)
42: 9 Load 41(g_tInputTexture)
44: 34(FxaaTex) CompositeConstruct 39 42 43
Store 36(flattenTemp) 44
48: 7(ptr) AccessChain 36(flattenTemp) 47
49: 6 Load 48
Store 45(tex.smpl) 49
52: 10(ptr) AccessChain 36(flattenTemp) 51
53: 9 Load 52
Store 50(tex.tex) 53
56: 11(ptr) AccessChain 36(flattenTemp) 55
57: 8(float) Load 56
Store 54(tex.f) 57
59: 6 Load 45(tex.smpl)
Store 58(param) 59
61: 9 Load 50(tex.tex)
Store 60(param) 61
63: 8(float) Load 54(tex.f)
Store 62(param) 63
64: 12(fvec4) FunctionCall 17(lookUp(struct-FxaaTex-p1-t21-f11;) 58(param) 60(param) 62(param)
ReturnValue 64
FunctionEnd
......@@ -59,7 +59,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 26
// Id's are bound by 27
Capability Shader
1: ExtInstImport "GLSL.std.450"
......@@ -68,44 +68,45 @@ gl_FragCoord origin is upper left
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 14 "TexFunc(t21;vf3;"
Name 12 "t2D"
Name 13 "RGB"
Name 16 "@main("
Name 13 "TexFunc(t21;vf3;"
Name 11 "t2D"
Name 12 "RGB"
Name 15 "@main("
Name 20 "MyTexture"
Name 21 "final_RGB"
Name 22 "param"
Name 22 "final_RGB"
Name 23 "param"
Decorate 20(MyTexture) DescriptorSet 0
Decorate 20(MyTexture) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeImage 6(float) 2D sampled format:Unknown
8: TypePointer UniformConstant 7
9: TypeVector 6(float) 3
10: TypePointer Function 9(fvec3)
11: TypeFunction 2 8(ptr) 10(ptr)
18: 6(float) Constant 0
19: 9(fvec3) ConstantComposite 18 18 18
20(MyTexture): 8(ptr) Variable UniformConstant
8: TypeVector 6(float) 3
9: TypePointer Function 8(fvec3)
10: TypeFunction 2 7 9(ptr)
17: 6(float) Constant 0
18: 8(fvec3) ConstantComposite 17 17 17
19: TypePointer UniformConstant 7
20(MyTexture): 19(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
25: 2 FunctionCall 16(@main()
26: 2 FunctionCall 15(@main()
Return
FunctionEnd
14(TexFunc(t21;vf3;): 2 Function None 11
12(t2D): 8(ptr) FunctionParameter
13(RGB): 10(ptr) FunctionParameter
15: Label
Store 13(RGB) 19
13(TexFunc(t21;vf3;): 2 Function None 10
11(t2D): 7 FunctionParameter
12(RGB): 9(ptr) FunctionParameter
14: Label
Store 12(RGB) 18
Return
FunctionEnd
16(@main(): 2 Function None 3
17: Label
21(final_RGB): 10(ptr) Variable Function
22(param): 10(ptr) Variable Function
23: 2 FunctionCall 14(TexFunc(t21;vf3;) 20(MyTexture) 22(param)
24: 9(fvec3) Load 22(param)
Store 21(final_RGB) 24
15(@main(): 2 Function None 3
16: Label
22(final_RGB): 9(ptr) Variable Function
23(param): 9(ptr) Variable Function
21: 7 Load 20(MyTexture)
24: 2 FunctionCall 13(TexFunc(t21;vf3;) 21 23(param)
25: 8(fvec3) Load 23(param)
Store 22(final_RGB) 25
Return
FunctionEnd
......@@ -151,12 +151,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 70
// Id's are bound by 76
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 58 61
EntryPoint Fragment 4 "main" 64 67
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
......@@ -171,51 +171,55 @@ gl_FragCoord origin is upper left
Name 18 "arg_c@count"
Name 25 "@main(u1;"
Name 24 "pos"
Name 49 "sbuf_a"
Name 50 "sbuf_a@count"
Name 51 "sbuf_c"
Name 52 "sbuf_c@count"
Name 56 "pos"
Name 58 "pos"
Name 61 "@entryPointOutput"
Name 62 "param"
Name 65 "sbuf_a@count"
MemberName 65(sbuf_a@count) 0 "@count"
Name 67 "sbuf_a@count"
Name 68 "sbuf_c@count"
Name 69 "sbuf_unused"
Name 50 "sbuf_a"
Name 52 "sbuf_a@count"
Name 53 "sbuf_c"
Name 54 "sbuf_c@count"
Name 55 "param"
Name 56 "param"
Name 57 "param"
Name 58 "param"
Name 62 "pos"
Name 64 "pos"
Name 67 "@entryPointOutput"
Name 68 "param"
Name 71 "sbuf_a@count"
MemberName 71(sbuf_a@count) 0 "@count"
Name 73 "sbuf_a@count"
Name 74 "sbuf_c@count"
Name 75 "sbuf_unused"
Decorate 8 ArrayStride 16
MemberDecorate 9 0 Offset 0
Decorate 9 BufferBlock
Decorate 12 BufferBlock
Decorate 49(sbuf_a) DescriptorSet 0
Decorate 50(sbuf_a@count) DescriptorSet 0
Decorate 51(sbuf_c) DescriptorSet 0
Decorate 52(sbuf_c@count) DescriptorSet 0
Decorate 58(pos) Flat
Decorate 58(pos) Location 0
Decorate 61(@entryPointOutput) Location 0
MemberDecorate 65(sbuf_a@count) 0 Offset 0
Decorate 65(sbuf_a@count) BufferBlock
Decorate 67(sbuf_a@count) DescriptorSet 0
Decorate 68(sbuf_c@count) DescriptorSet 0
Decorate 69(sbuf_unused) DescriptorSet 0
Decorate 50(sbuf_a) DescriptorSet 0
Decorate 52(sbuf_a@count) DescriptorSet 0
Decorate 53(sbuf_c) DescriptorSet 0
Decorate 54(sbuf_c@count) DescriptorSet 0
Decorate 64(pos) Flat
Decorate 64(pos) Location 0
Decorate 67(@entryPointOutput) Location 0
MemberDecorate 71(sbuf_a@count) 0 Offset 0
Decorate 71(sbuf_a@count) BufferBlock
Decorate 73(sbuf_a@count) DescriptorSet 0
Decorate 74(sbuf_c@count) DescriptorSet 0
Decorate 75(sbuf_unused) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeRuntimeArray 7(fvec4)
9: TypeStruct 8
10: TypePointer Uniform 9(struct)
10: TypePointer Function 9(struct)
11: TypeInt 32 1
12: TypeStruct 11(int)
13: TypePointer Uniform 12(struct)
13: TypePointer Function 12(struct)
14: TypeFunction 7(fvec4) 10(ptr) 13(ptr) 10(ptr) 13(ptr)
21: TypeInt 32 0
22: TypePointer Function 21(int)
23: TypeFunction 7(fvec4) 22(ptr)
27: 11(int) Constant 0
28: TypePointer Uniform 11(int)
28: TypePointer Function 11(int)
30: 11(int) Constant 1
31: 21(int) Constant 1
32: 21(int) Constant 0
......@@ -224,31 +228,33 @@ gl_FragCoord origin is upper left
36: 6(float) Constant 1077936128
37: 6(float) Constant 1082130432
38: 7(fvec4) ConstantComposite 34 35 36 37
39: TypePointer Uniform 7(fvec4)
39: TypePointer Function 7(fvec4)
42: 11(int) Constant 4294967295
49(sbuf_a): 10(ptr) Variable Uniform
50(sbuf_a@count): 13(ptr) Variable Uniform
51(sbuf_c): 10(ptr) Variable Uniform
52(sbuf_c@count): 13(ptr) Variable Uniform
57: TypePointer Input 21(int)
58(pos): 57(ptr) Variable Input
60: TypePointer Output 7(fvec4)
61(@entryPointOutput): 60(ptr) Variable Output
65(sbuf_a@count): TypeStruct 11(int)
66: TypePointer Uniform 65(sbuf_a@count)
67(sbuf_a@count): 66(ptr) Variable Uniform
68(sbuf_c@count): 66(ptr) Variable Uniform
69(sbuf_unused): 10(ptr) Variable Uniform
49: TypePointer Uniform 9(struct)
50(sbuf_a): 49(ptr) Variable Uniform
51: TypePointer Uniform 12(struct)
52(sbuf_a@count): 51(ptr) Variable Uniform
53(sbuf_c): 49(ptr) Variable Uniform
54(sbuf_c@count): 51(ptr) Variable Uniform
63: TypePointer Input 21(int)
64(pos): 63(ptr) Variable Input
66: TypePointer Output 7(fvec4)
67(@entryPointOutput): 66(ptr) Variable Output
71(sbuf_a@count): TypeStruct 11(int)
72: TypePointer Uniform 71(sbuf_a@count)
73(sbuf_a@count): 72(ptr) Variable Uniform
74(sbuf_c@count): 72(ptr) Variable Uniform
75(sbuf_unused): 49(ptr) Variable Uniform
4(main): 2 Function None 3
5: Label
56(pos): 22(ptr) Variable Function
62(param): 22(ptr) Variable Function
59: 21(int) Load 58(pos)
Store 56(pos) 59
63: 21(int) Load 56(pos)
Store 62(param) 63
64: 7(fvec4) FunctionCall 25(@main(u1;) 62(param)
Store 61(@entryPointOutput) 64
62(pos): 22(ptr) Variable Function
68(param): 22(ptr) Variable Function
65: 21(int) Load 64(pos)
Store 62(pos) 65
69: 21(int) Load 62(pos)
Store 68(param) 69
70: 7(fvec4) FunctionCall 25(@main(u1;) 68(param)
Store 67(@entryPointOutput) 70
Return
FunctionEnd
19(Fn2(block--vf4[0]1;block--vf4[0]1;): 7(fvec4) Function None 14
......@@ -271,6 +277,10 @@ gl_FragCoord origin is upper left
25(@main(u1;): 7(fvec4) Function None 23
24(pos): 22(ptr) FunctionParameter
26: Label
53: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 49(sbuf_a) 50(sbuf_a@count) 51(sbuf_c) 52(sbuf_c@count)
ReturnValue 53
55(param): 10(ptr) Variable Function
56(param): 13(ptr) Variable Function
57(param): 10(ptr) Variable Function
58(param): 13(ptr) Variable Function
59: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 55(param) 56(param) 57(param) 58(param)
ReturnValue 59
FunctionEnd
......@@ -135,14 +135,14 @@ local_size = (256, 1, 1)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 61
// Id's are bound by 62
Capability Shader
Capability ImageBuffer
Capability StorageImageExtendedFormats
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 56
EntryPoint GLCompute 4 "main" 57
ExecutionMode 4 LocalSize 256 1 1
Source HLSL 500
Name 4 "main"
......@@ -155,13 +155,14 @@ local_size = (256, 1, 1)
Name 18 "dispatchId"
Name 22 "result"
Name 25 "byteAddrTemp"
Name 43 "result"
Name 42 "result"
Name 44 "g_input"
Name 45 "param"
Name 50 "g_output"
Name 54 "dispatchId"
Name 56 "dispatchId"
Name 58 "param"
Name 47 "param"
Name 51 "g_output"
Name 55 "dispatchId"
Name 57 "dispatchId"
Name 59 "param"
Decorate 8 ArrayStride 4
MemberDecorate 9 0 NonWritable
MemberDecorate 9 0 Offset 0
......@@ -169,16 +170,16 @@ local_size = (256, 1, 1)
Decorate 14(buffer) NonWritable
Decorate 44(g_input) DescriptorSet 0
Decorate 44(g_input) Binding 0
Decorate 50(g_output) DescriptorSet 0
Decorate 50(g_output) Binding 1
Decorate 56(dispatchId) BuiltIn GlobalInvocationId
Decorate 51(g_output) DescriptorSet 0
Decorate 51(g_output) Binding 1
Decorate 57(dispatchId) BuiltIn GlobalInvocationId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypePointer Function 6(int)
8: TypeRuntimeArray 6(int)
9: TypeStruct 8
10: TypePointer Uniform 9(struct)
10: TypePointer Function 9(struct)
11: TypeVector 6(int) 2
12: TypeFunction 11(ivec2) 7(ptr) 10(ptr)
17: TypeFunction 2 7(ptr)
......@@ -187,23 +188,23 @@ local_size = (256, 1, 1)
24: TypePointer Function 23(int)
27: 23(int) Constant 2
29: 23(int) Constant 0
31: TypePointer Uniform 6(int)
35: 23(int) Constant 1
44(g_input): 10(ptr) Variable Uniform
48: TypeImage 6(int) Buffer nonsampled format:Rg32ui
49: TypePointer UniformConstant 48
50(g_output): 49(ptr) Variable UniformConstant
55: TypePointer Input 6(int)
56(dispatchId): 55(ptr) Variable Input
34: 23(int) Constant 1
43: TypePointer Uniform 9(struct)
44(g_input): 43(ptr) Variable Uniform
49: TypeImage 6(int) Buffer nonsampled format:Rg32ui
50: TypePointer UniformConstant 49
51(g_output): 50(ptr) Variable UniformConstant
56: TypePointer Input 6(int)
57(dispatchId): 56(ptr) Variable Input
4(main): 2 Function None 3
5: Label
54(dispatchId): 7(ptr) Variable Function
58(param): 7(ptr) Variable Function
57: 6(int) Load 56(dispatchId)
Store 54(dispatchId) 57
59: 6(int) Load 54(dispatchId)
Store 58(param) 59
60: 2 FunctionCall 19(@main(u1;) 58(param)
55(dispatchId): 7(ptr) Variable Function
59(param): 7(ptr) Variable Function
58: 6(int) Load 57(dispatchId)
Store 55(dispatchId) 58
60: 6(int) Load 55(dispatchId)
Store 59(param) 60
61: 2 FunctionCall 19(@main(u1;) 59(param)
Return
FunctionEnd
15(testLoad(u1;block--u1[0]1;): 11(ivec2) Function None 12
......@@ -216,29 +217,30 @@ local_size = (256, 1, 1)
28: 23(int) ShiftRightLogical 26 27
Store 25(byteAddrTemp) 28
30: 23(int) Load 25(byteAddrTemp)
32: 31(ptr) AccessChain 14(buffer) 29 30
33: 6(int) Load 32
34: 23(int) Load 25(byteAddrTemp)
36: 23(int) IAdd 34 35
37: 31(ptr) AccessChain 14(buffer) 29 36
38: 6(int) Load 37
39: 11(ivec2) CompositeConstruct 33 38
Store 22(result) 39
40: 11(ivec2) Load 22(result)
ReturnValue 40
31: 7(ptr) AccessChain 14(buffer) 29 30
32: 6(int) Load 31
33: 23(int) Load 25(byteAddrTemp)
35: 23(int) IAdd 33 34
36: 7(ptr) AccessChain 14(buffer) 29 35
37: 6(int) Load 36
38: 11(ivec2) CompositeConstruct 32 37
Store 22(result) 38
39: 11(ivec2) Load 22(result)
ReturnValue 39
FunctionEnd
19(@main(u1;): 2 Function None 17
18(dispatchId): 7(ptr) FunctionParameter
20: Label
43(result): 21(ptr) Variable Function
42(result): 21(ptr) Variable Function
45(param): 7(ptr) Variable Function
47(param): 10(ptr) Variable Function
46: 6(int) Load 18(dispatchId)
Store 45(param) 46
47: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 44(g_input)
Store 43(result) 47
51: 48 Load 50(g_output)
52: 6(int) Load 18(dispatchId)
53: 11(ivec2) Load 43(result)
ImageWrite 51 52 53
48: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 47(param)
Store 42(result) 48
52: 49 Load 51(g_output)
53: 6(int) Load 18(dispatchId)
54: 11(ivec2) Load 42(result)
ImageWrite 52 53 54
Return
FunctionEnd
......@@ -135,12 +135,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 62
// Id's are bound by 73
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 60
EntryPoint Fragment 4 "main" 71
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
......@@ -153,44 +153,51 @@ gl_FragCoord origin is upper left
Name 28 "Func(I21;"
Name 27 "DummyTex"
Name 31 "@main("
Name 44 "tf1"
Name 46 "tf4"
Name 50 "twf1"
Name 54 "twf4"
Name 60 "@entryPointOutput"
Decorate 44(tf1) DescriptorSet 0
Decorate 46(tf4) DescriptorSet 0
Decorate 50(twf1) DescriptorSet 0
Decorate 54(twf4) DescriptorSet 0
Decorate 60(@entryPointOutput) Location 0
Name 45 "tf1"
Name 46 "param"
Name 49 "tf4"
Name 50 "param"
Name 56 "twf1"
Name 57 "param"
Name 63 "twf4"
Name 64 "param"
Name 71 "@entryPointOutput"
Decorate 45(tf1) DescriptorSet 0
Decorate 49(tf4) DescriptorSet 0
Decorate 56(twf1) DescriptorSet 0
Decorate 63(twf4) DescriptorSet 0
Decorate 71(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeImage 6(float) 2D sampled format:Unknown
8: TypePointer UniformConstant 7
8: TypePointer Function 7
9: TypeFunction 6(float) 8(ptr)
13: TypeVector 6(float) 4
14: TypeFunction 13(fvec4) 8(ptr)
18: TypeImage 6(float) 2D nonsampled format:R32f
19: TypePointer UniformConstant 18
19: TypePointer Function 18
20: TypeFunction 6(float) 19(ptr)
24: TypeImage 6(float) 2D nonsampled format:Rgba32f
25: TypePointer UniformConstant 24
25: TypePointer Function 24
26: TypeFunction 13(fvec4) 25(ptr)
30: TypeFunction 13(fvec4)
33: 6(float) Constant 1065353216
36: 6(float) Constant 0
37: 13(fvec4) ConstantComposite 36 36 36 36
44(tf1): 8(ptr) Variable UniformConstant
46(tf4): 8(ptr) Variable UniformConstant
50(twf1): 19(ptr) Variable UniformConstant
54(twf4): 25(ptr) Variable UniformConstant
59: TypePointer Output 13(fvec4)
60(@entryPointOutput): 59(ptr) Variable Output
44: TypePointer UniformConstant 7
45(tf1): 44(ptr) Variable UniformConstant
49(tf4): 44(ptr) Variable UniformConstant
55: TypePointer UniformConstant 18
56(twf1): 55(ptr) Variable UniformConstant
62: TypePointer UniformConstant 24
63(twf4): 62(ptr) Variable UniformConstant
70: TypePointer Output 13(fvec4)
71(@entryPointOutput): 70(ptr) Variable Output
4(main): 2 Function None 3
5: Label
61: 13(fvec4) FunctionCall 31(@main()
Store 60(@entryPointOutput) 61
72: 13(fvec4) FunctionCall 31(@main()
Store 71(@entryPointOutput) 72
Return
FunctionEnd
11(Func(t211;): 6(float) Function None 9
......@@ -215,14 +222,26 @@ gl_FragCoord origin is upper left
FunctionEnd
31(@main(): 13(fvec4) Function None 30
32: Label
45: 6(float) FunctionCall 11(Func(t211;) 44(tf1)
47: 13(fvec4) FunctionCall 16(Func(t21;) 46(tf4)
48: 13(fvec4) CompositeConstruct 45 45 45 45
49: 13(fvec4) FAdd 48 47
51: 6(float) FunctionCall 22(Func(I211;) 50(twf1)
52: 13(fvec4) CompositeConstruct 51 51 51 51
53: 13(fvec4) FAdd 49 52
55: 13(fvec4) FunctionCall 28(Func(I21;) 54(twf4)
56: 13(fvec4) FAdd 53 55
ReturnValue 56
46(param): 8(ptr) Variable Function
50(param): 8(ptr) Variable Function
57(param): 19(ptr) Variable Function
64(param): 25(ptr) Variable Function
47: 7 Load 45(tf1)
Store 46(param) 47
48: 6(float) FunctionCall 11(Func(t211;) 46(param)
51: 7 Load 49(tf4)
Store 50(param) 51
52: 13(fvec4) FunctionCall 16(Func(t21;) 50(param)
53: 13(fvec4) CompositeConstruct 48 48 48 48
54: 13(fvec4) FAdd 53 52
58: 18 Load 56(twf1)
Store 57(param) 58
59: 6(float) FunctionCall 22(Func(I211;) 57(param)
60: 13(fvec4) CompositeConstruct 59 59 59 59
61: 13(fvec4) FAdd 54 60
65: 24 Load 63(twf4)
Store 64(param) 65
66: 13(fvec4) FunctionCall 28(Func(I21;) 64(param)
67: 13(fvec4) FAdd 61 66
ReturnValue 67
FunctionEnd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment