Looping in GLSL on android?
category: code [glöplog]
trying to loop in a glsl shader on android but it wont allow any kind of looping? what kind of bs is this? do i need to specifiy a specific version of glsl code to compilie or something?
static for loops still allowed.. :) just had to write it so that it was unrollable
Woah, massive unrolled shader for sphere tracing? XD
I once circumvented the "no variable length loops, and no messing around with the loop control variable" restriction with something like this
Code:
for (int i=0;i<99;i++)
{
if (i<variable)
{
...
}
}
Didn't GLSL ES allow using "break" and "continue" within loops? From what I remember, it had, and the "predictable index" restriction was mainly to assure that shader is going to finish some day.
Whether or not whis would work on actual device is still to be argued, though - Samsung Galaxy S certainly lives in different galaxy than GLSL spec and its GLSL compiler can crash badly in some cases.
KK: Well, it's PowerVR on a non-Nokia, non-Apple device ... what did you expect? :)
Desktop GPU Performance and OpenGL 4.3 - that's what I expected! Come it's 2012.
*Come on it's 2012.
And I forgot to add a ";)".
And I forgot to add a ";)".
":D"
ended up being able to make fractals on android after all, but the performance is dismal, even on a shader
You ARE benchmarking it on real hardware, and not AVD, yes?
yes on a nexus 7
AVD doesn't do shaders
It does now
just tried it in an avd and it does work, but at the same framerate i was seeing on the nexus 7, i think maybe i have some kind of frame limit set
Tested any other (non-Tegra) Android HW?
nope, but i did find something interesting: if i lower the iteration count and therefore loop less in the shader, the shader still updates slowly but the actuall framerate is high. The frames will update at a reasonable rate (~30 fps) and i can see the quad rotating smoothly, but the shader will update the texture on the quad at 1 fps (really slowly) . also for some reason at low iteration counts, i see weird artifacts and glitches on the quad