float F = A*C-B*B/4.0f;
/* check if it is an ellipse */
- /* ASSERT(F > 0.0); */
+ /* assert(F > 0.0); */
/* Compute the ellipse's (u,v) bounding box in texture space */
float d = -B*B+4.0f*C*A;
static int
get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
{
- ASSERT(xmvis);
+ assert(xmvis);
switch(attrib) {
case GLX_USE_GL:
if (fbconfig)
XMesaDisplay xmdpy = xmesa_init_display(vis->display);
XMesaBuffer b;
- ASSERT(type == WINDOW || type == PIXMAP || type == PBUFFER);
+ assert(type == WINDOW || type == PIXMAP || type == PBUFFER);
if (!xmdpy)
return NULL;
GLboolean rgb_flag, Drawable window,
Colormap cmap)
{
- ASSERT(!b || b->xm_visual == v);
+ assert(!b || b->xm_visual == v);
/* Save true bits/pixel */
v->BitsPerPixel = bits_per_pixel(v);
void
_mesa_meta_init(struct gl_context *ctx)
{
- ASSERT(!ctx->Meta);
+ assert(!ctx->Meta);
ctx->Meta = CALLOC_STRUCT(gl_meta_state);
}
if (state & MESA_META_TEXTURE) {
GLuint u, tgt;
- ASSERT(ctx->Texture.CurrentUnit == 0);
+ assert(ctx->Texture.CurrentUnit == 0);
/* restore texenv for unit[0] */
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, save->EnvMode);
{
GLboolean newTex = GL_FALSE;
- ASSERT(width <= tex->MaxSize);
- ASSERT(height <= tex->MaxSize);
+ assert(width <= tex->MaxSize);
+ assert(height <= tex->MaxSize);
if (width > tex->Width ||
height > tex->Height ||
_mesa_ClampColor(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
}
else {
- ASSERT(metaSave & MESA_META_COLOR_MASK);
+ assert(metaSave & MESA_META_COLOR_MASK);
_mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
}
{
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
- ASSERT(irb);
+ assert(irb);
intel_miptree_release(&irb->mt);
intel_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
- ASSERT(rb->Name == 0);
+ assert(rb->Name == 0);
rb->Width = width;
rb->Height = height;
rb->InternalFormat = internalFormat;
_DBG("%s %p %d\n", __FUNCTION__, region, region->refcount - 1);
- ASSERT(region->refcount > 0);
+ assert(region->refcount > 0);
region->refcount--;
if (region->refcount == 0) {
{
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
- ASSERT(irb);
+ assert(irb);
intel_miptree_release(&irb->mt);
intel_miptree_release(&irb->singlesample_mt);
intel_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
- ASSERT(rb->Name == 0);
+ assert(rb->Name == 0);
rb->Width = width;
rb->Height = height;
rb->InternalFormat = internalFormat;
r200ContextPtr rmesa = R200_CONTEXT(ctx);
GLuint rop = (GLuint)opcode - GL_CLEAR;
- ASSERT( rop < 16 );
+ assert( rop < 16 );
R200_STATECHANGE( rmesa, msk );
rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = r200_rop_tab[rop];
}
else if (t->base.Target == GL_TEXTURE_CUBE_MAP) {
- ASSERT(log2Width == log2Height);
+ assert(log2Width == log2Height);
t->pp_txformat |= ((log2Width << R200_TXFORMAT_F5_WIDTH_SHIFT) |
(log2Height << R200_TXFORMAT_F5_HEIGHT_SHIFT) |
/* don't think we need this bit, if it exists at all - fglrx does not set it */
rmesa->dma.flush = rcommon_flush_last_swtcl_prim;
}
- ASSERT( vsize == rmesa->swtcl.vertex_size * 4 );
- ASSERT( rmesa->dma.flush == rcommon_flush_last_swtcl_prim );
- ASSERT( rmesa->dma.current_used +
+ assert( vsize == rmesa->swtcl.vertex_size * 4 );
+ assert( rmesa->dma.flush == rcommon_flush_last_swtcl_prim );
+ assert( rmesa->dma.current_used +
rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
rmesa->dma.current_vertexptr );
"%s(rb %p, rrb %p) \n",
__func__, rb, rrb);
- ASSERT(rrb);
+ assert(rrb);
if (rrb && rrb->bo) {
radeon_bo_unref(rrb->bo);
"%s(%p, rb %p) \n",
__func__, ctx, rb);
- ASSERT(rb->Name != 0);
+ assert(rb->Name != 0);
switch (internalFormat) {
case GL_R3_G3_B2:
case GL_RGB4:
radeon_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLuint width, GLuint height)
{
- ASSERT(rb->Name == 0);
+ assert(rb->Name == 0);
rb->Width = width;
rb->Height = height;
rb->InternalFormat = internalFormat;
(void) fb;
- ASSERT(newImage);
+ assert(newImage);
radeon_image = (radeon_texture_image *)newImage;
r100ContextPtr rmesa = R100_CONTEXT(ctx);
GLuint rop = (GLuint)opcode - GL_CLEAR;
- ASSERT( rop < 16 );
+ assert( rop < 16 );
RADEON_STATECHANGE( rmesa, msk );
rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = radeon_rop_tab[rop];
t->tile_bits = 0;
if (t->base.Target == GL_TEXTURE_CUBE_MAP) {
- ASSERT(log2Width == log2Height);
+ assert(log2Width == log2Height);
t->pp_txformat |= ((log2Width << RADEON_TXFORMAT_F5_WIDTH_SHIFT) |
(log2Height << RADEON_TXFORMAT_F5_HEIGHT_SHIFT) |
/* don't think we need this bit, if it exists at all - fglrx does not set it */
return;
}
- ASSERT(xrb->Base.Buffer);
+ assert(xrb->Base.Buffer);
if (rb->AllocStorage == swrast_alloc_back_storage) {
map += (rb->Height - 1) * stride;
}
}
else if (osmesa->format == OSMESA_RGB_565) {
- ASSERT(osmesa->DataType == GL_UNSIGNED_BYTE);
+ assert(osmesa->DataType == GL_UNSIGNED_BYTE);
rb->Format = MESA_FORMAT_B5G6R5_UNORM;
}
else {
static int
get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
{
- ASSERT(xmvis);
+ assert(xmvis);
switch(attrib) {
case GLX_USE_GL:
if (fbconfig)
{
XMesaBuffer b;
- ASSERT(type == WINDOW || type == PIXMAP || type == PBUFFER);
+ assert(type == WINDOW || type == PIXMAP || type == PBUFFER);
b = (XMesaBuffer) CALLOC_STRUCT(xmesa_buffer);
if (!b)
const int xclass = v->visualType;
- ASSERT(!b || b->xm_visual == v);
+ assert(!b || b->xm_visual == v);
/* Save true bits/pixel */
v->BitsPerPixel = bits_per_pixel(v);
/* Do window-specific initializations */
/* these should have been set in create_xmesa_buffer */
- ASSERT(b->frontxrb->drawable == window);
- ASSERT(b->frontxrb->pixmap == (XMesaPixmap) window);
+ assert(b->frontxrb->drawable == window);
+ assert(b->frontxrb->pixmap == (XMesaPixmap) window);
/* Setup for single/double buffering */
if (v->mesa_visual.doubleBufferMode) {
const int rowLength = clippedUnpack.RowLength;
XMesaImage ximage;
- ASSERT(xmesa->xm_visual->dithered_pf == PF_8R8G8B);
- ASSERT(xmesa->xm_visual->undithered_pf == PF_8R8G8B);
- ASSERT(dpy);
- ASSERT(gc);
+ assert(xmesa->xm_visual->dithered_pf == PF_8R8G8B);
+ assert(xmesa->xm_visual->undithered_pf == PF_8R8G8B);
+ assert(dpy);
+ assert(gc);
/* This is a little tricky since all coordinates up to now have
* been in the OpenGL bottom-to-top orientation. X is top-to-bottom
const int rowLength = clippedUnpack.RowLength;
XMesaImage ximage;
- ASSERT(xmesa->xm_visual->undithered_pf == PF_5R6G5B);
- ASSERT(dpy);
- ASSERT(gc);
+ assert(xmesa->xm_visual->undithered_pf == PF_5R6G5B);
+ assert(dpy);
+ assert(gc);
/* This is a little tricky since all coordinates up to now have
* been in the OpenGL bottom-to-top orientation. X is top-to-bottom
struct xmesa_renderbuffer *dstXrb
= xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
- ASSERT(dpy);
- ASSERT(gc);
+ assert(dpy);
+ assert(gc);
/* Note: we don't do any special clipping work here. We could,
* but X will do it for us.
*/
at->array = attribArray;
at->binding = &vao->VertexBinding[attribArray->VertexBinding];
- ASSERT(!at->array->Normalized);
+ assert(!at->array->Normalized);
at->func = AttribFuncsNV[at->array->Normalized]
[at->array->Size-1]
[TYPE_IDX(at->array->Type)];
check_vbo(actx, vao->IndexBufferObj);
- ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
- ASSERT(aa - actx->arrays < 32);
+ assert(at - actx->attribs <= VERT_ATTRIB_MAX);
+ assert(aa - actx->arrays < 32);
at->func = NULL; /* terminate the list */
aa->offset = -1; /* terminate the list */
}
/* Never null pointers */
- ASSERT(ctx->VertexProgram.Current);
- ASSERT(ctx->FragmentProgram.Current);
+ assert(ctx->VertexProgram.Current);
+ assert(ctx->FragmentProgram.Current);
if (ctx->Driver.BindProgram)
ctx->Driver.BindProgram(ctx, target, newProg);
if (get_local_param_pointer(ctx, "glProgramLocalParameterARB",
target, index, ¶m)) {
- ASSERT(index < MAX_PROGRAM_LOCAL_PARAMS);
+ assert(index < MAX_PROGRAM_LOCAL_PARAMS);
ASSIGN_4V(param, x, y, z, w);
}
}
return;
}
- ASSERT(prog);
- ASSERT(limits);
+ assert(prog);
+ assert(limits);
/* Queries supported for both vertex and fragment programs */
switch (pname) {
return;
}
- ASSERT(prog);
+ assert(prog);
if (pname != GL_PROGRAM_STRING_ARB) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringARB(pname)");
struct gl_vertex_array_object *oldObj = *ptr;
mtx_lock(&oldObj->Mutex);
- ASSERT(oldObj->RefCount > 0);
+ assert(oldObj->RefCount > 0);
oldObj->RefCount--;
#if 0
printf("ArrayObj %p %d DECR to %d\n",
mtx_unlock(&oldObj->Mutex);
if (deleteFlag) {
- ASSERT(ctx->Driver.DeleteArrayObject);
+ assert(ctx->Driver.DeleteArrayObject);
ctx->Driver.DeleteArrayObject(ctx, oldObj);
}
*ptr = NULL;
}
- ASSERT(!*ptr);
+ assert(!*ptr);
if (vao) {
/* reference new array object */
struct gl_vertex_array_object * const oldObj = ctx->Array.VAO;
struct gl_vertex_array_object *newObj = NULL;
- ASSERT(oldObj != NULL);
+ assert(oldObj != NULL);
if ( oldObj->Name == id )
return; /* rebinding the same array object- no change */
struct gl_vertex_array_object *obj = _mesa_lookup_vao(ctx, ids[i]);
if ( obj != NULL ) {
- ASSERT( obj->Name == ids[i] );
+ assert( obj->Name == ids[i] );
/* If the array object is currently bound, the spec says "the binding
* for that object reverts to zero and the default vertex array
/* do actual bind */
ctx->ATIFragmentShader.Current = newProg;
- ASSERT(ctx->ATIFragmentShader.Current);
+ assert(ctx->ATIFragmentShader.Current);
if (newProg)
newProg->RefCount++;
if (clamp == GL_TRUE || clamp == GL_FALSE)
return clamp;
- ASSERT(clamp == GL_FIXED_ONLY);
+ assert(clamp == GL_FIXED_ONLY);
if (!fb)
return GL_TRUE;
return;
}
- ASSERT(ctx->Driver.BlitFramebuffer);
+ assert(ctx->Driver.BlitFramebuffer);
ctx->Driver.BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
struct gl_buffer_object *oldObj = *ptr;
mtx_lock(&oldObj->Mutex);
- ASSERT(oldObj->RefCount > 0);
+ assert(oldObj->RefCount > 0);
oldObj->RefCount--;
#if 0
printf("BufferObj %p %d DECR to %d\n",
/* some sanity checking: don't delete a buffer still in use */
#if 0
/* unfortunately, these tests are invalid during context tear-down */
- ASSERT(ctx->Array.ArrayBufferObj != bufObj);
- ASSERT(ctx->Array.VAO->IndexBufferObj != bufObj);
- ASSERT(ctx->Array.VAO->Vertex.BufferObj != bufObj);
+ assert(ctx->Array.ArrayBufferObj != bufObj);
+ assert(ctx->Array.VAO->IndexBufferObj != bufObj);
+ assert(ctx->Array.VAO->Vertex.BufferObj != bufObj);
#endif
- ASSERT(ctx->Driver.DeleteBuffer);
+ assert(ctx->Driver.DeleteBuffer);
ctx->Driver.DeleteBuffer(ctx, oldObj);
}
*ptr = NULL;
}
- ASSERT(!*ptr);
+ assert(!*ptr);
if (bufObj) {
/* reference new buffer */
(void) ctx;
/* this should have been caught in _mesa_BufferSubData() */
- ASSERT(size + offset <= bufObj->Size);
+ assert(size + offset <= bufObj->Size);
if (bufObj->Data) {
memcpy( (GLubyte *) bufObj->Data + offset, data, size );
GLsizeiptr i;
GLubyte *dest;
- ASSERT(ctx->Driver.MapBufferRange);
+ assert(ctx->Driver.MapBufferRange);
dest = ctx->Driver.MapBufferRange(ctx, offset, size,
GL_MAP_WRITE_BIT |
GL_MAP_INVALIDATE_RANGE_BIT,
/* If this is a new buffer object id, or one which was generated but
* never used before, allocate a buffer object now.
*/
- ASSERT(ctx->Driver.NewBufferObject);
+ assert(ctx->Driver.NewBufferObject);
buf = ctx->Driver.NewBufferObject(ctx, buffer);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", caller);
for (i = 0; i < MAP_COUNT; i++) {
if (_mesa_bufferobj_mapped(bufObj, i)) {
ctx->Driver.UnmapBuffer(ctx, bufObj, i);
- ASSERT(bufObj->Mappings[i].Pointer == NULL);
+ assert(bufObj->Mappings[i].Pointer == NULL);
bufObj->Mappings[i].AccessFlags = 0;
}
}
struct gl_vertex_array_object *vao = ctx->Array.VAO;
GLuint j;
- ASSERT(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
+ assert(bufObj->Name == ids[i] || bufObj == &DummyBufferObject);
_mesa_buffer_unmap_all_mappings(ctx, bufObj);
bufObj->Written = GL_TRUE;
bufObj->Immutable = GL_TRUE;
- ASSERT(ctx->Driver.BufferData);
+ assert(ctx->Driver.BufferData);
if (!ctx->Driver.BufferData(ctx, target, size, data, GL_DYNAMIC_DRAW,
flags, bufObj)) {
if (target == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD) {
size += 100;
#endif
- ASSERT(ctx->Driver.BufferData);
+ assert(ctx->Driver.BufferData);
if (!ctx->Driver.BufferData(ctx, target, size, data, usage,
GL_MAP_READ_BIT |
GL_MAP_WRITE_BIT |
bufObj->Written = GL_TRUE;
- ASSERT(ctx->Driver.BufferSubData);
+ assert(ctx->Driver.BufferSubData);
ctx->Driver.BufferSubData( ctx, offset, size, data, bufObj );
}
return;
}
- ASSERT(ctx->Driver.GetBufferSubData);
+ assert(ctx->Driver.GetBufferSubData);
ctx->Driver.GetBufferSubData( ctx, offset, size, data, bufObj );
}
return NULL;
}
- ASSERT(ctx->Driver.MapBufferRange);
+ assert(ctx->Driver.MapBufferRange);
map = ctx->Driver.MapBufferRange(ctx, 0, bufObj->Size, accessFlags, bufObj,
MAP_USER);
if (!map) {
* This is important because other modules (like VBO) might call
* the driver function directly.
*/
- ASSERT(bufObj->Mappings[MAP_USER].Pointer == map);
- ASSERT(bufObj->Mappings[MAP_USER].Length == bufObj->Size);
- ASSERT(bufObj->Mappings[MAP_USER].Offset == 0);
+ assert(bufObj->Mappings[MAP_USER].Pointer == map);
+ assert(bufObj->Mappings[MAP_USER].Length == bufObj->Size);
+ assert(bufObj->Mappings[MAP_USER].Offset == 0);
bufObj->Mappings[MAP_USER].AccessFlags = accessFlags;
}
status = ctx->Driver.UnmapBuffer(ctx, bufObj, MAP_USER);
bufObj->Mappings[MAP_USER].AccessFlags = 0;
- ASSERT(bufObj->Mappings[MAP_USER].Pointer == NULL);
- ASSERT(bufObj->Mappings[MAP_USER].Offset == 0);
- ASSERT(bufObj->Mappings[MAP_USER].Length == 0);
+ assert(bufObj->Mappings[MAP_USER].Pointer == NULL);
+ assert(bufObj->Mappings[MAP_USER].Offset == 0);
+ assert(bufObj->Mappings[MAP_USER].Length == 0);
return status;
}
return bufObj->Mappings[MAP_USER].Pointer;
}
- ASSERT(ctx->Driver.MapBufferRange);
+ assert(ctx->Driver.MapBufferRange);
map = ctx->Driver.MapBufferRange(ctx, offset, length, access, bufObj,
MAP_USER);
if (!map) {
* This is important because other modules (like VBO) might call
* the driver function directly.
*/
- ASSERT(bufObj->Mappings[MAP_USER].Pointer == map);
- ASSERT(bufObj->Mappings[MAP_USER].Length == length);
- ASSERT(bufObj->Mappings[MAP_USER].Offset == offset);
- ASSERT(bufObj->Mappings[MAP_USER].AccessFlags == access);
+ assert(bufObj->Mappings[MAP_USER].Pointer == map);
+ assert(bufObj->Mappings[MAP_USER].Length == length);
+ assert(bufObj->Mappings[MAP_USER].Offset == offset);
+ assert(bufObj->Mappings[MAP_USER].AccessFlags == access);
}
return map;
return;
}
- ASSERT(bufObj->Mappings[MAP_USER].AccessFlags & GL_MAP_WRITE_BIT);
+ assert(bufObj->Mappings[MAP_USER].AccessFlags & GL_MAP_WRITE_BIT);
if (ctx->Driver.FlushMappedBufferRange)
ctx->Driver.FlushMappedBufferRange(ctx, offset, length, bufObj,
GLuint output;
for (output = 0; output < n; output++) {
mask[output] = draw_buffer_enum_to_bitmask(ctx, buffers[output]);
- ASSERT(mask[output] != BAD_MASK);
+ assert(mask[output] != BAD_MASK);
mask[output] &= supportedMask;
}
destMask = mask;
if (destMask[buf]) {
GLint bufIndex = ffs(destMask[buf]) - 1;
/* only one bit should be set in the destMask[buf] field */
- ASSERT(_mesa_bitcount(destMask[buf]) == 1);
+ assert(_mesa_bitcount(destMask[buf]) == 1);
if (fb->_ColorDrawBufferIndexes[buf] != bufIndex) {
updated_drawbuffers(ctx);
fb->_ColorDrawBufferIndexes[buf] = bufIndex;
bufferMask |= BUFFER_BIT_ACCUM;
}
- ASSERT(ctx->Driver.Clear);
+ assert(ctx->Driver.Clear);
ctx->Driver.Clear(ctx, bufferMask);
}
}
#endif
-/**
- * ASSERT macro
- */
-#if defined(DEBUG)
-# define ASSERT(X) assert(X)
-#else
-# define ASSERT(X)
-#endif
-
-
/*
* A trick to suppress uninitialized variable warning without generating any
* code
return;
}
- ASSERT(ctx->Query.CondRenderMode == GL_NONE);
+ assert(ctx->Query.CondRenderMode == GL_NONE);
/* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says:
*
"glBeginConditionalRender(bad queryId=%u)", queryId);
return;
}
- ASSERT(q->Id == queryId);
+ assert(q->Id == queryId);
switch (mode) {
case GL_QUERY_WAIT:
/* We used to call _glapi_check_multithread() here. Now do it in drivers */
_glapi_set_context((void *) newCtx);
- ASSERT(_mesa_get_current_context() == newCtx);
+ assert(_mesa_get_current_context() == newCtx);
if (!newCtx) {
_glapi_set_dispatch(NULL); /* none current */
_glapi_set_dispatch(newCtx->CurrentDispatch);
if (drawBuffer && readBuffer) {
- ASSERT(_mesa_is_winsys_fbo(drawBuffer));
- ASSERT(_mesa_is_winsys_fbo(readBuffer));
+ assert(_mesa_is_winsys_fbo(drawBuffer));
+ assert(_mesa_is_winsys_fbo(readBuffer));
_mesa_reference_framebuffer(&newCtx->WinSysDrawBuffer, drawBuffer);
_mesa_reference_framebuffer(&newCtx->WinSysReadBuffer, readBuffer);
void (*BeginVertices)( struct gl_context *ctx );
/**
- * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if
+ * If inside glBegin()/glEnd(), it should assert(0). Otherwise, if
* FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
* vertices, if FLUSH_UPDATE_CURRENT bit is set updates
* __struct gl_contextRec::Current and gl_light_attrib::Material
}
else {
/* make sure instruction size agrees */
- ASSERT(numNodes == InstSize[opcode]);
+ assert(numNodes == InstSize[opcode]);
}
}
n[2].f = x;
}
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
ctx->ListState.ActiveAttribSize[attr] = 1;
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
n[3].f = y;
}
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
ctx->ListState.ActiveAttribSize[attr] = 2;
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
n[4].f = z;
}
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
ctx->ListState.ActiveAttribSize[attr] = 3;
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
n[5].f = w;
}
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
ctx->ListState.ActiveAttribSize[attr] = 4;
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
n[2].f = x;
}
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
ctx->ListState.ActiveAttribSize[attr] = 1;
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
n[3].f = y;
}
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
ctx->ListState.ActiveAttribSize[attr] = 2;
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
n[4].f = z;
}
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
ctx->ListState.ActiveAttribSize[attr] = 3;
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
n[5].f = w;
}
- ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
+ assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
ctx->ListState.ActiveAttribSize[attr] = 4;
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
ctx->Current.RasterTexCoords[0] );
}
else {
- ASSERT(ctx->RenderMode == GL_SELECT);
+ assert(ctx->RenderMode == GL_SELECT);
/* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
}
ctx->Current.RasterTexCoords[0] );
}
else {
- ASSERT(ctx->RenderMode == GL_SELECT);
+ assert(ctx->RenderMode == GL_SELECT);
/* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
}
ctx->Current.RasterTexCoords[0] );
}
else {
- ASSERT(ctx->RenderMode == GL_SELECT);
+ assert(ctx->RenderMode == GL_SELECT);
/* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
}
if (ctx->NewState)
_mesa_update_state(ctx);
- ASSERT(ctx->Driver.DrawTex);
+ assert(ctx->Driver.DrawTex);
ctx->Driver.DrawTex(ctx, x, y, z, width, height);
_mesa_set_vp_override(ctx, GL_FALSE);
_mesa_set_enablei(struct gl_context *ctx, GLenum cap,
GLuint index, GLboolean state)
{
- ASSERT(state == 0 || state == 1);
+ assert(state == 0 || state == 1);
switch (cap) {
case GL_BLEND:
if (!ctx->Extensions.EXT_draw_buffers2) {
/* Too long error message. Whoever calls _mesa_error should use
* shorter strings.
*/
- ASSERT(0);
+ assert(0);
return;
}
_mesa_lookup_enum_by_nr(error), s);
if (len >= MAX_DEBUG_MESSAGE_LENGTH) {
/* Same as above. */
- ASSERT(0);
+ assert(0);
return;
}
GLfloat *pnts;
struct gl_1d_map *map = NULL;
- ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
+ assert(type == GL_FLOAT || type == GL_DOUBLE);
if (u1 == u2) {
_mesa_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" );
GLfloat *pnts;
struct gl_2d_map *map = NULL;
- ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
+ assert(type == GL_FLOAT || type == GL_DOUBLE);
if (u1==u2) {
_mesa_error( ctx, GL_INVALID_VALUE, "glMap2(u1,u2)" );
map1d = get_1d_map(ctx, target);
map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
+ assert(map1d || map2d);
switch (query) {
case GL_COEFF:
map1d = get_1d_map(ctx, target);
map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
+ assert(map1d || map2d);
switch (query) {
case GL_COEFF:
map1d = get_1d_map(ctx, target);
map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
+ assert(map1d || map2d);
switch (query) {
case GL_COEFF:
ctx->Driver.FinishRenderTexture(ctx, rb);
if (att->Type == GL_TEXTURE) {
- ASSERT(att->Texture);
+ assert(att->Texture);
_mesa_reference_texobj(&att->Texture, NULL); /* unbind */
- ASSERT(!att->Texture);
+ assert(!att->Texture);
}
if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) {
- ASSERT(!att->Texture);
+ assert(!att->Texture);
_mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */
- ASSERT(!att->Renderbuffer);
+ assert(!att->Renderbuffer);
}
att->Type = GL_NONE;
att->Complete = GL_TRUE;
if (att->Texture == texObj) {
/* re-attaching same texture */
- ASSERT(att->Type == GL_TEXTURE);
+ assert(att->Type == GL_TEXTURE);
}
else {
/* new attachment */
mtx_lock(&fb->Mutex);
att = get_attachment(ctx, fb, attachment);
- ASSERT(att);
+ assert(att);
if (rb) {
set_renderbuffer_attachment(ctx, att, rb);
if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
}
}
else {
- ASSERT(format == GL_STENCIL);
+ assert(format == GL_STENCIL);
if (ctx->Extensions.ARB_depth_texture &&
baseFormat == GL_DEPTH_STENCIL) {
/* OK */
const GLenum baseFormat =
_mesa_get_format_base_format(att->Renderbuffer->Format);
- ASSERT(att->Renderbuffer);
+ assert(att->Renderbuffer);
if (!att->Renderbuffer->InternalFormat ||
att->Renderbuffer->Width < 1 ||
att->Renderbuffer->Height < 1) {
}
}
else {
- ASSERT(att->Type == GL_NONE);
+ assert(att->Type == GL_NONE);
/* complete */
return;
}
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT");
return;
}
- ASSERT(newRb->AllocStorage);
+ assert(newRb->AllocStorage);
_mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb);
newRb->RefCount = 1; /* referenced by hash table */
}
newRb = NULL;
}
- ASSERT(newRb != &DummyRenderbuffer);
+ assert(newRb != &DummyRenderbuffer);
_mesa_reference_renderbuffer(&ctx->CurrentRenderbuffer, newRb);
}
/* check if deleting currently bound renderbuffer object */
if (rb == ctx->CurrentRenderbuffer) {
/* bind default */
- ASSERT(rb->RefCount >= 2);
+ assert(rb->RefCount >= 2);
_mesa_BindRenderbuffer(GL_RENDERBUFFER_EXT, 0);
}
rb->NumSamples = samples;
/* Now allocate the storage */
- ASSERT(rb->AllocStorage);
+ assert(rb->AllocStorage);
if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) {
/* No error - check/set fields now */
/* If rb->Format == MESA_FORMAT_NONE, the format is unsupported. */
check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
{
GLuint i;
- ASSERT(ctx->Driver.RenderTexture);
+ assert(ctx->Driver.RenderTexture);
if (_mesa_is_winsys_fbo(fb))
return; /* can't render to texture with winsys framebuffers */
newReadFb = ctx->WinSysReadBuffer;
}
- ASSERT(newDrawFb);
- ASSERT(newDrawFb != &DummyFramebuffer);
+ assert(newDrawFb);
+ assert(newDrawFb != &DummyFramebuffer);
/* save pointers to current/old framebuffers */
oldDrawFb = ctx->DrawBuffer;
struct gl_framebuffer *fb;
fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]);
if (fb) {
- ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]);
+ assert(fb == &DummyFramebuffer || fb->Name == framebuffers[i]);
/* check if deleting currently bound framebuffer object */
if (fb == ctx->DrawBuffer) {
/* bind default */
- ASSERT(fb->RefCount >= 2);
+ assert(fb->RefCount >= 2);
_mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
if (fb == ctx->ReadBuffer) {
/* bind default */
- ASSERT(fb->RefCount >= 2);
+ assert(fb->RefCount >= 2);
_mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
}
values[3].f = s3;
idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4,
&swizzle );
- ASSERT(swizzle == SWIZZLE_NOOP);
+ assert(swizzle == SWIZZLE_NOOP);
return make_ureg(PROGRAM_CONSTANT, idx);
}
src->Abs = 0;
src->RelAddr = 0;
/* Check that bitfield sizes aren't exceeded */
- ASSERT(src->Index == reg.idx);
+ assert(src->Index == reg.idx);
}
dst->CondMask = COND_TR; /* always pass cond test */
dst->CondSwizzle = SWIZZLE_NOOP;
/* Check that bitfield sizes aren't exceeded */
- ASSERT(dst->Index == reg.idx);
+ assert(dst->Index == reg.idx);
}
GLuint i;
for (i = 0; i < n; i++) {
dst[i] = (GLfloat) ((s[i] >> 8) * scale);
- ASSERT(dst[i] >= 0.0F);
- ASSERT(dst[i] <= 1.0F);
+ assert(dst[i] >= 0.0F);
+ assert(dst[i] <= 1.0F);
}
}
GLuint i;
for (i = 0; i < n; i++) {
dst[i] = (GLfloat) ((s[i] & 0x00ffffff) * scale);
- ASSERT(dst[i] >= 0.0F);
- ASSERT(dst[i] <= 1.0F);
+ assert(dst[i] >= 0.0F);
+ assert(dst[i] <= 1.0F);
}
}
_mesa_get_format_bytes(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
- ASSERT(info->BytesPerBlock);
- ASSERT(info->BytesPerBlock <= MAX_PIXEL_BYTES ||
+ assert(info->BytesPerBlock);
+ assert(info->BytesPerBlock <= MAX_PIXEL_BYTES ||
_mesa_is_format_compressed(format));
return info->BytesPerBlock;
}
if (att->Texture) {
_mesa_reference_texobj(&att->Texture, NULL);
}
- ASSERT(!att->Renderbuffer);
- ASSERT(!att->Texture);
+ assert(!att->Renderbuffer);
+ assert(!att->Texture);
att->Type = GL_NONE;
}
}
struct gl_framebuffer *oldFb = *ptr;
mtx_lock(&oldFb->Mutex);
- ASSERT(oldFb->RefCount > 0);
+ assert(oldFb->RefCount > 0);
oldFb->RefCount--;
deleteFlag = (oldFb->RefCount == 0);
mtx_unlock(&oldFb->Mutex);
/* only resize if size is changing */
if (rb->Width != width || rb->Height != height) {
if (rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) {
- ASSERT(rb->Width == width);
- ASSERT(rb->Height == height);
+ assert(rb->Width == width);
+ assert(rb->Height == height);
}
else {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer");
}
}
- ASSERT(bbox[0] <= bbox[1]);
- ASSERT(bbox[2] <= bbox[3]);
+ assert(bbox[0] <= bbox[1]);
+ assert(bbox[2] <= bbox[3]);
}
/**
fb->_ColorReadBuffer = NULL; /* legal! */
}
else {
- ASSERT(fb->_ColorReadBufferIndex >= 0);
- ASSERT(fb->_ColorReadBufferIndex < BUFFER_COUNT);
+ assert(fb->_ColorReadBufferIndex >= 0);
+ assert(fb->_ColorReadBufferIndex < BUFFER_COUNT);
fb->_ColorReadBuffer
= fb->Attachment[fb->_ColorReadBufferIndex].Renderbuffer;
}
if (!readBuf) {
return GL_FALSE;
}
- ASSERT(_mesa_get_format_bits(readBuf->Format, GL_RED_BITS) > 0 ||
+ assert(_mesa_get_format_bits(readBuf->Format, GL_RED_BITS) > 0 ||
_mesa_get_format_bits(readBuf->Format, GL_ALPHA_BITS) > 0 ||
_mesa_get_format_bits(readBuf->Format, GL_TEXTURE_LUMINANCE_SIZE) > 0 ||
_mesa_get_format_bits(readBuf->Format, GL_TEXTURE_INTENSITY_SIZE) > 0 ||
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
v->value_int_n.n =
_mesa_get_compressed_formats(ctx, v->value_int_n.ints);
- ASSERT(v->value_int_n.n <= (int) ARRAY_SIZE(v->value_int_n.ints));
+ assert(v->value_int_n.n <= (int) ARRAY_SIZE(v->value_int_n.ints));
break;
case GL_MAX_VARYING_FLOATS_ARB:
{
struct hash_entry *entry;
- ASSERT(table);
- ASSERT(callback);
+ assert(table);
+ assert(callback);
mtx_lock(&table->Mutex);
table->InDeleteAll = GL_TRUE;
hash_table_foreach(table->ht, entry) {
struct hash_entry *entry;
struct _mesa_HashTable *clonetable;
- ASSERT(table);
+ assert(table);
mtx_lock(&table2->Mutex);
clonetable = _mesa_NewHashTable();
struct _mesa_HashTable *table2 = (struct _mesa_HashTable *) table;
struct hash_entry *entry;
- ASSERT(table);
- ASSERT(callback);
+ assert(table);
+ assert(callback);
mtx_lock(&table2->WalkMutex);
hash_table_foreach(table->ht, entry) {
callback((uintptr_t)entry->key, entry->data, userData);
GLint skipimages; /* for 3-D volume images */
GLintptr offset;
- ASSERT(dimensions >= 1 && dimensions <= 3);
+ assert(dimensions >= 1 && dimensions <= 3);
alignment = packing->Alignment;
if (packing->RowLength > 0) {
if (remainder > 0)
bytes_per_row += (alignment - remainder);
- ASSERT(bytes_per_row % alignment == 0);
+ assert(bytes_per_row % alignment == 0);
bytes_per_image = bytes_per_row * rows_per_image;
{
GLint bytesPerRow, remainder;
- ASSERT(packing);
+ assert(packing);
if (type == GL_BITMAP) {
if (packing->RowLength == 0) {
{
GLint bytesPerRow, bytesPerImage, remainder;
- ASSERT(packing);
+ assert(packing);
if (type == GL_BITMAP) {
if (packing->RowLength == 0) {
if (!tempBuffer)
return;
- ASSERT(srcType != dstType);
+ assert(srcType != dstType);
switch (srcType) {
case GL_UNSIGNED_BYTE:
const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src;
GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst);
GLuint i;
- ASSERT(dstType == GL_FLOAT);
+ assert(dstType == GL_FLOAT);
for (i = 0; i < count; i++) {
if (!mask || mask[i]) {
dst4[i][RCOMP] = UBYTE_TO_FLOAT(src1[i][RCOMP]);
const GLushort (*src2)[4] = (const GLushort (*)[4]) src;
GLfloat (*dst4)[4] = (GLfloat (*)[4]) (useTemp ? tempBuffer : dst);
GLuint i;
- ASSERT(dstType == GL_FLOAT);
+ assert(dstType == GL_FLOAT);
for (i = 0; i < count; i++) {
if (!mask || mask[i]) {
dst4[i][RCOMP] = USHORT_TO_FLOAT(src2[i][RCOMP]);
const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src;
GLushort (*dst2)[4] = (GLushort (*)[4]) (useTemp ? tempBuffer : dst);
GLuint i;
- ASSERT(dstType == GL_UNSIGNED_SHORT);
+ assert(dstType == GL_UNSIGNED_SHORT);
for (i = 0; i < count; i++) {
if (!mask || mask[i]) {
UNCLAMPED_FLOAT_TO_USHORT(dst2[i][RCOMP], src4[i][RCOMP]);
unpack->RowLength = *width;
}
- ASSERT(ctx->Pixel.ZoomX == 1.0F);
- ASSERT(ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F);
+ assert(ctx->Pixel.ZoomX == 1.0F);
+ assert(ctx->Pixel.ZoomY == 1.0F || ctx->Pixel.ZoomY == -1.0F);
/* left clipping */
if (*destX < buffer->_Xmin) {
if (*dstX1 > maxValue) {
/* X1 outside right edge */
- ASSERT(*dstX0 < maxValue); /* X0 should be inside right edge */
+ assert(*dstX0 < maxValue); /* X0 should be inside right edge */
t = (GLfloat) (maxValue - *dstX0) / (GLfloat) (*dstX1 - *dstX0);
/* chop off [t, 1] part */
- ASSERT(t >= 0.0 && t <= 1.0);
+ assert(t >= 0.0 && t <= 1.0);
*dstX1 = maxValue;
bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F;
*srcX1 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias);
}
else if (*dstX0 > maxValue) {
/* X0 outside right edge */
- ASSERT(*dstX1 < maxValue); /* X1 should be inside right edge */
+ assert(*dstX1 < maxValue); /* X1 should be inside right edge */
t = (GLfloat) (maxValue - *dstX1) / (GLfloat) (*dstX0 - *dstX1);
/* chop off [t, 1] part */
- ASSERT(t >= 0.0 && t <= 1.0);
+ assert(t >= 0.0 && t <= 1.0);
*dstX0 = maxValue;
bias = (*srcX0 < *srcX1) ? -0.5F : 0.5F;
*srcX0 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias);
if (*dstX0 < minValue) {
/* X0 outside left edge */
- ASSERT(*dstX1 > minValue); /* X1 should be inside left edge */
+ assert(*dstX1 > minValue); /* X1 should be inside left edge */
t = (GLfloat) (minValue - *dstX0) / (GLfloat) (*dstX1 - *dstX0);
/* chop off [0, t] part */
- ASSERT(t >= 0.0 && t <= 1.0);
+ assert(t >= 0.0 && t <= 1.0);
*dstX0 = minValue;
bias = (*srcX0 < *srcX1) ? 0.5F : -0.5F;
*srcX0 = *srcX0 + (GLint) (t * (*srcX1 - *srcX0) + bias);
}
else if (*dstX1 < minValue) {
/* X1 outside left edge */
- ASSERT(*dstX0 > minValue); /* X0 should be inside left edge */
+ assert(*dstX0 > minValue); /* X0 should be inside left edge */
t = (GLfloat) (minValue - *dstX1) / (GLfloat) (*dstX0 - *dstX1);
/* chop off [0, t] part */
- ASSERT(t >= 0.0 && t <= 1.0);
+ assert(t >= 0.0 && t <= 1.0);
*dstX1 = minValue;
bias = (*srcX0 < *srcX1) ? -0.5F : 0.5F;
*srcX1 = *srcX1 + (GLint) (t * (*srcX0 - *srcX1) + bias);
*srcY0, *srcY1, *dstY0, *dstY1);
*/
- ASSERT(*dstX0 >= dstXmin);
- ASSERT(*dstX0 <= dstXmax);
- ASSERT(*dstX1 >= dstXmin);
- ASSERT(*dstX1 <= dstXmax);
-
- ASSERT(*dstY0 >= dstYmin);
- ASSERT(*dstY0 <= dstYmax);
- ASSERT(*dstY1 >= dstYmin);
- ASSERT(*dstY1 <= dstYmax);
-
- ASSERT(*srcX0 >= srcXmin);
- ASSERT(*srcX0 <= srcXmax);
- ASSERT(*srcX1 >= srcXmin);
- ASSERT(*srcX1 <= srcXmax);
-
- ASSERT(*srcY0 >= srcYmin);
- ASSERT(*srcY0 <= srcYmax);
- ASSERT(*srcY1 >= srcYmin);
- ASSERT(*srcY1 <= srcYmax);
+ assert(*dstX0 >= dstXmin);
+ assert(*dstX0 <= dstXmax);
+ assert(*dstX1 >= dstXmin);
+ assert(*dstX1 <= dstXmax);
+
+ assert(*dstY0 >= dstYmin);
+ assert(*dstY0 <= dstYmax);
+ assert(*dstY1 >= dstYmin);
+ assert(*dstY1 <= dstYmax);
+
+ assert(*srcX0 >= srcXmin);
+ assert(*srcX0 <= srcXmax);
+ assert(*srcX1 >= srcXmin);
+ assert(*srcX1 <= srcXmax);
+
+ assert(*srcY0 >= srcYmin);
+ assert(*srcY0 <= srcYmax);
+ assert(*srcY1 >= srcYmin);
+ assert(*srcY1 <= srcYmax);
return GL_TRUE;
}
#else
uintptr_t ptr, buf;
- ASSERT( alignment > 0 );
+ assert( alignment > 0 );
ptr = (uintptr_t)malloc(bytes + alignment + sizeof(void *));
if (!ptr)
#else
uintptr_t ptr, buf;
- ASSERT( alignment > 0 );
+ assert( alignment > 0 );
ptr = (uintptr_t)calloc(1, bytes + alignment + sizeof(void *));
if (!ptr)
{
struct gl_light *light;
- ASSERT(lnum < MAX_LIGHTS);
+ assert(lnum < MAX_LIGHTS);
light = &ctx->Light.Light[lnum];
switch (pname) {
COPY_3V(light->SpotDirection, params);
break;
case GL_SPOT_EXPONENT:
- ASSERT(params[0] >= 0.0);
- ASSERT(params[0] <= ctx->Const.MaxSpotExponent);
+ assert(params[0] >= 0.0);
+ assert(params[0] <= ctx->Const.MaxSpotExponent);
if (light->SpotExponent == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
light->SpotExponent = params[0];
break;
case GL_SPOT_CUTOFF:
- ASSERT(params[0] == 180.0 || (params[0] >= 0.0 && params[0] <= 90.0));
+ assert(params[0] == 180.0 || (params[0] >= 0.0 && params[0] <= 90.0));
if (light->SpotCutoff == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
light->_Flags &= ~LIGHT_SPOT;
break;
case GL_CONSTANT_ATTENUATION:
- ASSERT(params[0] >= 0.0);
+ assert(params[0] >= 0.0);
if (light->ConstantAttenuation == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
light->ConstantAttenuation = params[0];
break;
case GL_LINEAR_ATTENUATION:
- ASSERT(params[0] >= 0.0);
+ assert(params[0] >= 0.0);
if (light->LinearAttenuation == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
light->LinearAttenuation = params[0];
break;
case GL_QUADRATIC_ATTENUATION:
- ASSERT(params[0] >= 0.0);
+ assert(params[0] >= 0.0);
if (light->QuadraticAttenuation == params[0])
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
GLuint f;
GLfloat (*mat)[4] = ctx->Light.Material.Attrib;
- ASSERT(ctx->API == API_OPENGL_COMPAT);
+ assert(ctx->API == API_OPENGL_COMPAT);
FLUSH_VERTICES(ctx, 0); /* update materials */
FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */
break;
default:
ASSIGN_4V(dst, 0.0f, 0.0f, 0.0f, 1.0f); /* silence warnings */
- ASSERT(!"Unexpected type in COPY_CLEAN_4V_TYPE_AS_FLOAT macro");
+ assert(!"Unexpected type in COPY_CLEAN_4V_TYPE_AS_FLOAT macro");
}
COPY_SZ_4V(dst, sz, src);
}
return;
}
#endif
- ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack));
+ assert(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack));
ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit];
break;
case GL_MATRIX0_ARB:
const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1;
const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2;
- ASSERT(comps >= 1);
- ASSERT(comps <= 4);
+ assert(comps >= 1);
+ assert(comps <= 4);
/* This assertion is no longer valid with non-power-of-2 textures
assert(srcWidth == dstWidth || srcWidth == 2 * dstWidth);
const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2;
GLuint i, j, k;
- ASSERT(comps >= 1);
- ASSERT(comps <= 4);
+ assert(comps >= 1);
+ assert(comps <= 4);
if ((datatype == GL_UNSIGNED_BYTE) && (comps == 4)) {
DECLARE_ROW_POINTERS(GLubyte, 4);
}
else {
/* average border pixels from adjacent src image pairs */
- ASSERT(srcDepthNB == 2 * dstDepthNB);
+ assert(srcDepthNB == 2 * dstDepthNB);
for (img = 0; img < dstDepthNB; img++) {
const GLubyte *srcA, *srcB;
GLubyte *dst;
/* get src image parameters */
srcImage = _mesa_select_tex_image(texObj, target, level);
- ASSERT(srcImage);
+ assert(srcImage);
srcWidth = srcImage->Width;
srcHeight = srcImage->Height;
srcDepth = srcImage->Depth;
/* get src image parameters */
srcImage = _mesa_select_tex_image(texObj, target, level);
- ASSERT(srcImage);
+ assert(srcImage);
srcWidth = srcImage->Width;
srcHeight = srcImage->Height;
srcDepth = srcImage->Depth;
struct gl_texture_image *srcImage;
GLint maxLevel;
- ASSERT(texObj);
+ assert(texObj);
srcImage = _mesa_select_tex_image(texObj, target, texObj->BaseLevel);
- ASSERT(srcImage);
+ assert(srcImage);
maxLevel = _mesa_max_texture_levels(ctx, texObj->Target) - 1;
- ASSERT(maxLevel >= 0); /* bad target */
+ assert(maxLevel >= 0); /* bad target */
maxLevel = MIN2(maxLevel, texObj->MaxLevel);
GLenum srcFormat, GLenum srcType, const GLvoid *src,
const struct gl_pixelstore_attrib *unpack )
{
- ASSERT(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX);
+ assert(srcFormat == GL_COLOR_INDEX || srcFormat == GL_STENCIL_INDEX);
- ASSERT(srcType == GL_BITMAP ||
+ assert(srcType == GL_BITMAP ||
srcType == GL_UNSIGNED_BYTE ||
srcType == GL_BYTE ||
srcType == GL_UNSIGNED_SHORT ||
const struct gl_pixelstore_attrib *srcPacking,
GLbitfield transferOps )
{
- ASSERT(srcType == GL_BITMAP ||
+ assert(srcType == GL_BITMAP ||
srcType == GL_UNSIGNED_BYTE ||
srcType == GL_BYTE ||
srcType == GL_UNSIGNED_SHORT ||
srcType == GL_FLOAT ||
srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
- ASSERT(dstType == GL_UNSIGNED_BYTE ||
+ assert(dstType == GL_UNSIGNED_BYTE ||
dstType == GL_UNSIGNED_SHORT ||
dstType == GL_UNSIGNED_INT ||
dstType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
else if (dstType == GL_UNSIGNED_SHORT) {
GLushort *zValues = (GLushort *) dest;
GLuint i;
- ASSERT(depthMax <= 0xffff);
+ assert(depthMax <= 0xffff);
for (i = 0; i < n; i++) {
zValues[i] = (GLushort) (depthValues[i] * (GLfloat) depthMax);
}
}
}
else {
- ASSERT(0);
+ assert(0);
}
free(depthTemp);
GLsizei clientMemSize,
const GLvoid *ptr, const char *where)
{
- ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3);
+ assert(dimensions == 1 || dimensions == 2 || dimensions == 3);
if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
format, type, clientMemSize, ptr)) {
_mesa_unmap_pbo_source(struct gl_context *ctx,
const struct gl_pixelstore_attrib *unpack)
{
- ASSERT(unpack != &ctx->Pack); /* catch pack/unpack mismatch */
+ assert(unpack != &ctx->Pack); /* catch pack/unpack mismatch */
if (_mesa_is_bufferobj(unpack->BufferObj)) {
ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj, MAP_INTERNAL);
}
GLenum format, GLenum type, GLsizei clientMemSize,
GLvoid *ptr, const char *where)
{
- ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3);
+ assert(dimensions == 1 || dimensions == 2 || dimensions == 3);
if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
format, type, clientMemSize, ptr)) {
_mesa_unmap_pbo_dest(struct gl_context *ctx,
const struct gl_pixelstore_attrib *pack)
{
- ASSERT(pack != &ctx->Unpack); /* catch pack/unpack mismatch */
+ assert(pack != &ctx->Unpack); /* catch pack/unpack mismatch */
if (_mesa_is_bufferobj(pack->BufferObj)) {
ctx->Driver.UnmapBuffer(ctx, pack->BufferObj, MAP_INTERNAL);
}
struct gl_pipeline_object *oldObj = *ptr;
mtx_lock(&oldObj->Mutex);
- ASSERT(oldObj->RefCount > 0);
+ assert(oldObj->RefCount > 0);
oldObj->RefCount--;
deleteFlag = (oldObj->RefCount == 0);
mtx_unlock(&oldObj->Mutex);
*ptr = NULL;
}
- ASSERT(!*ptr);
+ assert(!*ptr);
if (obj) {
/* reference new pipeline object */
lookup_pipeline_object(ctx, pipelines[i]);
if (obj) {
- ASSERT(obj->Name == pipelines[i]);
+ assert(obj->Name == pipelines[i]);
/* If the pipeline object is currently bound, the spec says "If an
* object that is currently bound is deleted, the binding for that
* If point parameters aren't supported, then this function shouldn't even
* exist.
*/
- ASSERT(!(ctx->Extensions.ARB_point_sprite
+ assert(!(ctx->Extensions.ARB_point_sprite
|| ctx->Extensions.NV_point_sprite)
|| ctx->Extensions.EXT_point_parameters);
_mesa_get_read_renderbuffer_for_format(ctx, format);
GLenum srcType;
- ASSERT(rb);
+ assert(rb);
/* There are different rules depending on the base format. */
switch (format) {
struct gl_renderbuffer *rb =
_mesa_get_read_renderbuffer_for_format(ctx, format);
- ASSERT(rb);
+ assert(rb);
if (_mesa_readpixels_needs_slow_path(ctx, format, type, GL_FALSE)) {
return GL_FALSE;
return;
/* clipping should have been done already */
- ASSERT(x >= 0);
- ASSERT(y >= 0);
- ASSERT(x + width <= (GLint) rb->Width);
- ASSERT(y + height <= (GLint) rb->Height);
+ assert(x >= 0);
+ assert(y >= 0);
+ assert(x + width <= (GLint) rb->Width);
+ assert(y + height <= (GLint) rb->Height);
if (type == GL_UNSIGNED_INT &&
read_uint_depth_pixels(ctx, x, y, width, height, type, pixels, packing)) {
const char *spec;
/* sanity check */
- ASSERT(i == remap[i].remap_index);
+ assert(i == remap[i].remap_index);
spec = _mesa_function_pool + remap[i].pool_index;
offset = _mesa_map_function_spec(spec);
struct gl_renderbuffer *oldRb = *ptr;
mtx_lock(&oldRb->Mutex);
- ASSERT(oldRb->RefCount > 0);
+ assert(oldRb->RefCount > 0);
oldRb->RefCount--;
/*printf("RB DECR %p (%d) to %d\n", (void*) oldRb, oldRb->Name, oldRb->RefCount);*/
deleteFlag = (oldRb->RefCount == 0);
struct gl_sampler_object *oldSamp = *ptr;
/*mtx_lock(&oldSamp->Mutex);*/
- ASSERT(oldSamp->RefCount > 0);
+ assert(oldSamp->RefCount > 0);
oldSamp->RefCount--;
#if 0
printf("SamplerObj %p %d DECR to %d\n",
/*mtx_unlock(&oldSamp->Mutex);*/
if (deleteFlag) {
- ASSERT(ctx->Driver.DeleteSamplerObject);
+ assert(ctx->Driver.DeleteSamplerObject);
ctx->Driver.DeleteSamplerObject(ctx, oldSamp);
}
*ptr = NULL;
}
- ASSERT(!*ptr);
+ assert(!*ptr);
if (samp) {
/* reference new sampler */
GLboolean deleteFlag = GL_FALSE;
struct gl_shader *old = *ptr;
- ASSERT(old->RefCount > 0);
+ assert(old->RefCount > 0);
old->RefCount--;
/*printf("SHADER DECR %p (%d) to %d\n",
(void*) old, old->Name, old->RefCount);*/
GLboolean deleteFlag = GL_FALSE;
struct gl_shader_program *old = *ptr;
- ASSERT(old->RefCount > 0);
+ assert(old->RefCount > 0);
old->RefCount--;
#if 0
printf("ShaderProgram %p ID=%u RefCount-- to %d\n",
case GL_COMPUTE_SHADER:
return MESA_SHADER_COMPUTE;
default:
- ASSERT(0 && "bad value in _mesa_shader_enum_to_shader_stage()");
+ assert(0 && "bad value in _mesa_shader_enum_to_shader_stage()");
return MESA_SHADER_VERTEX;
}
}
struct gl_program *prog = (struct gl_program *) data;
struct gl_context *ctx = (struct gl_context *) userData;
if(prog != &_mesa_DummyProgram) {
- ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */
+ assert(prog->RefCount == 1); /* should only be referenced by hash table */
prog->RefCount = 0; /* now going away */
ctx->Driver.DeleteProgram(ctx, prog);
}
}
else {
struct gl_shader_program *shProg = (struct gl_shader_program *) data;
- ASSERT(shProg->Type == GL_SHADER_PROGRAM_MESA);
+ assert(shProg->Type == GL_SHADER_PROGRAM_MESA);
ctx->Driver.DeleteShaderProgram(ctx, shProg);
}
}
* Free texture objects (after FBOs since some textures might have
* been bound to FBOs).
*/
- ASSERT(ctx->Driver.DeleteTexture);
+ assert(ctx->Driver.DeleteTexture);
/* the default textures */
for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
ctx->Driver.DeleteTexture(ctx, shared->DefaultTex[i]);
const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
unsigned i;
- ASSERT(depthMax > 0);
+ assert(depthMax > 0);
/* Compute scale and bias values. This is really driver-specific
* and should be maintained elsewhere if at all.
_mesa_get_format_block_size(mesaFormat, &bw, &bh);
- ASSERT(col % bw == 0);
- ASSERT(row % bh == 0);
+ assert(col % bw == 0);
+ assert(row % bh == 0);
offset = ((width + bw - 1) / bw) * (row / bh) + col / bw;
offset *= blockSize;
GLboolean
_mesa_texstore_bptc_rgb_signed_float(TEXSTORE_PARAMS)
{
- ASSERT(dstFormat == MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT);
+ assert(dstFormat == MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT);
return texstore_bptc_rgb_float(ctx, dims, baseInternalFormat,
dstFormat, dstRowStride, dstSlices,
GLboolean
_mesa_texstore_bptc_rgb_unsigned_float(TEXSTORE_PARAMS)
{
- ASSERT(dstFormat == MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT);
+ assert(dstFormat == MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT);
return texstore_bptc_rgb_float(ctx, dims, baseInternalFormat,
dstFormat, dstRowStride, dstSlices,
#include "glheader.h"
-#include "compiler.h" /* for ASSERT */
#include "context.h"
#include "mtypes.h"
#include "imports.h"
}
info = &formats[internalFormat - GL_PALETTE4_RGB8_OES];
- ASSERT(info->cpal_format == internalFormat);
+ assert(info->cpal_format == internalFormat);
expect_size = info->palette_size * info->size;
for (lvl = 0; lvl < num_levels; lvl++) {
_mesa_texstore_etc1_rgb8(TEXSTORE_PARAMS)
{
/* GL_ETC1_RGB8_OES is only valid in glCompressedTexImage2D */
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_rgb8(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_srgb8(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_rgba8_eac(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_srgb8_alpha8_eac(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_r11_eac(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_signed_r11_eac(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_rg11_eac(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_signed_rg11_eac(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_rgb8_punchthrough_alpha1(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLboolean
_mesa_texstore_etc2_srgb8_punchthrough_alpha1(TEXSTORE_PARAMS)
{
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
GLubyte *dst;
const GLubyte *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGB_FXT1);
+ assert(dstFormat == MESA_FORMAT_RGB_FXT1);
if (srcFormat != GL_RGB ||
srcType != GL_UNSIGNED_BYTE ||
GLubyte *dst;
const GLubyte *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGBA_FXT1);
+ assert(dstFormat == MESA_FORMAT_RGBA_FXT1);
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
{
GLint i, j, k;
- ASSERT(outWidth >= inWidth);
- ASSERT(outHeight >= inHeight);
+ assert(outWidth >= inWidth);
+ assert(outHeight >= inHeight);
#if 0
- ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2);
- ASSERT((outWidth & 3) == 0);
- ASSERT((outHeight & 3) == 0);
+ assert(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2);
+ assert((outWidth & 3) == 0);
+ assert((outHeight & 3) == 0);
#endif
for (i = 0; i < outHeight; i++) {
GLint dstRowDiff, redRowStride;
GLubyte *tempImageSlices[1];
- ASSERT(dstFormat == MESA_FORMAT_R_RGTC1_UNORM ||
+ assert(dstFormat == MESA_FORMAT_R_RGTC1_UNORM ||
dstFormat == MESA_FORMAT_L_LATC1_UNORM);
tempImage = malloc(srcWidth * srcHeight * 1 * sizeof(GLubyte));
GLint dstRowDiff, redRowStride;
GLfloat *tempImageSlices[1];
- ASSERT(dstFormat == MESA_FORMAT_R_RGTC1_SNORM ||
+ assert(dstFormat == MESA_FORMAT_R_RGTC1_SNORM ||
dstFormat == MESA_FORMAT_L_LATC1_SNORM);
redRowStride = 1 * srcWidth * sizeof(GLfloat);
mesa_format tempFormat;
GLubyte *tempImageSlices[1];
- ASSERT(dstFormat == MESA_FORMAT_RG_RGTC2_UNORM ||
+ assert(dstFormat == MESA_FORMAT_RG_RGTC2_UNORM ||
dstFormat == MESA_FORMAT_LA_LATC2_UNORM);
if (baseInternalFormat == GL_RG)
mesa_format tempFormat;
GLfloat *tempImageSlices[1];
- ASSERT(dstFormat == MESA_FORMAT_RG_RGTC2_SNORM ||
+ assert(dstFormat == MESA_FORMAT_RG_RGTC2_SNORM ||
dstFormat == MESA_FORMAT_LA_LATC2_SNORM);
if (baseInternalFormat == GL_RG)
GLubyte *dst;
const GLubyte *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1 ||
+ assert(dstFormat == MESA_FORMAT_RGB_DXT1 ||
dstFormat == MESA_FORMAT_SRGB_DXT1);
if (srcFormat != GL_RGB ||
GLubyte *dst;
const GLubyte *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1 ||
+ assert(dstFormat == MESA_FORMAT_RGBA_DXT1 ||
dstFormat == MESA_FORMAT_SRGBA_DXT1);
if (srcFormat != GL_RGBA ||
GLubyte *dst;
const GLubyte *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3 ||
+ assert(dstFormat == MESA_FORMAT_RGBA_DXT3 ||
dstFormat == MESA_FORMAT_SRGBA_DXT3);
if (srcFormat != GL_RGBA ||
GLubyte *dst;
const GLubyte *tempImage = NULL;
- ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5 ||
+ assert(dstFormat == MESA_FORMAT_RGBA_DXT5 ||
dstFormat == MESA_FORMAT_SRGBA_DXT5);
if (srcFormat != GL_RGBA ||
case GL_RGB9_E5:
/* GL_EXT_texture_shared_exponent -- just one format to support */
- ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R9G9B9E5_FLOAT]);
+ assert(ctx->TextureFormatSupported[MESA_FORMAT_R9G9B9E5_FLOAT]);
return MESA_FORMAT_R9G9B9E5_FLOAT;
case GL_R11F_G11F_B10F:
/* GL_EXT_texture_packed_float -- just one format to support */
- ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R11G11B10_FLOAT]);
+ assert(ctx->TextureFormatSupported[MESA_FORMAT_R11G11B10_FLOAT]);
return MESA_FORMAT_R11G11B10_FLOAT;
case GL_DEPTH_STENCIL_EXT:
break;
case GL_DEPTH_COMPONENT32F:
- ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32]);
+ assert(ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32]);
return MESA_FORMAT_Z_FLOAT32;
case GL_DEPTH32F_STENCIL8:
- ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_S8X24_UINT]);
+ assert(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_S8X24_UINT]);
return MESA_FORMAT_Z32_FLOAT_S8X24_UINT;
case GL_RED_SNORM:
{
const GLuint face = _mesa_tex_target_to_face(target);
- ASSERT(tObj);
- ASSERT(texImage);
+ assert(tObj);
+ assert(texImage);
if (target == GL_TEXTURE_RECTANGLE_NV || target == GL_TEXTURE_EXTERNAL_OES)
assert(level == 0);
/* Free texImage->Data and/or any other driver-specific texture
* image storage.
*/
- ASSERT(ctx->Driver.FreeTextureImageBuffer);
+ assert(ctx->Driver.FreeTextureImageBuffer);
ctx->Driver.FreeTextureImageBuffer( ctx, texImage );
free(texImage);
}
{
const GLuint face = _mesa_tex_target_to_face(target);
- ASSERT(texObj);
- ASSERT(level >= 0);
- ASSERT(level < MAX_TEXTURE_LEVELS);
+ assert(texObj);
+ assert(level >= 0);
+ assert(level < MAX_TEXTURE_LEVELS);
return texObj->Image[face][level];
}
static void
clear_teximage_fields(struct gl_texture_image *img)
{
- ASSERT(img);
+ assert(img);
img->_BaseFormat = 0;
img->InternalFormat = 0;
img->Border = 0;
GLuint numSamples, GLboolean fixedSampleLocations)
{
GLenum target;
- ASSERT(img);
- ASSERT(width >= 0);
- ASSERT(height >= 0);
- ASSERT(depth >= 0);
+ assert(img);
+ assert(width >= 0);
+ assert(height >= 0);
+ assert(depth >= 0);
target = img->TexObject->Target;
img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat );
- ASSERT(img->_BaseFormat != -1);
+ assert(img->_BaseFormat != -1);
img->InternalFormat = internalFormat;
img->Border = border;
img->Width = width;
/* additional checks for ycbcr textures */
if (internalFormat == GL_YCBCR_MESA) {
- ASSERT(ctx->Extensions.MESA_ycbcr_texture);
+ assert(ctx->Extensions.MESA_ycbcr_texture);
if (type != GL_UNSIGNED_SHORT_8_8_MESA &&
type != GL_UNSIGNED_SHORT_8_8_REV_MESA) {
char message[100];
att->TextureLevel == level &&
att->CubeMapFace == face) {
_mesa_update_texture_renderbuffer(ctx, ctx->DrawBuffer, att);
- ASSERT(att->Renderbuffer->TexImage);
+ assert(att->Renderbuffer->TexImage);
/* Mark fb status as indeterminate to force re-validation */
fb->_Status = 0;
}
if (texObj->GenerateMipmap &&
level == texObj->BaseLevel &&
level < texObj->MaxLevel) {
- ASSERT(ctx->Driver.GenerateMipmap);
+ assert(ctx->Driver.GenerateMipmap);
ctx->Driver.GenerateMipmap(ctx, target, texObj);
}
}
prevImage->Width > 0 &&
prevImage->InternalFormat == internalFormat) {
/* use the same format */
- ASSERT(prevImage->TexFormat != MESA_FORMAT_NONE);
+ assert(prevImage->TexFormat != MESA_FORMAT_NONE);
return prevImage->TexFormat;
}
}
/* choose format from scratch */
f = ctx->Driver.ChooseTextureFormat(ctx, target, internalFormat,
format, type);
- ASSERT(f != MESA_FORMAT_NONE);
+ assert(f != MESA_FORMAT_NONE);
return f;
}
struct gl_texture_object *obj,
GLuint name, GLenum target )
{
- ASSERT(target == 0 ||
+ assert(target == 0 ||
target == GL_TEXTURE_1D ||
target == GL_TEXTURE_2D ||
target == GL_TEXTURE_3D ||
GLboolean deleteFlag = GL_FALSE;
struct gl_texture_object *oldTex = *ptr;
- ASSERT(valid_texture_object(oldTex));
+ assert(valid_texture_object(oldTex));
(void) valid_texture_object; /* silence warning in release builds */
mtx_lock(&oldTex->Mutex);
- ASSERT(oldTex->RefCount > 0);
+ assert(oldTex->RefCount > 0);
oldTex->RefCount--;
deleteFlag = (oldTex->RefCount == 0);
if (tex) {
/* reference new texture */
- ASSERT(valid_texture_object(tex));
+ assert(valid_texture_object(tex));
mtx_lock(&tex->Mutex);
if (tex->RefCount == 0) {
/* this texture's being deleted (look just above) */
return;
}
- ASSERT(maxLevels > 0);
+ assert(maxLevels > 0);
t->_MaxLevel = MIN3(t->MaxLevel,
/* 'p' in the GL spec */
_mesa_reference_texobj(&texUnit->CurrentTex[targetIndex], newTexObj);
ctx->Texture.NumCurrentTexUsed = MAX2(ctx->Texture.NumCurrentTexUsed,
ctx->Texture.CurrentUnit + 1);
- ASSERT(texUnit->CurrentTex[targetIndex]);
+ assert(texUnit->CurrentTex[targetIndex]);
if (texName != 0)
texUnit->_BoundTextures |= (1 << targetIndex);
_mesa_reference_texobj(&texUnit->CurrentTex[texObj->TargetIndex],
texObj);
- ASSERT(texUnit->CurrentTex[texObj->TargetIndex]);
+ assert(texUnit->CurrentTex[texObj->TargetIndex]);
ctx->Texture.NumCurrentTexUsed = MAX2(ctx->Texture.NumCurrentTexUsed,
unit + 1);
texUnit->_BoundTextures |= (1 << texObj->TargetIndex);
static void
set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz)
{
- ASSERT(comp < 4);
- ASSERT(swz <= SWIZZLE_NIL);
+ assert(comp < 4);
+ assert(swz <= SWIZZLE_NIL);
{
GLuint mask = 0x7 << (3 * comp);
GLuint s = (*swizzle & ~mask) | (swz << (3 * comp));
"glTex%sParameter(swizzle 0x%x)", suffix, params[0]);
return GL_FALSE;
}
- ASSERT(comp < 4);
+ assert(comp < 4);
flush(ctx);
texObj->Swizzle[comp] = params[0];
{
GLuint u, tex;
- ASSERT(src);
- ASSERT(dst);
+ assert(src);
+ assert(dst);
dst->Texture.CurrentUnit = src->Texture.CurrentUnit;
dst->Texture._GenFlags = src->Texture._GenFlags;
k = _mesa_max_tex_unit(ctx);
- ASSERT(k <= Elements(ctx->Texture.Unit));
+ assert(k <= Elements(ctx->Texture.Unit));
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glActiveTexture %s\n",
ctx->Texture._TexMatEnabled = 0x0;
for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) {
- ASSERT(u < Elements(ctx->TextureMatrixStack));
+ assert(u < Elements(ctx->TextureMatrixStack));
if (_math_matrix_is_dirty(ctx->TextureMatrixStack[u].Top)) {
_math_matrix_analyse( ctx->TextureMatrixStack[u].Top );
ctx->Texture._GenFlags |= texUnit->_GenFlags;
}
- ASSERT(unit < Elements(ctx->TextureMatrixStack));
+ assert(unit < Elements(ctx->TextureMatrixStack));
if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
}
static inline struct gl_texture_unit *
_mesa_get_tex_unit(struct gl_context *ctx, GLuint unit)
{
- ASSERT(unit < Elements(ctx->Texture.Unit));
+ assert(unit < Elements(ctx->Texture.Unit));
return &(ctx->Texture.Unit[unit]);
}
const GLuint depthScale = 0xffffffff;
GLenum dstType;
(void) dims;
- ASSERT(dstFormat == MESA_FORMAT_Z_UNORM32 ||
+ assert(dstFormat == MESA_FORMAT_Z_UNORM32 ||
dstFormat == MESA_FORMAT_Z_FLOAT32);
- ASSERT(_mesa_get_format_bytes(dstFormat) == sizeof(GLuint));
+ assert(_mesa_get_format_bytes(dstFormat) == sizeof(GLuint));
if (dstFormat == MESA_FORMAT_Z_UNORM32)
dstType = GL_UNSIGNED_INT;
const GLuint depthScale = 0xffffff;
(void) dims;
- ASSERT(dstFormat == MESA_FORMAT_Z24_UNORM_X8_UINT);
+ assert(dstFormat == MESA_FORMAT_Z24_UNORM_X8_UINT);
{
/* general path */
const GLuint depthScale = 0xffffff;
(void) dims;
- ASSERT(dstFormat == MESA_FORMAT_X8_UINT_Z24_UNORM);
+ assert(dstFormat == MESA_FORMAT_X8_UINT_Z24_UNORM);
{
/* general path */
{
const GLuint depthScale = 0xffff;
(void) dims;
- ASSERT(dstFormat == MESA_FORMAT_Z_UNORM16);
- ASSERT(_mesa_get_format_bytes(dstFormat) == sizeof(GLushort));
+ assert(dstFormat == MESA_FORMAT_Z_UNORM16);
+ assert(_mesa_get_format_bytes(dstFormat) == sizeof(GLushort));
{
/* general path */
(void) ctx; (void) dims; (void) baseInternalFormat;
- ASSERT((dstFormat == MESA_FORMAT_YCBCR) ||
+ assert((dstFormat == MESA_FORMAT_YCBCR) ||
(dstFormat == MESA_FORMAT_YCBCR_REV));
- ASSERT(_mesa_get_format_bytes(dstFormat) == 2);
- ASSERT(ctx->Extensions.MESA_ycbcr_texture);
- ASSERT(srcFormat == GL_YCBCR_MESA);
- ASSERT((srcType == GL_UNSIGNED_SHORT_8_8_MESA) ||
+ assert(_mesa_get_format_bytes(dstFormat) == 2);
+ assert(ctx->Extensions.MESA_ycbcr_texture);
+ assert(srcFormat == GL_YCBCR_MESA);
+ assert((srcType == GL_UNSIGNED_SHORT_8_8_MESA) ||
(srcType == GL_UNSIGNED_SHORT_8_8_REV_MESA));
- ASSERT(baseInternalFormat == GL_YCBCR_MESA);
+ assert(baseInternalFormat == GL_YCBCR_MESA);
/* always just memcpy since no pixel transfer ops apply */
memcpy_texture(ctx, dims,
GLuint *depth = malloc(srcWidth * sizeof(GLuint));
GLubyte *stencil = malloc(srcWidth * sizeof(GLubyte));
- ASSERT(dstFormat == MESA_FORMAT_S8_UINT_Z24_UNORM);
- ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT ||
+ assert(dstFormat == MESA_FORMAT_S8_UINT_Z24_UNORM);
+ assert(srcFormat == GL_DEPTH_STENCIL_EXT ||
srcFormat == GL_DEPTH_COMPONENT ||
srcFormat == GL_STENCIL_INDEX);
- ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT ||
+ assert(srcFormat != GL_DEPTH_STENCIL_EXT ||
srcType == GL_UNSIGNED_INT_24_8_EXT ||
srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
GLuint *depth;
GLubyte *stencil;
- ASSERT(dstFormat == MESA_FORMAT_Z24_UNORM_S8_UINT);
- ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT ||
+ assert(dstFormat == MESA_FORMAT_Z24_UNORM_S8_UINT);
+ assert(srcFormat == GL_DEPTH_STENCIL_EXT ||
srcFormat == GL_DEPTH_COMPONENT ||
srcFormat == GL_STENCIL_INDEX);
- ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT ||
+ assert(srcFormat != GL_DEPTH_STENCIL_EXT ||
srcType == GL_UNSIGNED_INT_24_8_EXT ||
srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
static GLboolean
_mesa_texstore_s8(TEXSTORE_PARAMS)
{
- ASSERT(dstFormat == MESA_FORMAT_S_UINT8);
- ASSERT(srcFormat == GL_STENCIL_INDEX);
+ assert(dstFormat == MESA_FORMAT_S_UINT8);
+ assert(srcFormat == GL_STENCIL_INDEX);
{
const GLint srcRowStride
= _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType)
/ sizeof(uint64_t);
- ASSERT(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT);
- ASSERT(srcFormat == GL_DEPTH_STENCIL ||
+ assert(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT);
+ assert(srcFormat == GL_DEPTH_STENCIL ||
srcFormat == GL_DEPTH_COMPONENT ||
srcFormat == GL_STENCIL_INDEX);
- ASSERT(srcFormat != GL_DEPTH_STENCIL ||
+ assert(srcFormat != GL_DEPTH_STENCIL ||
srcType == GL_UNSIGNED_INT_24_8 ||
srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
initialized = GL_TRUE;
}
- ASSERT(table[dstFormat]);
+ assert(table[dstFormat]);
return table[dstFormat](ctx, dims, baseInternalFormat,
dstFormat, dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth,
initialized = GL_TRUE;
}
- ASSERT(table[dstFormat]);
+ assert(table[dstFormat]);
return table[dstFormat](ctx, dims, baseInternalFormat,
dstFormat, dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth,
* have to worry about the usual image unpacking or image transfer
* operations.
*/
- ASSERT(texImage);
- ASSERT(texImage->Width > 0);
- ASSERT(texImage->Height > 0);
- ASSERT(texImage->Depth > 0);
+ assert(texImage);
+ assert(texImage->Width > 0);
+ assert(texImage->Height > 0);
+ assert(texImage->Depth > 0);
/* allocate storage for texture data */
if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage)) {
/* Unreference the old object */
struct gl_transform_feedback_object *oldObj = *ptr;
- ASSERT(oldObj->RefCount > 0);
+ assert(oldObj->RefCount > 0);
oldObj->RefCount--;
if (oldObj->RefCount == 0) {
*ptr = NULL;
}
- ASSERT(!*ptr);
+ assert(!*ptr);
if (obj) {
/* reference new object */
_mesa_init_transform_feedback(struct gl_context *ctx)
{
/* core mesa expects this, even a dummy one, to be available */
- ASSERT(ctx->Driver.NewTransformFeedback);
+ assert(ctx->Driver.NewTransformFeedback);
ctx->TransformFeedback.DefaultObject =
ctx->Driver.NewTransformFeedback(ctx, 0);
_mesa_free_transform_feedback(struct gl_context *ctx)
{
/* core mesa expects this, even a dummy one, to be available */
- ASSERT(ctx->Driver.NewTransformFeedback);
+ assert(ctx->Driver.NewTransformFeedback);
_mesa_reference_buffer_object(ctx,
&ctx->TransformFeedback.CurrentBuffer,
return false;
}
- ASSERT(size <= 4);
+ assert(size <= 4);
elementSize = _mesa_bytes_per_vertex_attrib(size, type);
assert(elementSize != -1);
vao = ctx->Array.VAO;
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
if (!vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
/* was disabled, now being enabled */
vao = ctx->Array.VAO;
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
if (vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
/* was enabled, now being disabled */
return 0;
}
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib));
array = &vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)];
return NULL;
}
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->VertexAttrib));
FLUSH_CURRENT(ctx, 0);
return ctx->Current.Attrib[VERT_ATTRIB_GENERIC(index)];
return;
}
- ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->VertexAttrib));
+ assert(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->VertexAttrib));
*pointer = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Ptr;
}
return;
}
- ASSERT(genericIndex < Elements(ctx->Array.VAO->VertexAttrib));
+ assert(genericIndex < Elements(ctx->Array.VAO->VertexAttrib));
/* The ARB_vertex_attrib_binding spec says:
*
return;
}
- ASSERT(VERT_ATTRIB_GENERIC(attribIndex) <
+ assert(VERT_ATTRIB_GENERIC(attribIndex) <
Elements(ctx->Array.VAO->VertexAttrib));
vertex_attrib_binding(ctx, VERT_ATTRIB_GENERIC(attribIndex),
mat->type = mtypes[mtype];
m = mat->m;
- ASSERT( ((long)m & 15) == 0 );
+ assert( ((long)m & 15) == 0 );
init_matrix( m );
case VAR:
break;
default:
- ASSERT(0);
+ assert(0);
return 0;
}
}
static void INIT(void)
{
#ifdef DEST_1UI
- ASSERT(SZ == 1);
+ assert(SZ == 1);
TAB(_1ui)[SRC_IDX] = DEST_1UI;
#endif
#ifdef DEST_1UB
- ASSERT(SZ == 1);
+ assert(SZ == 1);
TAB(_1ub)[SRC_IDX] = DEST_1UB;
#endif
#ifdef DEST_1F
- ASSERT(SZ == 1);
+ assert(SZ == 1);
TAB(_1f)[SRC_IDX] = DEST_1F;
#endif
#ifdef DEST_3FN
- ASSERT(SZ == 3);
+ assert(SZ == 3);
TAB(_3fn)[SRC_IDX] = DEST_3FN;
#endif
#ifdef DEST_4UB
struct asm_parser_state state;
GLuint i;
- ASSERT(target == GL_FRAGMENT_PROGRAM_ARB);
+ assert(target == GL_FRAGMENT_PROGRAM_ARB);
memset(&prog, 0, sizeof(prog));
memset(&state, 0, sizeof(state));
struct gl_program prog;
struct asm_parser_state state;
- ASSERT(target == GL_VERTEX_PROGRAM_ARB);
+ assert(target == GL_VERTEX_PROGRAM_ARB);
memset(&prog, 0, sizeof(prog));
memset(&state, 0, sizeof(state));
COPY_4V(result, src);
}
else {
- ASSERT(GET_SWZ(source->Swizzle, 0) <= 3);
- ASSERT(GET_SWZ(source->Swizzle, 1) <= 3);
- ASSERT(GET_SWZ(source->Swizzle, 2) <= 3);
- ASSERT(GET_SWZ(source->Swizzle, 3) <= 3);
+ assert(GET_SWZ(source->Swizzle, 0) <= 3);
+ assert(GET_SWZ(source->Swizzle, 1) <= 3);
+ assert(GET_SWZ(source->Swizzle, 2) <= 3);
+ assert(GET_SWZ(source->Swizzle, 3) <= 3);
result[0] = src[GET_SWZ(source->Swizzle, 0)];
result[1] = src[GET_SWZ(source->Swizzle, 1)];
result[2] = src[GET_SWZ(source->Swizzle, 2)];
result[3] = FABSF(result[3]);
}
if (source->Negate) {
- ASSERT(source->Negate == NEGATE_XYZW);
+ assert(source->Negate == NEGATE_XYZW);
result[0] = -result[0];
result[1] = -result[1];
result[2] = -result[2];
result[3] = FABSF(result[3]);
}
if (source->Negate) {
- ASSERT(source->Negate == NEGATE_XYZW);
+ assert(source->Negate == NEGATE_XYZW);
result[0] = -result[0];
result[1] = -result[1];
result[2] = -result[2];
break;
case OPCODE_BGNLOOP:
/* no-op */
- ASSERT(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDLOOP);
break;
case OPCODE_ENDLOOP:
/* subtract 1 here since pc is incremented by for(pc) loop */
- ASSERT(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->Instructions[inst->BranchTarget].Opcode
== OPCODE_BGNLOOP);
pc = inst->BranchTarget - 1; /* go to matching BNGLOOP */
break;
case OPCODE_ENDSUB: /* end subroutine */
break;
case OPCODE_BRK: /* break out of loop (conditional) */
- ASSERT(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDLOOP);
if (eval_condition(machine, inst)) {
/* break out of loop */
}
break;
case OPCODE_CONT: /* continue loop (conditional) */
- ASSERT(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDLOOP);
if (eval_condition(machine, inst)) {
/* continue at ENDLOOP */
case OPCODE_IF:
{
GLboolean cond;
- ASSERT(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->Instructions[inst->BranchTarget].Opcode
== OPCODE_ELSE ||
program->Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDIF);
break;
case OPCODE_ELSE:
/* goto ENDIF */
- ASSERT(program->Instructions[inst->BranchTarget].Opcode
+ assert(program->Instructions[inst->BranchTarget].Opcode
== OPCODE_ENDIF);
assert(inst->BranchTarget >= 0);
pc = inst->BranchTarget;
else if (swz == SWIZZLE_ONE)
result[i] = 1.0;
else {
- ASSERT(swz <= 3);
+ assert(swz <= 3);
result[i] = src[swz];
}
if (source->Negate & (1 << i))
fetch_vector4(&inst->SrcReg[0], machine, texcoord);
/* Not so sure about this test - if texcoord[3] is
- * zero, we'd probably be fine except for an ASSERT in
+ * zero, we'd probably be fine except for an assert in
* IROUND_POS() which gets triggered by the inf values created.
*/
if (texcoord[3] != 0.0) {
GLuint
_mesa_num_inst_src_regs(gl_inst_opcode opcode)
{
- ASSERT(opcode < MAX_OPCODE);
- ASSERT(opcode == InstInfo[opcode].Opcode);
- ASSERT(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode);
+ assert(opcode < MAX_OPCODE);
+ assert(opcode == InstInfo[opcode].Opcode);
+ assert(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode);
return InstInfo[opcode].NumSrcRegs;
}
GLuint
_mesa_num_inst_dst_regs(gl_inst_opcode opcode)
{
- ASSERT(opcode < MAX_OPCODE);
- ASSERT(opcode == InstInfo[opcode].Opcode);
- ASSERT(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode);
+ assert(opcode < MAX_OPCODE);
+ assert(opcode == InstInfo[opcode].Opcode);
+ assert(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode);
return InstInfo[opcode].NumDstRegs;
}
GLuint read_mask, channel_mask;
GLuint comp;
- ASSERT(arg < _mesa_num_inst_src_regs(inst->Opcode));
+ assert(arg < _mesa_num_inst_src_regs(inst->Opcode));
/* Form the dst register, find the written channels */
if (inst->CondUpdate) {
GLuint comp;
GLuint updated_mask = 0x0;
- ASSERT(mov->Opcode == OPCODE_MOV);
+ assert(mov->Opcode == OPCODE_MOV);
for (comp = 0; comp < 4; ++comp) {
GLuint src_comp;
for (j = 0; j < numSrc; j++) {
if (inst->SrcReg[j].File == file) {
GLuint index = inst->SrcReg[j].Index;
- ASSERT(map[index] >= 0);
+ assert(map[index] >= 0);
inst->SrcReg[j].Index = map[index];
}
}
if (inst->DstReg.File == file) {
const GLuint index = inst->DstReg.Index;
- ASSERT(map[index] >= 0);
+ assert(map[index] >= 0);
inst->DstReg.Index = map[index];
}
}
if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) {
const GLuint index = inst->SrcReg[j].Index;
GLuint read_mask;
- ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
+ assert(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
read_mask = get_src_arg_mask(inst, j, NO_MASK);
if (inst->SrcReg[j].RelAddr) {
/* check dst reg */
if (inst->DstReg.File == PROGRAM_TEMPORARY) {
const GLuint index = inst->DstReg.Index;
- ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
+ assert(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
if (inst->DstReg.RelAddr) {
if (dbg)
for (dst_comp = 0; dst_comp < 4; ++dst_comp) {
if (mov->DstReg.WriteMask & (1 << dst_comp)) {
const GLuint src_comp = GET_SWZ(mov->SrcReg[0].Swizzle, dst_comp);
- ASSERT(src_comp < 4);
+ assert(src_comp < 4);
dst_to_src_comp[dst_comp] = src_comp;
}
}
if ((mov->DstReg.WriteMask & (1 << dst_comp)) == 0)
continue;
src_comp = dst_to_src_comp[dst_comp];
- ASSERT(src_comp < 4);
+ assert(src_comp < 4);
arg_comp = GET_SWZ(arg_swz, src_comp);
- ASSERT(arg_comp < 4);
+ assert(arg_comp < 4);
inst->SrcReg[arg].Swizzle |= arg_comp << (3*dst_comp);
}
}
{
GLuint i;
for (i = 0; i + 1 < list->Num; i++) {
- ASSERT(list->Intervals[i].End <= list->Intervals[i + 1].End);
+ assert(list->Intervals[i].End <= list->Intervals[i + 1].End);
}
}
#endif
for (k = 0; k < list->Num; k++) {
if (list->Intervals[k].Reg == inv->Reg) {
/* found, remove it */
- ASSERT(list->Intervals[k].Start == inv->Start);
- ASSERT(list->Intervals[k].End == inv->End);
+ assert(list->Intervals[k].Start == inv->Start);
+ assert(list->Intervals[k].End == inv->End);
while (k < list->Num - 1) {
list->Intervals[k] = list->Intervals[k + 1];
k++;
{
GLuint i;
for (i = 0; i + 1 < list->Num; i++) {
- ASSERT(list->Intervals[i].Start <= list->Intervals[i + 1].Start);
+ assert(list->Intervals[i].Start <= list->Intervals[i + 1].Start);
}
}
#endif
begin = loopStack[0].Start;
}
- ASSERT(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
+ assert(index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
if (intBegin[index] == -1) {
- ASSERT(intEnd[index] == -1);
+ assert(intEnd[index] == -1);
intBegin[index] = begin;
intEnd[index] = end;
}
else {
/* Interval 'inv' has expired */
const GLint regNew = registerMap[inv->Reg];
- ASSERT(regNew >= 0);
+ assert(regNew >= 0);
if (dbg)
printf(" expire interval for reg %u\n", inv->Reg);
/* return register regNew to the free pool */
if (dbg)
printf(" free reg %d\n", regNew);
- ASSERT(usedRegs[regNew] == GL_TRUE);
+ assert(usedRegs[regNew] == GL_TRUE);
usedRegs[regNew] = GL_FALSE;
}
}
GLenum datatype, GLuint *swizzleOut)
{
GLint pos;
- ASSERT(size >= 1);
- ASSERT(size <= 4);
+ assert(size >= 1);
+ assert(size <= 4);
if (swizzleOut &&
_mesa_lookup_parameter_constant(paramList, values,
GLuint size = MIN2(p->Size, 4);
GLint j = _mesa_add_parameter(clone, p->Type, p->Name, size, p->DataType,
list->ParameterValues[i], NULL);
- ASSERT(j >= 0);
+ assert(j >= 0);
pCopy = clone->Parameters + j;
/* copy state indexes */
if (p->Type == PROGRAM_STATE_VAR) {
/* state[1] is either 0=front or 1=back side */
const GLuint face = (GLuint) state[1];
const struct gl_material *mat = &ctx->Light.Material;
- ASSERT(face == 0 || face == 1);
+ assert(face == 0 || face == 1);
/* we rely on tokens numbered so that _BACK_ == _FRONT_+ 1 */
- ASSERT(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT);
+ assert(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT);
/* XXX we could get rid of this switch entirely with a little
* work in arbprogparse.c's parse_state_single_item().
*/
const GLuint ln = (GLuint) state[1];
const GLuint face = (GLuint) state[2];
GLint i;
- ASSERT(face == 0 || face == 1);
+ assert(face == 0 || face == 1);
switch (state[3]) {
case STATE_AMBIENT:
for (i = 0; i < 3; i++) {
const gl_state_index modifier = state[4];
const GLfloat *m;
GLuint row, i;
- ASSERT(firstRow < 4);
- ASSERT(lastRow < 4);
+ assert(firstRow < 4);
+ assert(lastRow < 4);
if (mat == STATE_MODELVIEW_MATRIX) {
matrix = ctx->ModelviewMatrixStack.Top;
}
matrix = &ctx->_ModelProjectMatrix;
}
else if (mat == STATE_TEXTURE_MATRIX) {
- ASSERT(index < Elements(ctx->TextureMatrixStack));
+ assert(index < Elements(ctx->TextureMatrixStack));
matrix = ctx->TextureMatrixStack[index].Top;
}
else if (mat == STATE_PROGRAM_MATRIX) {
- ASSERT(index < Elements(ctx->ProgramMatrixStack));
+ assert(index < Elements(ctx->ProgramMatrixStack));
matrix = ctx->ProgramMatrixStack[index].Top;
}
else {
* If this assertion fails, we need to increase the field
* size for register indexes (see INST_INDEX_BITS).
*/
- ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4
+ assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4
<= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4
+ assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4
<= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTemps <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= (1 << INST_INDEX_BITS));
+ assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps <= (1 << INST_INDEX_BITS));
+ assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams <= (1 << INST_INDEX_BITS));
+ assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTemps <= (1 << INST_INDEX_BITS));
+ assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents <= 4 * MAX_UNIFORMS);
- ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents <= 4 * MAX_UNIFORMS);
+ assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents <= 4 * MAX_UNIFORMS);
+ assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents <= 4 * MAX_UNIFORMS);
- ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxAddressOffset <= (1 << INST_INDEX_BITS));
- ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAddressOffset <= (1 << INST_INDEX_BITS));
+ assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxAddressOffset <= (1 << INST_INDEX_BITS));
+ assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAddressOffset <= (1 << INST_INDEX_BITS));
/* If this fails, increase prog_instruction::TexSrcUnit size */
STATIC_ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
_mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
{
(void) ctx;
- ASSERT(prog);
- ASSERT(prog->RefCount==0);
+ assert(prog);
+ assert(prog->RefCount==0);
if (prog == &_mesa_DummyProgram)
return;
if (*ptr && prog) {
/* sanity check */
if ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB)
- ASSERT(prog->Target == GL_VERTEX_PROGRAM_ARB);
+ assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB)
- ASSERT(prog->Target == GL_FRAGMENT_PROGRAM_ARB ||
+ assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB ||
prog->Target == GL_FRAGMENT_PROGRAM_NV);
else if ((*ptr)->Target == MESA_GEOMETRY_PROGRAM)
- ASSERT(prog->Target == MESA_GEOMETRY_PROGRAM);
+ assert(prog->Target == MESA_GEOMETRY_PROGRAM);
}
#endif
((*ptr)->Target == MESA_GEOMETRY_PROGRAM ? "GP" : "FP")),
(*ptr)->RefCount - 1);
#endif
- ASSERT((*ptr)->RefCount > 0);
+ assert((*ptr)->RefCount > 0);
(*ptr)->RefCount--;
deleteFlag = ((*ptr)->RefCount == 0);
/*mtx_lock(&(*ptr)->Mutex);*/
if (deleteFlag) {
- ASSERT(ctx);
+ assert(ctx);
ctx->Driver.DeleteProgram(ctx, *ptr);
}
GLbitfield64 inputsB;
GLuint i;
- ASSERT(progA->Target == progB->Target);
+ assert(progA->Target == progB->Target);
newInst = _mesa_alloc_instructions(newLength);
if (!newInst)
const GLuint n = _mesa_num_inst_src_regs(inst->Opcode);
if (inst->DstReg.File == file) {
- ASSERT(inst->DstReg.Index < usedSize);
+ assert(inst->DstReg.Index < usedSize);
if(inst->DstReg.Index < usedSize)
used[inst->DstReg.Index] = GL_TRUE;
}
for (j = 0; j < n; j++) {
if (inst->SrcReg[j].File == file) {
- ASSERT(inst->SrcReg[j].Index < (GLint) usedSize);
+ assert(inst->SrcReg[j].Index < (GLint) usedSize);
if (inst->SrcReg[j].Index < (GLint) usedSize)
used[inst->SrcReg[j].Index] = GL_TRUE;
}
case GL_COMPUTE_PROGRAM_NV:
return MESA_SHADER_COMPUTE;
default:
- ASSERT(0);
+ assert(0);
return ~0;
}
}
{
const GLint maxIndex = 1 << INST_INDEX_BITS;
const GLint minIndex = 0;
- ASSERT(index >= minIndex);
+ assert(index >= minIndex);
(void) minIndex;
- ASSERT(index <= maxIndex);
+ assert(index <= maxIndex);
(void) maxIndex;
- ASSERT(file == PROGRAM_TEMPORARY ||
+ assert(file == PROGRAM_TEMPORARY ||
file == PROGRAM_ADDRESS ||
file == PROGRAM_OUTPUT);
memset(r, 0, sizeof(*r));
{
const GLint maxIndex = (1 << INST_INDEX_BITS) - 1;
const GLint minIndex = -(1 << INST_INDEX_BITS);
- ASSERT(file < PROGRAM_FILE_MAX);
- ASSERT(index >= minIndex);
+ assert(file < PROGRAM_FILE_MAX);
+ assert(index >= minIndex);
(void) minIndex;
- ASSERT(index <= maxIndex);
+ assert(index <= maxIndex);
(void) maxIndex;
memset(r, 0, sizeof(*r));
r->Base.File = file;
inst++;
}
else {
- ASSERT(fog_mode == GL_EXP || fog_mode == GL_EXP2);
+ assert(fog_mode == GL_EXP || fog_mode == GL_EXP2);
/* fogPRefOpt.z = d/ln(2), fogPRefOpt.w = d/sqrt(ln(2) */
/* EXP: MUL fogFactorTemp.x, fogPRefOpt.z, fragment.fogcoord.x; */
/* EXP2: MUL fogFactorTemp.x, fogPRefOpt.w, fragment.fogcoord.x; */
struct st_buffer_object *st_obj = st_buffer_object(obj);
/* we may be called from VBO code, so double-check params here */
- ASSERT(offset >= 0);
- ASSERT(size >= 0);
- ASSERT(offset + size <= obj->Size);
+ assert(offset >= 0);
+ assert(size >= 0);
+ assert(offset + size <= obj->Size);
if (!size)
return;
struct st_buffer_object *st_obj = st_buffer_object(obj);
/* we may be called from VBO code, so double-check params here */
- ASSERT(offset >= 0);
- ASSERT(size >= 0);
- ASSERT(offset + size <= obj->Size);
+ assert(offset >= 0);
+ assert(size >= 0);
+ assert(offset + size <= obj->Size);
if (!size)
return;
*/
for (comp = 0; comp < 4; ++comp) {
const unsigned coord = GET_SWZ(src.swizzle, comp);
- ASSERT(coord < 4);
+ assert(coord < 4);
if (dst.writemask & (1 << comp) && coord <= SWIZZLE_W)
read_mask |= 1 << coord;
}
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- ASSERT(ctx->Line.SmoothFlag);
+ assert(ctx->Line.SmoothFlag);
if (ctx->Texture._EnabledCoordUnits != 0
|| _swrast_use_fragment_program(ctx)
static inline GLfloat
solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4])
{
- ASSERT(plane[2] != 0.0F);
+ assert(plane[2] != 0.0F);
return (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
}
GLint stop = 4, i;
GLfloat insideCount = 16.0F;
- ASSERT(dx0 * dy1 - dx1 * dy0 >= 0.0); /* area >= 0.0 */
+ assert(dx0 * dy1 - dx1 * dy0 >= 0.0); /* area >= 0.0 */
for (i = 0; i < stop; i++) {
const GLfloat sx = x + samples[i][0];
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- ASSERT(ctx->Polygon.SmoothFlag);
+ assert(ctx->Polygon.SmoothFlag);
if (ctx->Texture._EnabledCoordUnits != 0
|| _swrast_use_fragment_program(ctx)
SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri;
}
- ASSERT(SWRAST_CONTEXT(ctx)->Triangle);
+ assert(SWRAST_CONTEXT(ctx)->Triangle);
}
/* (cx,cy) = center of fragment */
const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
SWspanarrays *array = span.array;
- ASSERT(ix >= 0);
+ assert(ix >= 0);
array->coverage[ix] = coverage;
#ifdef DO_Z
array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane);
}
else {
/* Interpolate alpha values */
- ASSERT(span->interpMask & SPAN_RGBA);
+ assert(span->interpMask & SPAN_RGBA);
if (span->array->ChanType == GL_UNSIGNED_BYTE) {
const GLfixed alphaStep = span->alphaStep;
GLfixed alpha = span->alpha;
GLuint i;
/* incoming colors should be floats */
- ASSERT(span->array->ChanType == GL_FLOAT);
+ assert(span->array->ChanType == GL_FLOAT);
for (i = 0; i < span->end; i++) {
if (span->array->mask[i]) {
GLuint count = 0;
SWspan span;
- ASSERT(ctx->RenderMode == GL_RENDER);
+ assert(ctx->RenderMode == GL_RENDER);
if (!_mesa_check_conditional_render(ctx))
return; /* don't draw */
GLint row, col;
SWspan span;
- ASSERT(ctx->RenderMode == GL_RENDER);
- ASSERT(bitmap);
+ assert(ctx->RenderMode == GL_RENDER);
+ assert(bitmap);
swrast_render_start(ctx);
{
GLint bytes;
- ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].SrcRGB == GL_ZERO);
- ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE);
+ assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].SrcRGB == GL_ZERO);
+ assert(ctx->Color.Blend[0].DstRGB == GL_ONE);
(void) ctx;
/* just memcpy */
blend_replace(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
- ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].SrcRGB == GL_ONE);
- ASSERT(ctx->Color.Blend[0].DstRGB == GL_ZERO);
+ assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].SrcRGB == GL_ONE);
+ assert(ctx->Color.Blend[0].DstRGB == GL_ZERO);
(void) ctx;
(void) n;
(void) mask;
const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst;
GLuint i;
- ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA);
- ASSERT(chanType == GL_UNSIGNED_BYTE);
+ assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA);
+ assert(chanType == GL_UNSIGNED_BYTE);
(void) ctx;
const GLint g = DIV255((rgba[i][GCOMP] - dest[i][GCOMP]) * t) + dest[i][GCOMP];
const GLint b = DIV255((rgba[i][BCOMP] - dest[i][BCOMP]) * t) + dest[i][BCOMP];
const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP];
- ASSERT(r <= 255);
- ASSERT(g <= 255);
- ASSERT(b <= 255);
- ASSERT(a <= 255);
+ assert(r <= 255);
+ assert(g <= 255);
+ assert(b <= 255);
+ assert(a <= 255);
rgba[i][RCOMP] = (GLubyte) r;
rgba[i][GCOMP] = (GLubyte) g;
rgba[i][BCOMP] = (GLubyte) b;
const GLushort (*dest)[4] = (const GLushort (*)[4]) dst;
GLuint i;
- ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA);
- ASSERT(chanType == GL_UNSIGNED_SHORT);
+ assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA);
+ assert(chanType == GL_UNSIGNED_SHORT);
(void) ctx;
const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
GLuint i;
- ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA);
- ASSERT(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA);
- ASSERT(chanType == GL_FLOAT);
+ assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].SrcRGB == GL_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].SrcA == GL_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].DstRGB == GL_ONE_MINUS_SRC_ALPHA);
+ assert(ctx->Color.Blend[0].DstA == GL_ONE_MINUS_SRC_ALPHA);
+ assert(chanType == GL_FLOAT);
(void) ctx;
{
GLuint i;
- ASSERT(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
- ASSERT(ctx->Color.Blend[0].SrcRGB == GL_ONE);
- ASSERT(ctx->Color.Blend[0].DstRGB == GL_ONE);
+ assert(ctx->Color.Blend[0].EquationRGB == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].EquationA == GL_FUNC_ADD);
+ assert(ctx->Color.Blend[0].SrcRGB == GL_ONE);
+ assert(ctx->Color.Blend[0].DstRGB == GL_ONE);
(void) ctx;
if (chanType == GL_UNSIGNED_BYTE) {
else {
GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
- ASSERT(chanType == GL_FLOAT);
+ assert(chanType == GL_FLOAT);
for (i=0;i<n;i++) {
if (mask[i]) {
/* don't RGB clamp to max */
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
- ASSERT(ctx->Color.Blend[0].EquationRGB == GL_MIN);
- ASSERT(ctx->Color.Blend[0].EquationA == GL_MIN);
+ assert(ctx->Color.Blend[0].EquationRGB == GL_MIN);
+ assert(ctx->Color.Blend[0].EquationA == GL_MIN);
(void) ctx;
if (chanType == GL_UNSIGNED_BYTE) {
else {
GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
- ASSERT(chanType == GL_FLOAT);
+ assert(chanType == GL_FLOAT);
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
- ASSERT(ctx->Color.Blend[0].EquationRGB == GL_MAX);
- ASSERT(ctx->Color.Blend[0].EquationA == GL_MAX);
+ assert(ctx->Color.Blend[0].EquationRGB == GL_MAX);
+ assert(ctx->Color.Blend[0].EquationA == GL_MAX);
(void) ctx;
if (chanType == GL_UNSIGNED_BYTE) {
else {
GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
- ASSERT(chanType == GL_FLOAT);
+ assert(chanType == GL_FLOAT);
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
else {
GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
const GLfloat (*dest)[4] = (const GLfloat (*)[4]) dst;
- ASSERT(chanType == GL_FLOAT);
+ assert(chanType == GL_FLOAT);
for (i=0;i<n;i++) {
if (mask[i]) {
rgba[i][RCOMP] = rgba[i][RCOMP] * dest[i][RCOMP];
SWcontext *swrast = SWRAST_CONTEXT(ctx);
void *rbPixels;
- ASSERT(span->end <= SWRAST_MAX_WIDTH);
- ASSERT(span->arrayMask & SPAN_RGBA);
- ASSERT(!ctx->Color.ColorLogicOpEnabled);
+ assert(span->end <= SWRAST_MAX_WIDTH);
+ assert(span->arrayMask & SPAN_RGBA);
+ assert(!ctx->Color.ColorLogicOpEnabled);
rbPixels = _swrast_get_dest_rgba(ctx, rb, span);
if (flip) { \
for (dstCol = 0; dstCol < dstWidth; dstCol++) { \
GLint srcCol = (dstCol * srcWidth) / dstWidth; \
- ASSERT(srcCol >= 0); \
- ASSERT(srcCol < srcWidth); \
+ assert(srcCol >= 0); \
+ assert(srcCol < srcWidth); \
srcCol = srcWidth - 1 - srcCol; /* flip */ \
if (SIZE == 1) { \
dst[dstCol] = src[srcCol]; \
else { \
for (dstCol = 0; dstCol < dstWidth; dstCol++) { \
GLint srcCol = (dstCol * srcWidth) / dstWidth; \
- ASSERT(srcCol >= 0); \
- ASSERT(srcCol < srcWidth); \
+ assert(srcCol >= 0); \
+ assert(srcCol < srcWidth); \
if (SIZE == 1) { \
dst[dstCol] = src[srcCol]; \
} \
GLint srcRow = IROUND(srcRowF);
GLubyte *dstRowStart = dstMap + dstRowStride * dstRow;
- ASSERT(srcRow >= 0);
- ASSERT(srcRow < srcHeight);
+ assert(srcRow >= 0);
+ assert(srcRow < srcHeight);
if (invertY) {
srcRow = srcHeight - 1 - srcRow;
GLfloat colWeight = srcCol - srcCol0; /* fractional part of srcCol */
GLfloat red, green, blue, alpha;
- ASSERT(srcCol0 < srcWidth);
- ASSERT(srcCol1 <= srcWidth);
+ assert(srcCol0 < srcWidth);
+ assert(srcCol1 <= srcWidth);
if (srcCol1 == srcWidth) {
/* last column fudge */
GLfloat colWeight = srcCol - srcCol0; /* fractional part of srcCol */
GLfloat red, green, blue, alpha;
- ASSERT(srcCol0 < srcWidth);
- ASSERT(srcCol1 <= srcWidth);
+ assert(srcCol0 < srcWidth);
+ assert(srcCol1 <= srcWidth);
if (srcCol1 == srcWidth) {
/* last column fudge */
}
}
else {
- ASSERT(filter == GL_LINEAR);
+ assert(filter == GL_LINEAR);
if (mask & GL_COLOR_BUFFER_BIT) { /* depth/stencil not allowed */
blit_linear(ctx, readFb, drawFb, srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1);
_swrast_validate_derived( ctx );
swrast->choose_triangle( ctx );
- ASSERT(swrast->Triangle);
+ assert(swrast->Triangle);
if (swrast->SpecularVertexAdd) {
/* separate specular color, but no texture */
_swrast_validate_derived( ctx );
swrast->choose_line( ctx );
- ASSERT(swrast->Line);
+ assert(swrast->Line);
if (swrast->SpecularVertexAdd) {
swrast->SpecLine = swrast->Line;
p = NULL;
}
- ASSERT(width < SWRAST_MAX_WIDTH);
+ assert(width < SWRAST_MAX_WIDTH);
for (row = 0; row < height; row++, sy += stepy, dy += stepy) {
GLvoid *rgba = span.array->attribs[VARYING_SLOT_COL0];
dstRb = dstFb->Attachment[BUFFER_DEPTH].Renderbuffer;
}
else {
- ASSERT(type == GL_DEPTH_STENCIL_EXT);
+ assert(type == GL_DEPTH_STENCIL_EXT);
/* XXX correct? */
srcRb = srcFb->Attachment[BUFFER_DEPTH].Renderbuffer;
dstRb = dstFb->Attachment[BUFFER_DEPTH].Renderbuffer;
while (skipPixels < width) {
const GLint spanWidth = MIN2(width - skipPixels, SWRAST_MAX_WIDTH);
GLint row;
- ASSERT(span.end <= SWRAST_MAX_WIDTH);
+ assert(span.end <= SWRAST_MAX_WIDTH);
for (row = 0; row < height; row++) {
const GLvoid *zSrc = _mesa_image_address2d(unpack,
pixels, width, height,
depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
- ASSERT(depthRb);
- ASSERT(stencilRb);
+ assert(depthRb);
+ assert(stencilRb);
if (depthRb == stencilRb &&
(depthRb->Format == MESA_FORMAT_S8_UINT_Z24_UNORM ||
const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx);
GLfloat rFog, gFog, bFog;
- ASSERT(swrast->_FogEnabled);
- ASSERT(span->arrayMask & SPAN_RGBA);
+ assert(swrast->_FogEnabled);
+ assert(span->arrayMask & SPAN_RGBA);
/* compute (scaled) fog color */
if (span->array->ChanType == GL_UNSIGNED_BYTE) {
}
else {
GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
- ASSERT(span->array->ChanType == GL_FLOAT);
+ assert(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, LINEAR_FOG);
}
}
}
else {
GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
- ASSERT(span->array->ChanType == GL_FLOAT);
+ assert(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, EXP_FOG);
}
}
}
else {
GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
- ASSERT(span->array->ChanType == GL_FLOAT);
+ assert(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, EXP2_FOG);
}
}
}
else {
GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
- ASSERT(span->array->ChanType == GL_FLOAT);
+ assert(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, BLEND_FOG);
}
}
/* incoming colors should be floats */
if (program->Base.InputsRead & VARYING_BIT_COL0) {
- ASSERT(span->array->ChanType == GL_FLOAT);
+ assert(span->array->ChanType == GL_FLOAT);
}
run_program(ctx, span, 0, span->end);
ctx->Const.MaxLineWidth);
GLint start;
- ASSERT(span->end < SWRAST_MAX_WIDTH);
+ assert(span->end < SWRAST_MAX_WIDTH);
if (width & 1)
start = width / 2;
if (ctx->Line.SmoothFlag) {
/* antialiased lines */
_swrast_choose_aa_line_function(ctx);
- ASSERT(swrast->Line);
+ assert(swrast->Line);
}
else if (ctx->Texture._EnabledCoordUnits
|| _swrast_use_fragment_program(ctx)
#endif
}
else {
- ASSERT(!ctx->Depth.Test);
- ASSERT(ctx->Line.Width == 1.0);
+ assert(!ctx->Depth.Test);
+ assert(ctx->Line.Width == 1.0);
/* simple lines */
USE(simple_no_z_rgba_line);
}
USE(_swrast_feedback_line);
}
else {
- ASSERT(ctx->RenderMode == GL_SELECT);
+ assert(ctx->RenderMode == GL_SELECT);
USE(_swrast_select_line);
}
}
#endif
}
- ASSERT(dx >= 0);
- ASSERT(dy >= 0);
+ assert(dx >= 0);
+ assert(dy >= 0);
numPixels = MAX2(dx, dy);
{
void *rbPixels;
- ASSERT(span->end < SWRAST_MAX_WIDTH);
- ASSERT(span->arrayMask & SPAN_RGBA);
+ assert(span->end < SWRAST_MAX_WIDTH);
+ assert(span->arrayMask & SPAN_RGBA);
rbPixels = _swrast_get_dest_rgba(ctx, rb, span);
const GLuint n = span->end;
void *rbPixels;
- ASSERT(n < SWRAST_MAX_WIDTH);
- ASSERT(span->arrayMask & SPAN_RGBA);
+ assert(n < SWRAST_MAX_WIDTH);
+ assert(span->arrayMask & SPAN_RGBA);
rbPixels = _swrast_get_dest_rgba(ctx, rb, span);
if (attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7) {
/* a texcoord attribute */
const GLuint u = attr - VARYING_SLOT_TEX0;
- ASSERT(u < Elements(ctx->Point.CoordReplace));
+ assert(u < Elements(ctx->Point.CoordReplace));
if (ctx->Point.CoordReplace[u]) {
tCoords[numTcoords++] = attr;
span->array->z[count] = (GLint) (vert->attrib[VARYING_SLOT_POS][2] + 0.5F);
span->end = count + 1;
- ASSERT(span->end <= SWRAST_MAX_WIDTH);
+ assert(span->end <= SWRAST_MAX_WIDTH);
}
}
else {
/* the internalFormat should have been error checked long ago */
- ASSERT(rb->_BaseFormat);
+ assert(rb->_BaseFormat);
}
return GL_TRUE;
v3 += dv3dx;
w += dwdx;
}
- ASSERT((span->arrayAttribs & BITFIELD64_BIT(attr)) == 0);
+ assert((span->arrayAttribs & BITFIELD64_BIT(attr)) == 0);
span->arrayAttribs |= BITFIELD64_BIT(attr);
}
ATTRIB_LOOP_END
const GLuint n = span->end;
GLuint i;
- ASSERT(!(span->arrayMask & SPAN_RGBA));
+ assert(!(span->arrayMask & SPAN_RGBA));
#endif
switch (span->array->ChanType) {
}
else {
/* interpolate red/green/blue/alpha to get float colors */
- ASSERT(span->interpMask & SPAN_RGBA);
+ assert(span->interpMask & SPAN_RGBA);
if (span->interpMask & SPAN_FLAT) {
GLfloat r = FixedToFloat(span->red);
GLfloat g = FixedToFloat(span->green);
const GLuint n = span->end;
GLuint i;
- ASSERT(!(span->arrayMask & SPAN_Z));
+ assert(!(span->arrayMask & SPAN_Z));
if (ctx->DrawBuffer->Visual.depthBits <= 16) {
GLfixed zval = span->z;
{
GLubyte *mask = span->array->mask;
- ASSERT(ctx->Polygon.StippleFlag);
+ assert(ctx->Polygon.StippleFlag);
if (span->arrayMask & SPAN_XY) {
/* arrays of x/y pixel coords */
/* Clip to right */
if (x + n > xmax) {
- ASSERT(x < xmax);
+ assert(x < xmax);
n = span->end = xmax - x;
}
const GLint leftClip = xmin - x;
GLuint i;
- ASSERT(leftClip > 0);
- ASSERT(x + n > xmin);
+ assert(leftClip > 0);
+ assert(x + n > xmin);
/* Clip 'leftClip' pixels from the left side.
* The span->leftClip field will be applied when we interpolate
span->writeAll = GL_FALSE;
}
- ASSERT(span->x >= xmin);
- ASSERT(span->x + span->end <= xmax);
- ASSERT(span->y >= ymin);
- ASSERT(span->y < ymax);
+ assert(span->x >= xmin);
+ assert(span->x + span->end <= xmax);
+ assert(span->y >= ymin);
+ assert(span->y < ymax);
return GL_TRUE; /* some pixels visible */
}
GLfloat (*col1)[4] = span->array->attribs[VARYING_SLOT_COL1];
GLuint i;
- ASSERT(!_swrast_use_fragment_program(ctx));
- ASSERT(span->arrayMask & SPAN_RGBA);
- ASSERT(swrast->_ActiveAttribMask & VARYING_BIT_COL1);
+ assert(!_swrast_use_fragment_program(ctx));
+ assert(span->arrayMask & SPAN_RGBA);
+ assert(swrast->_ActiveAttribMask & VARYING_BIT_COL1);
(void) swrast; /* silence warning */
if (span->array->ChanType == GL_FLOAT) {
interpolate_active_attribs(ctx, span, VARYING_BIT_COL1);
}
- ASSERT(span->arrayAttribs & VARYING_BIT_COL0);
- ASSERT(span->arrayAttribs & VARYING_BIT_COL1);
+ assert(span->arrayAttribs & VARYING_BIT_COL0);
+ assert(span->arrayAttribs & VARYING_BIT_COL1);
for (i = 0; i < span->end; i++) {
if (mask[i]) {
for (i = 0; i < span->end; i++) {
const GLfloat a = rgba[i][ACOMP] * coverage[i];
rgba[i][ACOMP] = (GLubyte) CLAMP(a, 0.0, 255.0);
- ASSERT(coverage[i] >= 0.0);
- ASSERT(coverage[i] <= 1.0);
+ assert(coverage[i] >= 0.0);
+ assert(coverage[i] <= 1.0);
}
}
else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
{
GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
GLuint i;
- ASSERT(span->array->ChanType == GL_FLOAT);
+ assert(span->array->ChanType == GL_FLOAT);
for (i = 0; i < span->end; i++) {
rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F);
rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F);
src = span->array->rgba8;
}
else {
- ASSERT(srcType == GL_UNSIGNED_SHORT);
+ assert(srcType == GL_UNSIGNED_SHORT);
src = span->array->rgba16;
}
_swrast_exec_fragment_program(ctx, span);
}
else {
- ASSERT(ctx->ATIFragmentShader._Enabled);
+ assert(ctx->ATIFragmentShader._Enabled);
_swrast_exec_fragment_shader(ctx, span);
}
}
span->interpMask, span->arrayMask);
*/
- ASSERT(span->primitive == GL_POINT ||
+ assert(span->primitive == GL_POINT ||
span->primitive == GL_LINE ||
span->primitive == GL_POLYGON ||
span->primitive == GL_BITMAP);
return;
}
- ASSERT(span->end <= SWRAST_MAX_WIDTH);
+ assert(span->end <= SWRAST_MAX_WIDTH);
/* Depth bounds test */
if (ctx->Depth.BoundsTest && fb->Visual.depthBits > 0) {
}
else if (fb->Visual.depthBits > 0) {
/* Just regular depth testing */
- ASSERT(ctx->Depth.Test);
- ASSERT(span->arrayMask & SPAN_Z);
+ assert(ctx->Depth.Test);
+ assert(span->arrayMask & SPAN_Z);
if (!_swrast_depth_test_span(ctx, span)) {
/* all fragments failed test */
goto end;
}
#endif
- ASSERT(span->arrayMask & SPAN_RGBA);
+ assert(span->arrayMask & SPAN_RGBA);
if (span->primitive == GL_BITMAP || !swrast->SpecularVertexAdd) {
/* Add primary and specular (diffuse + specular) colors */
4 * span->end * sizeof(GLchan));
}
- ASSERT(rb->_BaseFormat == GL_RGBA ||
+ assert(rb->_BaseFormat == GL_RGBA ||
rb->_BaseFormat == GL_RGB ||
rb->_BaseFormat == GL_RED ||
rb->_BaseFormat == GL_RG ||
length = (GLint) n;
}
- ASSERT(rb);
- ASSERT(rb->_BaseFormat == GL_RGBA ||
+ assert(rb);
+ assert(rb->_BaseFormat == GL_RGBA ||
rb->_BaseFormat == GL_RGB ||
rb->_BaseFormat == GL_RG ||
rb->_BaseFormat == GL_RED ||
{
GLuint i;
for (i = 0; i < n; i++) {
- ASSERT(newMask[i] == 0 || newMask[i] == 1);
+ assert(newMask[i] == 0 || newMask[i] == 1);
passMask[i] = origMask[i] & newMask[i];
failMask[i] = origMask[i] & (newMask[i] ^ 1);
}
/* ARB_texture_env_crossbar source */
{
const GLuint srcUnit = srcRGB - GL_TEXTURE0;
- ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
+ assert(srcUnit < ctx->Const.MaxTextureUnits);
if (!ctx->Texture.Unit[srcUnit]._Current)
goto end;
argRGB[term] = get_texel_array(swrast, srcUnit);
/* ARB_texture_env_crossbar source */
{
const GLuint srcUnit = srcA - GL_TEXTURE0;
- ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
+ assert(srcUnit < ctx->Const.MaxTextureUnits);
if (!ctx->Texture.Unit[srcUnit]._Current)
goto end;
argA[term] = get_texel_array(swrast, srcUnit);
return;
}
- ASSERT(span->end <= SWRAST_MAX_WIDTH);
+ assert(span->end <= SWRAST_MAX_WIDTH);
/*
* Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR)
texImage->FetchCompressedTexel = _mesa_get_compressed_fetch_func(format);
- ASSERT(texImage->FetchTexel);
+ assert(texImage->FetchTexel);
}
void
GLfloat minMagThresh;
/* we shouldn't be here if minfilter == magfilter */
- ASSERT(samp->MinFilter != samp->MagFilter);
+ assert(samp->MinFilter != samp->MagFilter);
/* This bit comes from the OpenGL spec: */
if (samp->MagFilter == GL_LINEAR
printf("lambda delta = %g\n", lambda[0] - lambda[n-1]);
if (lambda[0] >= lambda[n-1]) { /* decreasing */
for (i = 0; i < n - 1; i++) {
- ASSERT((GLint) (lambda[i] * 10) >= (GLint) (lambda[i+1] * 10));
+ assert((GLint) (lambda[i] * 10) >= (GLint) (lambda[i+1] * 10));
}
}
else { /* increasing */
for (i = 0; i < n - 1; i++) {
- ASSERT((GLint) (lambda[i] * 10) <= (GLint) (lambda[i+1] * 10));
+ assert((GLint) (lambda[i] * 10) <= (GLint) (lambda[i+1] * 10));
}
}
}
for (i = 0; i < n; i++) {
if (lambda[i] > minMagThresh) {
/* minification */
- ASSERT(i >= *minStart);
- ASSERT(i < *minEnd);
+ assert(i >= *minStart);
+ assert(i < *minEnd);
}
else {
/* magnification */
- ASSERT(i >= *magStart);
- ASSERT(i < *magEnd);
+ assert(i >= *magStart);
+ assert(i < *magEnd);
}
}
}
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = nearest_mipmap_level(tObj, lambda[i]);
sample_1d_nearest(ctx, samp, tObj->Image[0][level], texcoord[i], rgba[i]);
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = nearest_mipmap_level(tObj, lambda[i]);
sample_1d_linear(ctx, samp, tObj->Image[0][level], texcoord[i], rgba[i]);
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
GLuint magStart, magEnd; /* texels with magnification */
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
compute_min_mag_ranges(samp, n, lambda,
&minStart, &minEnd, &magStart, &magEnd);
(void) ctx;
- ASSERT(samp->WrapS == GL_REPEAT);
- ASSERT(samp->WrapT == GL_REPEAT);
- ASSERT(img->Border == 0);
- ASSERT(swImg->_IsPowerOfTwo);
+ assert(samp->WrapS == GL_REPEAT);
+ assert(samp->WrapT == GL_REPEAT);
+ assert(img->Border == 0);
+ assert(swImg->_IsPowerOfTwo);
linear_repeat_texel_location(width, texcoord[0], &i0, &i1, &wi);
linear_repeat_texel_location(height, texcoord[1], &j0, &j1, &wj);
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = nearest_mipmap_level(tObj, lambda[i]);
sample_2d_linear(ctx, samp, tObj->Image[0][level], texcoord[i], rgba[i]);
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
const GLfloat lambda[], GLfloat rgba[][4] )
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
- ASSERT(samp->WrapS == GL_REPEAT);
- ASSERT(samp->WrapT == GL_REPEAT);
+ assert(lambda != NULL);
+ assert(samp->WrapS == GL_REPEAT);
+ assert(samp->WrapT == GL_REPEAT);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
GLuint k;
(void) ctx;
(void) lambda;
- ASSERT(samp->WrapS==GL_REPEAT);
- ASSERT(samp->WrapT==GL_REPEAT);
- ASSERT(img->Border==0);
- ASSERT(img->TexFormat == MESA_FORMAT_BGR_UNORM8);
- ASSERT(swImg->_IsPowerOfTwo);
+ assert(samp->WrapS==GL_REPEAT);
+ assert(samp->WrapT==GL_REPEAT);
+ assert(img->Border==0);
+ assert(img->TexFormat == MESA_FORMAT_BGR_UNORM8);
+ assert(swImg->_IsPowerOfTwo);
(void) swImg;
for (k=0; k<n; k++) {
GLuint i;
(void) ctx;
(void) lambda;
- ASSERT(samp->WrapS==GL_REPEAT);
- ASSERT(samp->WrapT==GL_REPEAT);
- ASSERT(img->Border==0);
- ASSERT(img->TexFormat == MESA_FORMAT_A8B8G8R8_UNORM);
- ASSERT(swImg->_IsPowerOfTwo);
+ assert(samp->WrapS==GL_REPEAT);
+ assert(samp->WrapT==GL_REPEAT);
+ assert(img->Border==0);
+ assert(img->TexFormat == MESA_FORMAT_A8B8G8R8_UNORM);
+ assert(swImg->_IsPowerOfTwo);
(void) swImg;
for (i = 0; i < n; i++) {
swImg->RowStride)
&& swImg->_IsPowerOfTwo;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
compute_min_mag_ranges(samp, n, lambda,
&minStart, &minEnd, &magStart, &magEnd);
GLfloat F = A*C-B*B/4.0f;
/* check if it is an ellipse */
- /* ASSERT(F > 0.0); */
+ /* assert(F > 0.0); */
/* Compute the ellipse's (u,v) bounding box in texture space */
GLfloat d = -B*B+4.0f*C*A;
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = nearest_mipmap_level(tObj, lambda[i]);
sample_3d_linear(ctx, samp, tObj->Image[0][level], texcoord[i], rgba[i]);
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
GLuint magStart, magEnd; /* texels with magnification */
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
compute_min_mag_ranges(samp, n, lambda,
&minStart, &minEnd, &magStart, &magEnd);
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
GLfloat newCoord[4];
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
GLfloat newCoord[4];
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
GLfloat newCoord[4];
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
GLfloat newCoord[4];
GLuint minStart, minEnd; /* texels with minification */
GLuint magStart, magEnd; /* texels with magnification */
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
compute_min_mag_ranges(samp, n, lambda,
&minStart, &minEnd, &magStart, &magEnd);
(void) ctx;
(void) lambda;
- ASSERT(samp->WrapS == GL_CLAMP ||
+ assert(samp->WrapS == GL_CLAMP ||
samp->WrapS == GL_CLAMP_TO_EDGE ||
samp->WrapS == GL_CLAMP_TO_BORDER);
- ASSERT(samp->WrapT == GL_CLAMP ||
+ assert(samp->WrapT == GL_CLAMP ||
samp->WrapT == GL_CLAMP_TO_EDGE ||
samp->WrapT == GL_CLAMP_TO_BORDER);
(void) ctx;
(void) lambda;
- ASSERT(samp->WrapS == GL_CLAMP ||
+ assert(samp->WrapS == GL_CLAMP ||
samp->WrapS == GL_CLAMP_TO_EDGE ||
samp->WrapS == GL_CLAMP_TO_BORDER);
- ASSERT(samp->WrapT == GL_CLAMP ||
+ assert(samp->WrapT == GL_CLAMP ||
samp->WrapT == GL_CLAMP_TO_EDGE ||
samp->WrapT == GL_CLAMP_TO_BORDER);
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = nearest_mipmap_level(tObj, lambda[i]);
sample_2d_array_linear(ctx, samp, tObj->Image[0][level],
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
GLuint magStart, magEnd; /* texels with magnification */
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
compute_min_mag_ranges(samp, n, lambda,
&minStart, &minEnd, &magStart, &magEnd);
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = nearest_mipmap_level(tObj, lambda[i]);
sample_1d_array_linear(ctx, samp, tObj->Image[0][level],
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level = linear_mipmap_level(tObj, lambda[i]);
if (level >= tObj->_MaxLevel) {
GLuint magStart, magEnd; /* texels with magnification */
GLuint i;
- ASSERT(lambda != NULL);
+ assert(lambda != NULL);
compute_min_mag_ranges(samp, n, lambda,
&minStart, &minEnd, &magStart, &magEnd);
GLenum function;
GLfloat result;
- ASSERT(img->_BaseFormat == GL_DEPTH_COMPONENT ||
+ assert(img->_BaseFormat == GL_DEPTH_COMPONENT ||
img->_BaseFormat == GL_DEPTH_STENCIL_EXT);
- ASSERT(tObj->Target == GL_TEXTURE_1D ||
+ assert(tObj->Target == GL_TEXTURE_1D ||
tObj->Target == GL_TEXTURE_2D ||
tObj->Target == GL_TEXTURE_RECTANGLE_NV ||
tObj->Target == GL_TEXTURE_1D_ARRAY_EXT ||
}
else {
GLuint i;
- ASSERT(samp->MagFilter == GL_LINEAR);
+ assert(samp->MagFilter == GL_LINEAR);
for (i = 0; i < n; i++) {
GLfloat depth00, depth01, depth10, depth11, depthRef;
GLint i0, i1, j0, j1;
return &sample_linear_1d;
}
else {
- ASSERT(sampler->MinFilter == GL_NEAREST);
+ assert(sampler->MinFilter == GL_NEAREST);
return &sample_nearest_1d;
}
case GL_TEXTURE_2D:
swrast_texture_image_const(img);
texture_sample_func func;
- ASSERT(sampler->MinFilter == GL_NEAREST);
+ assert(sampler->MinFilter == GL_NEAREST);
func = &sample_nearest_2d;
if (sampler->WrapS == GL_REPEAT &&
sampler->WrapT == GL_REPEAT &&
return &sample_linear_3d;
}
else {
- ASSERT(sampler->MinFilter == GL_NEAREST);
+ assert(sampler->MinFilter == GL_NEAREST);
return &sample_nearest_3d;
}
case GL_TEXTURE_CUBE_MAP:
return &sample_linear_cube;
}
else {
- ASSERT(sampler->MinFilter == GL_NEAREST);
+ assert(sampler->MinFilter == GL_NEAREST);
return &sample_nearest_cube;
}
case GL_TEXTURE_RECTANGLE_NV:
return &sample_linear_rect;
}
else {
- ASSERT(sampler->MinFilter == GL_NEAREST);
+ assert(sampler->MinFilter == GL_NEAREST);
return &sample_nearest_rect;
}
case GL_TEXTURE_1D_ARRAY_EXT:
return &sample_linear_1d_array;
}
else {
- ASSERT(sampler->MinFilter == GL_NEAREST);
+ assert(sampler->MinFilter == GL_NEAREST);
return &sample_nearest_1d_array;
}
case GL_TEXTURE_2D_ARRAY_EXT:
return &sample_linear_2d_array;
}
else {
- ASSERT(sampler->MinFilter == GL_NEAREST);
+ assert(sampler->MinFilter == GL_NEAREST);
return &sample_nearest_2d_array;
}
default:
static void
delete_texture_wrapper(struct gl_context *ctx, struct gl_renderbuffer *rb)
{
- ASSERT(rb->RefCount == 0);
+ assert(rb->RefCount == 0);
free(rb);
}
#define NAME flat_rgba_triangle
#define INTERP_Z 1
#define SETUP_CODE \
- ASSERT(ctx->Texture._EnabledCoordUnits == 0);\
- ASSERT(ctx->Light.ShadeModel==GL_FLAT); \
+ assert(ctx->Texture._EnabledCoordUnits == 0);\
+ assert(ctx->Light.ShadeModel==GL_FLAT); \
span.interpMask |= SPAN_RGBA; \
span.red = ChanToFixed(v2->color[0]); \
span.green = ChanToFixed(v2->color[1]); \
#define SETUP_CODE \
{ \
/* texturing must be off */ \
- ASSERT(ctx->Texture._EnabledCoordUnits == 0); \
- ASSERT(ctx->Light.ShadeModel==GL_SMOOTH); \
+ assert(ctx->Texture._EnabledCoordUnits == 0); \
+ assert(ctx->Light.ShadeModel==GL_SMOOTH); \
}
#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
#include "s_tritemp.h"
const GLubyte *texture = (const GLubyte *) swImg->ImageSlices[0]; \
const GLint smask = texImg->Width - 1; \
const GLint tmask = texImg->Height - 1; \
- ASSERT(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \
+ assert(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \
if (!rb || !texture) { \
return; \
}
const GLubyte *texture = (const GLubyte *) swImg->ImageSlices[0]; \
const GLint smask = texImg->Width - 1; \
const GLint tmask = texImg->Height - 1; \
- ASSERT(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \
+ assert(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \
if (!rb || !texture) { \
return; \
}
break;
}
span->interpMask &= ~SPAN_RGBA;
- ASSERT(span->arrayMask & SPAN_RGBA);
+ assert(span->arrayMask & SPAN_RGBA);
_swrast_write_rgba_span(ctx, span);
break;
}
- ASSERT(span->arrayMask & SPAN_RGBA);
+ assert(span->arrayMask & SPAN_RGBA);
_swrast_write_rgba_span(ctx, span);
#undef SPAN_NEAREST
struct gl_renderbuffer *rb = \
ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; \
struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; \
- ASSERT(ctx->Depth.Test); \
- ASSERT(!ctx->Depth.Mask); \
- ASSERT(ctx->Depth.Func == GL_LESS); \
+ assert(ctx->Depth.Test); \
+ assert(!ctx->Depth.Mask); \
+ assert(ctx->Depth.Func == GL_LESS); \
assert(rb->Format == MESA_FORMAT_Z_UNORM16); \
if (!q) { \
return; \
if (ctx->Polygon.SmoothFlag) {
_swrast_set_aa_triangle_function(ctx);
- ASSERT(swrast->Triangle);
+ assert(swrast->Triangle);
return;
}
}
}
else {
- ASSERT(!swrast->_FogEnabled);
- ASSERT(!_mesa_need_secondary_color(ctx));
+ assert(!swrast->_FogEnabled);
+ assert(!_mesa_need_secondary_color(ctx));
if (ctx->Light.ShadeModel==GL_SMOOTH) {
/* smooth shaded, no texturing, stippled or some raster ops */
#if CHAN_BITS != 8
# endif /* INTERP_ALPHA */
}
else {
- ASSERT(ctx->Light.ShadeModel == GL_FLAT);
+ assert(ctx->Light.ShadeModel == GL_FLAT);
span.interpMask |= SPAN_FLAT;
span.attrStepX[VARYING_SLOT_COL0][0] = span.attrStepY[VARYING_SLOT_COL0][0] = 0.0F;
span.attrStepX[VARYING_SLOT_COL0][1] = span.attrStepY[VARYING_SLOT_COL0][1] = 0.0F;
# endif
}
else {
- ASSERT(ctx->Light.ShadeModel == GL_FLAT);
+ assert(ctx->Light.ShadeModel == GL_FLAT);
rLeft = ChanToFixed(v2->color[RCOMP]);
gLeft = ChanToFixed(v2->color[GCOMP]);
bLeft = ChanToFixed(v2->color[BCOMP]);
const struct gl_framebuffer *fb = ctx->DrawBuffer;
GLint c0, c1, r0, r1;
- ASSERT(spanX >= imageX);
- ASSERT(spanY >= imageY);
+ assert(spanX >= imageX);
+ assert(spanY >= imageY);
/*
* Compute destination columns: [c0, c1)
}
zoomedWidth = x1 - x0;
- ASSERT(zoomedWidth > 0);
- ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH);
+ assert(zoomedWidth > 0);
+ assert(zoomedWidth <= SWRAST_MAX_WIDTH);
/* no pixel arrays! must be horizontal spans. */
- ASSERT((span->arrayMask & SPAN_XY) == 0);
- ASSERT(span->primitive == GL_BITMAP);
+ assert((span->arrayMask & SPAN_XY) == 0);
+ assert(span->primitive == GL_BITMAP);
INIT_SPAN(zoomed, GL_BITMAP);
zoomed.x = x0;
zoomed.interpMask = span->interpMask & ~SPAN_RGBA;
zoomed.arrayMask |= SPAN_RGBA;
zoomed.arrayAttribs |= VARYING_BIT_COL0; /* we'll produce these values */
- ASSERT(span->arrayMask & SPAN_RGBA);
+ assert(span->arrayMask & SPAN_RGBA);
}
else if (format == GL_DEPTH_COMPONENT) {
/* Copy color info */
/* we'll generate an array of depth values */
zoomed.interpMask = span->interpMask & ~SPAN_Z;
zoomed.arrayMask |= SPAN_Z;
- ASSERT(span->arrayMask & SPAN_Z);
+ assert(span->arrayMask & SPAN_Z);
}
else {
_mesa_problem(ctx, "Bad format in zoom_span");
GLint i;
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
+ assert(j >= 0);
+ assert(j < (GLint) span->end);
COPY_4UBV(zoomed.array->rgba8[i], rgba[j]);
}
}
GLint i;
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
+ assert(j >= 0);
+ assert(j < (GLint) span->end);
COPY_4V(zoomed.array->rgba16[i], rgba[j]);
}
}
GLint i;
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
+ assert(j >= 0);
+ assert(j < (GLint) span->end);
COPY_4V(zoomed.array->attribs[VARYING_SLOT_COL0][i], rgba[j]);
}
}
GLint i;
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
+ assert(j >= 0);
+ assert(j < (GLint) span->end);
zoomed.array->rgba8[i][0] = rgb[j][0];
zoomed.array->rgba8[i][1] = rgb[j][1];
zoomed.array->rgba8[i][2] = rgb[j][2];
GLint i;
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
+ assert(j >= 0);
+ assert(j < (GLint) span->end);
zoomed.array->rgba16[i][0] = rgb[j][0];
zoomed.array->rgba16[i][1] = rgb[j][1];
zoomed.array->rgba16[i][2] = rgb[j][2];
GLint i;
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
+ assert(j >= 0);
+ assert(j < (GLint) span->end);
zoomed.array->attribs[VARYING_SLOT_COL0][i][0] = rgb[j][0];
zoomed.array->attribs[VARYING_SLOT_COL0][i][1] = rgb[j][1];
zoomed.array->attribs[VARYING_SLOT_COL0][i][2] = rgb[j][2];
GLint i;
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
+ assert(j >= 0);
+ assert(j < (GLint) span->end);
zoomed.array->z[i] = zValues[j];
}
/* Now, fall into the RGB path below */
}
zoomedWidth = x1 - x0;
- ASSERT(zoomedWidth > 0);
- ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH);
+ assert(zoomedWidth > 0);
+ assert(zoomedWidth <= SWRAST_MAX_WIDTH);
zoomedVals = malloc(zoomedWidth * sizeof(GLubyte));
if (!zoomedVals)
/* zoom the span horizontally */
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
- ASSERT(j >= 0);
- ASSERT(j < width);
+ assert(j >= 0);
+ assert(j < width);
zoomedVals[i] = stencil[j];
}
}
zoomedWidth = x1 - x0;
- ASSERT(zoomedWidth > 0);
- ASSERT(zoomedWidth <= SWRAST_MAX_WIDTH);
+ assert(zoomedWidth > 0);
+ assert(zoomedWidth <= SWRAST_MAX_WIDTH);
zoomedVals = malloc(zoomedWidth * sizeof(GLuint));
if (!zoomedVals)
/* zoom the span horizontally */
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
- ASSERT(j >= 0);
- ASSERT(j < width);
+ assert(j >= 0);
+ assert(j < width);
zoomedVals[i] = zVals[j];
}
GLuint i;
if (new_state & (_NEW_HINT | _NEW_PROGRAM)) {
- ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
+ assert(tnl->AllowVertexFog || tnl->AllowPixelFog);
tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
|| !tnl->AllowPixelFog) && !fp;
}
newvert++;
}
else {
- ASSERT(t0 == 0.0);
+ assert(t0 == 0.0);
}
/* Note: we need to use vertex v0_orig when computing the new
newvert++;
}
else {
- ASSERT(t1 == 0.0);
+ assert(t1 == 0.0);
}
tnl->Driver.Render.ClippedLine( ctx, v0, v1 );
if (ctx->Light.ShadeModel == GL_FLAT) {
if (pv != inlist[0]) {
- ASSERT( inlist[0] >= VB->Count );
+ assert( inlist[0] >= VB->Count );
tnl->Driver.Render.CopyPV( ctx, inlist[0], pv );
}
}
if (ctx->Light.ShadeModel == GL_FLAT) {
if (pv != inlist[0]) {
- ASSERT( inlist[0] >= VB->Count );
+ assert( inlist[0] >= VB->Count );
tnl->Driver.Render.CopyPV( ctx, inlist[0], pv );
}
}
struct tnl_shine_tab *list = tnl->_ShineTabList;
struct tnl_shine_tab *s;
- ASSERT(side < 2);
+ assert(side < 2);
foreach(s, list)
if ( s->shininess == shininess )
store->results[VARYING_SLOT_FOGC].data[i][3] = 1.0;
}
#ifdef NAN_CHECK
- ASSERT(machine->Outputs[0][3] != 0.0F);
+ assert(machine->Outputs[0][3] != 0.0F);
#endif
#if 0
printf("HPOS: %f %f %f %f\n",
* that window coordinates are guarenteed not to change before
* rendering.
*/
- ASSERT(tnl->Driver.Render.Start);
+ assert(tnl->Driver.Render.Start);
tnl->Driver.Render.Start( ctx );
- ASSERT(tnl->Driver.Render.BuildVertices);
- ASSERT(tnl->Driver.Render.PrimitiveNotify);
- ASSERT(tnl->Driver.Render.Points);
- ASSERT(tnl->Driver.Render.Line);
- ASSERT(tnl->Driver.Render.Triangle);
- ASSERT(tnl->Driver.Render.Quad);
- ASSERT(tnl->Driver.Render.ResetLineStipple);
- ASSERT(tnl->Driver.Render.Interp);
- ASSERT(tnl->Driver.Render.CopyPV);
- ASSERT(tnl->Driver.Render.ClippedLine);
- ASSERT(tnl->Driver.Render.ClippedPolygon);
- ASSERT(tnl->Driver.Render.Finish);
+ assert(tnl->Driver.Render.BuildVertices);
+ assert(tnl->Driver.Render.PrimitiveNotify);
+ assert(tnl->Driver.Render.Points);
+ assert(tnl->Driver.Render.Line);
+ assert(tnl->Driver.Render.Triangle);
+ assert(tnl->Driver.Render.Quad);
+ assert(tnl->Driver.Render.ResetLineStipple);
+ assert(tnl->Driver.Render.Interp);
+ assert(tnl->Driver.Render.CopyPV);
+ assert(tnl->Driver.Render.ClippedLine);
+ assert(tnl->Driver.Render.ClippedPolygon);
+ assert(tnl->Driver.Render.Finish);
tnl->Driver.Render.BuildVertices( ctx, 0, VB->Count, ~0 );
VERT_SAVE_RGBA( 2 );
if (VB->BackfaceColorPtr->stride) {
- ASSERT(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat));
+ assert(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat));
if (!DO_FLAT) {
VERT_SET_RGBA( v[0], vbcolor[e0] );
if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) {
GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
- ASSERT(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat));
+ assert(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat));
if (!DO_FLAT) {
VERT_SAVE_SPEC( 0 );
if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) {
GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
- ASSERT(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat));
+ assert(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat));
if (!DO_FLAT) {
VERT_SAVE_SPEC( 0 );
&vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT];
GLuint i;
- ASSERT(NR_MAT_ATTRIBS == MAT_ATTRIB_MAX);
+ assert(NR_MAT_ATTRIBS == MAT_ATTRIB_MAX);
memset(arrays, 0, sizeof(*arrays) * NR_MAT_ATTRIBS);
ctx->Array._DrawArrays = vbo->save.inputs;
break;
default:
- ASSERT(0);
+ assert(0);
}
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
case GL_UNSIGNED_INT:
return GL_TRUE;
default:
- ASSERT(0);
+ assert(0);
return GL_FALSE;
}
}
case GL_UNSIGNED_INT:
return (const GLfloat*)default_int;
default:
- ASSERT(0);
+ assert(0);
return NULL;
}
}
&exec->vtx.bufferobj,
ctx->Shared->NullBufferObj);
- ASSERT(!exec->vtx.buffer_map);
+ assert(!exec->vtx.buffer_map);
exec->vtx.buffer_map = _mesa_align_malloc(VBO_VERT_BUFFER_SIZE, 64);
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
_mesa_noop_vtxfmt_init(&exec->vtxfmt_noop);
for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) {
- ASSERT(i < Elements(exec->vtx.attrsz));
+ assert(i < Elements(exec->vtx.attrsz));
exec->vtx.attrsz[i] = 0;
- ASSERT(i < Elements(exec->vtx.attrtype));
+ assert(i < Elements(exec->vtx.attrtype));
exec->vtx.attrtype[i] = GL_FLOAT;
- ASSERT(i < Elements(exec->vtx.active_sz));
+ assert(i < Elements(exec->vtx.active_sz));
exec->vtx.active_sz[i] = 0;
}
for (i = 0 ; i < VERT_ATTRIB_MAX; i++) {
- ASSERT(i < Elements(exec->vtx.inputs));
- ASSERT(i < Elements(exec->vtx.arrays));
+ assert(i < Elements(exec->vtx.inputs));
+ assert(i < Elements(exec->vtx.arrays));
exec->vtx.inputs[i] = &exec->vtx.arrays[i];
}
/* True VBOs should already be unmapped
*/
if (exec->vtx.buffer_map) {
- ASSERT(exec->vtx.bufferobj->Name == 0 ||
+ assert(exec->vtx.bufferobj->Name == 0 ||
exec->vtx.bufferobj->Name == IMM_BUFFER_NAME);
if (exec->vtx.bufferobj->Name == 0) {
_mesa_align_free(exec->vtx.buffer_map);
exec->vtx.inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr];
}
for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) {
- ASSERT(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs));
+ assert(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs));
exec->vtx.inputs[VERT_ATTRIB_GENERIC(attr)] =
&vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT+attr];
}
exec->vtx.inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr];
}
for (attr = 0; attr < VERT_ATTRIB_GENERIC_MAX; attr++) {
- ASSERT(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs));
+ assert(VERT_ATTRIB_GENERIC(attr) < Elements(exec->vtx.inputs));
exec->vtx.inputs[VERT_ATTRIB_GENERIC(attr)] =
&vbo->currval[VBO_ATTRIB_GENERIC0+attr];
}
(GLbyte *)exec->vtx.vertex;
/* override the default array set above */
- ASSERT(attr < Elements(exec->vtx.inputs));
- ASSERT(attr < Elements(exec->vtx.arrays)); /* arrays[] */
+ assert(attr < Elements(exec->vtx.inputs));
+ assert(attr < Elements(exec->vtx.arrays)); /* arrays[] */
exec->vtx.inputs[attr] = &arrays[attr];
if (_mesa_is_bufferobj(exec->vtx.bufferobj)) {
for (i = VBO_ATTRIB_POS; i <= VBO_ATTRIB_GENERIC15; i++) {
const GLuint j = i - VBO_ATTRIB_POS;
- ASSERT(j < VERT_ATTRIB_MAX);
+ assert(j < VERT_ATTRIB_MAX);
save->currentsz[i] = &ctx->ListState.ActiveAttribSize[j];
save->current[i] = ctx->ListState.CurrentAttrib[j];
}
for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_LAST_MATERIAL; i++) {
const GLuint j = i - VBO_ATTRIB_FIRST_MATERIAL;
- ASSERT(j < MAT_ATTRIB_MAX);
+ assert(j < MAT_ATTRIB_MAX);
save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
save->current[i] = ctx->ListState.CurrentMaterial[j];
}