WebGL - Width, height parameters passed in validateCompressedTexSubDimensions() function?

80 views Asked by At

I am working on some compression support in WebGL-Webkit. So I was looking at existing S3TC support provided in WebGLRenderingContext.cpp file in Webkit code. What confuses me is the code written inside "validateCompressedTexSubDimensions(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, ArrayBufferView data)" s3tc extension spec says that you should throw an error in your application if: " plus is not equal to texture width*"; Then how is it that in the existing webkit code for the function validateCompressedTexSubDimensions() for S3TC, the code goes on something like this: "if (width - xoffset > tex->getWidth(target, level) {synthesizeGLError("blah blah") }" Is this code right? If so, then what is the meaning of "width", and "tex->getWidth()" in the webkit code. Is width the width of the sub-image or the actual width of the complete tex2D texel array? And what does the constant "TEXTURE_WIDTH" stand for? Looking forward to your useful comments :)

0

There are 0 answers