[AD] shader addon

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Here are some questions or proposals for the shader addon.

- al_create_shader creates, in GL terms, a program, to which multiple
  shader objects are attached.  It may be less confusing to call our
  functions al_create_shader_program, al_link_shader_program,
  al_use_shader_program, al_destroy_shader_program, etc.

- GL allows multiple shader objects of the same type to be attached to
  the one program.  I think we should allow the same.
  But the other backends may be a consideration(?)

- Get error log after al_attach_shader_source or al_link_shader_program
  with:
    const char *al_get_shader_program_log(ALLEGRO_SHADER *s);

- For convenience:
    al_attach_shader_source_file(ALLEGRO_SHADER *, const char *filename)

  For consistency:
    al_attach_shader_source_f(ALLEGRO_SHADER *, ALLEGRO_FILE *file)

- There is no way to detach (not delete) a shader object from a program.
  I don't know how important that is.  al_attach_shader_source could
  return an id number, used to detach/reattach the shader later.

- AIUI the d3d backend currently requires the pairing of:
    al_use_shader_program(S, true);
    ...
    al_use_shader_program(S, false);

  That implies a redundant glUseProgram(0); if you want to switch from
  one program to another.  Maybe we can do better.

Peter

PS. ex_shader currently crashes with the Cg backend if the
ALLEGRO_USE_PROGRAMMABLE_PIPELINE flag is used.  I haven't checked further.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/