realitix / vulkan

The ultimate Python binding for Vulkan API
Apache License 2.0
505 stars 46 forks source link

VkPipeline array type incorrect (compute example fails) #57

Closed pieper closed 10 months ago

pieper commented 5 years ago

(First - thanks for the cool package!).

Running the compute example fails with the trace below. I tried various fixes like ffi.new("VkPipeline*") etc but didn't find a way to fix it. I get the same behavior on linux and mac installations using either the pip package or installation from source.

It looks like this is related to #56.

$python example_mandelbrot_compute.py 
Traceback (most recent call last):
  File "example_mandelbrot_compute.py", line 562, in <module>
    app.run()
  File "example_mandelbrot_compute.py", line 134, in run
    self.createCommandBuffer()
  File "example_mandelbrot_compute.py", line 517, in createCommandBuffer
    vkCmdBindPipeline(self.__commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, self.__pipeline)
  File "/usr/local/lib/python2.7/dist-packages/vulkan-1.1.99.1-py2.7.egg/vulkan/_vulkan.py", line 6340, in vkCmdBindPipeline
    result = _callApi(lib.vkCmdBindPipeline, commandBuffer,pipelineBindPoint,pipeline)
  File "/usr/local/lib/python2.7/dist-packages/vulkan-1.1.99.1-py2.7.egg/vulkan/_vulkan.py", line 4962, in _callApi
    return fn(*fn_args)
TypeError: initializer for ctype 'struct VkPipeline_T *' must be a pointer to same type, not cdata 'struct VkPipeline_T *[1]'
Exception TypeError: "'NoneType' object is not callable" in <bound method ComputeApplication.__del__ of <__main__.ComputeApplication object at 0x7fa3387d3810>> ignored
realitix commented 5 years ago

Hello, Thanks for the report. Index I didn't updater the contrib tests. I will take a look.

pieper commented 5 years ago

Is there a version of the code in github or pypy that should work for the compute example?

realitix commented 5 years ago

You can try at this commit: https://github.com/realitix/vulkan/commit/6033845aa77d7d272e6d1be03f30b00fa1ac9c37

pieper commented 5 years ago

Yes, that one works - thanks!