newShader is slow

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Ghust1995
Prole
Posts: 3
Joined: Sat Apr 29, 2017 4:21 am

newShader is slow

Post by Ghust1995 »

I have a call to love.graphics.newShader that is taking 10s plus to finish in some cellphones. It is pretty similar to this one https://github.com/vrld/shine/blob/mast ... anblur.lua

I thought it might be a load issue and tried loading my shaders async, but love.graphics is not supported in separate threads.

Any suggestions?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: newShader is slow

Post by Karai17 »

Can you show us your shader? It shouldn't be taking 10s. We use newShader all the time and it takes no discernible amount of time.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: newShader is slow

Post by raidho36 »

I think I remember someone had similar issues, the culprit was their GPU driver. Try updating your software.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: newShader is slow

Post by s-ol »

The only other thing I can imagine is a malformed shader, since you are creating it programatically. Did you try printing out the code? maybe it's huuuuge and slows down the GPU, but I think code size limits should shut that down before a 10s parsing delay.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Ghust1995
Prole
Posts: 3
Joined: Sat Apr 29, 2017 4:21 am

Re: newShader is slow

Post by Ghust1995 »

I did try printing ouy the code, and making it too big was another part of the problem, together with some string concatenation.
Aparently the time was not spent loading the shader but the shader was actually not working and making the screen never leave loading, and when simplified it was just the regular load time (which is strangely high in some cellphones 2s+ in before the first love.load time)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 72 guests