Fix unpacking overlapping unpack buffer rows on NVIDIA GL When unpack parameters are set so that rows being read overlap in the unpack buffer stored in GPU memory, NVIDIA GL driver may not upload the last pixels of the last one or more rows of a texture. The driver may also crash when the amount of overlap is high. This issue affects both TexImage* and TexSubImage* calls. Work around the issue by uploading textures row by row when the rows being read overlap in the unpack buffer. The workaround could possibly be optimized by uploading several of the first rows with a single call in some cases where the amount of overlap is low, but this is expected to be a rarely used corner case, so the added complexity that the optimization would create seems like a bad tradeoff. The issue does not seem to be triggered when the layers (images) of a 3D texture overlap, as long as the rows inside the images don't. The workaround has been ported from Chromium. This patch adds setting dirty bits when unpack state is set in StateManagerGL. The included test case also reveals some issue in the D3D backend, but this is left to be addressed later. BUG=angleproject:1376 TEST=angle_end2end_tests Change-Id: I7dbe73ebb70bbbc284fa92381546f4f2f832d333 Reviewed-on: https://chromium-review.googlesource.com/346430 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>