Commit 6689a54d by Shahbaz Youssefi Committed by Commit Bot

Vulkan: autogen for SPIR-V instruction build and parse

Handwritten SPIR-V instruction parse and build code is replaced with autogenerated functions based on the SPIR-V grammar. Bug: angleproject:4889 Change-Id: I09d724fd944e79c03fe4eadca3ee3e3ef0b49872 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2644721 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent cc5083e0
......@@ -685,6 +685,8 @@ if (angle_enable_vulkan || angle_enable_metal) {
]
deps = [
":libANGLE_headers",
"$angle_root/src/common/spirv:angle_spirv_builder",
"$angle_root/src/common/spirv:angle_spirv_parser",
"${angle_glslang_dir}:glslang_default_resource_limits_sources",
"${angle_glslang_dir}:glslang_lib_sources",
"${angle_spirv_headers_dir}:spv_headers",
......
{
"src/common/spirv/gen_spirv_builder_and_parser.py":
"02381e3a7cf898265de3ba438b3b6e5e",
"src/common/spirv/spirv_instruction_builder_autogen.cpp":
"b9c0c27ab2de86955528d4d8ba9be817",
"src/common/spirv/spirv_instruction_builder_autogen.h":
"9629f02ff30720ec38a9aad0fc5c1503",
"src/common/spirv/spirv_instruction_parser_autogen.cpp":
"55d28bb4b003dbecf31e162ff996fc4f",
"src/common/spirv/spirv_instruction_parser_autogen.h":
"68c5746bc94e6b9f891ff2a11869ccd1",
"third_party/vulkan-deps/spirv-headers/src/include/spirv/1.0/spirv.core.grammar.json":
"a8c4239344b2fc10bfc4ace7ddee1867"
}
\ No newline at end of file
......@@ -115,6 +115,8 @@ generators = {
'scripts/gen_proc_table.py',
'restricted traces':
'src/tests/restricted_traces/gen_restricted_traces.py',
'SPIR-V helpers':
'src/common/spirv/gen_spirv_builder_and_parser.py',
'Static builtins':
'src/compiler/translator/gen_builtin_symbols.py',
'uniform type':
......
......@@ -70,6 +70,9 @@ class FastVector final
void push_back(const value_type &value);
void push_back(value_type &&value);
template <typename... Args>
void emplace_back(Args &&... args);
void pop_back();
reference front();
......@@ -288,9 +291,16 @@ ANGLE_INLINE void FastVector<T, N, Storage>::push_back(const value_type &value)
template <class T, size_t N, class Storage>
ANGLE_INLINE void FastVector<T, N, Storage>::push_back(value_type &&value)
{
emplace_back(std::move(value));
}
template <class T, size_t N, class Storage>
template <typename... Args>
ANGLE_INLINE void FastVector<T, N, Storage>::emplace_back(Args &&... args)
{
if (mSize == mReservedSize)
ensure_capacity(mSize + 1);
mData[mSize++] = std::move(value);
mData[mSize++] = std::move(T(std::forward<Args>(args)...));
}
template <class T, size_t N, class Storage>
......
# Copyright 2021 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../../gni/angle.gni")
angle_source_set("angle_spirv_builder") {
sources = [
"spirv_instruction_builder_autogen.cpp",
"spirv_instruction_builder_autogen.h",
"spirv_types.h",
]
deps = [
"$angle_root:angle_common",
"${angle_spirv_headers_dir}:spv_headers",
]
}
angle_source_set("angle_spirv_parser") {
sources = [
"spirv_instruction_parser_autogen.cpp",
"spirv_instruction_parser_autogen.h",
"spirv_types.h",
]
deps = [
"$angle_root:angle_common",
"${angle_spirv_headers_dir}:spv_headers",
]
}
#!/usr/bin/python
# Copyright 2021 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# gen_spirv_builder_and_parser.py:
# Code generation for SPIR-V instruction builder and parser.
# NOTE: don't run this script directly. Run scripts/run_code_generation.py.
import itertools
import json
import os
import sys
# ANGLE uses SPIR-V 1.0 currently, so there's no reason to generate code for newer instructions.
SPIRV_GRAMMAR_FILE = '../../../third_party/vulkan-deps/spirv-headers/src/include/spirv/1.0/spirv.core.grammar.json'
# The script has two sets of outputs, a header and source file for SPIR-V code generation, and a
# header and source file for SPIR-V parsing.
SPIRV_BUILDER_FILE = 'spirv_instruction_builder'
SPIRV_PARSER_FILE = 'spirv_instruction_parser'
# The types are either defined in spirv_types.h (to use strong types), or are enums that are
# defined by SPIR-V headers.
ANGLE_DEFINED_TYPES = [
'IdRef', 'IdResult', 'IdResultType', 'IdMemorySemantics', 'IdScope', 'LiteralInteger',
'LiteralString', 'LiteralContextDependentNumber', 'LiteralExtInstInteger',
'PairLiteralIntegerIdRef', 'PairIdRefLiteralInteger', 'PairIdRefIdRef'
]
HEADER_TEMPLATE = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// {file_name}_autogen.h:
// Functions to {verb} SPIR-V binary for each instruction.
#ifndef COMMON_SPIRV_{file_name_capitalized}AUTOGEN_H_
#define COMMON_SPIRV_{file_name_capitalized}AUTOGEN_H_
#include <vector>
#include "spirv_types.h"
namespace angle
{{
namespace spirv
{{
{prototype_list}
}} // namespace spirv
}} // namespace angle
#endif // COMMON_SPIRV_{file_name_capitalized}AUTOGEN_H_
"""
SOURCE_TEMPLATE = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// {file_name}_autogen.cpp:
// Functions to {verb} SPIR-V binary for each instruction.
#include "{file_name}_autogen.h"
#include <string.h>
#include "common/debug.h"
namespace angle
{{
namespace spirv
{{
{helper_functions}
{function_list}
}} // namespace spirv
}} // namespace angle
"""
BUILDER_HELPER_FUNCTIONS = """namespace
{
uint32_t MakeLengthOp(size_t length, spv::Op op)
{
ASSERT(length <= 0xFFFFu);
ASSERT(op <= 0xFFFFu);
return static_cast<uint32_t>(length) << 16 | op;
}
} // anonymous namespace"""
PARSER_FIXED_FUNCTIONS_PROTOTYPES = """void GetInstructionOpAndLength(const uint32_t *_instruction,
spv::Op *opOut, uint32_t *lengthOut);
"""
PARSER_FIXED_FUNCTIONS = """void GetInstructionOpAndLength(const uint32_t *_instruction,
spv::Op *opOut, uint32_t *lengthOut)
{
constexpr uint32_t kOpMask = 0xFFFFu;
*opOut = static_cast<spv::Op>(_instruction[0] & kOpMask);
*lengthOut = _instruction[0] >> 16;
}
"""
TEMPLATE_BUILDER_FUNCTION_PROTOTYPE = """void Write{op}(std::vector<uint32_t> *blob {param_list})"""
TEMPLATE_BUILDER_FUNCTION_BODY = """{{
const size_t startSize = blob->size();
blob->push_back(0);
{push_back_lines}
(*blob)[startSize] = MakeLengthOp(blob->size() - startSize, spv::Op{op});
}}
"""
TEMPLATE_PARSER_FUNCTION_PROTOTYPE = """void Parse{op}(const uint32_t *_instruction {param_list})"""
TEMPLATE_PARSER_FUNCTION_BODY = """{{
spv::Op _op;
uint32_t _length;
GetInstructionOpAndLength(_instruction, &_op, &_length);
ASSERT(_op == spv::Op{op});
uint32_t _o = 1;
{parse_lines}
}}
"""
def load_grammar(grammar_file):
with open(grammar_file) as grammar_in:
grammar = json.loads(grammar_in.read())
return grammar
def remove_chars(string, chars):
return filter(lambda c: c not in chars, string)
def make_camel_case(name):
return name[0].lower() + name[1:]
class Writer:
def __init__(self):
self.path_prefix = os.path.dirname(os.path.realpath(__file__)) + os.path.sep
self.grammar = load_grammar(self.path_prefix + SPIRV_GRAMMAR_FILE)
# If an instruction has a parameter of these types, the instruction is ignored
self.unsupported_kinds = set(['LiteralSpecConstantOpInteger'])
# If an instruction requires a capability of these kinds, the instruction is ignored
self.unsupported_capabilities = set(['Kernel'])
# If an instruction requires an extension other than these, the instruction is ignored
self.supported_extensions = set([])
# List of bit masks. These have 'Mask' added to their typename in SPIR-V headers.
self.bit_mask_types = set([])
# List of generated instructions builder/parser functions so far.
self.instruction_builder_prototypes = []
self.instruction_builder_impl = []
self.instruction_parser_prototypes = [PARSER_FIXED_FUNCTIONS_PROTOTYPES]
self.instruction_parser_impl = [PARSER_FIXED_FUNCTIONS]
def write_builder_and_parser(self):
"""Generates four files, a set of header and source files for generating SPIR-V instructions
and a set for parsing SPIR-V instructions. Only Vulkan instructions are processed (and not
OpenCL for example), and some assumptions are made based on ANGLE's usage (for example that
constants always fit in one 32-bit unit, as GLES doesn't support double or 64-bit types).
Additionally, enums and other parameter 'kinds' are not parsed from the json file, but
rather use the definitions from the SPIR-V headers repository and the spirv_types.h file."""
# Recurse through capabilities and accumulate ones that depend on unsupported ones.
self.accumulate_unsupported_capabilities()
self.find_bit_mask_types()
for instruction in self.grammar['instructions']:
self.generate_instruction_functions(instruction)
# Write out the files.
data_source_base_name = os.path.basename(SPIRV_GRAMMAR_FILE)
builder_template_args = {
'script_name': sys.argv[0],
'data_source_name': data_source_base_name,
'file_name': SPIRV_BUILDER_FILE,
'file_name_capitalized': remove_chars(SPIRV_BUILDER_FILE.upper(), '_'),
'verb': 'generate',
'helper_functions': BUILDER_HELPER_FUNCTIONS,
'prototype_list': ''.join(self.instruction_builder_prototypes),
'function_list': ''.join(self.instruction_builder_impl)
}
parser_template_args = {
'script_name': sys.argv[0],
'data_source_name': data_source_base_name,
'file_name': SPIRV_PARSER_FILE,
'file_name_capitalized': remove_chars(SPIRV_PARSER_FILE.upper(), '_'),
'verb': 'parse',
'helper_functions': '',
'prototype_list': ''.join(self.instruction_parser_prototypes),
'function_list': ''.join(self.instruction_parser_impl)
}
with (open(self.path_prefix + SPIRV_BUILDER_FILE + '_autogen.h', 'w')) as f:
f.write(HEADER_TEMPLATE.format(**builder_template_args))
with (open(self.path_prefix + SPIRV_BUILDER_FILE + '_autogen.cpp', 'w')) as f:
f.write(SOURCE_TEMPLATE.format(**builder_template_args))
with (open(self.path_prefix + SPIRV_PARSER_FILE + '_autogen.h', 'w')) as f:
f.write(HEADER_TEMPLATE.format(**parser_template_args))
with (open(self.path_prefix + SPIRV_PARSER_FILE + '_autogen.cpp', 'w')) as f:
f.write(SOURCE_TEMPLATE.format(**parser_template_args))
def requires_unsupported_capability(self, item):
depends = item.get('capabilities', [])
return any([dep in self.unsupported_capabilities for dep in depends])
def requires_unsupported_extension(self, item):
extensions = item.get('extensions', [])
return any([ext not in self.supported_extensions for ext in extensions])
def accumulate_unsupported_capabilities(self):
operand_kinds = self.grammar['operand_kinds']
# Find the Capability enum
for kind in filter(lambda entry: entry['kind'] == 'Capability', operand_kinds):
capabilities = kind['enumerants']
for capability in capabilities:
name = capability['enumerant']
# For each capability, see if any of the capabilities they depend on is unsupported.
# If so, add the capability to the list of unsupported ones.
if self.requires_unsupported_capability(capability):
self.unsupported_capabilities.add(name)
continue
# Do the same for extensions
if self.requires_unsupported_extension(capability):
self.unsupported_capabilities.add(name)
def find_bit_mask_types(self):
operand_kinds = self.grammar['operand_kinds']
# Find the BitEnum categories
for bitEnumEntry in filter(lambda entry: entry['category'] == 'BitEnum', operand_kinds):
self.bit_mask_types.add(bitEnumEntry['kind'])
def get_operand_name(self, operand):
kind = operand['kind']
name = operand.get('name')
# If no name is given, derive the name from the kind
if name is None:
assert (kind.find(' ') == -1)
return make_camel_case(kind)
quantifier = operand.get('quantifier', '')
name = remove_chars(name, "'")
# First, a number of special-cases for optional lists
if quantifier == '*':
# For IdRefs, change 'Xyz 1', +\n'Xyz 2', +\n...' to xyzList
if kind == 'IdRef':
if name.find(' ') != -1:
name = name[0:name.find(' ')]
return make_camel_case(name) + 'List'
# Otherwise, it's a pair in the form of 'Xyz, Abc, ...', which is changed to
# xyzAbcPairList
name = remove_chars(name, " ,.")
return make_camel_case(name) + 'PairList'
# Otherwise, remove invalid characters and make the first letter lower case.
name = remove_chars(name, " .,+\n~")
name = make_camel_case(name)
# Make sure the name is not a C++ keyword
return 'default_' if name == 'default' else name
def get_operand_namespace(self, kind):
return '' if kind in ANGLE_DEFINED_TYPES else 'spv::'
def get_operand_type_suffix(self, kind):
return 'Mask' if kind in self.bit_mask_types else ''
def get_kind_cpp_type(self, kind):
return self.get_operand_namespace(kind) + kind + self.get_operand_type_suffix(kind)
def get_operand_type_in_and_out(self, operand):
kind = operand['kind']
quantifier = operand.get('quantifier', '')
is_array = quantifier == '*'
is_optional = quantifier == '?'
cpp_type = self.get_kind_cpp_type(kind)
if is_array:
type_in = 'const ' + cpp_type + 'List &'
type_out = cpp_type + 'List *'
elif is_optional:
type_in = cpp_type + ' *'
type_out = cpp_type + ' *'
else:
type_in = cpp_type
type_out = cpp_type + ' *'
return (type_in, type_out, is_array, is_optional)
def get_operand_push_back_line(self, operand, operand_name, is_array, is_optional):
kind = operand['kind']
pre = ''
post = ''
accessor = '.'
item = operand_name
item_dereferenced = item
if is_optional:
# If optional, surround with an if.
pre = 'if (' + operand_name + ') {\n'
post = '\n}'
accessor = '->'
item_dereferenced = '*' + item
elif is_array:
# If array, surround with a loop.
pre = 'for (const auto &operand : ' + operand_name + ') {\n'
post = '\n}'
item = 'operand'
item_dereferenced = item
# Usually the operand is one uint32_t, but it may be pair. Handle the pairs especially.
if kind == 'PairLiteralIntegerIdRef':
line = 'blob->push_back(' + item + accessor + 'literal);'
line += 'blob->push_back(' + item + accessor + 'id);'
elif kind == 'PairIdRefLiteralInteger':
line = 'blob->push_back(' + item + accessor + 'id);'
line += 'blob->push_back(' + item + accessor + 'literal);'
elif kind == 'PairIdRefIdRef':
line = 'blob->push_back(' + item + accessor + 'id1);'
line += 'blob->push_back(' + item + accessor + 'id2);'
elif kind == 'LiteralString':
line = '{size_t d = blob->size();'
line += 'blob->resize(d + strlen(' + item_dereferenced + ') / 4 + 1, 0);'
# We currently don't have any big-endian devices in the list of supported platforms.
# Literal strings in SPIR-V are stored little-endian (SPIR-V 1.0 Section 2.2.1, Literal
# String), so if a big-endian device is to be supported, the string copy here should
# be adjusted.
line += 'ASSERT(IsLittleEndian());'
line += 'strcpy(reinterpret_cast<char *>(blob->data() + d), ' + item_dereferenced + ');}'
else:
line = 'blob->push_back(' + item_dereferenced + ');'
return pre + line + post
def get_operand_parse_line(self, operand, operand_name, is_array, is_optional):
kind = operand['kind']
pre = ''
post = ''
accessor = '->'
if is_optional:
# If optional, surround with an if, both checking if argument is provided, and whether
# it exists.
pre = 'if (' + operand_name + ' && _o < _length) {\n'
post = '\n}'
elif is_array:
# If array, surround with an if and a loop.
pre = 'if (' + operand_name + ') {\n'
pre += 'while (_o < _length) {\n'
post = '\n}}'
accessor = '.'
# Usually the operand is one uint32_t, but it may be pair. Handle the pairs especially.
if kind == 'PairLiteralIntegerIdRef':
if is_array:
line = operand_name + '->emplace_back(' + kind + '{LiteralInteger(_instruction[_o]), IdRef(_instruction[_o + 1])});'
line += '_o += 2;'
else:
line = operand_name + '->literal = LiteralInteger(_instruction[_o++]);'
line += operand_name + '->id = IdRef(_instruction[_o++]);'
elif kind == 'PairIdRefLiteralInteger':
if is_array:
line = operand_name + '->emplace_back(' + kind + '{IdRef(_instruction[_o]), LiteralInteger(_instruction[_o + 1])});'
line += '_o += 2;'
else:
line = operand_name + '->id = IdRef(_instruction[_o++]);'
line += operand_name + '->literal = LiteralInteger(_instruction[_o++]);'
elif kind == 'PairIdRefIdRef':
if is_array:
line = operand_name + '->emplace_back(' + kind + '{IdRef(_instruction[_o]), IdRef(_instruction[_o + 1])});'
line += '_o += 2;'
else:
line = operand_name + '->id1 = IdRef(_instruction[_o++]);'
line += operand_name + '->id2 = IdRef(_instruction[_o++]);'
elif kind == 'LiteralString':
# The length of string in words is ceil((strlen(str) + 1) / 4). This is equal to
# (strlen(str)+1+3) / 4, which is equal to strlen(str)/4+1.
assert (not is_array)
# See handling of LiteralString in get_operand_push_back_line.
line = 'ASSERT(IsLittleEndian());'
line += '*' + operand_name + ' = reinterpret_cast<const char *>(&_instruction[_o]);'
line += '_o += strlen(*' + operand_name + ') / 4 + 1;'
else:
if is_array:
line = operand_name + '->emplace_back(_instruction[_o++]);'
else:
line = '*' + operand_name + ' = ' + self.get_kind_cpp_type(
kind) + '(_instruction[_o++]);'
return pre + line + post
def process_operand(self, operand, cpp_operands_in, cpp_operands_out, cpp_in_parse_lines,
cpp_out_push_back_lines):
operand_name = self.get_operand_name(operand)
type_in, type_out, is_array, is_optional = self.get_operand_type_in_and_out(operand)
# Make the parameter list
cpp_operands_in.append(', ' + type_in + ' ' + operand_name)
cpp_operands_out.append(', ' + type_out + ' ' + operand_name)
# Make the builder body lines
cpp_out_push_back_lines.append(
self.get_operand_push_back_line(operand, operand_name, is_array, is_optional))
# Make the parser body lines
cpp_in_parse_lines.append(
self.get_operand_parse_line(operand, operand_name, is_array, is_optional))
def generate_instruction_functions(self, instruction):
name = instruction['opname']
assert (name.startswith('Op'))
name = name[2:]
# Skip if the instruction depends on a capability or extension we aren't interested in
if self.requires_unsupported_capability(instruction):
return
if self.requires_unsupported_extension(instruction):
return
operands = instruction.get('operands', [])
# Skip if any of the operands are not supported
if any([operand['kind'] in self.unsupported_kinds for operand in operands]):
return
cpp_operands_in = []
cpp_operands_out = []
cpp_in_parse_lines = []
cpp_out_push_back_lines = []
for operand in operands:
self.process_operand(operand, cpp_operands_in, cpp_operands_out, cpp_in_parse_lines,
cpp_out_push_back_lines)
# get_operand_parse_line relies on there only being one array parameter, and it being
# the last.
assert (operand.get('quantifier') != '*' or len(cpp_in_parse_lines) == len(operands))
if operand['kind'] == 'Decoration':
# Special handling of Op*Decorate instructions with a Decoration operand. That
# operand always comes last, and implies a number of LiteralIntegers to follow.
assert (len(cpp_in_parse_lines) == len(operands))
decoration_operands = {
'name': 'values',
'kind': 'LiteralInteger',
'quantifier': '*'
}
self.process_operand(decoration_operands, cpp_operands_in, cpp_operands_out,
cpp_in_parse_lines, cpp_out_push_back_lines)
elif operand['kind'] == 'ImageOperands':
# Special handling of OpImage* instructions with an ImageOperands operand. That
# operand always comes last, and implies a number of IdRefs to follow with different
# meanings based on the bits set in said operand.
assert (len(cpp_in_parse_lines) == len(operands))
image_operands = {'name': 'imageOperandIds', 'kind': 'IdRef', 'quantifier': '*'}
self.process_operand(image_operands, cpp_operands_in, cpp_operands_out,
cpp_in_parse_lines, cpp_out_push_back_lines)
# Make the builder prototype body
builder_prototype = TEMPLATE_BUILDER_FUNCTION_PROTOTYPE.format(
op=name, param_list=''.join(cpp_operands_in))
self.instruction_builder_prototypes.append(builder_prototype + ';\n')
self.instruction_builder_impl.append(
builder_prototype + '\n' + TEMPLATE_BUILDER_FUNCTION_BODY.format(
op=name, push_back_lines='\n'.join(cpp_out_push_back_lines)))
if len(operands) == 0:
return
parser_prototype = TEMPLATE_PARSER_FUNCTION_PROTOTYPE.format(
op=name, param_list=''.join(cpp_operands_out))
self.instruction_parser_prototypes.append(parser_prototype + ';\n')
self.instruction_parser_impl.append(
parser_prototype + '\n' + TEMPLATE_PARSER_FUNCTION_BODY.format(
op=name, parse_lines='\n'.join(cpp_in_parse_lines)))
def main():
# auto_script parameters.
if len(sys.argv) > 1:
if sys.argv[1] == 'inputs':
print(SPIRV_GRAMMAR_FILE)
elif sys.argv[1] == 'outputs':
output_files_base = [SPIRV_BUILDER_FILE, SPIRV_PARSER_FILE]
output_files = [
'_autogen.'.join(pair)
for pair in itertools.product(output_files_base, ['h', 'cpp'])
]
print(','.join(output_files))
else:
print('Invalid script parameters')
return 1
return 0
writer = Writer()
writer.write_builder_and_parser()
return 0
if __name__ == '__main__':
sys.exit(main())
This source diff could not be displayed because it is too large. You can view the blob instead.
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_spirv_builder_and_parser.py using data from spirv.core.grammar.json.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// spirv_instruction_builder_autogen.h:
// Functions to generate SPIR-V binary for each instruction.
#ifndef COMMON_SPIRV_SPIRVINSTRUCTIONBUILDERAUTOGEN_H_
#define COMMON_SPIRV_SPIRVINSTRUCTIONBUILDERAUTOGEN_H_
#include <vector>
#include "spirv_types.h"
namespace angle
{
namespace spirv
{
void WriteNop(std::vector<uint32_t> *blob);
void WriteUndef(std::vector<uint32_t> *blob, IdResultType idResultType, IdResult idResult);
void WriteSourceContinued(std::vector<uint32_t> *blob, LiteralString continuedSource);
void WriteSource(std::vector<uint32_t> *blob,
spv::SourceLanguage sourceLanguage,
LiteralInteger version,
IdRef *file,
LiteralString *source);
void WriteSourceExtension(std::vector<uint32_t> *blob, LiteralString extension);
void WriteName(std::vector<uint32_t> *blob, IdRef target, LiteralString name);
void WriteMemberName(std::vector<uint32_t> *blob,
IdRef type,
LiteralInteger member,
LiteralString name);
void WriteString(std::vector<uint32_t> *blob, IdResult idResult, LiteralString string);
void WriteLine(std::vector<uint32_t> *blob, IdRef file, LiteralInteger line, LiteralInteger column);
void WriteExtension(std::vector<uint32_t> *blob, LiteralString name);
void WriteExtInstImport(std::vector<uint32_t> *blob, IdResult idResult, LiteralString name);
void WriteExtInst(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef set,
LiteralExtInstInteger instruction,
const IdRefList &operandList);
void WriteMemoryModel(std::vector<uint32_t> *blob,
spv::AddressingModel addressingModel,
spv::MemoryModel memoryModel);
void WriteEntryPoint(std::vector<uint32_t> *blob,
spv::ExecutionModel executionModel,
IdRef entryPoint,
LiteralString name,
const IdRefList &interfaceList);
void WriteExecutionMode(std::vector<uint32_t> *blob, IdRef entryPoint, spv::ExecutionMode mode);
void WriteCapability(std::vector<uint32_t> *blob, spv::Capability capability);
void WriteTypeVoid(std::vector<uint32_t> *blob, IdResult idResult);
void WriteTypeBool(std::vector<uint32_t> *blob, IdResult idResult);
void WriteTypeInt(std::vector<uint32_t> *blob,
IdResult idResult,
LiteralInteger width,
LiteralInteger signedness);
void WriteTypeFloat(std::vector<uint32_t> *blob, IdResult idResult, LiteralInteger width);
void WriteTypeVector(std::vector<uint32_t> *blob,
IdResult idResult,
IdRef componentType,
LiteralInteger componentCount);
void WriteTypeMatrix(std::vector<uint32_t> *blob,
IdResult idResult,
IdRef columnType,
LiteralInteger columnCount);
void WriteTypeImage(std::vector<uint32_t> *blob,
IdResult idResult,
IdRef sampledType,
spv::Dim dim,
LiteralInteger depth,
LiteralInteger arrayed,
LiteralInteger mS,
LiteralInteger sampled,
spv::ImageFormat imageFormat,
spv::AccessQualifier *accessQualifier);
void WriteTypeSampler(std::vector<uint32_t> *blob, IdResult idResult);
void WriteTypeSampledImage(std::vector<uint32_t> *blob, IdResult idResult, IdRef imageType);
void WriteTypeArray(std::vector<uint32_t> *blob,
IdResult idResult,
IdRef elementType,
IdRef length);
void WriteTypeRuntimeArray(std::vector<uint32_t> *blob, IdResult idResult, IdRef elementType);
void WriteTypeStruct(std::vector<uint32_t> *blob, IdResult idResult, const IdRefList &memberList);
void WriteTypePointer(std::vector<uint32_t> *blob,
IdResult idResult,
spv::StorageClass storageClass,
IdRef type);
void WriteTypeFunction(std::vector<uint32_t> *blob,
IdResult idResult,
IdRef returnType,
const IdRefList &parameterList);
void WriteTypeForwardPointer(std::vector<uint32_t> *blob,
IdRef pointerType,
spv::StorageClass storageClass);
void WriteConstantTrue(std::vector<uint32_t> *blob, IdResultType idResultType, IdResult idResult);
void WriteConstantFalse(std::vector<uint32_t> *blob, IdResultType idResultType, IdResult idResult);
void WriteConstant(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
LiteralContextDependentNumber value);
void WriteConstantComposite(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
const IdRefList &constituentsList);
void WriteConstantNull(std::vector<uint32_t> *blob, IdResultType idResultType, IdResult idResult);
void WriteSpecConstantTrue(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult);
void WriteSpecConstantFalse(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult);
void WriteSpecConstant(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
LiteralContextDependentNumber value);
void WriteSpecConstantComposite(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
const IdRefList &constituentsList);
void WriteFunction(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
spv::FunctionControlMask functionControl,
IdRef functionType);
void WriteFunctionParameter(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult);
void WriteFunctionEnd(std::vector<uint32_t> *blob);
void WriteFunctionCall(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef function,
const IdRefList &argumentList);
void WriteVariable(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
spv::StorageClass storageClass,
IdRef *initializer);
void WriteImageTexelPointer(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef image,
IdRef coordinate,
IdRef sample);
void WriteLoad(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
spv::MemoryAccessMask *memoryAccess);
void WriteStore(std::vector<uint32_t> *blob,
IdRef pointer,
IdRef object,
spv::MemoryAccessMask *memoryAccess);
void WriteCopyMemory(std::vector<uint32_t> *blob,
IdRef target,
IdRef source,
spv::MemoryAccessMask *memoryAccess);
void WriteCopyMemorySized(std::vector<uint32_t> *blob,
IdRef target,
IdRef source,
IdRef size,
spv::MemoryAccessMask *memoryAccess);
void WriteAccessChain(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
const IdRefList &indexesList);
void WriteInBoundsAccessChain(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
const IdRefList &indexesList);
void WriteArrayLength(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef structure,
LiteralInteger arraymember);
void WriteInBoundsPtrAccessChain(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
IdRef element,
const IdRefList &indexesList);
void WriteDecorate(std::vector<uint32_t> *blob,
IdRef target,
spv::Decoration decoration,
const LiteralIntegerList &valuesPairList);
void WriteMemberDecorate(std::vector<uint32_t> *blob,
IdRef structureType,
LiteralInteger member,
spv::Decoration decoration,
const LiteralIntegerList &valuesPairList);
void WriteDecorationGroup(std::vector<uint32_t> *blob, IdResult idResult);
void WriteGroupDecorate(std::vector<uint32_t> *blob,
IdRef decorationGroup,
const IdRefList &targetsList);
void WriteGroupMemberDecorate(std::vector<uint32_t> *blob,
IdRef decorationGroup,
const PairIdRefLiteralIntegerList &targetsPairList);
void WriteVectorExtractDynamic(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector,
IdRef index);
void WriteVectorInsertDynamic(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector,
IdRef component,
IdRef index);
void WriteVectorShuffle(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector1,
IdRef vector2,
const LiteralIntegerList &componentsPairList);
void WriteCompositeConstruct(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
const IdRefList &constituentsList);
void WriteCompositeExtract(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef composite,
const LiteralIntegerList &indexesPairList);
void WriteCompositeInsert(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef object,
IdRef composite,
const LiteralIntegerList &indexesPairList);
void WriteCopyObject(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand);
void WriteTranspose(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef matrix);
void WriteSampledImage(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef image,
IdRef sampler);
void WriteImageSampleImplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSampleExplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
spv::ImageOperandsMask imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSampleDrefImplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSampleDrefExplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSampleProjImplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSampleProjExplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
spv::ImageOperandsMask imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSampleProjDrefImplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSampleProjDrefExplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageFetch(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef image,
IdRef coordinate,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageGather(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef component,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageDrefGather(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageRead(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef image,
IdRef coordinate,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageWrite(std::vector<uint32_t> *blob,
IdRef image,
IdRef coordinate,
IdRef texel,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImage(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage);
void WriteImageQueryLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate);
void WriteConvertFToU(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef floatValue);
void WriteConvertFToS(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef floatValue);
void WriteConvertSToF(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef signedValue);
void WriteConvertUToF(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef unsignedValue);
void WriteUConvert(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef unsignedValue);
void WriteSConvert(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef signedValue);
void WriteFConvert(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef floatValue);
void WriteQuantizeToF16(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef value);
void WriteConvertPtrToU(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer);
void WriteConvertUToPtr(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef integerValue);
void WriteBitcast(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand);
void WriteSNegate(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand);
void WriteFNegate(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand);
void WriteIAdd(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFAdd(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteISub(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFSub(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteIMul(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFMul(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteUDiv(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteSDiv(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFDiv(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteUMod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteSRem(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteSMod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFRem(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFMod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteVectorTimesScalar(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector,
IdRef scalar);
void WriteMatrixTimesScalar(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef matrix,
IdRef scalar);
void WriteVectorTimesMatrix(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector,
IdRef matrix);
void WriteMatrixTimesVector(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef matrix,
IdRef vector);
void WriteMatrixTimesMatrix(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef leftMatrix,
IdRef rightMatrix);
void WriteOuterProduct(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector1,
IdRef vector2);
void WriteDot(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector1,
IdRef vector2);
void WriteIAddCarry(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteISubBorrow(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteUMulExtended(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteSMulExtended(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteAny(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector);
void WriteAll(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef vector);
void WriteIsNan(std::vector<uint32_t> *blob, IdResultType idResultType, IdResult idResult, IdRef x);
void WriteIsInf(std::vector<uint32_t> *blob, IdResultType idResultType, IdResult idResult, IdRef x);
void WriteLogicalEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteLogicalNotEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteLogicalOr(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteLogicalAnd(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteLogicalNot(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand);
void WriteSelect(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef condition,
IdRef object1,
IdRef object2);
void WriteIEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteINotEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteUGreaterThan(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteSGreaterThan(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteUGreaterThanEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteSGreaterThanEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteULessThan(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteSLessThan(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteULessThanEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteSLessThanEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFOrdEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFUnordEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFOrdNotEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFUnordNotEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFOrdLessThan(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFUnordLessThan(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFOrdGreaterThan(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFUnordGreaterThan(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFOrdLessThanEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFUnordLessThanEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFOrdGreaterThanEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteFUnordGreaterThanEqual(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteShiftRightLogical(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
IdRef shift);
void WriteShiftRightArithmetic(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
IdRef shift);
void WriteShiftLeftLogical(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
IdRef shift);
void WriteBitwiseOr(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteBitwiseXor(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteBitwiseAnd(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand1,
IdRef operand2);
void WriteNot(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef operand);
void WriteBitFieldInsert(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
IdRef insert,
IdRef offset,
IdRef count);
void WriteBitFieldSExtract(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
IdRef offset,
IdRef count);
void WriteBitFieldUExtract(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base,
IdRef offset,
IdRef count);
void WriteBitReverse(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base);
void WriteBitCount(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef base);
void WriteDPdx(std::vector<uint32_t> *blob, IdResultType idResultType, IdResult idResult, IdRef p);
void WriteDPdy(std::vector<uint32_t> *blob, IdResultType idResultType, IdResult idResult, IdRef p);
void WriteFwidth(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef p);
void WriteDPdxFine(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef p);
void WriteDPdyFine(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef p);
void WriteFwidthFine(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef p);
void WriteDPdxCoarse(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef p);
void WriteDPdyCoarse(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef p);
void WriteFwidthCoarse(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef p);
void WriteEmitVertex(std::vector<uint32_t> *blob);
void WriteEndPrimitive(std::vector<uint32_t> *blob);
void WriteEmitStreamVertex(std::vector<uint32_t> *blob, IdRef stream);
void WriteEndStreamPrimitive(std::vector<uint32_t> *blob, IdRef stream);
void WriteControlBarrier(std::vector<uint32_t> *blob,
IdScope execution,
IdScope memory,
IdMemorySemantics semantics);
void WriteMemoryBarrier(std::vector<uint32_t> *blob, IdScope memory, IdMemorySemantics semantics);
void WriteAtomicLoad(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics);
void WriteAtomicStore(std::vector<uint32_t> *blob,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicExchange(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicCompareExchange(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics equal,
IdMemorySemantics unequal,
IdRef value,
IdRef comparator);
void WriteAtomicIIncrement(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics);
void WriteAtomicIDecrement(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics);
void WriteAtomicIAdd(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicISub(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicSMin(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicUMin(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicSMax(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicUMax(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicAnd(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicOr(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WriteAtomicXor(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef pointer,
IdScope scope,
IdMemorySemantics semantics,
IdRef value);
void WritePhi(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
const PairIdRefIdRefList &variableParentPairList);
void WriteLoopMerge(std::vector<uint32_t> *blob,
IdRef mergeBlock,
IdRef continueTarget,
spv::LoopControlMask loopControl);
void WriteSelectionMerge(std::vector<uint32_t> *blob,
IdRef mergeBlock,
spv::SelectionControlMask selectionControl);
void WriteLabel(std::vector<uint32_t> *blob, IdResult idResult);
void WriteBranch(std::vector<uint32_t> *blob, IdRef targetLabel);
void WriteBranchConditional(std::vector<uint32_t> *blob,
IdRef condition,
IdRef trueLabel,
IdRef falseLabel,
const LiteralIntegerList &branchweightsPairList);
void WriteSwitch(std::vector<uint32_t> *blob,
IdRef selector,
IdRef default_,
const PairLiteralIntegerIdRefList &targetPairList);
void WriteKill(std::vector<uint32_t> *blob);
void WriteReturn(std::vector<uint32_t> *blob);
void WriteReturnValue(std::vector<uint32_t> *blob, IdRef value);
void WriteUnreachable(std::vector<uint32_t> *blob);
void WriteGroupAll(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
IdRef predicate);
void WriteGroupAny(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
IdRef predicate);
void WriteGroupBroadcast(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
IdRef value,
IdRef localId);
void WriteGroupIAdd(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupFAdd(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupFMin(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupUMin(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupSMin(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupFMax(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupUMax(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupSMax(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteImageSparseSampleImplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseSampleExplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
spv::ImageOperandsMask imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseSampleDrefImplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseSampleDrefExplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseSampleProjImplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseSampleProjExplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
spv::ImageOperandsMask imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseSampleProjDrefImplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseSampleProjDrefExplicitLod(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseFetch(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef image,
IdRef coordinate,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseGather(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef component,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseDrefGather(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef sampledImage,
IdRef coordinate,
IdRef dref,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteImageSparseTexelsResident(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef residentCode);
void WriteNoLine(std::vector<uint32_t> *blob);
void WriteImageSparseRead(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdRef image,
IdRef coordinate,
spv::ImageOperandsMask *imageOperands,
const IdRefList &imageOperandIdsList);
void WriteGroupIAddNonUniformAMD(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupFAddNonUniformAMD(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupFMinNonUniformAMD(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupUMinNonUniformAMD(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupSMinNonUniformAMD(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupFMaxNonUniformAMD(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupUMaxNonUniformAMD(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
void WriteGroupSMaxNonUniformAMD(std::vector<uint32_t> *blob,
IdResultType idResultType,
IdResult idResult,
IdScope execution,
spv::GroupOperation operation,
IdRef x);
} // namespace spirv
} // namespace angle
#endif // COMMON_SPIRV_SPIRVINSTRUCTIONBUILDERAUTOGEN_H_
This source diff could not be displayed because it is too large. You can view the blob instead.
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_spirv_builder_and_parser.py using data from spirv.core.grammar.json.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// spirv_instruction_parser_autogen.h:
// Functions to parse SPIR-V binary for each instruction.
#ifndef COMMON_SPIRV_SPIRVINSTRUCTIONPARSERAUTOGEN_H_
#define COMMON_SPIRV_SPIRVINSTRUCTIONPARSERAUTOGEN_H_
#include <vector>
#include "spirv_types.h"
namespace angle
{
namespace spirv
{
void GetInstructionOpAndLength(const uint32_t *_instruction, spv::Op *opOut, uint32_t *lengthOut);
void ParseUndef(const uint32_t *_instruction, IdResultType *idResultType, IdResult *idResult);
void ParseSourceContinued(const uint32_t *_instruction, LiteralString *continuedSource);
void ParseSource(const uint32_t *_instruction,
spv::SourceLanguage *sourceLanguage,
LiteralInteger *version,
IdRef *file,
LiteralString *source);
void ParseSourceExtension(const uint32_t *_instruction, LiteralString *extension);
void ParseName(const uint32_t *_instruction, IdRef *target, LiteralString *name);
void ParseMemberName(const uint32_t *_instruction,
IdRef *type,
LiteralInteger *member,
LiteralString *name);
void ParseString(const uint32_t *_instruction, IdResult *idResult, LiteralString *string);
void ParseLine(const uint32_t *_instruction,
IdRef *file,
LiteralInteger *line,
LiteralInteger *column);
void ParseExtension(const uint32_t *_instruction, LiteralString *name);
void ParseExtInstImport(const uint32_t *_instruction, IdResult *idResult, LiteralString *name);
void ParseExtInst(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *set,
LiteralExtInstInteger *instruction,
IdRefList *operandList);
void ParseMemoryModel(const uint32_t *_instruction,
spv::AddressingModel *addressingModel,
spv::MemoryModel *memoryModel);
void ParseEntryPoint(const uint32_t *_instruction,
spv::ExecutionModel *executionModel,
IdRef *entryPoint,
LiteralString *name,
IdRefList *interfaceList);
void ParseExecutionMode(const uint32_t *_instruction, IdRef *entryPoint, spv::ExecutionMode *mode);
void ParseCapability(const uint32_t *_instruction, spv::Capability *capability);
void ParseTypeVoid(const uint32_t *_instruction, IdResult *idResult);
void ParseTypeBool(const uint32_t *_instruction, IdResult *idResult);
void ParseTypeInt(const uint32_t *_instruction,
IdResult *idResult,
LiteralInteger *width,
LiteralInteger *signedness);
void ParseTypeFloat(const uint32_t *_instruction, IdResult *idResult, LiteralInteger *width);
void ParseTypeVector(const uint32_t *_instruction,
IdResult *idResult,
IdRef *componentType,
LiteralInteger *componentCount);
void ParseTypeMatrix(const uint32_t *_instruction,
IdResult *idResult,
IdRef *columnType,
LiteralInteger *columnCount);
void ParseTypeImage(const uint32_t *_instruction,
IdResult *idResult,
IdRef *sampledType,
spv::Dim *dim,
LiteralInteger *depth,
LiteralInteger *arrayed,
LiteralInteger *mS,
LiteralInteger *sampled,
spv::ImageFormat *imageFormat,
spv::AccessQualifier *accessQualifier);
void ParseTypeSampler(const uint32_t *_instruction, IdResult *idResult);
void ParseTypeSampledImage(const uint32_t *_instruction, IdResult *idResult, IdRef *imageType);
void ParseTypeArray(const uint32_t *_instruction,
IdResult *idResult,
IdRef *elementType,
IdRef *length);
void ParseTypeRuntimeArray(const uint32_t *_instruction, IdResult *idResult, IdRef *elementType);
void ParseTypeStruct(const uint32_t *_instruction, IdResult *idResult, IdRefList *memberList);
void ParseTypePointer(const uint32_t *_instruction,
IdResult *idResult,
spv::StorageClass *storageClass,
IdRef *type);
void ParseTypeFunction(const uint32_t *_instruction,
IdResult *idResult,
IdRef *returnType,
IdRefList *parameterList);
void ParseTypeForwardPointer(const uint32_t *_instruction,
IdRef *pointerType,
spv::StorageClass *storageClass);
void ParseConstantTrue(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult);
void ParseConstantFalse(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult);
void ParseConstant(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
LiteralContextDependentNumber *value);
void ParseConstantComposite(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRefList *constituentsList);
void ParseConstantNull(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult);
void ParseSpecConstantTrue(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult);
void ParseSpecConstantFalse(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult);
void ParseSpecConstant(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
LiteralContextDependentNumber *value);
void ParseSpecConstantComposite(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRefList *constituentsList);
void ParseFunction(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
spv::FunctionControlMask *functionControl,
IdRef *functionType);
void ParseFunctionParameter(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult);
void ParseFunctionCall(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *function,
IdRefList *argumentList);
void ParseVariable(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
spv::StorageClass *storageClass,
IdRef *initializer);
void ParseImageTexelPointer(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *image,
IdRef *coordinate,
IdRef *sample);
void ParseLoad(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
spv::MemoryAccessMask *memoryAccess);
void ParseStore(const uint32_t *_instruction,
IdRef *pointer,
IdRef *object,
spv::MemoryAccessMask *memoryAccess);
void ParseCopyMemory(const uint32_t *_instruction,
IdRef *target,
IdRef *source,
spv::MemoryAccessMask *memoryAccess);
void ParseCopyMemorySized(const uint32_t *_instruction,
IdRef *target,
IdRef *source,
IdRef *size,
spv::MemoryAccessMask *memoryAccess);
void ParseAccessChain(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRefList *indexesList);
void ParseInBoundsAccessChain(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRefList *indexesList);
void ParseArrayLength(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *structure,
LiteralInteger *arraymember);
void ParseInBoundsPtrAccessChain(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRef *element,
IdRefList *indexesList);
void ParseDecorate(const uint32_t *_instruction,
IdRef *target,
spv::Decoration *decoration,
LiteralIntegerList *valuesPairList);
void ParseMemberDecorate(const uint32_t *_instruction,
IdRef *structureType,
LiteralInteger *member,
spv::Decoration *decoration,
LiteralIntegerList *valuesPairList);
void ParseDecorationGroup(const uint32_t *_instruction, IdResult *idResult);
void ParseGroupDecorate(const uint32_t *_instruction,
IdRef *decorationGroup,
IdRefList *targetsList);
void ParseGroupMemberDecorate(const uint32_t *_instruction,
IdRef *decorationGroup,
PairIdRefLiteralIntegerList *targetsPairList);
void ParseVectorExtractDynamic(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector,
IdRef *index);
void ParseVectorInsertDynamic(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector,
IdRef *component,
IdRef *index);
void ParseVectorShuffle(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector1,
IdRef *vector2,
LiteralIntegerList *componentsPairList);
void ParseCompositeConstruct(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRefList *constituentsList);
void ParseCompositeExtract(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *composite,
LiteralIntegerList *indexesPairList);
void ParseCompositeInsert(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *object,
IdRef *composite,
LiteralIntegerList *indexesPairList);
void ParseCopyObject(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand);
void ParseTranspose(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *matrix);
void ParseSampledImage(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *image,
IdRef *sampler);
void ParseImageSampleImplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSampleExplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSampleDrefImplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSampleDrefExplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSampleProjImplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSampleProjExplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSampleProjDrefImplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSampleProjDrefExplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageFetch(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *image,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageGather(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *component,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageDrefGather(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageRead(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *image,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageWrite(const uint32_t *_instruction,
IdRef *image,
IdRef *coordinate,
IdRef *texel,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImage(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage);
void ParseImageQueryLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate);
void ParseConvertFToU(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *floatValue);
void ParseConvertFToS(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *floatValue);
void ParseConvertSToF(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *signedValue);
void ParseConvertUToF(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *unsignedValue);
void ParseUConvert(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *unsignedValue);
void ParseSConvert(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *signedValue);
void ParseFConvert(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *floatValue);
void ParseQuantizeToF16(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *value);
void ParseConvertPtrToU(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer);
void ParseConvertUToPtr(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *integerValue);
void ParseBitcast(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand);
void ParseSNegate(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand);
void ParseFNegate(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand);
void ParseIAdd(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFAdd(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseISub(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFSub(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseIMul(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFMul(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseUDiv(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseSDiv(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFDiv(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseUMod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseSRem(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseSMod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFRem(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFMod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseVectorTimesScalar(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector,
IdRef *scalar);
void ParseMatrixTimesScalar(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *matrix,
IdRef *scalar);
void ParseVectorTimesMatrix(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector,
IdRef *matrix);
void ParseMatrixTimesVector(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *matrix,
IdRef *vector);
void ParseMatrixTimesMatrix(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *leftMatrix,
IdRef *rightMatrix);
void ParseOuterProduct(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector1,
IdRef *vector2);
void ParseDot(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector1,
IdRef *vector2);
void ParseIAddCarry(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseISubBorrow(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseUMulExtended(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseSMulExtended(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseAny(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector);
void ParseAll(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *vector);
void ParseIsNan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *x);
void ParseIsInf(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *x);
void ParseLogicalEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseLogicalNotEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseLogicalOr(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseLogicalAnd(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseLogicalNot(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand);
void ParseSelect(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *condition,
IdRef *object1,
IdRef *object2);
void ParseIEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseINotEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseUGreaterThan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseSGreaterThan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseUGreaterThanEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseSGreaterThanEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseULessThan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseSLessThan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseULessThanEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseSLessThanEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFOrdEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFUnordEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFOrdNotEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFUnordNotEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFOrdLessThan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFUnordLessThan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFOrdGreaterThan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFUnordGreaterThan(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFOrdLessThanEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFUnordLessThanEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFOrdGreaterThanEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseFUnordGreaterThanEqual(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseShiftRightLogical(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRef *shift);
void ParseShiftRightArithmetic(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRef *shift);
void ParseShiftLeftLogical(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRef *shift);
void ParseBitwiseOr(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseBitwiseXor(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseBitwiseAnd(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand1,
IdRef *operand2);
void ParseNot(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *operand);
void ParseBitFieldInsert(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRef *insert,
IdRef *offset,
IdRef *count);
void ParseBitFieldSExtract(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRef *offset,
IdRef *count);
void ParseBitFieldUExtract(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base,
IdRef *offset,
IdRef *count);
void ParseBitReverse(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base);
void ParseBitCount(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *base);
void ParseDPdx(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseDPdy(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseFwidth(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseDPdxFine(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseDPdyFine(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseFwidthFine(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseDPdxCoarse(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseDPdyCoarse(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseFwidthCoarse(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *p);
void ParseEmitStreamVertex(const uint32_t *_instruction, IdRef *stream);
void ParseEndStreamPrimitive(const uint32_t *_instruction, IdRef *stream);
void ParseControlBarrier(const uint32_t *_instruction,
IdScope *execution,
IdScope *memory,
IdMemorySemantics *semantics);
void ParseMemoryBarrier(const uint32_t *_instruction,
IdScope *memory,
IdMemorySemantics *semantics);
void ParseAtomicLoad(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics);
void ParseAtomicStore(const uint32_t *_instruction,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicExchange(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicCompareExchange(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *equal,
IdMemorySemantics *unequal,
IdRef *value,
IdRef *comparator);
void ParseAtomicIIncrement(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics);
void ParseAtomicIDecrement(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics);
void ParseAtomicIAdd(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicISub(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicSMin(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicUMin(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicSMax(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicUMax(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicAnd(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicOr(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParseAtomicXor(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *pointer,
IdScope *scope,
IdMemorySemantics *semantics,
IdRef *value);
void ParsePhi(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
PairIdRefIdRefList *variableParentPairList);
void ParseLoopMerge(const uint32_t *_instruction,
IdRef *mergeBlock,
IdRef *continueTarget,
spv::LoopControlMask *loopControl);
void ParseSelectionMerge(const uint32_t *_instruction,
IdRef *mergeBlock,
spv::SelectionControlMask *selectionControl);
void ParseLabel(const uint32_t *_instruction, IdResult *idResult);
void ParseBranch(const uint32_t *_instruction, IdRef *targetLabel);
void ParseBranchConditional(const uint32_t *_instruction,
IdRef *condition,
IdRef *trueLabel,
IdRef *falseLabel,
LiteralIntegerList *branchweightsPairList);
void ParseSwitch(const uint32_t *_instruction,
IdRef *selector,
IdRef *default_,
PairLiteralIntegerIdRefList *targetPairList);
void ParseReturnValue(const uint32_t *_instruction, IdRef *value);
void ParseGroupAll(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
IdRef *predicate);
void ParseGroupAny(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
IdRef *predicate);
void ParseGroupBroadcast(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
IdRef *value,
IdRef *localId);
void ParseGroupIAdd(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupFAdd(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupFMin(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupUMin(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupSMin(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupFMax(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupUMax(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupSMax(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseImageSparseSampleImplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseSampleExplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseSampleDrefImplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseSampleDrefExplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseSampleProjImplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseSampleProjExplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseSampleProjDrefImplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseSampleProjDrefExplicitLod(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseFetch(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *image,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseGather(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *component,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseDrefGather(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *sampledImage,
IdRef *coordinate,
IdRef *dref,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseImageSparseTexelsResident(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *residentCode);
void ParseImageSparseRead(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdRef *image,
IdRef *coordinate,
spv::ImageOperandsMask *imageOperands,
IdRefList *imageOperandIdsList);
void ParseGroupIAddNonUniformAMD(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupFAddNonUniformAMD(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupFMinNonUniformAMD(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupUMinNonUniformAMD(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupSMinNonUniformAMD(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupFMaxNonUniformAMD(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupUMaxNonUniformAMD(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
void ParseGroupSMaxNonUniformAMD(const uint32_t *_instruction,
IdResultType *idResultType,
IdResult *idResult,
IdScope *execution,
spv::GroupOperation *operation,
IdRef *x);
} // namespace spirv
} // namespace angle
#endif // COMMON_SPIRV_SPIRVINSTRUCTIONPARSERAUTOGEN_H_
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// spirv_types.h:
// Strong types for SPIR-V Ids to prevent mistakes when using the builder and parser APIs.
//
#ifndef COMMON_SPIRV_TYPES_H_
#define COMMON_SPIRV_TYPES_H_
#include <spirv/unified1/spirv.hpp>
#include "common/FastVector.h"
namespace angle
{
namespace spirv
{
template <typename Helper>
class BoxedUint32
{
public:
BoxedUint32() : mValue{0} {}
explicit BoxedUint32(uint32_t value) : mValue{value} {}
template <typename T>
T as() const
{
return T{mValue};
}
BoxedUint32(const BoxedUint32 &other) = default;
BoxedUint32 &operator=(const BoxedUint32 &other) = default;
operator uint32_t() const { return mValue.value; }
bool operator==(const BoxedUint32 &other) const { return mValue.value == other.mValue.value; }
// Applicable to ids, which cannot be 0.
bool valid() const { return static_cast<bool>(mValue.value); }
private:
Helper mValue;
};
struct IdRefHelper
{
spv::Id value;
};
struct LiteralIntegerHelper
{
uint32_t value;
};
using IdRef = BoxedUint32<IdRefHelper>;
// IdResult, IdResultType, IdMemorySemantics and IdScope are all translated as IdRef. This makes
// the type verification weaker, but stops the API from becoming tediously verbose.
using IdResult = IdRef;
using IdResultType = IdRef;
using IdMemorySemantics = IdRef;
using IdScope = IdRef;
using LiteralInteger = BoxedUint32<LiteralIntegerHelper>;
using LiteralString = const char *;
// Note: In ANGLE's use cases, all literals fit in 32 bits.
using LiteralContextDependentNumber = LiteralInteger;
// TODO(syoussefi): To be made stronger when generating SPIR-V from the translator.
// http://anglebug.com/4889
using LiteralExtInstInteger = LiteralInteger;
struct PairLiteralIntegerIdRef
{
LiteralInteger literal;
IdRef id;
};
struct PairIdRefLiteralInteger
{
IdRef id;
LiteralInteger literal;
};
struct PairIdRefIdRef
{
IdRef id1;
IdRef id2;
};
// Some instructions need 4 components. The drivers uniform struct in ANGLE has 8 fields. A value
// of 8 means almost no instruction would end up making dynamic allocations. Notable exceptions are
// user-defined structs/blocks and OpEntryPoint.
constexpr size_t kFastVectorSize = 8;
template <typename T>
using FastVectorHelper = angle::FastVector<T, kFastVectorSize>;
using IdRefList = FastVectorHelper<IdRef>;
using LiteralIntegerList = FastVectorHelper<LiteralInteger>;
using PairLiteralIntegerIdRefList = FastVectorHelper<PairLiteralIntegerIdRef>;
using PairIdRefLiteralIntegerList = FastVectorHelper<PairIdRefLiteralInteger>;
using PairIdRefIdRefList = FastVectorHelper<PairIdRefIdRef>;
} // namespace spirv
} // namespace angle
#endif // COMMON_SPIRV_TYPES_H_
This source diff could not be displayed because it is too large. You can view the blob instead.
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