Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Shader Support Version

This thread is locked; no one can reply to it. rss feed Print
Shader Support Version
JaykopX
Member #19,997
April 2021

Hello,

i'm trying to use a Shader (HLSL), but i get the following error messages

al_attach_shader_source_file failed: error X3543: asuint cannot be used on ps_2_0
error X3535: Bitwise operations not supported on legacy targets.
ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
ID3DXEffectCompiler: Compilation failed

I managed to get it running without the function asuint and bitwise operations.

Where can i specify that i want to use Shader Version 3.0 or higher? Is it supported?

Edit: I just looked at the history of Shaders. Version 4.0 was introduced with Geforce 8 about 14 Years ago, so i think it's safe to assume it is available on PC :D

Thanks!

Best regards

Dizzy Egg
Member #10,824
March 2009
avatar

SiegeLord posted a reply to me about this, you'll need to recompile Allegro with a patch (I just used GLSL instead):

HLSL Shaders Post

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

JaykopX
Member #19,997
April 2021

Thanks for the information. I never compiled Allegro myself, i may look into it. I also tried to use GLSL instead, but it crashes with a nullpointer exception if i call al_attach_shader_source_file

I changed
ALLEGRO_SHADER_PLATFORM platform = al_get_shader_platform(shader);
to
ALLEGRO_SHADER_PLATFORM platform = ALLEGRO_SHADER_GLSL;

and

shader = al_create_shader(ALLEGRO_SHADER_AUTO);
to
shader = al_create_shader(ALLEGRO_SHADER_GLSL);

and i used the files from the example

*vsource = "data/ex_shader_vertex.glsl";
*psource = "data/ex_shader_pixel.glsl";

Did i miss something?

Dizzy Egg
Member #10,824
March 2009
avatar

Are you setting the display to opengl?

al_set_new_display_flags(ALLEGRO_OPENGL);

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

JaykopX
Member #19,997
April 2021

Missed that, thank you! Now it's working (kinda, it's flickering, but if think i can figure that out)

Go to: