kbenzie/vim-spirv

Automatic disassembly/assembly of SPIR-V binary files can't be disabled

AlexeySachkov opened this issue · 2 comments

Hi,

There is an option g:spirv_enable_autodisassemble, but it is only used to enable/disable highlighting of IDs and OpExtImport errors when opening a binary SPIR-V files. Autocommands for assembly/disassembly binary SPIR-V files are added uncoditionally:

augroup spirv
" Remove all autocmds from the spirv group
autocmd!
" Set autocommands to disassemble SPIR-V binaries on load
autocmd BufReadPre,FileReadPre *.spv,*.spv32,*.spv64 setlocal bin
autocmd BufReadPost,FileReadPost *.spv,*.spv32,*.spv64 call spirv#disassemble()
" Set autocommands to assemble SPIR-V binaries on write
autocmd BufWriteCmd,FileWriteCmd *.spv,*.spv32,*.spv64 call spirv#assemble()
augroup END

This means that even if I set g:spirv_enable_autodisassemble = 0 I will still see the following error when opening a binary SPIR-V file:

spirv-dis failed
Error detected while processing BufRead Autocommands for "*.spv"..function spirv#disassemble:
line   13:
E484: Can't open file /tmp/vzQKVBI/1

I guess this is not an important issue, because with autodisassemble disabled I wouldn't open binary files anyway

Thanks for the bug report. This looks a lot like I've made a mistake, I'll look into it 😄

This should now be fixed.