summaryrefslogtreecommitdiff
path: root/dist/Mesa/src/mesa/swrast/s_depth.c
diff options
context:
space:
mode:
Diffstat (limited to 'dist/Mesa/src/mesa/swrast/s_depth.c')
-rw-r--r--dist/Mesa/src/mesa/swrast/s_depth.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/dist/Mesa/src/mesa/swrast/s_depth.c b/dist/Mesa/src/mesa/swrast/s_depth.c
index 0f4fb9506..134f897c0 100644
--- a/dist/Mesa/src/mesa/swrast/s_depth.c
+++ b/dist/Mesa/src/mesa/swrast/s_depth.c
@@ -171,12 +171,12 @@ _swrast_depth_clamp_span( struct gl_context *ctx, SWspan *span )
GLfloat min_f, max_f;
GLuint i;
- if (ctx->Viewport.Near < ctx->Viewport.Far) {
- min_f = ctx->Viewport.Near;
- max_f = ctx->Viewport.Far;
+ if (ctx->ViewportArray[0].Near < ctx->ViewportArray[0].Far) {
+ min_f = ctx->ViewportArray[0].Near;
+ max_f = ctx->ViewportArray[0].Far;
} else {
- min_f = ctx->Viewport.Far;
- max_f = ctx->Viewport.Near;
+ min_f = ctx->ViewportArray[0].Far;
+ max_f = ctx->ViewportArray[0].Near;
}
/* Convert floating point values in [0,1] to device Z coordinates in
@@ -217,7 +217,7 @@ get_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
const GLubyte *map = _swrast_pixel_address(rb, 0, 0);
GLuint i;
- if (rb->Format == MESA_FORMAT_Z32) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM32) {
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
@@ -252,7 +252,7 @@ put_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLubyte *map = _swrast_pixel_address(rb, 0, 0);
GLuint i;
- if (rb->Format == MESA_FORMAT_Z32) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM32) {
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (mask[i] && x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
@@ -300,12 +300,12 @@ _swrast_depth_test_span(struct gl_context *ctx, SWspan *span)
else
zStart = _swrast_pixel_address(rb, span->x, span->y);
- if (rb->Format == MESA_FORMAT_Z16 && !(span->arrayMask & SPAN_XY)) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM16 && !(span->arrayMask & SPAN_XY)) {
/* directly read/write row of 16-bit Z values */
zBufferVals = zStart;
ztest16 = GL_TRUE;
}
- else if (rb->Format == MESA_FORMAT_Z32 && !(span->arrayMask & SPAN_XY)) {
+ else if (rb->Format == MESA_FORMAT_Z_UNORM32 && !(span->arrayMask & SPAN_XY)) {
/* directly read/write row of 32-bit Z values */
zBufferVals = zStart;
}
@@ -439,7 +439,7 @@ _swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
else
zStart = _swrast_pixel_address(rb, span->x, span->y);
- if (rb->Format == MESA_FORMAT_Z32 && !(span->arrayMask & SPAN_XY)) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM32 && !(span->arrayMask & SPAN_XY)) {
/* directly access 32-bit values in the depth buffer */
zBufferVals = (const GLuint *) zStart;
}
@@ -552,10 +552,10 @@ _swrast_clear_depth_buffer(struct gl_context *ctx)
height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
mapMode = GL_MAP_WRITE_BIT;
- if (rb->Format == MESA_FORMAT_S8_Z24 ||
- rb->Format == MESA_FORMAT_X8_Z24 ||
- rb->Format == MESA_FORMAT_Z24_S8 ||
- rb->Format == MESA_FORMAT_Z24_X8) {
+ if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT ||
+ rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT ||
+ rb->Format == MESA_FORMAT_S8_UINT_Z24_UNORM ||
+ rb->Format == MESA_FORMAT_X8_UINT_Z24_UNORM) {
mapMode |= GL_MAP_READ_BIT;
}
@@ -567,7 +567,7 @@ _swrast_clear_depth_buffer(struct gl_context *ctx)
}
switch (rb->Format) {
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
{
GLfloat clear = (GLfloat) ctx->Depth.Clear;
GLushort clearVal = 0;
@@ -587,8 +587,8 @@ _swrast_clear_depth_buffer(struct gl_context *ctx)
}
}
break;
- case MESA_FORMAT_Z32:
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_UNORM32:
+ case MESA_FORMAT_Z_FLOAT32:
{
GLfloat clear = (GLfloat) ctx->Depth.Clear;
GLuint clearVal = 0;
@@ -602,17 +602,17 @@ _swrast_clear_depth_buffer(struct gl_context *ctx)
}
}
break;
- case MESA_FORMAT_S8_Z24:
- case MESA_FORMAT_X8_Z24:
- case MESA_FORMAT_Z24_S8:
- case MESA_FORMAT_Z24_X8:
+ case MESA_FORMAT_Z24_UNORM_S8_UINT:
+ case MESA_FORMAT_Z24_UNORM_X8_UINT:
+ case MESA_FORMAT_S8_UINT_Z24_UNORM:
+ case MESA_FORMAT_X8_UINT_Z24_UNORM:
{
GLfloat clear = (GLfloat) ctx->Depth.Clear;
GLuint clearVal = 0;
GLuint mask;
- if (rb->Format == MESA_FORMAT_S8_Z24 ||
- rb->Format == MESA_FORMAT_X8_Z24)
+ if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT ||
+ rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT)
mask = 0xff000000;
else
mask = 0xff;
@@ -628,7 +628,7 @@ _swrast_clear_depth_buffer(struct gl_context *ctx)
}
break;
- case MESA_FORMAT_Z32_FLOAT_X24S8:
+ case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
/* XXX untested */
{
GLfloat clearVal = (GLfloat) ctx->Depth.Clear;
@@ -692,15 +692,15 @@ _swrast_clear_depth_stencil_buffer(struct gl_context *ctx)
}
switch (rb->Format) {
- case MESA_FORMAT_S8_Z24:
- case MESA_FORMAT_Z24_S8:
+ case MESA_FORMAT_Z24_UNORM_S8_UINT:
+ case MESA_FORMAT_S8_UINT_Z24_UNORM:
{
GLfloat zClear = (GLfloat) ctx->Depth.Clear;
GLuint clear = 0, mask;
_mesa_pack_float_z_row(rb->Format, 1, &zClear, &clear);
- if (rb->Format == MESA_FORMAT_S8_Z24) {
+ if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT) {
mask = ((~writeMask) & 0xff) << 24;
clear |= (ctx->Stencil.Clear & writeMask & 0xff) << 24;
}
@@ -725,7 +725,7 @@ _swrast_clear_depth_stencil_buffer(struct gl_context *ctx)
}
}
break;
- case MESA_FORMAT_Z32_FLOAT_X24S8:
+ case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
/* XXX untested */
{
const GLfloat zClear = (GLfloat) ctx->Depth.Clear;