Skip to content

Commit

Permalink
Publish the header for the vulkan-shader-profiler embedded reflection…
Browse files Browse the repository at this point in the history
… 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)
  • Loading branch information
rjodinchr committed Dec 28, 2023
1 parent 1c6bb27 commit 2c4d12e
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 0 deletions.
6 changes: 6 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ filegroup(
srcs = ["include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json"],
)

filegroup(
name = "spirv_ext_inst_nonsemantic_vkspreflection_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json"],
)

filegroup(
name = "spirv_ext_inst_nonsemantic_debugprintf_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json"],
Expand Down Expand Up @@ -128,6 +133,7 @@ cc_library(
"include/spirv/unified1/GLSL.std.450.h",
"include/spirv/unified1/NonSemanticClspvReflection.h",
"include/spirv/unified1/NonSemanticDebugPrintf.h",
"include/spirv/unified1/NonSemanticVkspReflection.h",
"include/spirv/unified1/OpenCL.std.h",
],
includes = ["include"],
Expand Down
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ source_set("spv_headers") {
"include/spirv/unified1/GLSL.std.450.h",
"include/spirv/unified1/NonSemanticClspvReflection.h",
"include/spirv/unified1/NonSemanticDebugPrintf.h",
"include/spirv/unified1/NonSemanticVkspReflection.h",
"include/spirv/unified1/OpenCL.std.h",
"include/spirv/unified1/spirv.h",
"include/spirv/unified1/spirv.hpp",
Expand Down
57 changes: 57 additions & 0 deletions include/spirv/unified1/NonSemanticVkspReflection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright (c) 2023 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.
//

#ifndef SPIRV_UNIFIED1_NonSemanticVkspReflection_H_
#define SPIRV_UNIFIED1_NonSemanticVkspReflection_H_

#ifdef __cplusplus
extern "C" {
#endif

enum {
NonSemanticVkspReflectionRevision = 1,
NonSemanticVkspReflectionRevision_BitWidthPadding = 0x7fffffff
};

enum NonSemanticVkspReflectionInstructions {
NonSemanticVkspReflectionConfiguration = 1,
NonSemanticVkspReflectionStartCounter = 2,
NonSemanticVkspReflectionStopCounter = 3,
NonSemanticVkspReflectionPushConstants = 4,
NonSemanticVkspReflectionSpecializationMapEntry = 5,
NonSemanticVkspReflectionDescriptorSetBuffer = 6,
NonSemanticVkspReflectionDescriptorSetImage = 7,
NonSemanticVkspReflectionDescriptorSetSampler = 8,
NonSemanticVkspReflectionInstructionsMax = 0x7fffffff
};


#ifdef __cplusplus
}
#endif

#endif // SPIRV_UNIFIED1_NonSemanticVkspReflection_H_
135 changes: 135 additions & 0 deletions include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"revision" : 1,
"instructions" : [
{
"opname" : "Configuration",
"opcode" : 1,
"operands" : [
{"kind" : "LiteralString", "name" : "enabledExtensionNames" },
{"kind" : "LiteralInteger", "name" : "specializationInfoDataSize" },
{"kind" : "LiteralString", "name" : "specializationInfoData" },
{"kind" : "LiteralString", "name" : "shaderName" },
{"kind" : "LiteralString", "name" : "EntryPoint" },
{"kind" : "LiteralInteger", "name" : "groupCountX" },
{"kind" : "LiteralInteger", "name" : "groupCountY" },
{"kind" : "LiteralInteger", "name" : "groupCountZ" }
]
},
{
"opname" : "StartCounter",
"opcode" : 2,
"operands" : [
{"kind" : "LiteralString", "name" : "name" }
]
},
{
"opname" : "StopCounter",
"opcode" : 3,
"operands" : [
{"kind" : "IdRef", "name" : "counter" }
]
},
{
"opname" : "PushConstants",
"opcode" : 4,
"operands" : [
{ "kind" : "LiteralInteger", "name" : "offset" },
{ "kind" : "LiteralInteger", "name" : "size" },
{ "kind" : "LiteralString", "name" : "pValues" },
{ "kind" : "LiteralInteger", "name" : "stageFlags" }
]
},
{
"opname" : "SpecializationMapEntry",
"opcode" : 5,
"operands" : [
{"kind" : "LiteralInteger", "name" : "constantID" },
{"kind" : "LiteralInteger", "name" : "offset" },
{"kind" : "LiteralInteger", "name" : "size" }
]
},
{
"opname" : "DescriptorSetBuffer",
"opcode" : 6,
"operands" : [
{ "kind" : "LiteralInteger", "name" : "ds" },
{ "kind" : "LiteralInteger", "name" : "binding" },
{ "kind" : "LiteralInteger", "name" : "type" },
{ "kind" : "LiteralInteger", "name" : "flags" },
{ "kind" : "LiteralInteger", "name" : "queueFamilyIndexCount" },
{ "kind" : "LiteralInteger", "name" : "sharingMode" },
{ "kind" : "LiteralInteger", "name" : "size" },
{ "kind" : "LiteralInteger", "name" : "usage" },
{ "kind" : "LiteralInteger", "name" : "range" },
{ "kind" : "LiteralInteger", "name" : "offset" },
{ "kind" : "LiteralInteger", "name" : "memorySize" },
{ "kind" : "LiteralInteger", "name" : "memoryType" },
{ "kind" : "LiteralInteger", "name" : "bindOffset" }
]
},
{
"opname" : "DescriptorSetImage",
"opcode" : 7,
"operands" : [
{ "kind" : "LiteralInteger", "name" : "ds" },
{ "kind" : "LiteralInteger", "name" : "binding" },
{ "kind" : "LiteralInteger", "name" : "type" },
{ "kind" : "LiteralInteger", "name" : "imageLayout"},
{ "kind" : "LiteralInteger", "name" : "imageFlags"},
{ "kind" : "LiteralInteger", "name" : "imageType"},
{ "kind" : "LiteralInteger", "name" : "imageformat"},
{ "kind" : "LiteralInteger", "name" : "width"},
{ "kind" : "LiteralInteger", "name" : "height"},
{ "kind" : "LiteralInteger", "name" : "depth"},
{ "kind" : "LiteralInteger", "name" : "mipLevels"},
{ "kind" : "LiteralInteger", "name" : "arrayLayers"},
{ "kind" : "LiteralInteger", "name" : "samples"},
{ "kind" : "LiteralInteger", "name" : "tiling"},
{ "kind" : "LiteralInteger", "name" : "usage"},
{ "kind" : "LiteralInteger", "name" : "sharingMode"},
{ "kind" : "LiteralInteger", "name" : "queueFamilyIndexCount"},
{ "kind" : "LiteralInteger", "name" : "initialLayout"},
{ "kind" : "LiteralInteger", "name" : "aspectMask"},
{ "kind" : "LiteralInteger", "name" : "baseMipLevel"},
{ "kind" : "LiteralInteger", "name" : "levelCount"},
{ "kind" : "LiteralInteger", "name" : "baseArrayLayer"},
{ "kind" : "LiteralInteger", "name" : "layerCount"},
{ "kind" : "LiteralInteger", "name" : "viewFlags"},
{ "kind" : "LiteralInteger", "name" : "viewType"},
{ "kind" : "LiteralInteger", "name" : "viewFormat"},
{ "kind" : "LiteralInteger", "name" : "component_a"},
{ "kind" : "LiteralInteger", "name" : "component_b"},
{ "kind" : "LiteralInteger", "name" : "component_g"},
{ "kind" : "LiteralInteger", "name" : "component_r"},
{ "kind" : "LiteralInteger", "name" : "memorySize" },
{ "kind" : "LiteralInteger", "name" : "memoryType" },
{ "kind" : "LiteralInteger", "name" : "bindOffset"}
]
},
{
"opname" : "DescriptorSetSampler",
"opcode" : 8,
"operands" : [
{ "kind" : "LiteralInteger", "name" : "ds" },
{ "kind" : "LiteralInteger", "name" : "binding" },
{ "kind" : "LiteralInteger", "name" : "type" },
{ "kind" : "LiteralInteger", "name" : "flags"},
{ "kind" : "LiteralInteger", "name" : "magFilter"},
{ "kind" : "LiteralInteger", "name" : "minFilter"},
{ "kind" : "LiteralInteger", "name" : "mipmapMode"},
{ "kind" : "LiteralInteger", "name" : "addressModeU"},
{ "kind" : "LiteralInteger", "name" : "addressModeV"},
{ "kind" : "LiteralInteger", "name" : "addressModeW"},
{ "kind" : "LiteralFloat", "name" : "mipLodBias"},
{ "kind" : "LiteralInteger", "name" : "anisotropyEnable"},
{ "kind" : "LiteralFloat", "name" : "maxAnisotropy"},
{ "kind" : "LiteralInteger", "name" : "compareEnable"},
{ "kind" : "LiteralInteger", "name" : "compareOp"},
{ "kind" : "LiteralFloat", "name" : "minLod"},
{ "kind" : "LiteralFloat", "name" : "maxLod"},
{ "kind" : "LiteralInteger", "name" : "borderColor"},
{ "kind" : "LiteralInteger", "name" : "unnormalizedCoordinates"}
]
}
]
}
1 change: 1 addition & 0 deletions tools/buildHeaders/bin/makeExtinstHeaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ def mk_extinst(name, grammar_file):
mk_extinst('NonSemanticDebugPrintf', 'extinst.nonsemantic.debugprintf.grammar.json')
mk_extinst('NonSemanticClspvReflection', 'extinst.nonsemantic.clspvreflection.grammar.json')
mk_extinst('NonSemanticDebugBreak', 'extinst.nonsemantic.debugbreak.grammar.json')
mk_extinst('NonSemanticVkspReflection', 'extinst.nonsemantic.vkspreflection.grammar.json')

0 comments on commit 2c4d12e

Please sign in to comment.