#include "main/glheader.h"
#include "main/context.h"
-#include "main/colormac.h"
#include "main/imports.h"
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/state.h"
#include "main/samplerobj.h"
+#include "main/teximage.h"
#include "program/prog_instruction.h"
#include "s_aatriangle.h"
#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 struct gl_texture_object *obj = \
ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
const struct gl_texture_image *texImg = \
- obj->Image[0][obj->BaseLevel]; \
+ _mesa_base_tex_image(obj); \
const struct swrast_texture_image *swImg = \
swrast_texture_image_const(texImg); \
const GLfloat twidth = (GLfloat) texImg->Width; \
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 struct gl_texture_object *obj = \
ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
const struct gl_texture_image *texImg = \
- obj->Image[0][obj->BaseLevel]; \
+ _mesa_base_tex_image(obj); \
const struct swrast_texture_image *swImg = \
swrast_texture_image_const(texImg); \
const GLfloat twidth = (GLfloat) texImg->Width; \
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);
const struct gl_texture_object *obj = \
ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
const struct gl_texture_image *texImg = \
- obj->Image[0][obj->BaseLevel]; \
+ _mesa_base_tex_image(obj); \
const struct swrast_texture_image *swImg = \
swrast_texture_image_const(texImg); \
const GLfloat twidth = (GLfloat) texImg->Width; \
break;
}
- ASSERT(span->arrayMask & SPAN_RGBA);
+ assert(span->arrayMask & SPAN_RGBA);
_swrast_write_rgba_span(ctx, span);
#undef SPAN_NEAREST
const struct gl_texture_object *obj = \
ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \
const struct gl_texture_image *texImg = \
- obj->Image[0][obj->BaseLevel]; \
+ _mesa_base_tex_image(obj); \
const struct swrast_texture_image *swImg = \
swrast_texture_image_const(texImg); \
info.texture = (const GLchan *) swImg->ImageSlices[0]; \
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
samp = NULL;
- texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL;
+ texImg = texObj2D ? _mesa_base_tex_image(texObj2D) : NULL;
swImg = swrast_texture_image_const(texImg);
format = texImg ? texImg->TexFormat : MESA_FORMAT_NONE;
if (ctx->Texture._EnabledCoordUnits == 0x1
&& !_swrast_use_fragment_program(ctx)
&& !ctx->ATIFragmentShader._Enabled
- && ctx->Texture._EnabledUnits == 0x1
- && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT
+ && ctx->Texture._MaxEnabledTexImageUnit == 0
+ && ctx->Texture.Unit[0]._Current->Target == GL_TEXTURE_2D
&& samp->WrapS == GL_REPEAT
&& samp->WrapT == GL_REPEAT
&& texObj2D->_Swizzle == SWIZZLE_NOOP
}
}
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