SPIRV: Add more utility functions to build some opcodes (#2398)
authorRex Xu <rex.xu@amd.com>
Fri, 18 Sep 2020 13:18:35 +0000 (21:18 +0800)
committerGitHub <noreply@github.com>
Fri, 18 Sep 2020 13:18:35 +0000 (07:18 -0600)
commit4dcc12d1a441b29d5901bc708bb1343d29d6459f
tree01fe81b2f23daf1404dd20eb272344a83bbbdc34
parent9eaa69c21c45c173b6ab9aacef271ab0e7c083bf
SPIRV: Add more utility functions to build some opcodes (#2398)

Add more builder functions to OpExecutionMode, OpExecutionModeId,
OpDecorateString, OpMemberDecorateString.

According to SPIR-V, OpExecutionMode and OpExecutionModeId could
take variable extra operands. Current implementation doesn't support
this and assumes at most 3 operands are extra operands. It is not
true. Similarly, OpDecorateString and OpMemberDecorateString could
support multiple strings either as literal strings or as string
operands. Further, OpDecorate and OpDecorateId have the same problem,
taking variable extra operands.
SPIRV/SpvBuilder.cpp
SPIRV/SpvBuilder.h