Advertisement

Shaders on embedded systems

Started by September 13, 2018 10:00 AM
1 comment, last by cgrant 6 years, 4 months ago

Just wrote a shader that uses a texture but only when a bool flag is set to true, so that means i can either to use texture mapping in shader or not, now since i use  texturecoordinate attribute in passed vertex buffer, and send it from vertex shader to fragment one where i choose to use it or not via uniform bool I WONDER.

Will drawing crash ? I mean after some time of developement i encountered problems with various phones that claim only to 'eat' correct shaders (that means i need to make 2 different shaders - one that uses texture and second one that does not), but its an overkill and waste of time to do everything like that, i could but #ifdefs in shader and load 2 different ones but still i could just switch the uniform bool and get over with it. So are phones/tablets still so strict?

Hard to say what will happen when you run your application on a device. There are several things to consider when write shaders for any system.
1. What level of shader support is available ex. SMx, GLSL ES x.x . This is first and foremost factor which will decide whether or not your shader will 'work' on the system.
2. For some API like GLSL ES the same shader can fail on different HW from different vendors even when spec compliant. Again this will only manifest itself during testing.

In general the question being ask in too vague as its hard to say what will happen when your shader runs without even seeing the shader code ( the description alone is not a good indicator. ).  However, if you stick to making your shader compliant to the shader specification of the API being used, then you are more than half-way there.

This topic is closed to new replies.

Advertisement