Vulkan-Samples icon indicating copy to clipboard operation
Vulkan-Samples copied to clipboard

Sample request: Cross Platform startup project creation script/bat

Open Eths33 opened this issue 3 years ago • 8 comments

Is there documentation or a sample showing how to create a cross platform project? I saw there are batch files/scripts to add samples to this project, but I have not seen anywhere showing how to create a new standalone Vulkan project that works across all platforms.

Since Vulkan 1.0 I have been taking one of SaschaWillems simple samples, removing most of the code, then building off of that.

I, and I assume others too, would benefit from a good startup project. Specifically interested in the best way to create it, so I can create standalone projects myself in the future. (CMake, Gradle, etc.)

The following site covers 3/4 platforms in isolation, missing Android. If there is a site that already shows what I am asking for that is okay too, I just haven't found it. https://vulkan-tutorial.com/Development_environment

Eths33 avatar Nov 19 '20 06:11 Eths33

Last time we tested, the new sample generation scripts as you mentioned this one should generate a sample that works on all platforms we support. Did you have issues with that? Or did I misunderstand your request?

abbaswasim avatar Nov 19 '20 11:11 abbaswasim

From what I understand that script creates a new sample within the larger set of samples.

Can it be used to create a stand alone project if run in an empty folder? I did not try that.

Eths33 avatar Nov 19 '20 11:11 Eths33

Standalone project? What do you mean by that?

The sample generated is part of the bigger samples project yes. It will be like any other sample. You can build it in isolation though and run/debug it with or without the meta project.

There are some instructions around that in the build instructions using VKB_ENTRYPOINTS cmake option.

abbaswasim avatar Nov 19 '20 11:11 abbaswasim

Standalone as in a new project using Vulkan that has no connection to any other Vulkan project or sample code (edit: it would have connections to code sets that are dependencies to get a working Vulkan based render though, such as the third_party folder). Tomorrow I will have more time to look at how the scripts and batch files work, maybe I can make what I am looking for.

Eths33 avatar Nov 19 '20 12:11 Eths33

That’s not possible with these scripts. The scripts just creates a Skelton sample for you that you can fill in. It still uses the vulkan samples framework as well as build system to build/run the sample.

After reading your edit. That might work for you. If you want a skeleton project you will get something from other project in it, like the build system etc otherwise you might as well start from scratch.

abbaswasim avatar Nov 19 '20 12:11 abbaswasim

Okay thank you for the input.

Being able to start from scratch was the main goal. Currently I do not know how to do that with Vulkan so that it will run on windows and android (android is the barrier for me). I was crossing my fingers that there was a sample/tutorial to save time. I am sure I could figure it out, I just need to find time.

Eths33 avatar Nov 19 '20 20:11 Eths33

Hi @Eths33, This might not be of any use at this point looking at the date but take a look at the android native development kit stable api documentation.

We also use the android native app glue header to help with interoperability between android and C++.

This and a bit of CMake should do the trick

TomAtkinsonArm avatar Dec 30 '20 15:12 TomAtkinsonArm

Hi @TomAtkinsonArm thank you for the suggestion. I have been going back and forth with this so it is still appreciated.

In my initial post I said I was using a sample from SaschaWillems, that was a mistake, I had forgot parts of my project since I took a half a year or so break. I have been using code from https://github.com/renelindsay/Vulkan-WSIWindow as a base. Some updates were needed but it is working well.

Recently I found this on ARM's site. Still in the process of reading it, but it has been the most in-depth android focused tutorial. https://arm-software.github.io/vulkan-sdk/tutorials.html

Eths33 avatar Jan 18 '21 04:01 Eths33

Better documentation on how we support multiple platforms in the framework can be added. Adjusting the tickets name to reflect this

tomadamatkinson avatar May 04 '23 23:05 tomadamatkinson

We will add Android, and probably also iOS support to the Vulkan Tutorial at some point in the future. That's a better place than this sample repo.

SaschaWillems avatar Sep 25 '23 18:09 SaschaWillems