projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote branch 'origin/nvc0'
[mesa.git]
/
src
/
mesa
/
main
/
depthstencil.c
diff --git
a/src/mesa/main/depthstencil.c
b/src/mesa/main/depthstencil.c
index 193c7f8255fe9e4d246a7105b98b12ec8d8f26f4..c5466dc9fccbde0cca42014d5c04e1d69b2102e1 100644
(file)
--- a/
src/mesa/main/depthstencil.c
+++ b/
src/mesa/main/depthstencil.c
@@
-25,7
+25,6
@@
#include "glheader.h"
#include "imports.h"
#include "context.h"
#include "glheader.h"
#include "imports.h"
#include "context.h"
-#include "fbobject.h"
#include "formats.h"
#include "mtypes.h"
#include "depthstencil.h"
#include "formats.h"
#include "mtypes.h"
#include "depthstencil.h"
@@
-47,7
+46,7
@@
static void *
static void *
-nop_get_pointer(
GL
context *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
+nop_get_pointer(
struct gl_
context *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
{
(void) ctx;
(void) rb;
{
(void) ctx;
(void) rb;
@@
-63,10
+62,10
@@
nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
static void
delete_wrapper(struct gl_renderbuffer *rb)
{
static void
delete_wrapper(struct gl_renderbuffer *rb)
{
- ASSERT(rb->Format == MESA_FORMAT_
Z24_
S8 ||
- rb->Format == MESA_FORMAT_
S
8_Z24);
+ ASSERT(rb->Format == MESA_FORMAT_S8 ||
+ rb->Format == MESA_FORMAT_
X
8_Z24);
_mesa_reference_renderbuffer(&rb->Wrapped, NULL);
_mesa_reference_renderbuffer(&rb->Wrapped, NULL);
-
_mesa_
free(rb);
+ free(rb);
}
}
@@
-74,7
+73,7
@@
delete_wrapper(struct gl_renderbuffer *rb)
* Realloc storage for wrapper.
*/
static GLboolean
* Realloc storage for wrapper.
*/
static GLboolean
-alloc_wrapper_storage(
GL
context *ctx, struct gl_renderbuffer *rb,
+alloc_wrapper_storage(
struct gl_
context *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
/* just pass this on to the wrapped renderbuffer */
GLenum internalFormat, GLuint width, GLuint height)
{
/* just pass this on to the wrapped renderbuffer */
@@
-84,7
+83,9
@@
alloc_wrapper_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
(void) internalFormat;
ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
(void) internalFormat;
ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
- dsrb->Format == MESA_FORMAT_S8_Z24);
+ dsrb->Format == MESA_FORMAT_Z24_X8 ||
+ dsrb->Format == MESA_FORMAT_S8_Z24 ||
+ dsrb->Format == MESA_FORMAT_X8_Z24);
retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height);
if (retVal) {
retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height);
if (retVal) {
@@
-102,7
+103,7
@@
alloc_wrapper_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
*/
static void
*/
static void
-get_row_z24(
GL
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+get_row_z24(
struct gl_
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
GLint x, GLint y, void *values)
{
struct gl_renderbuffer *dsrb = z24rb->Wrapped;
GLint x, GLint y, void *values)
{
struct gl_renderbuffer *dsrb = z24rb->Wrapped;
@@
-129,7
+130,7
@@
get_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count,
}
static void
}
static void
-get_values_z24(
GL
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+get_values_z24(
struct gl_
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
const GLint x[], const GLint y[], void *values)
{
struct gl_renderbuffer *dsrb = z24rb->Wrapped;
const GLint x[], const GLint y[], void *values)
{
struct gl_renderbuffer *dsrb = z24rb->Wrapped;
@@
-154,7
+155,7
@@
get_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count,
}
static void
}
static void
-put_row_z24(
GL
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+put_row_z24(
struct gl_
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
GLint x, GLint y, const void *values, const GLubyte *mask)
{
struct gl_renderbuffer *dsrb = z24rb->Wrapped;
GLint x, GLint y, const void *values, const GLubyte *mask)
{
struct gl_renderbuffer *dsrb = z24rb->Wrapped;
@@
-205,7
+206,7
@@
put_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count,
}
static void
}
static void
-put_mono_row_z24(
GL
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+put_mono_row_z24(
struct gl_
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
GLint x, GLint y, const void *value, const GLubyte *mask)
{
struct gl_renderbuffer *dsrb = z24rb->Wrapped;
GLint x, GLint y, const void *value, const GLubyte *mask)
{
struct gl_renderbuffer *dsrb = z24rb->Wrapped;
@@
-259,7
+260,7
@@
put_mono_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count,
}
static void
}
static void
-put_values_z24(
GL
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
+put_values_z24(
struct gl_
context *ctx, struct gl_renderbuffer *z24rb, GLuint count,
const GLint x[], const GLint y[],
const void *values, const GLubyte *mask)
{
const GLint x[], const GLint y[],
const void *values, const GLubyte *mask)
{
@@
-312,7
+313,7
@@
put_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count,
}
static void
}
static void
-put_mono_values_z24(
GL
context *ctx, struct gl_renderbuffer *z24rb,
+put_mono_values_z24(
struct gl_
context *ctx, struct gl_renderbuffer *z24rb,
GLuint count, const GLint x[], const GLint y[],
const void *value, const GLubyte *mask)
{
GLuint count, const GLint x[], const GLint y[],
const void *value, const GLubyte *mask)
{
@@
-347,22
+348,27
@@
put_mono_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb,
* \return new depth renderbuffer
*/
struct gl_renderbuffer *
* \return new depth renderbuffer
*/
struct gl_renderbuffer *
-_mesa_new_z24_renderbuffer_wrapper(
GL
context *ctx,
+_mesa_new_z24_renderbuffer_wrapper(
struct gl_
context *ctx,
struct gl_renderbuffer *dsrb)
{
struct gl_renderbuffer *z24rb;
ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
struct gl_renderbuffer *dsrb)
{
struct gl_renderbuffer *z24rb;
ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
- dsrb->Format == MESA_FORMAT_S8_Z24);
+ dsrb->Format == MESA_FORMAT_Z24_X8 ||
+ dsrb->Format == MESA_FORMAT_S8_Z24 ||
+ dsrb->Format == MESA_FORMAT_X8_Z24);
ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- z24rb =
_mesa_new_r
enderbuffer(ctx, 0);
+ z24rb =
ctx->Driver.NewR
enderbuffer(ctx, 0);
if (!z24rb)
return NULL;
if (!z24rb)
return NULL;
+ /* NOTE: need to do manual refcounting here */
z24rb->Wrapped = dsrb;
z24rb->Wrapped = dsrb;
+ dsrb->RefCount++;
+
z24rb->Name = dsrb->Name;
z24rb->Name = dsrb->Name;
- z24rb->RefCount =
1
;
+ z24rb->RefCount =
0
;
z24rb->Width = dsrb->Width;
z24rb->Height = dsrb->Height;
z24rb->InternalFormat = GL_DEPTH_COMPONENT24;
z24rb->Width = dsrb->Width;
z24rb->Height = dsrb->Height;
z24rb->InternalFormat = GL_DEPTH_COMPONENT24;
@@
-390,7
+396,7
@@
_mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx,
*/
static void
*/
static void
-get_row_s8(
GL
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+get_row_s8(
struct gl_
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
GLint x, GLint y, void *values)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
GLint x, GLint y, void *values)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
@@
-417,7
+423,7
@@
get_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count,
}
static void
}
static void
-get_values_s8(
GL
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+get_values_s8(
struct gl_
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
const GLint x[], const GLint y[], void *values)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
const GLint x[], const GLint y[], void *values)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
@@
-442,7
+448,7
@@
get_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count,
}
static void
}
static void
-put_row_s8(
GL
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+put_row_s8(
struct gl_
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
GLint x, GLint y, const void *values, const GLubyte *mask)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
GLint x, GLint y, const void *values, const GLubyte *mask)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
@@
-493,7
+499,7
@@
put_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count,
}
static void
}
static void
-put_mono_row_s8(
GL
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+put_mono_row_s8(
struct gl_
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
GLint x, GLint y, const void *value, const GLubyte *mask)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
GLint x, GLint y, const void *value, const GLubyte *mask)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
@@
-544,7
+550,7
@@
put_mono_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count,
}
static void
}
static void
-put_values_s8(
GL
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+put_values_s8(
struct gl_
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
const GLint x[], const GLint y[],
const void *values, const GLubyte *mask)
{
const GLint x[], const GLint y[],
const void *values, const GLubyte *mask)
{
@@
-597,7
+603,7
@@
put_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count,
}
static void
}
static void
-put_mono_values_s8(
GL
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
+put_mono_values_s8(
struct gl_
context *ctx, struct gl_renderbuffer *s8rb, GLuint count,
const GLint x[], const GLint y[],
const void *value, const GLubyte *mask)
{
const GLint x[], const GLint y[],
const void *value, const GLubyte *mask)
{
@@
-631,7
+637,7
@@
put_mono_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count,
* \return new stencil renderbuffer
*/
struct gl_renderbuffer *
* \return new stencil renderbuffer
*/
struct gl_renderbuffer *
-_mesa_new_s8_renderbuffer_wrapper(
GL
context *ctx, struct gl_renderbuffer *dsrb)
+_mesa_new_s8_renderbuffer_wrapper(
struct gl_
context *ctx, struct gl_renderbuffer *dsrb)
{
struct gl_renderbuffer *s8rb;
{
struct gl_renderbuffer *s8rb;
@@
-639,13
+645,16
@@
_mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, struct gl_renderbuffer *dsrb)
dsrb->Format == MESA_FORMAT_S8_Z24);
ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
dsrb->Format == MESA_FORMAT_S8_Z24);
ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
- s8rb =
_mesa_new_r
enderbuffer(ctx, 0);
+ s8rb =
ctx->Driver.NewR
enderbuffer(ctx, 0);
if (!s8rb)
return NULL;
if (!s8rb)
return NULL;
+ /* NOTE: need to do manual refcounting here */
s8rb->Wrapped = dsrb;
s8rb->Wrapped = dsrb;
+ dsrb->RefCount++;
+
s8rb->Name = dsrb->Name;
s8rb->Name = dsrb->Name;
- s8rb->RefCount =
1
;
+ s8rb->RefCount =
0
;
s8rb->Width = dsrb->Width;
s8rb->Height = dsrb->Height;
s8rb->InternalFormat = GL_STENCIL_INDEX8_EXT;
s8rb->Width = dsrb->Width;
s8rb->Height = dsrb->Height;
s8rb->InternalFormat = GL_STENCIL_INDEX8_EXT;
@@
-689,7
+698,7
@@
_mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, struct gl_renderbuffer *dsrb)
* (either 8-bit or 32-bit)
*/
void
* (either 8-bit or 32-bit)
*/
void
-_mesa_extract_stencil(
GL
context *ctx,
+_mesa_extract_stencil(
struct gl_
context *ctx,
struct gl_renderbuffer *dsRb,
struct gl_renderbuffer *stencilRb)
{
struct gl_renderbuffer *dsRb,
struct gl_renderbuffer *stencilRb)
{
@@
-738,7
+747,7
@@
_mesa_extract_stencil(GLcontext *ctx,
* \param stencilRb the source stencil buffer (either 8-bit or 32-bit)
*/
void
* \param stencilRb the source stencil buffer (either 8-bit or 32-bit)
*/
void
-_mesa_insert_stencil(
GL
context *ctx,
+_mesa_insert_stencil(
struct gl_
context *ctx,
struct gl_renderbuffer *dsRb,
struct gl_renderbuffer *stencilRb)
{
struct gl_renderbuffer *dsRb,
struct gl_renderbuffer *stencilRb)
{
@@
-794,7
+803,7
@@
_mesa_insert_stencil(GLcontext *ctx,
* \param stencilRb the stencil renderbuffer to promote
*/
void
* \param stencilRb the stencil renderbuffer to promote
*/
void
-_mesa_promote_stencil(
GL
context *ctx, struct gl_renderbuffer *stencilRb)
+_mesa_promote_stencil(
struct gl_
context *ctx, struct gl_renderbuffer *stencilRb)
{
const GLsizei width = stencilRb->Width;
const GLsizei height = stencilRb->Height;
{
const GLsizei width = stencilRb->Width;
const GLsizei height = stencilRb->Height;
@@
-819,5
+828,5
@@
_mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb)
}
stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL);
}
}
stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL);
}
-
_mesa_
free(data);
+ free(data);
}
}