From: Brian Paul Date: Tue, 24 Apr 2001 03:00:17 +0000 (+0000) Subject: assign texImage->FetchTexel only if NULL X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29acfe5bd40e1741c07959c4b44a9bf46d250283;p=mesa.git assign texImage->FetchTexel only if NULL --- diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 349e857743e..723d74d7aae 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,4 +1,4 @@ -/* $Id: teximage.c,v 1.92 2001/04/19 22:39:50 brianp Exp $ */ +/* $Id: teximage.c,v 1.93 2001/04/24 03:00:17 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1348,7 +1348,10 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, } ASSERT(texImage->TexFormat); - texImage->FetchTexel = texImage->TexFormat->FetchTexel1D; + if (!texImage->FetchTexel) { + /* If driver didn't explicitly set this, use the default */ + texImage->FetchTexel = texImage->TexFormat->FetchTexel1D; + } ASSERT(texImage->FetchTexel); /* state update */ @@ -1458,7 +1461,10 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, } ASSERT(texImage->TexFormat); - texImage->FetchTexel = texImage->TexFormat->FetchTexel2D; + if (!texImage->FetchTexel) { + /* If driver didn't explicitly set this, use the default */ + texImage->FetchTexel = texImage->TexFormat->FetchTexel2D; + } ASSERT(texImage->FetchTexel); /* state update */ @@ -1562,7 +1568,10 @@ _mesa_TexImage3D( GLenum target, GLint level, GLenum internalFormat, } ASSERT(texImage->TexFormat); - texImage->FetchTexel = texImage->TexFormat->FetchTexel3D; + if (!texImage->FetchTexel) { + /* If driver didn't explicitly set this, use the default */ + texImage->FetchTexel = texImage->TexFormat->FetchTexel3D; + } ASSERT(texImage->FetchTexel); /* state update */ @@ -1801,7 +1810,10 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, x, y, width, border); ASSERT(texImage->TexFormat); - texImage->FetchTexel = texImage->TexFormat->FetchTexel1D; + if (!texImage->FetchTexel) { + /* If driver didn't explicitly set this, use the default */ + texImage->FetchTexel = texImage->TexFormat->FetchTexel1D; + } ASSERT(texImage->FetchTexel); /* state update */ @@ -1861,7 +1873,10 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, x, y, width, height, border); ASSERT(texImage->TexFormat); - texImage->FetchTexel = texImage->TexFormat->FetchTexel2D; + if (!texImage->FetchTexel) { + /* If driver didn't explicitly set this, use the default */ + texImage->FetchTexel = texImage->TexFormat->FetchTexel2D; + } ASSERT(texImage->FetchTexel); /* state update */