-/* $Id: s_texture.c,v 1.54 2002/02/17 17:58:31 brianp Exp $ */
+/* $Id: s_texture.c,v 1.55 2002/03/08 00:09:18 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLuint *minStart, GLuint *minEnd,
GLuint *magStart, GLuint *magEnd )
{
+ ASSERT(lambda != NULL);
#ifdef DEBUG
/* verify that lambda[] is monotonous */
if (n > 1) {
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[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
GLuint magStart, magEnd; /* texels with magnification */
GLuint i;
+ ASSERT(lambda != NULL);
compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
n, lambda, &minStart, &minEnd, &magStart, &magEnd);
/*
* Return the texture sample for coordinate (s,t) using GL_NEAREST filter.
*/
-static void
+static INLINE void
sample_2d_nearest(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
* Return the texture sample for coordinate (s,t) using GL_LINEAR filter.
* New sampling code contributed by Lynn Quam <quam@ai.sri.com>.
*/
-static void
+static INLINE void
sample_2d_linear(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
* As above, but we know WRAP_S == REPEAT and WRAP_T == REPEAT
* and we're not using a paletted texture.
*/
-static void
+static INLINE void
sample_2d_linear_repeat(GLcontext *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
+ ASSERT(lambda != NULL);
ASSERT(tObj->WrapS == GL_REPEAT);
ASSERT(tObj->WrapT == GL_REPEAT);
for (i = 0; i < n; i++) {
&& (tImg->Border == 0)
&& (tImg->Format != GL_COLOR_INDEX);
+ ASSERT(lambda != NULL);
compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
n, lambda, &minStart, &minEnd, &magStart, &magEnd);
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
GLuint magStart, magEnd; /* texels with magnification */
GLuint i;
+ ASSERT(lambda != NULL);
compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
n, lambda, &minStart, &minEnd, &magStart, &magEnd);
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
GLfloat newCoord[4];
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
GLfloat newCoord[4];
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ ASSERT(lambda != NULL);
for (i = 0; i < n; i++) {
const struct gl_texture_image **images;
GLfloat newCoord[4];
const GLfloat lambda[], GLchan rgba[][4])
{
GLuint i;
+ 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);
compute_min_mag_ranges(SWRAST_CONTEXT(ctx)->_MinMagThresh[texUnit],
n, lambda, &minStart, &minEnd, &magStart, &magEnd);
const struct gl_texture_object *curObj = textureUnit->_Current;
GLchan texel[MAX_WIDTH][4];
- if (textureUnit->LodBias != 0.0F) {
- /* apply LOD bias, but don't clamp yet */
- GLuint i;
- for (i=0;i<n;i++) {
- lambda[i] += textureUnit->LodBias;
- }
- }
-
- if ((curObj->MinLod != -1000.0 || curObj->MaxLod != 1000.0)
- && lambda) {
- /* apply LOD clamping to lambda */
- const GLfloat min = curObj->MinLod;
- const GLfloat max = curObj->MaxLod;
- GLuint i;
- for (i=0;i<n;i++) {
- GLfloat l = lambda[i];
- lambda[i] = CLAMP(l, min, max);
+ if (lambda) {
+ if (textureUnit->LodBias != 0.0F) {
+ /* apply LOD bias, but don't clamp yet */
+ GLuint i;
+ for (i=0;i<n;i++) {
+ lambda[i] += textureUnit->LodBias;
+ }
+ }
+
+ if (curObj->MinLod != -1000.0 || curObj->MaxLod != 1000.0) {
+ /* apply LOD clamping to lambda */
+ const GLfloat min = curObj->MinLod;
+ const GLfloat max = curObj->MaxLod;
+ GLuint i;
+ for (i=0;i<n;i++) {
+ GLfloat l = lambda[i];
+ lambda[i] = CLAMP(l, min, max);
+ }
}
}