-void
-_mesa_fetch_texel_2d_f_etc2_rgb8(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- uint8_t dst[3];
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8;
-
- etc2_rgb8_parse_block(&block, src,
- false /* punchthrough_alpha */);
- etc2_rgb8_fetch_texel(&block, i % 4, j % 4, dst,
- false /* punchthrough_alpha */);
-
- texel[RCOMP] = UBYTE_TO_FLOAT(dst[0]);
- texel[GCOMP] = UBYTE_TO_FLOAT(dst[1]);
- texel[BCOMP] = UBYTE_TO_FLOAT(dst[2]);
- texel[ACOMP] = 1.0f;
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_srgb8(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- uint8_t dst[3];
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8;
-
- etc2_rgb8_parse_block(&block, src,
- false /* punchthrough_alpha */);
- etc2_rgb8_fetch_texel(&block, i % 4, j % 4, dst,
- false /* punchthrough_alpha */);
-
- texel[RCOMP] = _mesa_nonlinear_to_linear(dst[0]);
- texel[GCOMP] = _mesa_nonlinear_to_linear(dst[1]);
- texel[BCOMP] = _mesa_nonlinear_to_linear(dst[2]);
- texel[ACOMP] = 1.0f;
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_rgba8_eac(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- uint8_t dst[4];
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 16;
-
- etc2_rgba8_parse_block(&block, src);
- etc2_rgba8_fetch_texel(&block, i % 4, j % 4, dst);
-
- texel[RCOMP] = UBYTE_TO_FLOAT(dst[0]);
- texel[GCOMP] = UBYTE_TO_FLOAT(dst[1]);
- texel[BCOMP] = UBYTE_TO_FLOAT(dst[2]);
- texel[ACOMP] = UBYTE_TO_FLOAT(dst[3]);
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_srgb8_alpha8_eac(const struct
- swrast_texture_image *texImage,
- GLint i, GLint j,
- GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- uint8_t dst[4];
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 16;
-
- etc2_rgba8_parse_block(&block, src);
- etc2_rgba8_fetch_texel(&block, i % 4, j % 4, dst);
-
- texel[RCOMP] = _mesa_nonlinear_to_linear(dst[0]);
- texel[GCOMP] = _mesa_nonlinear_to_linear(dst[1]);
- texel[BCOMP] = _mesa_nonlinear_to_linear(dst[2]);
- texel[ACOMP] = UBYTE_TO_FLOAT(dst[3]);
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_r11_eac(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- GLushort dst;
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8;
-
- etc2_r11_parse_block(&block, src);
- etc2_r11_fetch_texel(&block, i % 4, j % 4, (uint8_t *)&dst);
-
- texel[RCOMP] = USHORT_TO_FLOAT(dst);
- texel[GCOMP] = 0.0f;
- texel[BCOMP] = 0.0f;
- texel[ACOMP] = 1.0f;
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_rg11_eac(const struct
- swrast_texture_image *texImage,
- GLint i, GLint j,
- GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- GLushort dst[2];
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 16;
-
- /* red component */
- etc2_r11_parse_block(&block, src);
- etc2_r11_fetch_texel(&block, i % 4, j % 4, (uint8_t *)dst);
-
- /* green component */
- etc2_r11_parse_block(&block, src + 8);
- etc2_r11_fetch_texel(&block, i % 4, j % 4, (uint8_t *)(dst + 1));
-
- texel[RCOMP] = USHORT_TO_FLOAT(dst[0]);
- texel[GCOMP] = USHORT_TO_FLOAT(dst[1]);
- texel[BCOMP] = 0.0f;
- texel[ACOMP] = 1.0f;
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_signed_r11_eac(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- GLushort dst;
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8;
-
- etc2_r11_parse_block(&block, src);
- etc2_signed_r11_fetch_texel(&block, i % 4, j % 4, (uint8_t *)&dst);
-
- texel[RCOMP] = SHORT_TO_FLOAT(dst);
- texel[GCOMP] = 0.0f;
- texel[BCOMP] = 0.0f;
- texel[ACOMP] = 1.0f;
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_signed_rg11_eac(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- GLushort dst[2];
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 16;
-
- /* red component */
- etc2_r11_parse_block(&block, src);
- etc2_signed_r11_fetch_texel(&block, i % 4, j % 4, (uint8_t *)dst);
-
- /* green component */
- etc2_r11_parse_block(&block, src + 8);
- etc2_signed_r11_fetch_texel(&block, i % 4, j % 4, (uint8_t *)(dst + 1));
-
- texel[RCOMP] = SHORT_TO_FLOAT(dst[0]);
- texel[GCOMP] = SHORT_TO_FLOAT(dst[1]);
- texel[BCOMP] = 0.0f;
- texel[ACOMP] = 1.0f;
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_rgb8_punchthrough_alpha1(
- const struct swrast_texture_image *texImage,
- GLint i, GLint j,
- GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- uint8_t dst[4];
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8;
-
- etc2_rgb8_parse_block(&block, src,
- true /* punchthrough alpha */);
- etc2_rgb8_fetch_texel(&block, i % 4, j % 4, dst,
- true /* punchthrough alpha */);
- texel[RCOMP] = UBYTE_TO_FLOAT(dst[0]);
- texel[GCOMP] = UBYTE_TO_FLOAT(dst[1]);
- texel[BCOMP] = UBYTE_TO_FLOAT(dst[2]);
- texel[ACOMP] = UBYTE_TO_FLOAT(dst[3]);
-}
-
-void
-_mesa_fetch_texel_2d_f_etc2_srgb8_punchthrough_alpha1(
- const struct swrast_texture_image *texImage,
- GLint i, GLint j,
- GLint k, GLfloat *texel)
-{
- struct etc2_block block;
- uint8_t dst[4];
- const uint8_t *src;
-
- src = texImage->Map +
- (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8;
-
- etc2_rgb8_parse_block(&block, src,
- true /* punchthrough alpha */);
- etc2_rgb8_fetch_texel(&block, i % 4, j % 4, dst,
- true /* punchthrough alpha */);
- texel[RCOMP] = _mesa_nonlinear_to_linear(dst[0]);
- texel[GCOMP] = _mesa_nonlinear_to_linear(dst[1]);
- texel[BCOMP] = _mesa_nonlinear_to_linear(dst[2]);
- texel[ACOMP] = UBYTE_TO_FLOAT(dst[3]);
-}