From: Brian P. <br...@va...> - 2000-12-14 17:13:48
|
Daniel Vogel wrote: > > hi` > > I tried running UT with the Mesa software renderer and when I turned on > trilinear filtering it crashed in sample_2d_linear being called with a > NULL pointer for the image from sample_2d_linear_mipmap_linear. The > problem seems to be that UT uses GL_TEXTURE_MAX_LEVEL and tObj->_P was 7 > and tObj->_M was 5. From what I can read in mtypes.h shouldn't _M be > used instead of _P in the following code? Changing the code to use _M at > least made it work ;) BTW, why is _M a float and not an integer? > > s_texture.c:840 [sample_2d_linear_mipmap_linear] > > if (level >= tObj->_P) { > sample_2d_linear( tObj, tObj->Image[tObj->_P], s, t, rgba); > } > else { > GLchan t0[4], t1[4]; /* texels */ > const GLfloat f = myFrac(lambda); > sample_2d_linear( tObj, tObj->Image[level ], s, t, t0 ); > sample_2d_linear( tObj, tObj->Image[level+1], s, t, t1 ); > rgba[RCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]); > rgba[GCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]); > rgba[BCOMP] = (GLchan) (GLint) ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]); > rgba[ACOMP] = (GLchan) (GLint) ((1.0F-f) * t0[ACOMP] + f * t1[ACOMP]); > } Are you settting GL_TEXTURE_BASE_LEVEL? I think I see an error in the calculation in _P. I think I should add the base level to it. However, that would increase _P. I'll have to review the spec and write a test program. I do think there is a bug here. Thanks for flagging it. -Brian |