mesa: Remove _mesa_rebase_rgba_uint and _mesa_rebase_rgba_float
These are no longer used anywhere now that we have _mesa_format_convert. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
8993b9818c
commit
769de5165c
|
@ -1325,132 +1325,6 @@ _mesa_unpack_image( GLuint dimensions,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* If we unpack colors from a luminance surface, we'll get pixel colors
|
||||
* such as (l, l, l, a).
|
||||
* When we call _mesa_pack_rgba_span_float(format=GL_LUMINANCE), that
|
||||
* function will compute L=R+G+B before packing. The net effect is we'll
|
||||
* accidentally store luminance values = 3*l.
|
||||
* This function compensates for that by converting (aka rebasing) (l,l,l,a)
|
||||
* to be (l,0,0,a).
|
||||
* It's a similar story for other formats such as LUMINANCE_ALPHA, ALPHA
|
||||
* and INTENSITY.
|
||||
*
|
||||
* Finally, we also need to do this when the actual surface format does
|
||||
* not match the logical surface format. For example, suppose the user
|
||||
* requests a GL_LUMINANCE texture but the driver stores it as RGBA.
|
||||
* Again, we'll get pixel values like (l,l,l,a).
|
||||
*/
|
||||
void
|
||||
_mesa_rebase_rgba_float(GLuint n, GLfloat rgba[][4], GLenum baseFormat)
|
||||
{
|
||||
GLuint i;
|
||||
|
||||
switch (baseFormat) {
|
||||
case GL_ALPHA:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][RCOMP] = 0.0F;
|
||||
rgba[i][GCOMP] = 0.0F;
|
||||
rgba[i][BCOMP] = 0.0F;
|
||||
}
|
||||
break;
|
||||
case GL_INTENSITY:
|
||||
/* fall-through */
|
||||
case GL_LUMINANCE:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][GCOMP] = 0.0F;
|
||||
rgba[i][BCOMP] = 0.0F;
|
||||
rgba[i][ACOMP] = 1.0F;
|
||||
}
|
||||
break;
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][GCOMP] = 0.0F;
|
||||
rgba[i][BCOMP] = 0.0F;
|
||||
}
|
||||
break;
|
||||
case GL_RGB:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][ACOMP] = 1.0F;
|
||||
}
|
||||
break;
|
||||
case GL_RG:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][BCOMP] = 0.0F;
|
||||
rgba[i][ACOMP] = 1.0F;
|
||||
}
|
||||
break;
|
||||
case GL_RED:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][GCOMP] = 0.0F;
|
||||
rgba[i][BCOMP] = 0.0F;
|
||||
rgba[i][ACOMP] = 1.0F;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* no-op */
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* As above, but GLuint components.
|
||||
*/
|
||||
void
|
||||
_mesa_rebase_rgba_uint(GLuint n, GLuint rgba[][4], GLenum baseFormat)
|
||||
{
|
||||
GLuint i;
|
||||
|
||||
switch (baseFormat) {
|
||||
case GL_ALPHA:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][RCOMP] = 0;
|
||||
rgba[i][GCOMP] = 0;
|
||||
rgba[i][BCOMP] = 0;
|
||||
}
|
||||
break;
|
||||
case GL_INTENSITY:
|
||||
/* fall-through */
|
||||
case GL_LUMINANCE:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][GCOMP] = 0;
|
||||
rgba[i][BCOMP] = 0;
|
||||
rgba[i][ACOMP] = 1;
|
||||
}
|
||||
break;
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][GCOMP] = 0;
|
||||
rgba[i][BCOMP] = 0;
|
||||
}
|
||||
break;
|
||||
case GL_RGB:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][ACOMP] = 1;
|
||||
}
|
||||
break;
|
||||
case GL_RG:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][BCOMP] = 0;
|
||||
rgba[i][ACOMP] = 1;
|
||||
}
|
||||
break;
|
||||
case GL_RED:
|
||||
for (i = 0; i < n; i++) {
|
||||
rgba[i][GCOMP] = 0;
|
||||
rgba[i][BCOMP] = 0;
|
||||
rgba[i][ACOMP] = 1;
|
||||
}
|
||||
default:
|
||||
/* no-op */
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_pack_luminance_from_rgba_float(GLuint n, GLfloat rgba[][4],
|
||||
GLvoid *dstAddr, GLenum dst_format,
|
||||
|
|
|
@ -85,13 +85,6 @@ _mesa_unpack_image(GLuint dimensions,
|
|||
GLenum format, GLenum type, const GLvoid *pixels,
|
||||
const struct gl_pixelstore_attrib *unpack);
|
||||
|
||||
|
||||
extern void
|
||||
_mesa_rebase_rgba_float(GLuint n, GLfloat rgba[][4], GLenum baseFormat);
|
||||
|
||||
extern void
|
||||
_mesa_rebase_rgba_uint(GLuint n, GLuint rgba[][4], GLenum baseFormat);
|
||||
|
||||
extern void
|
||||
_mesa_pack_luminance_from_rgba_float(GLuint n, GLfloat rgba[][4],
|
||||
GLvoid *dstAddr, GLenum dst_format,
|
||||
|
|
Loading…
Reference in New Issue