mesa: remove unused functions in depthstencil.c

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Brian Paul 2011-12-04 13:39:27 -07:00
parent 14721dfe99
commit 6e8c1a92b3
2 changed files with 0 additions and 171 deletions

View File

@ -957,158 +957,3 @@ _mesa_new_s8_renderbuffer_wrapper(struct gl_context *ctx, struct gl_renderbuffer
return s8rb;
}
/**
** The following functions are useful for hardware drivers that only
** implement combined depth/stencil buffers.
** The GL_EXT_framebuffer_object extension allows indepedent depth and
** stencil buffers to be used in any combination.
** Therefore, we sometimes have to merge separate depth and stencil
** renderbuffers into a single depth+stencil renderbuffer. And sometimes
** we have to split combined depth+stencil renderbuffers into separate
** renderbuffers.
**/
/**
* Extract stencil values from the combined depth/stencil renderbuffer, storing
* the values into a separate stencil renderbuffer.
* \param dsRb the source depth/stencil renderbuffer
* \param stencilRb the destination stencil renderbuffer
* (either 8-bit or 32-bit)
*/
void
_mesa_extract_stencil(struct gl_context *ctx,
struct gl_renderbuffer *dsRb,
struct gl_renderbuffer *stencilRb)
{
GLuint row, width, height;
ASSERT(dsRb);
ASSERT(stencilRb);
ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8);
ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 ||
stencilRb->Format == MESA_FORMAT_S8);
ASSERT(dsRb->Width == stencilRb->Width);
ASSERT(dsRb->Height == stencilRb->Height);
width = dsRb->Width;
height = dsRb->Height;
for (row = 0; row < height; row++) {
GLuint depthStencil[MAX_WIDTH];
dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil);
if (stencilRb->Format == MESA_FORMAT_S8) {
/* 8bpp stencil */
GLubyte stencil[MAX_WIDTH];
GLuint i;
for (i = 0; i < width; i++) {
stencil[i] = depthStencil[i] & 0xff;
}
stencilRb->PutRow(ctx, stencilRb, width, 0, row, stencil, NULL);
}
else {
/* 32bpp stencil */
/* the 24 depth bits will be ignored */
ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8);
ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
stencilRb->PutRow(ctx, stencilRb, width, 0, row, depthStencil, NULL);
}
}
}
/**
* Copy stencil values from a stencil renderbuffer into a combined
* depth/stencil renderbuffer.
* \param dsRb the destination depth/stencil renderbuffer
* \param stencilRb the source stencil buffer (either 8-bit or 32-bit)
*/
void
_mesa_insert_stencil(struct gl_context *ctx,
struct gl_renderbuffer *dsRb,
struct gl_renderbuffer *stencilRb)
{
GLuint row, width, height;
ASSERT(dsRb);
ASSERT(stencilRb);
ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8);
ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 ||
stencilRb->Format == MESA_FORMAT_S8);
ASSERT(dsRb->Width == stencilRb->Width);
ASSERT(dsRb->Height == stencilRb->Height);
width = dsRb->Width;
height = dsRb->Height;
for (row = 0; row < height; row++) {
GLuint depthStencil[MAX_WIDTH];
dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil);
if (stencilRb->Format == MESA_FORMAT_S8) {
/* 8bpp stencil */
GLubyte stencil[MAX_WIDTH];
GLuint i;
stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil);
for (i = 0; i < width; i++) {
depthStencil[i] = (depthStencil[i] & 0xffffff00) | stencil[i];
}
}
else {
/* 32bpp stencil buffer */
GLuint stencil[MAX_WIDTH], i;
ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8);
ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil);
for (i = 0; i < width; i++) {
depthStencil[i]
= (depthStencil[i] & 0xffffff00) | (stencil[i] & 0xff);
}
}
dsRb->PutRow(ctx, dsRb, width, 0, row, depthStencil, NULL);
}
}
/**
* Convert the stencil buffer from 8bpp to 32bpp depth/stencil.
* \param stencilRb the stencil renderbuffer to promote
*/
void
_mesa_promote_stencil(struct gl_context *ctx, struct gl_renderbuffer *stencilRb)
{
const GLsizei width = stencilRb->Width;
const GLsizei height = stencilRb->Height;
GLubyte *data;
GLint i, j, k;
ASSERT(stencilRb->Format == MESA_FORMAT_S8);
ASSERT(stencilRb->Data);
data = (GLubyte *) stencilRb->Data;
stencilRb->Data = NULL;
stencilRb->AllocStorage(ctx, stencilRb, GL_DEPTH24_STENCIL8_EXT,
width, height);
ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT);
k = 0;
for (i = 0; i < height; i++) {
GLuint depthStencil[MAX_WIDTH];
for (j = 0; j < width; j++) {
depthStencil[j] = data[k++];
}
stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL);
}
free(data);
}

View File

@ -43,20 +43,4 @@ _mesa_new_s8_renderbuffer_wrapper(struct gl_context *ctx,
struct gl_renderbuffer *dsrb);
extern void
_mesa_extract_stencil(struct gl_context *ctx,
struct gl_renderbuffer *dsRb,
struct gl_renderbuffer *stencilRb);
extern void
_mesa_insert_stencil(struct gl_context *ctx,
struct gl_renderbuffer *dsRb,
struct gl_renderbuffer *stencilRb);
extern void
_mesa_promote_stencil(struct gl_context *ctx, struct gl_renderbuffer *stencilRb);
#endif /* DEPTHSTENCIL_H */