GLSL unsigned integers not supported in last version ?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
logoliv
Prole
Posts: 27
Joined: Mon Jan 27, 2014 3:05 pm

GLSL unsigned integers not supported in last version ?

Post by logoliv »

Hi all,

I've joined a file as example of my problem : when i run this app in Löve 0.10.1 everything runs fine, but not in Löve 11.1 : I only obtain a generic error message without explanation...

As you can see, to enable uint support in my shader I have included these lines :
#extension GL_EXT_gpu_shader4 : enable
#extension GL_ARB_shader_bit_encoding : enable

With Löve 0.10.1 when i launched the app without these i had an explicative error message saying that i must perhaps add the extensions, but it seems they are not valid anymore in 11.1 :(
If some dev can give me a solution it would be nice, thanks in advance.
Attachments
hash.love
(1.76 KiB) Downloaded 113 times
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: GLSL unsigned integers not supported in last version ?

Post by pgimeno »

Try adding this line at the top of the shader:

Code: Select all

#pragma language glsl3
logoliv
Prole
Posts: 27
Joined: Mon Jan 27, 2014 3:05 pm

Re: GLSL unsigned integers not supported in last version ?

Post by logoliv »

thanks for your answer, but it does not work :(
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: GLSL unsigned integers not supported in last version ?

Post by pgimeno »

Really? It works fine for me after that change. I've attached it.
Attachments
hash2.love
(1.91 KiB) Downloaded 109 times
logoliv
Prole
Posts: 27
Joined: Mon Jan 27, 2014 3:05 pm

Re: GLSL unsigned integers not supported in last version ?

Post by logoliv »

You're right it works fine, I was in a hurry and surely made a mistake, thanks for your help :)

By the way, something strange happened with Lôve version 0.10.1 : i've used love.graphics.getRendererInfo() to display the GLSL version, and it is 4.6.0 without the pragma directive (3.3.0 with it), instead with Lôve 11.1 the GLSL version is 3.3.0 by default...

What's the difference between #pragma language glsl3 and #version 330 ?
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: GLSL unsigned integers not supported in last version ?

Post by pgimeno »

"#version" is not directly supported by Löve. I imagine that the main reason is that it needs to be placed at the very beginning, but Löve needs to add code before that, and the code it needs to add may depend on the version.

"#pragma language glsl3" is for Löve 11.1 only. It makes it add "#version 330 core" for OpenGL and "#version 300 es" for OpenGL ES. The only values supported are glsl1 and glsl3.

You can override Löve's internal shader boilerplate and write GLSL code directly, by overriding function "love.graphics._shaderCodeToGLSL".

Details of all of the above are in the src/modules/graphics/wrap_Graphics.lua source code.

I don't remember what did 0.10 do, and haven't checked recently. Perhaps it didn't use "#version" at all, which would explain why it takes the default, whatever that is.
logoliv
Prole
Posts: 27
Joined: Mon Jan 27, 2014 3:05 pm

Re: GLSL unsigned integers not supported in last version ?

Post by logoliv »

very interesting informations, I just had a look at the wrapper and it's all clear now :awesome:
Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests