aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_texfetch_tmp.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/swrast/s_texfetch_tmp.h')
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch_tmp.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/mesalib/src/mesa/swrast/s_texfetch_tmp.h b/mesalib/src/mesa/swrast/s_texfetch_tmp.h
index deda59246..72037ec00 100644
--- a/mesalib/src/mesa/swrast/s_texfetch_tmp.h
+++ b/mesalib/src/mesa/swrast/s_texfetch_tmp.h
@@ -737,9 +737,9 @@ FETCH(BGR_SRGB8)(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);
- texel[RCOMP] = nonlinear_to_linear(src[2]);
- texel[GCOMP] = nonlinear_to_linear(src[1]);
- texel[BCOMP] = nonlinear_to_linear(src[0]);
+ texel[RCOMP] = util_format_srgb_8unorm_to_linear_float(src[2]);
+ texel[GCOMP] = util_format_srgb_8unorm_to_linear_float(src[1]);
+ texel[BCOMP] = util_format_srgb_8unorm_to_linear_float(src[0]);
texel[ACOMP] = 1.0F;
}
@@ -749,9 +749,9 @@ FETCH(A8B8G8R8_SRGB)(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- texel[RCOMP] = nonlinear_to_linear( (s >> 24) );
- texel[GCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
- texel[BCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
+ texel[RCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 24) );
+ texel[GCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 16) & 0xff );
+ texel[BCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 8) & 0xff );
texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */
}
@@ -761,9 +761,9 @@ FETCH(B8G8R8A8_SRGB)(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- texel[RCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
- texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
- texel[BCOMP] = nonlinear_to_linear( (s ) & 0xff );
+ texel[RCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 16) & 0xff );
+ texel[GCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 8) & 0xff );
+ texel[BCOMP] = util_format_srgb_8unorm_to_linear_float( (s ) & 0xff );
texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */
}
@@ -773,9 +773,9 @@ FETCH(R8G8B8A8_SRGB)(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- texel[RCOMP] = nonlinear_to_linear( (s ) & 0xff );
- texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
- texel[BCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
+ texel[RCOMP] = util_format_srgb_8unorm_to_linear_float( (s ) & 0xff );
+ texel[GCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 8) & 0xff );
+ texel[BCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 16) & 0xff );
texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */
}
@@ -785,9 +785,9 @@ FETCH(R8G8B8X8_SRGB)(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
- texel[RCOMP] = nonlinear_to_linear( (s ) & 0xff );
- texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
- texel[BCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
+ texel[RCOMP] = util_format_srgb_8unorm_to_linear_float( (s ) & 0xff );
+ texel[GCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 8) & 0xff );
+ texel[BCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 16) & 0xff );
texel[ACOMP] = 1.0f;
}
@@ -799,7 +799,7 @@ FETCH(L_SRGB8)(const struct swrast_texture_image *texImage,
const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
texel[RCOMP] =
texel[GCOMP] =
- texel[BCOMP] = nonlinear_to_linear(src[0]);
+ texel[BCOMP] = util_format_srgb_8unorm_to_linear_float(src[0]);
texel[ACOMP] = 1.0F;
}
@@ -811,7 +811,7 @@ FETCH(L8A8_SRGB)(const struct swrast_texture_image *texImage,
const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2);
texel[RCOMP] =
texel[GCOMP] =
- texel[BCOMP] = nonlinear_to_linear(src[0]);
+ texel[BCOMP] = util_format_srgb_8unorm_to_linear_float(src[0]);
texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */
}