Why does this crash when I attempt to destroy the shader? I haven't even attempted to attach a source yet. I've read through the documentation here, looked at the examples here and checked my allegro.log for anything odd. This is frustrating beyond belief.

When I run this, it creates the shader and correctly finds both of the shader files with fopen(). The platform is identified as ALLEGRO_SHADER_HLSL and line 36 is run. My console then prints "Failed to attach shader source." I don't know how to write HLSL shaders yet so I used ex_prim_shader_pixel.glsl and ex_prim_shader_pixel.hlsl from here. This is the GDB output:

...then it successfully attaches, builds, then destroys. Finally! I haven't learned HLSL so I don't understand what VS_OUTPUT is. In the past, I used SFML which defaulted to GLSL. Is there any reason why allegro is forcing me to use HLSL? Would I get a performance penalty if I switched to GLSL? Is that even possible on Windows 8.1? Would it be portable?

On another note, could there please be an allegro error to reflect this quirk with shaders? It would be nice if you got a printout like "Cannot destroy a shader without attaching source." when you attempt doing so. It would've saved me several days and a lot of frustration getting this to work. The shader was going to be for something very minor, anyways.

Oh, VS_OUTPUT is defined in the vertex shader, I guess you had to attach both for it to work.

You can use GLSL too if you want, there is a tiny performance penalty but nothing that should prevent you from using it. Do this by adding al_set_new_display_flags(ALLEGRO_OPENGL) before creating the display.

As for destroying the shaders, your original code will work in the next release without the crash.