# PowerVR SGX 530 does NOT support Depth Textures

If you download the PowerVR SDK for the TI OMAP3430 which is used in the N900, you will find a nice shadow mapping examle which uses the OES_depth_texture extension. You can even run this example using the included emulator using the SGX 530 profile.

However if you try to run your code on the actual device you will soon find out that it does NOT support OES_depth_texture. This is quite surprinsing as the device supports OES_texture_float and OES_depth24, so depth_texture should be not too hard to implement.

But the situation is the same on the iPhone 3GS, which uses the same hardware. This leads me to believe that this is not just a driver limitation.

However here is a workaround using a ordinary RGBA texture and byte packing:

const highp vec4 packFactors = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0);
const highp vec4 cutoffMask  = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);

void main() {
highp vec4 packedVal = vec4(fract(packFactors*gl_FragCoord.z));