Skip to content

Conversation

@afishhh
Copy link
Owner

@afishhh afishhh commented May 10, 2025

Adds a functional C API for creating a rasterize::wgpu::Rasterizer from handles obtained via the Vulkan API, along with the ability to query what extensions/features the rasterizer requires.

This does indeed work which is demonstrated in the new examples/c_glfw_vulkan example which uses GLFW to create a window, manually creates all required Vulkan objects and finally an sbr_vk_rasterizer.

TODO:

  • Add some documentation
  • There is actually one change that was necessary in wgpu-hal to make this work: https://github.com/afishhh/wgpu/tree/public_physical_device_features, the PhysicalDeviceFeatures structure is required to be able to tell what device features and extensions are necessary but it is private even though it's returned in a public function! I assume this is a mistake and will make an issue/PR to wgpu soon™.
  • Implement synchronization in the example.
  • Add functions for destroying the sbr_vk_* objects since currently you're forced to leak them.
  • Figure out how to handle the case when the library is compiled without the wgpu feature. Should these functions be stubbed out? Is there another way of doing things without making using the API significantly more annoying?

@afishhh afishhh force-pushed the c_vk branch 5 times, most recently from 6be7b32 to 6970a24 Compare May 15, 2025 16:39
@afishhh afishhh force-pushed the c_vk branch 3 times, most recently from 8ece5e8 to 34bc2d9 Compare May 26, 2025 13:40
@afishhh afishhh mentioned this pull request Jul 20, 2025
@afishhh afishhh force-pushed the c_vk branch 2 times, most recently from 2ac2dd0 to 12e8133 Compare July 20, 2025 14:43
@afishhh
Copy link
Owner Author

afishhh commented Dec 6, 2025

This is on-hold pending a GPU-acceleration rework in subrandr. The API will probably be changed as I think this may not actually be what we actually want (need to learn Vulkan to know :)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant