Skip to content

Commit 2e3dc2e

Browse files
rjodinchrbashbaug
andauthored
Publish the header for the vulkan-shader-profiler embedded reflection… (KhronosGroup#398)
* Publish the header for the vulkan-shader-profiler embedded reflection non-semantic instruction set vulkan-shader-profiler is a tool based on perfetto to help vulkan developer profil their applications. First on the Host side using perfetto, but then using the extractor and the runner, this tools allow to get inside about a shader using counters (based on SPV_KHR_shader_clock) * Update include/spirv/unified1/NonSemanticVkspReflection.h Co-authored-by: Ben Ashbaugh <[email protected]> * Revert "Update include/spirv/unified1/NonSemanticVkspReflection.h" This reverts commit 3c9c24d. --------- Co-authored-by: Ben Ashbaugh <[email protected]>
1 parent 1bfd271 commit 2e3dc2e

File tree

5 files changed

+200
-0
lines changed

5 files changed

+200
-0
lines changed

BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ filegroup(
8181
srcs = ["include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json"],
8282
)
8383

84+
filegroup(
85+
name = "spirv_ext_inst_nonsemantic_vkspreflection_grammar_unified1",
86+
srcs = ["include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json"],
87+
)
88+
8489
filegroup(
8590
name = "spirv_ext_inst_nonsemantic_debugprintf_grammar_unified1",
8691
srcs = ["include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json"],
@@ -128,6 +133,7 @@ cc_library(
128133
"include/spirv/unified1/GLSL.std.450.h",
129134
"include/spirv/unified1/NonSemanticClspvReflection.h",
130135
"include/spirv/unified1/NonSemanticDebugPrintf.h",
136+
"include/spirv/unified1/NonSemanticVkspReflection.h",
131137
"include/spirv/unified1/OpenCL.std.h",
132138
],
133139
includes = ["include"],

BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ source_set("spv_headers") {
3535
"include/spirv/unified1/GLSL.std.450.h",
3636
"include/spirv/unified1/NonSemanticClspvReflection.h",
3737
"include/spirv/unified1/NonSemanticDebugPrintf.h",
38+
"include/spirv/unified1/NonSemanticVkspReflection.h",
3839
"include/spirv/unified1/OpenCL.std.h",
3940
"include/spirv/unified1/spirv.h",
4041
"include/spirv/unified1/spirv.hpp",
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright (c) 2020 The Khronos Group Inc.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a
4+
// copy of this software and/or associated documentation files (the
5+
// "Materials"), to deal in the Materials without restriction, including
6+
// without limitation the rights to use, copy, modify, merge, publish,
7+
// distribute, sublicense, and/or sell copies of the Materials, and to
8+
// permit persons to whom the Materials are furnished to do so, subject to
9+
// the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included
12+
// in all copies or substantial portions of the Materials.
13+
//
14+
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
15+
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
16+
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
17+
// https://www.khronos.org/registry/
18+
//
19+
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22+
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
23+
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24+
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25+
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
26+
//
27+
28+
#ifndef SPIRV_UNIFIED1_NonSemanticVkspReflection_H_
29+
#define SPIRV_UNIFIED1_NonSemanticVkspReflection_H_
30+
31+
#ifdef __cplusplus
32+
extern "C" {
33+
#endif
34+
35+
enum {
36+
NonSemanticVkspReflectionRevision = 1,
37+
NonSemanticVkspReflectionRevision_BitWidthPadding = 0x7fffffff
38+
};
39+
40+
enum NonSemanticVkspReflectionInstructions {
41+
NonSemanticVkspReflectionConfiguration = 1,
42+
NonSemanticVkspReflectionStartCounter = 2,
43+
NonSemanticVkspReflectionStopCounter = 3,
44+
NonSemanticVkspReflectionPushConstants = 4,
45+
NonSemanticVkspReflectionSpecializationMapEntry = 5,
46+
NonSemanticVkspReflectionDescriptorSetBuffer = 6,
47+
NonSemanticVkspReflectionDescriptorSetImage = 7,
48+
NonSemanticVkspReflectionDescriptorSetSampler = 8,
49+
NonSemanticVkspReflectionInstructionsMax = 0x7fffffff
50+
};
51+
52+
53+
#ifdef __cplusplus
54+
}
55+
#endif
56+
57+
#endif // SPIRV_UNIFIED1_NonSemanticVkspReflection_H_
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"revision" : 1,
3+
"instructions" : [
4+
{
5+
"opname" : "Configuration",
6+
"opcode" : 1,
7+
"operands" : [
8+
{"kind" : "LiteralString", "name" : "enabledExtensionNames" },
9+
{"kind" : "LiteralInteger", "name" : "specializationInfoDataSize" },
10+
{"kind" : "LiteralString", "name" : "specializationInfoData" },
11+
{"kind" : "LiteralString", "name" : "shaderName" },
12+
{"kind" : "LiteralString", "name" : "EntryPoint" },
13+
{"kind" : "LiteralInteger", "name" : "groupCountX" },
14+
{"kind" : "LiteralInteger", "name" : "groupCountY" },
15+
{"kind" : "LiteralInteger", "name" : "groupCountZ" }
16+
]
17+
},
18+
{
19+
"opname" : "StartCounter",
20+
"opcode" : 2,
21+
"operands" : [
22+
{"kind" : "LiteralString", "name" : "name" }
23+
]
24+
},
25+
{
26+
"opname" : "StopCounter",
27+
"opcode" : 3,
28+
"operands" : [
29+
{"kind" : "IdRef", "name" : "counter" }
30+
]
31+
},
32+
{
33+
"opname" : "PushConstants",
34+
"opcode" : 4,
35+
"operands" : [
36+
{ "kind" : "LiteralInteger", "name" : "offset" },
37+
{ "kind" : "LiteralInteger", "name" : "size" },
38+
{ "kind" : "LiteralString", "name" : "pValues" },
39+
{ "kind" : "LiteralInteger", "name" : "stageFlags" }
40+
]
41+
},
42+
{
43+
"opname" : "SpecializationMapEntry",
44+
"opcode" : 5,
45+
"operands" : [
46+
{"kind" : "LiteralInteger", "name" : "constantID" },
47+
{"kind" : "LiteralInteger", "name" : "offset" },
48+
{"kind" : "LiteralInteger", "name" : "size" }
49+
]
50+
},
51+
{
52+
"opname" : "DescriptorSetBuffer",
53+
"opcode" : 6,
54+
"operands" : [
55+
{ "kind" : "LiteralInteger", "name" : "ds" },
56+
{ "kind" : "LiteralInteger", "name" : "binding" },
57+
{ "kind" : "LiteralInteger", "name" : "type" },
58+
{ "kind" : "LiteralInteger", "name" : "flags" },
59+
{ "kind" : "LiteralInteger", "name" : "queueFamilyIndexCount" },
60+
{ "kind" : "LiteralInteger", "name" : "sharingMode" },
61+
{ "kind" : "LiteralInteger", "name" : "size" },
62+
{ "kind" : "LiteralInteger", "name" : "usage" },
63+
{ "kind" : "LiteralInteger", "name" : "range" },
64+
{ "kind" : "LiteralInteger", "name" : "offset" },
65+
{ "kind" : "LiteralInteger", "name" : "memorySize" },
66+
{ "kind" : "LiteralInteger", "name" : "memoryType" },
67+
{ "kind" : "LiteralInteger", "name" : "bindOffset" }
68+
]
69+
},
70+
{
71+
"opname" : "DescriptorSetImage",
72+
"opcode" : 7,
73+
"operands" : [
74+
{ "kind" : "LiteralInteger", "name" : "ds" },
75+
{ "kind" : "LiteralInteger", "name" : "binding" },
76+
{ "kind" : "LiteralInteger", "name" : "type" },
77+
{ "kind" : "LiteralInteger", "name" : "imageLayout"},
78+
{ "kind" : "LiteralInteger", "name" : "imageFlags"},
79+
{ "kind" : "LiteralInteger", "name" : "imageType"},
80+
{ "kind" : "LiteralInteger", "name" : "imageformat"},
81+
{ "kind" : "LiteralInteger", "name" : "width"},
82+
{ "kind" : "LiteralInteger", "name" : "height"},
83+
{ "kind" : "LiteralInteger", "name" : "depth"},
84+
{ "kind" : "LiteralInteger", "name" : "mipLevels"},
85+
{ "kind" : "LiteralInteger", "name" : "arrayLayers"},
86+
{ "kind" : "LiteralInteger", "name" : "samples"},
87+
{ "kind" : "LiteralInteger", "name" : "tiling"},
88+
{ "kind" : "LiteralInteger", "name" : "usage"},
89+
{ "kind" : "LiteralInteger", "name" : "sharingMode"},
90+
{ "kind" : "LiteralInteger", "name" : "queueFamilyIndexCount"},
91+
{ "kind" : "LiteralInteger", "name" : "initialLayout"},
92+
{ "kind" : "LiteralInteger", "name" : "aspectMask"},
93+
{ "kind" : "LiteralInteger", "name" : "baseMipLevel"},
94+
{ "kind" : "LiteralInteger", "name" : "levelCount"},
95+
{ "kind" : "LiteralInteger", "name" : "baseArrayLayer"},
96+
{ "kind" : "LiteralInteger", "name" : "layerCount"},
97+
{ "kind" : "LiteralInteger", "name" : "viewFlags"},
98+
{ "kind" : "LiteralInteger", "name" : "viewType"},
99+
{ "kind" : "LiteralInteger", "name" : "viewFormat"},
100+
{ "kind" : "LiteralInteger", "name" : "component_a"},
101+
{ "kind" : "LiteralInteger", "name" : "component_b"},
102+
{ "kind" : "LiteralInteger", "name" : "component_g"},
103+
{ "kind" : "LiteralInteger", "name" : "component_r"},
104+
{ "kind" : "LiteralInteger", "name" : "memorySize" },
105+
{ "kind" : "LiteralInteger", "name" : "memoryType" },
106+
{ "kind" : "LiteralInteger", "name" : "bindOffset"}
107+
]
108+
},
109+
{
110+
"opname" : "DescriptorSetSampler",
111+
"opcode" : 8,
112+
"operands" : [
113+
{ "kind" : "LiteralInteger", "name" : "ds" },
114+
{ "kind" : "LiteralInteger", "name" : "binding" },
115+
{ "kind" : "LiteralInteger", "name" : "type" },
116+
{ "kind" : "LiteralInteger", "name" : "flags"},
117+
{ "kind" : "LiteralInteger", "name" : "magFilter"},
118+
{ "kind" : "LiteralInteger", "name" : "minFilter"},
119+
{ "kind" : "LiteralInteger", "name" : "mipmapMode"},
120+
{ "kind" : "LiteralInteger", "name" : "addressModeU"},
121+
{ "kind" : "LiteralInteger", "name" : "addressModeV"},
122+
{ "kind" : "LiteralInteger", "name" : "addressModeW"},
123+
{ "kind" : "LiteralFloat", "name" : "mipLodBias"},
124+
{ "kind" : "LiteralInteger", "name" : "anisotropyEnable"},
125+
{ "kind" : "LiteralFloat", "name" : "maxAnisotropy"},
126+
{ "kind" : "LiteralInteger", "name" : "compareEnable"},
127+
{ "kind" : "LiteralInteger", "name" : "compareOp"},
128+
{ "kind" : "LiteralFloat", "name" : "minLod"},
129+
{ "kind" : "LiteralFloat", "name" : "maxLod"},
130+
{ "kind" : "LiteralInteger", "name" : "borderColor"},
131+
{ "kind" : "LiteralInteger", "name" : "unnormalizedCoordinates"}
132+
]
133+
}
134+
]
135+
}

tools/buildHeaders/bin/makeExtinstHeaders.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ def mk_extinst(name, grammar_file):
2727
mk_extinst('NonSemanticDebugPrintf', 'extinst.nonsemantic.debugprintf.grammar.json')
2828
mk_extinst('NonSemanticClspvReflection', 'extinst.nonsemantic.clspvreflection.grammar.json')
2929
mk_extinst('NonSemanticDebugBreak', 'extinst.nonsemantic.debugbreak.grammar.json')
30+
mk_extinst('NonSemanticVkspReflection', 'extinst.nonsemantic.vkspreflection.grammar.json')

0 commit comments

Comments
 (0)