SiebenCorgie / jakar-engine

Formerly "Ori-Engine" is an hobby project of mine. Target is an Rust/Vulkan engine for games and visualization software.
MIT License
19 stars 0 forks source link

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

Closed SiebenCorgie closed 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.