Skip to content

Commit

Permalink
SPV: The result type of OpArrayLength should be UINT
Browse files Browse the repository at this point in the history
  • Loading branch information
amdrexu committed Mar 3, 2018
1 parent b5b5f91 commit e518772
Show file tree
Hide file tree
Showing 470 changed files with 590 additions and 589 deletions.
3 changes: 2 additions & 1 deletion SPIRV/GlslangToSpv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6134,7 +6134,8 @@ int GetSpirvGeneratorVersion()
// return 1; // start
// return 2; // EOpAtomicCounterDecrement gets a post decrement, to map between GLSL -> SPIR-V
// return 3; // change/correct barrier-instruction operands, to match memory model group decisions
return 4; // some deeper access chains: for dynamic vector component, and local Boolean component
// return 4; // some deeper access chains: for dynamic vector component, and local Boolean component
return 5; // make OpArrayLength result type be an int with signedness of 0
}

// Write SPIR-V out to a binary file
Expand Down
2 changes: 1 addition & 1 deletion SPIRV/SpvBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vec

Id Builder::createArrayLength(Id base, unsigned int member)
{
spv::Id intType = makeIntType(32);
spv::Id intType = makeUintType(32);
Instruction* length = new Instruction(getUniqueId(), intType, OpArrayLength);
length->addIdOperand(base);
length->addImmediateOperand(member);
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/glspv.version.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ glspv.version.frag
ERROR: #version: compilation for SPIR-V does not support the compatibility profile

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 6

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.PointSize.geom.out
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ output primitive = line_strip
0:? 'OutputStream.ps' ( out float PointSize)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 36

Capability Geometry
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.PointSize.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out float PointSize)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 16

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.aliasOpaque.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 64

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.amend.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ gl_FragCoord origin is upper left
0:? 'm' ( global 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 57

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.array.flatten.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ gl_FragCoord origin is upper left
0:? 'ps_output.color' (layout( location=0) out 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 143

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.array.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 126

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.array.implicit-size.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ gl_FragCoord origin is upper left
0:? 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f})

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 72

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.array.multidim.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 57

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.assoc.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ gl_FragCoord origin is upper left
0:? 'a5' (layout( location=4) in 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 58

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.attribute.expression.comp.out
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ local_size = (4, 6, 8)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 39

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.attribute.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 24

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.attributeC11.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=8) in 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 51

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.attributeGlobalBuffer.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 28

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.basic.comp.out
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ local_size = (1, 1, 1)
0:? 'gti' ( in int LocalInvocationID)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 35

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.basic.geom.out
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ output primitive = line_strip
0:? 'OutputStream.something' (layout( location=1) out int)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 68

Capability Geometry
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.boolConv.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 99

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.buffer.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ gl_FragCoord origin is upper left
0:? 'input' ( in 4-component vector of float FragCoord)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 73

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.calculatelod.dx10.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 148

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.cast.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 39

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.cbuffer-identifier.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Shader version: 500
0:? 'input.Norm' (layout( location=1) in 3-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 106

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.charLit.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 58

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clip.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 30

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-1.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 1-element array of float CullDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 53

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-1.geom.out
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ output primitive = line_strip
0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 118

Capability Geometry
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-1.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Shader version: 500
0:? 'cull' ( out 1-element array of float CullDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 46

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-2.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 4-element array of float CullDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 84

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-2.geom.out
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ output primitive = line_strip
0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 128

Capability Geometry
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-2.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ Shader version: 500
0:? 'cull' ( out 4-element array of float CullDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 89

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-3.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 2-element array of float CullDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 53

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-3.geom.out
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ output primitive = line_strip
0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 127

Capability Geometry
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-3.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Shader version: 500
0:? 'cull' ( out 2-element array of float CullDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 51

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-4.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ gl_FragCoord origin is upper left
0:? 'v.ClipRect' ( in 4-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 57

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-4.geom.out
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ output primitive = line_strip
0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 130

Capability Geometry
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-4.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Shader version: 500
0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 72

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-5.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ gl_FragCoord origin is upper left
0:? 'v.ClipRect' ( in 4-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 62

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-5.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Shader version: 500
0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 73

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-6.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 8-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 79

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-6.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ Shader version: 500
0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 86

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-7.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 8-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 78

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-7.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ Shader version: 500
0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 81

Capability Shader
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/hlsl.clipdistance-8.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 4-element array of float ClipDistance)

// Module Version 10000
// Generated by (magic number): 80004
// Generated by (magic number): 80005
// Id's are bound by 65

Capability Shader
Expand Down
Loading

0 comments on commit e518772

Please sign in to comment.