vulkan-go / vulkan

Vulkan API bindings for Go programming language
MIT License
742 stars 55 forks source link

EnumerateInstanceLayerProperties not setting the go struct values to the C values #38

Closed kohlten closed 5 years ago

kohlten commented 5 years ago

So I am getting into vulkan using go and I am having some issues. When calling EnumerateInstanceLayerProperties it will return correctly, but the Go struct values are not correct. I can see internally that the internal values are correct however.

Screenshot from 2019-05-19 16-40-34

Here is my code: layerNames := make([]string, 1) layerNames[0] = "VK_LAYER_KHRONOS_validation" layerCount := uint32(0) vulkan.EnumerateInstanceLayerProperties(&layerCount, nil) layers := make([]vulkan.LayerProperties, layerCount) vulkan.EnumerateInstanceLayerProperties(&layerCount, layers)`

Thanks!

Noofbiz commented 5 years ago

You have to do layer.Deref() when you loop through the layers to make the go side get the updates from the C side, I believe. I had a similar issue at some point.

kohlten commented 5 years ago

Thank you that fixed it.