Octachron / olivine

Ocaml binding generator for vulkan
40 stars 2 forks source link

two errors running make, including unbound module Vk_const #6

Closed tari3x closed 4 years ago

tari3x commented 4 years ago

I ran make twice, each time it failed differently, output below.

> make 
dune build generator/libgen.exe \
&& mv _build/default/generator/libgen.exe bin/libgen
File "info/cxml_parser.mly", line 17, characters 11-14:
Warning: the token AND is unused.
File "info/cxml_parser.mly", line 13, characters 13-17:
Warning: the token BANG is unused.
File "info/cxml_parser.mly", line 14, characters 18-21:
Warning: the token DOT is unused.
File "info/cxml_parser.mly", line 3, characters 13-18:
Warning: the token EQUAL is unused.
File "info/cxml_parser.mly", line 16, characters 15-22:
Warning: the token GREATER is unused.
File "info/cxml_parser.mly", line 13, characters 7-11:
Warning: the token HASH is unused.
File "info/cxml_parser.mly", line 13, characters 19-24:
Warning: the token HHASH is unused.
File "info/cxml_parser.mly", line 4, characters 17-23:
Warning: the token LBRACE is unused.
File "info/cxml_parser.mly", line 16, characters 7-13:
Warning: the token LESSER is unused.
File "info/cxml_parser.mly", line 16, characters 24-30:
Warning: the token LSHIFT is unused.
File "info/cxml_parser.mly", line 11, characters 15-20:
Warning: the token MACRO is unused.
File "info/cxml_parser.mly", line 15, characters 7-9:
Warning: the token NL is unused.
File "info/cxml_parser.mly", line 17, characters 7-9:
Warning: the token OR is unused.
File "info/cxml_parser.mly", line 3, characters 20-24:
Warning: the token PLUS is unused.
File "info/cxml_parser.mly", line 4, characters 24-30:
Warning: the token RBRACE is unused.
File "info/cxml_parser.mly", line 16, characters 32-38:
Warning: the token RSHIFT is unused.
File "info/cxml_parser.mly", line 14, characters 13-17:
Warning: the token SEMI is unused.
File "info/cxml_parser.mly", line 3, characters 33-38:
Warning: the token SLASH is unused.
File "info/cxml_parser.mly", line 9, characters 15-21:
Warning: the token STRING is unused.
File "info/cxml_parser.mly", line 2, characters 21-26:
Warning: the token UNION is unused.
File "info/cxml_parser.mly", line 17, characters 28-31:
Warning: the token XOR is unused.
File "info/cxml_parser.mly", line 22, characters 0-5:
Warning: the precedence level assigned to AND is never useful.
File "info/cxml_parser.mly", line 21, characters 0-5:
Warning: the precedence level assigned to LSHIFT is never useful.
File "info/cxml_parser.mly", line 22, characters 0-5:
Warning: the precedence level assigned to OR is never useful.
File "info/cxml_parser.mly", line 20, characters 0-5:
Warning: the precedence level assigned to PLUS is never useful.
File "info/cxml_parser.mly", line 21, characters 0-5:
Warning: the precedence level assigned to RSHIFT is never useful.
File "info/cxml_parser.mly", line 22, characters 0-5:
Warning: the precedence level assigned to XOR is never useful.
Warning: one state has reduce/reduce conflicts.
Warning: 3 reduce/reduce conflicts were arbitrarily resolved.
Warning: 4 states have an end-of-stream conflict.
Done: 216/217 (jobs: 1)./bin/libgen spec/vk.xml lib
Debug:latex, \textrm{codeSize} \over 4
Debug:tokenized, \textrm { "codeSize" } / "4" eof
Debug:parsed, \over{\textrm{{codeSize}},4}
Debug:latex, \lceil{\mathit{rasterizationSamples} \over 32}\rceil
Debug:tokenized, ⌈ { \mathit { "rasterizationSamples" } / "32" } ⌉ eof
Debug:parsed, \ceil{{{\over{\mathit{{rasterizationSamples}},32}}}}
Not found: VkSemaphoreCreateFlagBits
Lost item vkGetBufferDeviceAddressEXT
Lost item vkBindAccelerationStructureMemoryNV
Lost item vkCmdWriteAccelerationStructuresPropertiesNV
Lost item vkDestroyAccelerationStructureNV
Lost item vkGetRayTracingShaderGroupHandlesNV
Builtin type: {::Bool_32::}
Builtin type: {::bool_32::}
Builtin type: {::cametallayer::}
Builtin type: {::double::}
Builtin type: {::float::}
Builtin type: {::int::}
Builtin type: {::int_32_t::}
Builtin type: {::int_64_t::}
Builtin type: {::size_t::}
Builtin type: {::uint_16_t::}
Builtin type: {::uint_32_t::}
Builtin type: {::uint_64_t::}
Builtin type: {::uint_8_t::}
Builtin type: {::void::}
Alias {::a_hardware_buffer::}
Builtin type: {::Bool_32::}
Builtin type: {::bool_32::}
Builtin type: {::cametallayer::}
Builtin type: {::double::}
Builtin type: {::float::}
Builtin type: {::int::}
Builtin type: {::int_32_t::}
Builtin type: {::int_64_t::}
Builtin type: {::size_t::}
Builtin type: {::uint_16_t::}
Builtin type: {::uint_32_t::}
Builtin type: {::uint_64_t::}
Builtin type: {::uint_8_t::}
Builtin type: {::void::}
Alias {::a_native_window::}
Builtin type: {::Bool_32::}
Builtin type: {::bool_32::}
Builtin type: {::cametallayer::}
Builtin type: {::double::}
Builtin type: {::float::}
Builtin type: {::int::}
Builtin type: {::int_32_t::}
Builtin type: {::int_64_t::}
Builtin type: {::size_t::}
Builtin type: {::uint_16_t::}
Builtin type: {::uint_32_t::}
Builtin type: {::uint_64_t::}
Builtin type: {::uint_8_t::}
Builtin type: {::void::}
Alias {::device_address::}
Builtin type: {::Bool_32::}
Builtin type: {::bool_32::}
Builtin type: {::cametallayer::}
Builtin type: {::double::}
Builtin type: {::float::}
Builtin type: {::int::}
Builtin type: {::int_32_t::}
Builtin type: {::int_64_t::}
Builtin type: {::size_t::}
Builtin type: {::uint_16_t::}
Builtin type: {::uint_32_t::}
Builtin type: {::uint_64_t::}
Builtin type: {::uint_8_t::}
Builtin type: {::void::}
Alias {::device_size::}
Builtin type: {::Bool_32::}
Builtin type: {::bool_32::}
Builtin type: {::cametallayer::}
Builtin type: {::double::}
Builtin type: {::float::}
Builtin type: {::int::}
Builtin type: {::int_32_t::}
Builtin type: {::int_64_t::}
Builtin type: {::size_t::}
Builtin type: {::uint_16_t::}
Builtin type: {::uint_32_t::}
Builtin type: {::uint_64_t::}
Builtin type: {::uint_8_t::}
Builtin type: {::void::}
Alias {::::flags}
Builtin type: {::Bool_32::}
Builtin type: {::bool_32::}
Builtin type: {::cametallayer::}
Builtin type: {::double::}
Builtin type: {::float::}
Builtin type: {::int::}
Builtin type: {::int_32_t::}
Builtin type: {::int_64_t::}
Builtin type: {::size_t::}
Builtin type: {::uint_16_t::}
Builtin type: {::uint_32_t::}
Builtin type: {::uint_64_t::}
Builtin type: {::uint_8_t::}
Builtin type: {::void::}
Alias {::sample_mask::}
Either.find: not found error_invalid_opaque_capture_address_khr
error_device_lost:-4
error_extension_not_present:-7
error_feature_not_present:-8
error_format_not_supported:-11
error_fragmentation:-1000161000
error_fragmented_pool:-12
error_full_screen_exclusive_mode_lost_ext:-1000255000
error_incompatible_display_khr:-1000003001
error_incompatible_driver:-9
error_incompatible_version_khr:-1000150000
error_initialization_failed:-3
error_invalid_drm_format_modifier_plane_layout_ext:-1000158000
error_invalid_external_handle:-1000072003
error_invalid_opaque_capture_address:-1000257000
error_invalid_shader_nv:-1000012000
error_layer_not_present:-6
error_memory_map_failed:-5
error_native_window_in_use_khr:-1000000001
error_not_permitted_ext:-1000174001
error_out_of_date_khr:-1000001004
error_out_of_device_memory:-2
error_out_of_host_memory:-1
error_out_of_pool_memory:-1000069000
error_surface_lost_khr:-1000000000
error_too_many_objects:-10
error_unknown:-13
error_validation_failed_ext:-1000011001
event_reset:4
event_set:3
incomplete:5
not_ready:1
operation_deferred_khr:1000268002
operation_not_deferred_khr:1000268003
pipeline_compile_required_ext:1000297000
suboptimal_khr:1000001003
success:0
thread_done_khr:1000268001
thread_idle_khr:1000268000
timeout:2

make: *** [Makefile:27: lib/vk.ml] Error 2
exit 2

> make 
cp lib_aux/*.ml lib
dune build @install
File "lib/vk__builtin__types.ml", line 62, characters 25-40:
62 |   let true' = U32.of_int Vk__Const.true'
                              ^^^^^^^^^^^^^^^
Error: Unbound module Vk__Const
File "lib/vk__extension_sig.ml", line 13, characters 4-33:
13 |     Vk__Core.get_device_proc_addr X.x name
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module Vk__Core
Done: 10202/13926 (jobs: 1)make: *** [Makefile:31: vk] Error 1
exit 2
Octachron commented 4 years ago

The triangle example should compile and "run" properly now. The other example needs fixing (and the handling of record extension is wrong)

tari3x commented 4 years ago

Thanks! bin/triangle got built, however when running I get

Fatal error: exception Dl.DL_error("/usr/lib64/libvulkan.so: undefined symbol: vkBindBufferMemory2")

Do you happen to know what vulkan version I need? My system got 1.0.65.

Octachron commented 4 years ago

This is a vulkan 1.1 function. The error is happening because post-1.0 functions are not protected by the functor mechanism used for extensions. I will fix the issue by adjusting the spec analyzer and code generator to be aware of those version-gated functions. Thanks for the report.

tari3x commented 4 years ago

Cool, thanks! I'll upgrade my system in the meantime, is nearing end of life anyway.

tari3x commented 4 years ago

Got newer vulkan, and triangle works! Thanks!

My goal is to evaluate a polynomial in each pixel and to draw a picture where the colour in each pixel represents the computed value. Do you expect any issues with that, or is the current API sufficient?

Octachron commented 4 years ago

It should work: it is a matter of setting the vertew buffer, a texture buffer, and an index buffer. The "tesseract" example does something similar. (It only doesn't work reliably currently because I cut some corners on synchronization when writing it for an APU laptop.)

Octachron commented 4 years ago

Also note, that the vulkan API is extremely front loaded: there is a lot of ceremony before doing anything even compared to modern openGL . And compared to openGL there is also lot of data types, thus this binding generator: a quick grep shows that olivine generate bindings for more than 1800 datatypes currently.

tari3x commented 4 years ago

Cool! I sent you an email regarding general vulkan help (hope you got it!), but I think this issues is resolved, I'll close it.

tari3x commented 4 years ago

It should work: it is a matter of setting the vertew buffer, a texture buffer, and an index buffer.

Curious, why would I need those? I kinda want to short-cut the whole rendering pipeline and just compute my pixels directly. Or does vulkan just not work like that?