Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
munce
Oct 23, 2010

i'm making a game that relies on a shader to run. It works fine on desktop, laptop and one 5 year old phone. I want to test it on a newer phone with higher resolution, so i get the phone and load it up. nothing.

many hours of testing, android debugging and searching eventually leads me to the culprit - a single line in the vertex shader:
- a simple texture lookup, that is getting the value of a pixel from a texture in memory. the problem is that because that line is in the Vertex shader, not the Fragmet shader, it just doesn't work. why? more searching reveals that its because the gpu on that phone can't do a Vertex Texture Fetch due to how it is constructed.

having identified the problem i try to get an idea of what phones/gpus i could run my thing on. Turns out that spec sheets and documentation for phones and their gpus is pretty bad. Trying to find out which gpu is in a phone can be a bit of work, finding out if the gpu can do a VTF is almost impossible.

so after a load of effort all i know is that my thing will work on some adreno gpus and not on some mali ones. beyond that i have no idea and i'm not buying one of every phone to test it on.

in summary: mobile phones and their gpus suck.

Adbot
ADBOT LOVES YOU

munce
Oct 23, 2010

Doc Block posted:

you can check via opengl whether or not the GPU supports texture fetch in the vertex shader. of course, we're talking about android, so the driver might lie, but still. I forget the exact enum, but it's something like GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS.

yeah but the problem is you need to check on the device itself, so either test all gpus yourself or let users download and check if it works on their device. building a list of compatible devices before releasing a commercial product seems pretty essential, but is practically very hard to do. i'm also just annoyed that something so basic as a texture lookup can make a program just not work at all on a proportion of devices.

  • Locked thread