Added ctx->Driver.GenerateMipmap() driver hook
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "buffers.h"
|
||||
#include "context.h"
|
||||
#include "framebuffer.h"
|
||||
#include "mipmap.h"
|
||||
#include "program.h"
|
||||
#include "prog_execute.h"
|
||||
#include "queryobj.h"
|
||||
@@ -99,6 +100,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d;
|
||||
driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d;
|
||||
driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d;
|
||||
driver->GenerateMipmap = _mesa_generate_mipmap;
|
||||
driver->TestProxyTexImage = _mesa_test_proxy_teximage;
|
||||
driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d;
|
||||
driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d;
|
||||
|
@@ -332,6 +332,13 @@ struct dd_function_table {
|
||||
GLint x, GLint y,
|
||||
GLsizei width, GLsizei height );
|
||||
|
||||
/**
|
||||
* Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
|
||||
*/
|
||||
void (*GenerateMipmap)(GLcontext *ctx, GLenum target,
|
||||
const struct gl_texture_unit *texUnit,
|
||||
struct gl_texture_object *texObj);
|
||||
|
||||
/**
|
||||
* Called by glTexImage[123]D when user specifies a proxy texture
|
||||
* target.
|
||||
|
@@ -1560,7 +1560,7 @@ _mesa_GenerateMipmapEXT(GLenum target)
|
||||
|
||||
/* XXX this might not handle cube maps correctly */
|
||||
_mesa_lock_texture(ctx, texObj);
|
||||
_mesa_generate_mipmap(ctx, target, texUnit, texObj);
|
||||
ctx->Driver.GenerateMipmap(ctx, target, texUnit, texObj);
|
||||
_mesa_unlock_texture(ctx, texObj);
|
||||
}
|
||||
|
||||
|
@@ -2917,7 +2917,7 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
|
||||
|
||||
/* GL_SGIS_generate_mipmap */
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
_mesa_generate_mipmap(ctx, target,
|
||||
ctx->Driver.GenerateMipmap(ctx, target,
|
||||
&ctx->Texture.Unit[ctx->Texture.CurrentUnit],
|
||||
texObj);
|
||||
}
|
||||
@@ -3003,7 +3003,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
|
||||
|
||||
/* GL_SGIS_generate_mipmap */
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
_mesa_generate_mipmap(ctx, target,
|
||||
ctx->Driver.GenerateMipmap(ctx, target,
|
||||
&ctx->Texture.Unit[ctx->Texture.CurrentUnit],
|
||||
texObj);
|
||||
}
|
||||
@@ -3079,7 +3079,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
|
||||
|
||||
/* GL_SGIS_generate_mipmap */
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
_mesa_generate_mipmap(ctx, target,
|
||||
ctx->Driver.GenerateMipmap(ctx, target,
|
||||
&ctx->Texture.Unit[ctx->Texture.CurrentUnit],
|
||||
texObj);
|
||||
}
|
||||
@@ -3127,7 +3127,7 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
|
||||
|
||||
/* GL_SGIS_generate_mipmap */
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
_mesa_generate_mipmap(ctx, target,
|
||||
ctx->Driver.GenerateMipmap(ctx, target,
|
||||
&ctx->Texture.Unit[ctx->Texture.CurrentUnit],
|
||||
texObj);
|
||||
}
|
||||
@@ -3182,7 +3182,7 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
|
||||
|
||||
/* GL_SGIS_generate_mipmap */
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
_mesa_generate_mipmap(ctx, target,
|
||||
ctx->Driver.GenerateMipmap(ctx, target,
|
||||
&ctx->Texture.Unit[ctx->Texture.CurrentUnit],
|
||||
texObj);
|
||||
}
|
||||
@@ -3237,7 +3237,7 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
|
||||
|
||||
/* GL_SGIS_generate_mipmap */
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
_mesa_generate_mipmap(ctx, target,
|
||||
ctx->Driver.GenerateMipmap(ctx, target,
|
||||
&ctx->Texture.Unit[ctx->Texture.CurrentUnit],
|
||||
texObj);
|
||||
}
|
||||
@@ -3313,7 +3313,7 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level,
|
||||
|
||||
/* GL_SGIS_generate_mipmap */
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
_mesa_generate_mipmap(ctx, target,
|
||||
ctx->Driver.GenerateMipmap(ctx, target,
|
||||
&ctx->Texture.Unit[ctx->Texture.CurrentUnit],
|
||||
texObj);
|
||||
}
|
||||
@@ -3425,7 +3425,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
|
||||
|
||||
/* GL_SGIS_generate_mipmap */
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
_mesa_generate_mipmap(ctx, target,
|
||||
ctx->Driver.GenerateMipmap(ctx, target,
|
||||
&ctx->Texture.Unit[ctx->Texture.CurrentUnit],
|
||||
texObj);
|
||||
}
|
||||
|
Reference in New Issue
Block a user