Given the following shader, with "sierra::ShaderLanguage::WGSL".
How would I need to adapt the shader, to get it to output a triangle?
The current example is simplistic sure, but it is too simplistic, to be usable.
I thought, that I maybe need to bind my own descriptor, to set the vertex input. I then spent 1-2 hours trying to understand the sierra::descriptors macro code, only to realise, that that is something completely different (for bindings, and sets).
The next day, I looked closer at the wgsl spec and a little at vulkan c code.
That gave me the insight, that I'd need to specifiy the layouts I need in the sierra::pipeline layout.
Now as I am writing this, I would probably also then need to modify the sierra::pass struct, to then actually specify the contents of the locations to the pipeline?
Ontop there is no description, on what the macros do.
That is exspecially true for proc_macro_attributes, since one might want to modify descriptors, the pipline, add pipline inputs and more.
The current state of this library is in my view horrible/unusable for programmers.
vulkano has great examples, but it's types are too complex for me to understand.
With vulkano I was however able to render my own simple shapes, and create circle shaders without a problem.
That is not something, that can be said for this crate.
Most basic programms will at least require a shader such as the one below.
It would go a long way for usablility, if you could provide an example with the next release, and better explain what the macros do.
Looking for 1-2 hours at a single proc-macro, just to understand, that it doesn't do what you want is frustrating.
EDIT:
As it stands now, I could probably create a different shader for each possible vertex/color combination I need, and be done faster.
Creating the shader source code is simple, since only the vec values would change.
I don't know however if that approach would work at all for even rendering a simple triangle.
I also don't know, if runtime shader compilation is even something, that could be done (because I don't know how you compile the shaders).
Given the following shader, with "
sierra::ShaderLanguage::WGSL
". How would I need to adapt the shader, to get it to output a triangle?The current example is simplistic sure, but it is too simplistic, to be usable.
I thought, that I maybe need to bind my own descriptor, to set the vertex input. I then spent 1-2 hours trying to understand the sierra::descriptors macro code, only to realise, that that is something completely different (for bindings, and sets). The next day, I looked closer at the wgsl spec and a little at vulkan c code. That gave me the insight, that I'd need to specifiy the layouts I need in the
sierra::pipeline
layout. Now as I am writing this, I would probably also then need to modify thesierra::pass
struct, to then actually specify the contents of the locations to the pipeline?Ontop there is no description, on what the macros do. That is exspecially true for
proc_macro_attribute
s, since one might want to modify descriptors, the pipline, add pipline inputs and more.The current state of this library is in my view horrible/unusable for programmers. vulkano has great examples, but it's types are too complex for me to understand. With vulkano I was however able to render my own simple shapes, and create circle shaders without a problem. That is not something, that can be said for this crate.
Most basic programms will at least require a shader such as the one below. It would go a long way for usablility, if you could provide an example with the next release, and better explain what the macros do.
Looking for 1-2 hours at a single proc-macro, just to understand, that it doesn't do what you want is frustrating.
EDIT: As it stands now, I could probably create a different shader for each possible vertex/color combination I need, and be done faster. Creating the shader source code is simple, since only the
vec
values would change. I don't know however if that approach would work at all for even rendering a simple triangle. I also don't know, if runtime shader compilation is even something, that could be done (because I don't know how you compile the shaders).