Closed Danielmelody closed 4 years ago
I've changed how spvm_state_prepare
works and forgot to update README and example.c
...
It should now be:
spvm_word fnMain = spvm_state_get_result_location(state, "main");
spvm_state_prepare(state, fnMain);
Thanks for reporting!
BTW, any plans for unit tests?
I 'm interesting on using your project, but I 'm not sure it is still in an early stage or full featured.
Honestly, unit tests aren't on my TODO list right now but SPIRV-VM has most of the instructions implemented (except some OpImage* and compute shader related instructions). You can check the list of instructions that don't have an implementation here: OPCODES.txt.
BTW, may I know what you would use SPIRV-VM for? Just curious 😊
Well, I 'm developing a DSL targeting SPIR-V, and I 'm interesting on debugging and validating my compiler by this vm. I 've googled an found this is the only SPIR-V vm in the world. I 'd be very appreciate if you can make this project more serious, like, for example, well tested.
Both in README.md and example.c, I found this code strange:
where fnMain is a pointer, but
spvm_state_prepare
declares aswhich makes
state->results[fnLocation]
accessed an invalid memory.If I change the call to
I got
However from the source examples/shader.glsl, this is incorrect.
What did I do wrong? or there is a bug here?