You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current triangle example code uses this to construct the shader program:
let shader = shader::Library::from_bytes(SHADER_BYTES).unwrap();let vertex_shader = shader.get(0).unwrap();let program = shader::Program::new(vertex_shader).unwrap();
When changed to this:
let program = {let shader = shader::Library::from_bytes(SHADER_BYTES).unwrap();let vertex_shader = shader.get(0).unwrap();
shader::Program::new(vertex_shader).unwrap()};
shader is dropped which causes the internal *mut ctru_sys::DVLB_s to be freed. I believe this is required to stay alive while the Program is in use, I think its Entrypoint is used to bind uniforms and run the shader etc.
With the second version of the above code I was getting a crash due to a memory read error in libctru::DVLE_GetUniformRegister which had been called by citro3d::Shader::get_uniform.
The text was updated successfully, but these errors were encountered:
The current triangle example code uses this to construct the shader program:
When changed to this:
shader
is dropped which causes the internal*mut ctru_sys::DVLB_s
to be freed. I believe this is required to stay alive while theProgram
is in use, I think itsEntrypoint
is used to bind uniforms and run the shader etc.With the second version of the above code I was getting a crash due to a memory read error in
libctru::DVLE_GetUniformRegister
which had been called bycitro3d::Shader::get_uniform
.The text was updated successfully, but these errors were encountered: