glapi: add indexed blend functions (GL 4.0)
[mesa.git] / src / mesa / main / texcompress_etc.c
index 75019820577924742ba271e1ceb942f195987586..ae973b001d6f12e039663a2ef1d66dbdd079d88c 100644 (file)
@@ -685,15 +685,15 @@ etc2_unpack_rgb8(uint8_t *dst_row,
       const unsigned h = MIN2(bh, height - y);
 
       for (x = 0; x < width; x+= bw) {
-         etc2_rgb8_parse_block(&block, src,
-                               false /* punchthrough_alpha */);
-
          /*
           * Destination texture may not be a multiple of four texels in
           * width. Compute a safe width to avoid writing outside the texture.
           */
          const unsigned w = MIN2(bw, width - x);
 
+         etc2_rgb8_parse_block(&block, src,
+                               false /* punchthrough_alpha */);
+
          for (j = 0; j < h; j++) {
             uint8_t *dst = dst_row + (y + j) * dst_stride + x * comps;
             for (i = 0; i < w; i++) {