Improve shader version selection
This commit is contained in:
parent
afdf3e799a
commit
e31566d430
17 changed files with 179 additions and 69 deletions
|
|
@ -3,6 +3,7 @@ use glow::HasContext;
|
|||
pub unsafe fn create(
|
||||
gl: &glow::Context,
|
||||
shader_sources: &[(u32, &str)],
|
||||
attributes: &[(u32, &str)],
|
||||
) -> <glow::Context as HasContext>::Program {
|
||||
let program = gl.create_program().expect("Cannot create program");
|
||||
|
||||
|
|
@ -25,6 +26,10 @@ pub unsafe fn create(
|
|||
shaders.push(shader);
|
||||
}
|
||||
|
||||
for (i, name) in attributes {
|
||||
gl.bind_attrib_location(program, *i, name);
|
||||
}
|
||||
|
||||
gl.link_program(program);
|
||||
if !gl.get_program_link_status(program) {
|
||||
panic!("{}", gl.get_program_info_log(program));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue