I’m implementing glReadNPixels() in a driver. this API has a bufSize parameter. GLES spec 3.2 says: “An INVALID_OPERATION error is generated by ReadnPixels if the buffersize required to store the requested data is greater than bufSize”.
Here is my question:
When the driver calculates the required buffer size, should we count in the pixel store parameters set by glPixelStore(), e.g. PACK_ROW_LENGTH or PACK_SKIP_PIXELS? Or we simply check widthheightpixel_size? The required buffer size would be larger if the app set PACK_ROW_LENGTH to a value larger than pixel rectangle width, right?