core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

s_depth.c File Reference

#include "main/glheader.h"
#include "main/context.h"
#include "main/macros.h"
#include "main/imports.h"
#include "main/fbobject.h"
#include "s_depth.h"
#include "s_context.h"
#include "s_span.h"

Defines

#define Z_ADDRESS(X, Y)   (zStart + (Y) * stride + (X))

Functions

static GLuint depth_test_span16 (GLcontext *ctx, GLuint n, GLushort zbuffer[], const GLuint z[], GLubyte mask[])
 Do depth test for a horizontal span of fragments.
static GLuint depth_test_span32 (GLcontext *ctx, GLuint n, GLuint zbuffer[], const GLuint z[], GLubyte mask[])
void _swrast_depth_clamp_span (GLcontext *ctx, SWspan *span)
static GLuint depth_test_span (GLcontext *ctx, SWspan *span)
static void direct_depth_test_pixels16 (GLcontext *ctx, GLushort *zStart, GLuint stride, GLuint n, const GLint x[], const GLint y[], const GLuint z[], GLubyte mask[])
static void direct_depth_test_pixels32 (GLcontext *ctx, GLuint *zStart, GLuint stride, GLuint n, const GLint x[], const GLint y[], const GLuint z[], GLubyte mask[])
static GLuint depth_test_pixels (GLcontext *ctx, SWspan *span)
GLuint _swrast_depth_test_span (GLcontext *ctx, SWspan *span)
 Apply depth (Z) buffer testing to the span.
GLboolean _swrast_depth_bounds_test (GLcontext *ctx, SWspan *span)
 GL_EXT_depth_bounds_test extension.
void _swrast_read_depth_span_float (GLcontext *ctx, struct gl_renderbuffer *rb, GLint n, GLint x, GLint y, GLfloat depth[])
 Read a span of depth values from the given depth renderbuffer, returning the values as GLfloats.
void _swrast_read_depth_span_uint (GLcontext *ctx, struct gl_renderbuffer *rb, GLint n, GLint x, GLint y, GLuint depth[])
 As above, but return 32-bit GLuint values.
void _swrast_clear_depth_buffer (GLcontext *ctx, struct gl_renderbuffer *rb)
 Clear the given z/depth renderbuffer.


Define Documentation

#define Z_ADDRESS ( X,
 )     (zStart + (Y) * stride + (X))


Function Documentation

void _swrast_clear_depth_buffer ( GLcontext ctx,
struct gl_renderbuffer rb 
)

Clear the given z/depth renderbuffer.

GLboolean _swrast_depth_bounds_test ( GLcontext ctx,
SWspan span 
)

GL_EXT_depth_bounds_test extension.

Discard fragments depending on whether the corresponding Z-buffer values are outside the depth bounds test range. Note: we test the Z buffer values, not the fragment Z values!

Returns:
GL_TRUE if any fragments pass, GL_FALSE if no fragments pass

void _swrast_depth_clamp_span ( GLcontext ctx,
SWspan span 
)

GLuint _swrast_depth_test_span ( GLcontext ctx,
SWspan span 
)

Apply depth (Z) buffer testing to the span.

Returns:
approx number of pixels that passed (only zero is reliable)

void _swrast_read_depth_span_float ( GLcontext ctx,
struct gl_renderbuffer rb,
GLint  n,
GLint  x,
GLint  y,
GLfloat  depth[] 
)

Read a span of depth values from the given depth renderbuffer, returning the values as GLfloats.

This function does clipping to prevent reading outside the depth buffer's bounds. Though the clipping is redundant when we're called from _swrast_ReadPixels.

void _swrast_read_depth_span_uint ( GLcontext ctx,
struct gl_renderbuffer rb,
GLint  n,
GLint  x,
GLint  y,
GLuint  depth[] 
)

As above, but return 32-bit GLuint values.

static GLuint depth_test_pixels ( GLcontext ctx,
SWspan span 
) [static]

static GLuint depth_test_span ( GLcontext ctx,
SWspan span 
) [static]

static GLuint depth_test_span16 ( GLcontext ctx,
GLuint  n,
GLushort  zbuffer[],
const GLuint  z[],
GLubyte  mask[] 
) [static]

Do depth test for a horizontal span of fragments.

Input: zbuffer - array of z values in the zbuffer z - array of fragment z values Return: number of fragments which pass the test.

static GLuint depth_test_span32 ( GLcontext ctx,
GLuint  n,
GLuint  zbuffer[],
const GLuint  z[],
GLubyte  mask[] 
) [static]

static void direct_depth_test_pixels16 ( GLcontext ctx,
GLushort *  zStart,
GLuint  stride,
GLuint  n,
const GLint  x[],
const GLint  y[],
const GLuint  z[],
GLubyte  mask[] 
) [static]

static void direct_depth_test_pixels32 ( GLcontext ctx,
GLuint *  zStart,
GLuint  stride,
GLuint  n,
const GLint  x[],
const GLint  y[],
const GLuint  z[],
GLubyte  mask[] 
) [static]


Generated on Sun Sep 27 06:48:05 2009 for Mesa Software Rasterization (swrast) by  doxygen 1.5.4