SiebenCorgie / ori-engine

A small engine written in rust + vulkan.
Other
7 stars 1 forks source link

Change the shader storing to a "shader-manager + shader module" methode #17

Open SiebenCorgie opened 7 years ago

SiebenCorgie commented 7 years ago

While investigating the alignment problem (https://github.com/SiebenCorgie/ori-engine/issues/16) I found out that this part:

#[derive(VulkanoShader)]
#[ty = "vertex"]
#[path = "data/test.vs"]
struct Dummy;

Actually creates all struct in the shader as Rust structs. That's the reason why I'll move the shaders to a "One shader = one module" abroach. The in this ways the material can, based on the pipeline send the correct, filled struct to the shader. For instance for the directional lights a vertex_shader::directional_lights struct created from a struct definition in the shader. The struct creation might be handled by the shader itself though. I'll see.

SiebenCorgie commented 7 years ago

currently thinking about leaving it like it is. However, I read somewhere that, after rust lands some changes tomaka will change the shader system of vulkano. SO this might be changed in the distant future.