gfx-rs / portability

Vulkan Portability Implementation
Mozilla Public License 2.0
383 stars 25 forks source link

Require a tutorial demonstrate how to integrate this driver to Vulkan applications #171

Open shrinktofit opened 5 years ago

shrinktofit commented 5 years ago

I have successfully ran the LunarG/VulkanSmples according to readme. Next I wish to use it in my vulkan application but I don't know how to. I use lunarG SDK and it by default load my graphic card's vulkan driver.

kvark commented 5 years ago

Here are the steps:

  1. build libportability_icd, e.g. cd libportability_icd && cargo build --features metal
  2. make sure to have a good ICD definition. We have a few in-repo, e.g. portability-win-debug, and we want those for all configuration in the end. If there isn't one for your platform/config, just copy an existing one and modify the path, if needed.
  3. run your app with VULKAN_ICD_FILENAMES=<path_to_your_ICD.json>
shrinktofit commented 5 years ago

Here are the steps:

  1. build libportability_icd, e.g. cd libportability_icd && cargo build --features metal
  2. make sure to have a good ICD definition. We have a few in-repo, e.g. portability-win-debug, and we want those for all configuration in the end. If there isn't one for your platform/config, just copy an existing one and modify the path, if needed.
  3. run your app with VULKAN_ICD_FILENAMES=<path_to_your_ICD.json>

@kvark I modified metal to vulkan and VULKAN_ICD_FILENAMES to VK_ICD_FILENAMES

My steps:

I ran my application, it successfully load the portability_icd.dll. But a stackoverflow is produced during call vkCreateInstance, I trace the call stack and I found in LunarG SDK's loader/loader.c file, the vkCreateInstance's loader_create_instance_chain() invocation line is continuously called: image

grovesNL commented 5 years ago

@shrinktofit I think there is an open issue about loading portability with --features vulkan at the moment (https://github.com/LunarG/VulkanSamples/issues/162) that needs to be resolved.

Are you trying to test portability for use with DirectX 12 or something else? You could try --features dx12 instead (if you have it installed).

shrinktofit commented 5 years ago

I think I misunderstood the feature option...

It represent "which backend is choosen to implement the vulkan", not "do you want to implement vulkan or metal or dx12", right? Hah...

grovesNL commented 5 years ago

That's right 😄

kvark commented 5 years ago

@shrinktofit would you want to try out dx12 as @grovesNL suggested? Otherwise the issue can be closed.