summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_texfetch_tmp.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-07-24 12:32:49 -0700
committerJason Ekstrand <[email protected]>2014-08-04 11:07:20 -0700
commite97498ef811b49b8fb894bd167503109151a1fc8 (patch)
tree61acffa231367ef3da8fb69524658240024c4a86 /src/mesa/swrast/s_texfetch_tmp.h
parent992e1ea8e4290cf14d59f89415bfd13e0920aad7 (diff)
mesa/main: Use the RGB <-> sRGB conversion functions in libmesautil
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_texfetch_tmp.h')
-rw-r--r--src/mesa/swrast/s_texfetch_tmp.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index deda59246c0..72037ec0020 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/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 */
}