mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Add generated code based on SPIR-V json grammar
* This includes both our own enums and per-opcode helper structs for decoding
This commit is contained in:
@@ -93,6 +93,9 @@ set(sources
|
||||
spirv_common.h
|
||||
spirv_editor.cpp
|
||||
spirv_editor.h
|
||||
spirv_gen.cpp
|
||||
spirv_gen.h
|
||||
spirv_op_helpers.h
|
||||
spirv_compile.cpp
|
||||
spirv_compile.h
|
||||
spirv_reflect.cpp
|
||||
|
||||
@@ -0,0 +1,642 @@
|
||||
{
|
||||
"copyright" : [
|
||||
"Copyright (c) 2014-2016 The Khronos Group Inc.",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||
"of this software and/or associated documentation files (the \"Materials\"),",
|
||||
"to deal in the Materials without restriction, including without limitation",
|
||||
"the rights to use, copy, modify, merge, publish, distribute, sublicense,",
|
||||
"and/or sell copies of the Materials, and to permit persons to whom the",
|
||||
"Materials are furnished to do so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in",
|
||||
"all copies or substantial portions of the Materials.",
|
||||
"",
|
||||
"MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS",
|
||||
"STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND",
|
||||
"HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ",
|
||||
"",
|
||||
"THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS",
|
||||
"OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
|
||||
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL",
|
||||
"THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
|
||||
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING",
|
||||
"FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS",
|
||||
"IN THE MATERIALS."
|
||||
],
|
||||
"version" : 100,
|
||||
"revision" : 2,
|
||||
"instructions" : [
|
||||
{
|
||||
"opname" : "Round",
|
||||
"opcode" : 1,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "RoundEven",
|
||||
"opcode" : 2,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Trunc",
|
||||
"opcode" : 3,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FAbs",
|
||||
"opcode" : 4,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "SAbs",
|
||||
"opcode" : 5,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FSign",
|
||||
"opcode" : 6,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "SSign",
|
||||
"opcode" : 7,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Floor",
|
||||
"opcode" : 8,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Ceil",
|
||||
"opcode" : 9,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Fract",
|
||||
"opcode" : 10,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Radians",
|
||||
"opcode" : 11,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'degrees'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Degrees",
|
||||
"opcode" : 12,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'radians'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Sin",
|
||||
"opcode" : 13,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Cos",
|
||||
"opcode" : 14,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Tan",
|
||||
"opcode" : 15,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Asin",
|
||||
"opcode" : 16,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Acos",
|
||||
"opcode" : 17,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Atan",
|
||||
"opcode" : 18,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'y_over_x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Sinh",
|
||||
"opcode" : 19,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Cosh",
|
||||
"opcode" : 20,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Tanh",
|
||||
"opcode" : 21,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Asinh",
|
||||
"opcode" : 22,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Acosh",
|
||||
"opcode" : 23,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Atanh",
|
||||
"opcode" : 24,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Atan2",
|
||||
"opcode" : 25,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'y'" },
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Pow",
|
||||
"opcode" : 26,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Exp",
|
||||
"opcode" : 27,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Log",
|
||||
"opcode" : 28,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Exp2",
|
||||
"opcode" : 29,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Log2",
|
||||
"opcode" : 30,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Sqrt",
|
||||
"opcode" : 31,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "InverseSqrt",
|
||||
"opcode" : 32,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Determinant",
|
||||
"opcode" : 33,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "MatrixInverse",
|
||||
"opcode" : 34,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Modf",
|
||||
"opcode" : 35,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'i'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "ModfStruct",
|
||||
"opcode" : 36,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FMin",
|
||||
"opcode" : 37,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "UMin",
|
||||
"opcode" : 38,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "SMin",
|
||||
"opcode" : 39,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FMax",
|
||||
"opcode" : 40,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "UMax",
|
||||
"opcode" : 41,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "SMax",
|
||||
"opcode" : 42,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FClamp",
|
||||
"opcode" : 43,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'minVal'" },
|
||||
{ "kind" : "IdRef", "name" : "'maxVal'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "UClamp",
|
||||
"opcode" : 44,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'minVal'" },
|
||||
{ "kind" : "IdRef", "name" : "'maxVal'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "SClamp",
|
||||
"opcode" : 45,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'minVal'" },
|
||||
{ "kind" : "IdRef", "name" : "'maxVal'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FMix",
|
||||
"opcode" : 46,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" },
|
||||
{ "kind" : "IdRef", "name" : "'a'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "IMix",
|
||||
"opcode" : 47,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" },
|
||||
{ "kind" : "IdRef", "name" : "'a'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Step",
|
||||
"opcode" : 48,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'edge'" },
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "SmoothStep",
|
||||
"opcode" : 49,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'edge0'" },
|
||||
{ "kind" : "IdRef", "name" : "'edge1'" },
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Fma",
|
||||
"opcode" : 50,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'a'" },
|
||||
{ "kind" : "IdRef", "name" : "'b'" },
|
||||
{ "kind" : "IdRef", "name" : "'c'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Frexp",
|
||||
"opcode" : 51,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'exp'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FrexpStruct",
|
||||
"opcode" : 52,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Ldexp",
|
||||
"opcode" : 53,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'exp'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "PackSnorm4x8",
|
||||
"opcode" : 54,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'v'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "PackUnorm4x8",
|
||||
"opcode" : 55,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'v'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "PackSnorm2x16",
|
||||
"opcode" : 56,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'v'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "PackUnorm2x16",
|
||||
"opcode" : 57,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'v'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "PackHalf2x16",
|
||||
"opcode" : 58,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'v'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "PackDouble2x32",
|
||||
"opcode" : 59,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'v'" }
|
||||
],
|
||||
"capabilities" : [ "Float64" ]
|
||||
},
|
||||
{
|
||||
"opname" : "UnpackSnorm2x16",
|
||||
"opcode" : 60,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'p'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "UnpackUnorm2x16",
|
||||
"opcode" : 61,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'p'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "UnpackHalf2x16",
|
||||
"opcode" : 62,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'v'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "UnpackSnorm4x8",
|
||||
"opcode" : 63,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'p'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "UnpackUnorm4x8",
|
||||
"opcode" : 64,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'p'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "UnpackDouble2x32",
|
||||
"opcode" : 65,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'v'" }
|
||||
],
|
||||
"capabilities" : [ "Float64" ]
|
||||
},
|
||||
{
|
||||
"opname" : "Length",
|
||||
"opcode" : 66,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Distance",
|
||||
"opcode" : 67,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'p0'" },
|
||||
{ "kind" : "IdRef", "name" : "'p1'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Cross",
|
||||
"opcode" : 68,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Normalize",
|
||||
"opcode" : 69,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FaceForward",
|
||||
"opcode" : 70,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'N'" },
|
||||
{ "kind" : "IdRef", "name" : "'I'" },
|
||||
{ "kind" : "IdRef", "name" : "'Nref'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Reflect",
|
||||
"opcode" : 71,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'I'" },
|
||||
{ "kind" : "IdRef", "name" : "'N'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "Refract",
|
||||
"opcode" : 72,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'I'" },
|
||||
{ "kind" : "IdRef", "name" : "'N'" },
|
||||
{ "kind" : "IdRef", "name" : "'eta'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FindILsb",
|
||||
"opcode" : 73,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'Value'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FindSMsb",
|
||||
"opcode" : 74,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'Value'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "FindUMsb",
|
||||
"opcode" : 75,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'Value'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "InterpolateAtCentroid",
|
||||
"opcode" : 76,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'interpolant'" }
|
||||
],
|
||||
"capabilities" : [ "InterpolationFunction" ]
|
||||
},
|
||||
{
|
||||
"opname" : "InterpolateAtSample",
|
||||
"opcode" : 77,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'interpolant'" },
|
||||
{ "kind" : "IdRef", "name" : "'sample'" }
|
||||
],
|
||||
"capabilities" : [ "InterpolationFunction" ]
|
||||
},
|
||||
{
|
||||
"opname" : "InterpolateAtOffset",
|
||||
"opcode" : 78,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'interpolant'" },
|
||||
{ "kind" : "IdRef", "name" : "'offset'" }
|
||||
],
|
||||
"capabilities" : [ "InterpolationFunction" ]
|
||||
},
|
||||
{
|
||||
"opname" : "NMin",
|
||||
"opcode" : 79,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "NMax",
|
||||
"opcode" : 80,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'y'" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"opname" : "NClamp",
|
||||
"opcode" : 81,
|
||||
"operands" : [
|
||||
{ "kind" : "IdRef", "name" : "'x'" },
|
||||
{ "kind" : "IdRef", "name" : "'minVal'" },
|
||||
{ "kind" : "IdRef", "name" : "'maxVal'" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -163,6 +163,7 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="spirv_editor.cpp" />
|
||||
<ClCompile Include="spirv_reflect.cpp" />
|
||||
<ClCompile Include="spirv_gen.cpp" />
|
||||
<ClCompile Include="spirv_stringise.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -216,6 +217,8 @@
|
||||
<ClInclude Include="spirv_common.h" />
|
||||
<ClInclude Include="spirv_compile.h" />
|
||||
<ClInclude Include="spirv_editor.h" />
|
||||
<ClInclude Include="spirv_gen.h" />
|
||||
<ClInclude Include="spirv_op_helpers.h" />
|
||||
<ClInclude Include="spirv_reflect.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
<Filter Include="PCH">
|
||||
<UniqueIdentifier>{88413a79-d32c-4386-9428-47a9ea0d52b5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JSON-Generated helpers">
|
||||
<UniqueIdentifier>{1b2858fa-eefd-42e7-af56-bfad5e61e8e9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\3rdparty\glslang\OGLCompilersDLL\InitializeDll.cpp">
|
||||
@@ -134,6 +137,9 @@
|
||||
<ClCompile Include="..\..\..\3rdparty\glslang\SPIRV\SpvTools.cpp">
|
||||
<Filter>3rdparty\glslang</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="spirv_gen.cpp">
|
||||
<Filter>JSON-Generated helpers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="spirv_reflect.cpp" />
|
||||
<ClCompile Include="glslang_compile.cpp" />
|
||||
</ItemGroup>
|
||||
@@ -278,8 +284,14 @@
|
||||
<ClInclude Include="..\..\..\3rdparty\glslang\SPIRV\SpvTools.h">
|
||||
<Filter>3rdparty\glslang</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="spirv_gen.h">
|
||||
<Filter>JSON-Generated helpers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="spirv_compile.h" />
|
||||
<ClInclude Include="glslang_compile.h" />
|
||||
<ClInclude Include="spirv_reflect.h" />
|
||||
<ClInclude Include="spirv_op_helpers.h">
|
||||
<Filter>JSON-Generated helpers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<registry>
|
||||
<!--
|
||||
Copyright (c) 2015 The Khronos Group Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and/or associated documentation files (the
|
||||
"Materials"), to deal in the Materials without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
permit persons to whom the Materials are furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Materials.
|
||||
|
||||
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
-->
|
||||
<!--
|
||||
This file, spir-v.xml, is the SPIR-V Tool ID and Opcode registry. The
|
||||
canonical version of the registry, together with related schema and
|
||||
documentation, can be found in the Khronos Registry at
|
||||
http://www.khronos.org/registry/spir-v/
|
||||
-->
|
||||
|
||||
<!-- SECTION: SPIR-V Tool ID Definitions -->
|
||||
|
||||
<!-- A SPIR-V Generator Magic Number is a 32 bit word: The high order 16
|
||||
bits are a tool ID, which should be unique across all SPIR-V
|
||||
generators. The low order 16 bits are reserved for use as a tool
|
||||
version number, or any other purpose the tool supplier chooses.
|
||||
Only the tool IDs are reserved with Khronos.
|
||||
|
||||
Add new tool ID reservations contiguously with the first available
|
||||
number (the "start" attribute of the <unused> tag below), and
|
||||
modify that <unused> tag accordingly. Please add a vendor/tool
|
||||
supplier name in a 'vendor="name"' attribute; a tool name in a
|
||||
'tool="name"' attribute; and a contact person/address in a
|
||||
'comment' attribute. Remember that this value is the high 16 bits
|
||||
of a 32-bit word.
|
||||
|
||||
Note: a single vendor/tool supplier may have multiple tool IDs
|
||||
reserved for different SPIR-V generators -->
|
||||
|
||||
<ids type="vendor" start="0" end="0xFFFF" comment="SPIR-V Tool IDs">
|
||||
<id value="0" vendor="Khronos" comment="Reserved by Khronos"/>
|
||||
<id value="1" vendor="LunarG" comment="Contact TBD"/>
|
||||
<id value="2" vendor="Valve" comment="Contact TBD"/>
|
||||
<id value="3" vendor="Codeplay" comment="Contact Victor Lomuller, victor@codeplay.com"/>
|
||||
<id value="4" vendor="NVIDIA" comment="Contact Kerch Holt, kholt@nvidia.com"/>
|
||||
<id value="5" vendor="ARM" comment="Contact Alexander Galazin, alexander.galazin@arm.com"/>
|
||||
<id value="6" vendor="Khronos" tool="LLVM/SPIR-V Translator" comment="Contact Yaxun (Sam) Liu, yaxun.liu@amd.com"/>
|
||||
<id value="7" vendor="Khronos" tool="SPIR-V Tools Assembler" comment="Contact David Neto, dneto@google.com"/>
|
||||
<id value="8" vendor="Khronos" tool="Glslang Reference Front End" comment="Contact John Kessenich, johnkessenich@google.com"/>
|
||||
<id value="9" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
|
||||
<id value="10" vendor="AMD" comment="Contact Daniel Rakos, daniel.rakos@amd.com"/>
|
||||
<id value="11" vendor="Intel" comment="Contact Alexey, alexey.bader@intel.com"/>
|
||||
<id value="12" vendor="Imagination" comment="Contact James Jones"/>
|
||||
<id value="13" vendor="Google" tool="Shaderc over Glslang" comment="Contact David Neto, dneto@google.com"/>
|
||||
<id value="14" vendor="Google" tool="spiregg" comment="Contact Lei Zhang, antiagainst@google.com"/>
|
||||
<id value="15" vendor="Google" tool="rspirv" comment="Contact Lei Zhang, antiagainst@gmail.com"/>
|
||||
<id value="16" vendor="X-LEGEND" tool="Mesa-IR/SPIR-V Translator" comment="Contact Metora Wang, github:metora/MesaGLSLCompiler"/>
|
||||
<id value="17" vendor="Khronos" tool="SPIR-V Tools Linker" comment="Contact David Neto, dneto@google.com"/>
|
||||
<id value="18" vendor="Wine" tool="VKD3D Shader Compiler" comment="Contact wine-devel@winehq.org"/>
|
||||
<id value="19" vendor="Clay" tool="Clay Shader Compiler" comment="Contact info@clayengine.com"/>
|
||||
<id value="20" vendor="W3C WebGPU Group" tool="WHLSL Shader Translator" comment="https://github.com/gpuweb/WHLSL"/>
|
||||
<id value="21" vendor="Google" tool="Clspv" comment="Contact David Neto, dneto@google.com"/>
|
||||
<id value="22" vendor="Google" tool="MLIR SPIR-V Serializer" comment="Contact Lei Zhang, antiagainst@google.com"/>
|
||||
<unused start="23" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
|
||||
</ids>
|
||||
|
||||
<!-- SECTION: SPIR-V Opcodes and Enumerants -->
|
||||
<!-- Reserve new ranges for vendors in contiguous blocks of 64
|
||||
preceding the "Future use" block below, and modify that block
|
||||
accordingly.
|
||||
|
||||
Each vendor determines the use of values in their own ranges.
|
||||
Vendors are not required to disclose those uses. If the use of a
|
||||
value is included in an extension that is adopted by a Khronos
|
||||
extension or specification, then that value's use may be permanently
|
||||
fixed as if originally reserved in a Khronos range.
|
||||
|
||||
The SPIR Working Group strongly recommends:
|
||||
- Each value is used for only one purpose.
|
||||
- All values in a range should be used before allocating a new range.
|
||||
For example, to avoid unused gaps in ranges, it is customary for
|
||||
several extensions to use values from the same range.
|
||||
|
||||
The Id type "enum" is a synonym for "opcode".
|
||||
|
||||
Note that SPIR-V restricts opcode values to 16 bits.
|
||||
-->
|
||||
|
||||
<!-- Reserved opcode & enumerant blocks -->
|
||||
<ids type="opcode" start="0" end="4095" vendor="Khronos" comment="Reserved opcodes, not available to vendors - see the SPIR-V Specification"/>
|
||||
<ids type="opcode" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
|
||||
<ids type="opcode" start="4160" end="4415" vendor="ARM"/>
|
||||
<ids type="opcode" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, neil.henning@amd.com"/>
|
||||
<ids type="opcode" start="4480" end="4991" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
|
||||
<ids type="opcode" start="4992" end="5247" vendor="AMD"/>
|
||||
<ids type="opcode" start="5248" end="5503" vendor="NVIDIA"/>
|
||||
<ids type="opcode" start="5504" end="5567" vendor="Imagination"/>
|
||||
<ids type="opcode" start="5568" end="5631" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
|
||||
<ids type="opcode" start="5632" end="5695" vendor="Google" comment="Contact dneto@google.com"/>
|
||||
<ids type="opcode" start="5696" end="5823" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
|
||||
<ids type="opcode" start="5824" end="5951" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
|
||||
<ids type="opcode" start="5952" end="6015" vendor="Codeplay" comment="Contact victor@codeplay.com"/>
|
||||
<!-- Opcodes & enumerants reservable for future use. To get a block, allocate
|
||||
multiples of 64 starting at the lowest available point in this
|
||||
block and add a corresponding <ids> tag immediately above. Make
|
||||
sure to fill in the vendor attribute, and preferably add a contact
|
||||
person/address in a comment attribute. -->
|
||||
|
||||
<!-- Example new block: <ids type="opcode" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
|
||||
|
||||
<ids type="opcode" start="6016" end="4294967295" comment="Opcode range reservable for future use by vendors"/>
|
||||
|
||||
|
||||
<!-- SECTION: SPIR-V Loop Control Bit Reservations -->
|
||||
<!-- Reserve ranges of bits in the loop control bitfield.
|
||||
|
||||
Each vendor determines the use of values in their own ranges.
|
||||
Vendors are not required to disclose those uses. If the use of a
|
||||
value is included in an extension that is adopted by a Khronos
|
||||
extension or specification, then that value's use may be permanently
|
||||
fixed as if originally reserved in a Khronos range.
|
||||
|
||||
The SPIR Working Group strongly recommends:
|
||||
- Each value is used for only one purpose.
|
||||
- All values in a range should be used before allocating a new range.
|
||||
-->
|
||||
|
||||
<!-- Reserved loop control bits -->
|
||||
<ids type="LoopControl" start="0" end="15" vendor="Khronos" comment="Reserved LoopControl bits, not available to vendors - see the SPIR-V Specification"/>
|
||||
<ids type="LoopControl" start="16" end="19" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
|
||||
<ids type="LoopControl" start="20" end="30" comment="Unreserved bits reservable for use by vendors"/>
|
||||
<ids type="LoopControl" start="31" end="31" vendor="Khronos" comment="Reserved LoopControl bit, not available to vendors"/>
|
||||
|
||||
</registry>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -28,30 +28,13 @@
|
||||
#include <vector>
|
||||
#include "3rdparty/glslang/SPIRV/spirv.hpp"
|
||||
#include "api/replay/renderdoc_replay.h"
|
||||
#include "spirv_gen.h"
|
||||
|
||||
namespace rdcspv
|
||||
{
|
||||
// length of 1 word in the top 16-bits, OpNop = 0 in the lower 16-bits
|
||||
static constexpr uint32_t OpNopWord = 0x00010000U;
|
||||
|
||||
struct Id
|
||||
{
|
||||
constexpr inline Id() : id(0) {}
|
||||
// only allow explicit functions to cast to/from uint32_t
|
||||
constexpr static inline Id fromWord(uint32_t i) { return Id(i); }
|
||||
inline uint32_t value() const { return id; }
|
||||
constexpr inline explicit operator bool() const { return id != 0; }
|
||||
constexpr inline bool operator==(const Id o) const { return id == o.id; }
|
||||
constexpr inline bool operator!=(const Id o) const { return id != o.id; }
|
||||
constexpr inline bool operator<(const Id o) const { return id < o.id; }
|
||||
constexpr inline bool operator==(const uint32_t o) const { return id == o; }
|
||||
constexpr inline bool operator!=(const uint32_t o) const { return id != o; }
|
||||
constexpr inline bool operator<(const uint32_t o) const { return id < o; }
|
||||
private:
|
||||
constexpr inline Id(uint32_t i) : id(i) {}
|
||||
uint32_t id;
|
||||
};
|
||||
|
||||
class Operation;
|
||||
|
||||
template <typename ConstOrNotVector>
|
||||
@@ -134,6 +117,8 @@ private:
|
||||
class Operation
|
||||
{
|
||||
public:
|
||||
// temporary hack so the (unused) generated code will compile
|
||||
Operation(rdcspv::Op op, const std::vector<uint32_t> &data) : Operation((spv::Op)op, data) {}
|
||||
// constructor of a synthetic operation, from an operation & subsequent words, calculates the
|
||||
// length then constructs the first word with opcode + length.
|
||||
Operation(spv::Op op, const std::vector<uint32_t> &data)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user