mirror of
https://github.com/RPCSX/SPIRV-Tools.git
synced 2024-11-23 19:39:51 +00:00
Fix generation of Vim syntax file
This commit is contained in:
parent
4e4a254bc8
commit
886859159e
@ -66,7 +66,7 @@ macro(spvtools_vimsyntax VERSION CLVERSION)
|
||||
add_custom_command(OUTPUT ${VIMSYNTAX_FILE}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${VIMSYNTAX_PROCESSING_SCRIPT}
|
||||
--spirv-core-grammar=${GRAMMAR_JSON_FILE}
|
||||
--exinst-debuginfo-grammar=${DEBUGINFO_GRAMMAR_JSON_FILE}
|
||||
--extinst-debuginfo-grammar=${DEBUGINFO_GRAMMAR_JSON_FILE}
|
||||
--extinst-glsl-grammar=${GLSL_GRAMMAR_JSON_FILE}
|
||||
--extinst-opencl-grammar=${OPENCL_GRAMMAR_JSON_FILE}
|
||||
>${VIMSYNTAX_FILE}
|
||||
|
@ -150,6 +150,10 @@ def main():
|
||||
type=str, required=False, default=None,
|
||||
help='input JSON grammar file for OpenGL extended '
|
||||
'instruction set')
|
||||
parser.add_argument('--extinst-debuginfo-grammar', metavar='<path>',
|
||||
type=str, required=False, default=None,
|
||||
help='input JSON grammar file for DebugInfo extended '
|
||||
'instruction set')
|
||||
args = parser.parse_args()
|
||||
|
||||
# Generate the syntax rules.
|
||||
@ -179,6 +183,17 @@ def main():
|
||||
for inst in opencl["instructions"]:
|
||||
EmitAsEnumerant(inst['opname'])
|
||||
|
||||
if args.extinst_debuginfo_grammar is not None:
|
||||
print('\n" DebugInfo extended instructions')
|
||||
debuginfo = json.loads(open(args.extinst_debuginfo_grammar).read())
|
||||
for inst in debuginfo["instructions"]:
|
||||
EmitAsEnumerant(inst['opname'])
|
||||
print('\n" DebugInfo operand enums')
|
||||
for operand_kind in debuginfo["operand_kinds"]:
|
||||
if 'enumerants' in operand_kind:
|
||||
for e in operand_kind['enumerants']:
|
||||
EmitAsEnumerant(e['enumerant'])
|
||||
|
||||
print('\n" OpSpecConstantOp opcodes')
|
||||
for word in SPEC_CONSTANT_OP_OPCODES.split(' '):
|
||||
stripped = word.strip('\n,')
|
||||
|
Loading…
Reference in New Issue
Block a user