浏览代码

Update kong

luboslenco 3 月之前
父节点
当前提交
a268585298
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      base/sources/libs/kong/backends/spirv.c

+ 3 - 1
base/sources/libs/kong/backends/spirv.c

@@ -449,8 +449,10 @@ static spirv_id allocate_index(void) {
 
 static uint16_t write_string(uint32_t *operands, const char *string) {
 	uint16_t length = (uint16_t)strlen(string);
+	uint16_t word_count = (length + 1) / 4 + 1;
+	operands[word_count - 1] = 0;
 	memcpy(&operands[0], string, length + 1);
-	return (length + 1) / 4 + 1;
+	return word_count;
 }
 
 static spirv_id write_op_ext_inst_import(instructions_buffer *instructions, const char *name) {