${spirv-tools_SOURCE_DIR}
COMMENT "Update build-version.inc in the Spirv-tools build directory (if necessary).")
-add_custom_target(spirv-tools-build-tables
- ${PYTHON_EXECUTABLE}
- ${CMAKE_CURRENT_SOURCE_DIR}/utils/generate_grammar_tables.py
- --spirv-core-grammar=${spirv-tools_SOURCE_DIR}/source/spirv.core.grammar.json
- --extinst-glsl-grammar=${spirv-tools_SOURCE_DIR}/source/extinst.glsl.std.450.grammar.json
- --extinst-opencl-grammar=${spirv-tools_SOURCE_DIR}/source/extinst.opencl.std.grammar.json
- --core-insts-output=${spirv-tools_BINARY_DIR}/core.insts.inc
- --glsl-insts-output=${spirv-tools_BINARY_DIR}/glsl.std.450.insts.inc
- --opencl-insts-output=${spirv-tools_BINARY_DIR}/opencl.std.insts.inc
- --operand-kinds-output=${spirv-tools_BINARY_DIR}/operand.kinds.inc
- COMMENT "Generate info tables for SPIR-V instructions and operands.")
+function(spvtools_tables VERSION)
+ add_custom_target(spirv-tools-build-tables-${VERSION}
+ ${PYTHON_EXECUTABLE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/utils/generate_grammar_tables.py
+ --spirv-core-grammar=${spirv-tools_SOURCE_DIR}/source/spirv-${VERSION}.core.grammar.json
+ --extinst-glsl-grammar=${spirv-tools_SOURCE_DIR}/source/extinst-${VERSION}.glsl.std.450.grammar.json
+ --extinst-opencl-grammar=${spirv-tools_SOURCE_DIR}/source/extinst-${VERSION}.opencl.std.grammar.json
+ --core-insts-output=${spirv-tools_BINARY_DIR}/core.insts-${VERSION}.inc
+ --glsl-insts-output=${spirv-tools_BINARY_DIR}/glsl.std.450.insts-${VERSION}.inc
+ --opencl-insts-output=${spirv-tools_BINARY_DIR}/opencl.std.insts-${VERSION}.inc
+ --operand-kinds-output=${spirv-tools_BINARY_DIR}/operand.kinds-${VERSION}.inc
+ COMMENT "Generate info tables for SPIR-V-${VERSION} instructions and operands.")
+endfunction(spvtools_tables)
+
+spvtools_tables("1-0")
# Defaults to OFF if the user didn't set it.
option(SPIRV_SKIP_EXECUTABLES
PUBLIC ${spirv-tools_SOURCE_DIR}/include
PRIVATE ${spirv-tools_BINARY_DIR}
)
-add_dependencies(${SPIRV_TOOLS} spirv-tools-build-tables)
+add_dependencies(${SPIRV_TOOLS} spirv-tools-build-tables-1-0)
install(TARGETS ${SPIRV_TOOLS}
RUNTIME DESTINATION bin
#include "spirv_definition.h"
static const spv_ext_inst_desc_t glslStd450Entries[] = {
-#include "glsl.std.450.insts.inc"
+#include "glsl.std.450.insts-1-0.inc"
};
static const spv_ext_inst_desc_t openclEntries[] = {
-#include "opencl.std.insts.inc"
+#include "opencl.std.insts-1-0.inc"
};
spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable) {
// TODO(dneto): Some of the macros are quite unreadable. We could make
// good use of constexpr functions, but some compilers don't support that yet.
const spv_opcode_desc_t opcodeTableEntries[] = {
-#include "core.insts.inc"
+#include "core.insts-1-0.inc"
};
} // anonymous namespace
#define ARRAY_SIZE(A) (static_cast<uint32_t>(sizeof(A) / sizeof(A[0])))
// Pull in operand info tables automatically generated from JSON grammar.
-#include "operand.kinds.inc"
+#include "operand.kinds-1-0.inc"
spv_result_t spvOperandTableGet(spv_operand_table* pOperandTable) {
if (!pOperandTable) return SPV_ERROR_INVALID_POINTER;