}
}
-/**
- * Called via ctx->Driver.GenerateMipmap()
- * This is basically a wrapper for _mesa_meta_GenerateMipmap() which checks
- * if we'll be using software mipmap generation. In that case, we need to
- * map/unmap the base level texture image.
- */
-static void
-intelGenerateMipmap(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *texObj)
-{
- if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) {
- fallback_debug("%s - fallback to swrast\n", __FUNCTION__);
-
- _mesa_generate_mipmap(ctx, target, texObj);
- }
- else {
- _mesa_meta_GenerateMipmap(ctx, target, texObj);
- }
-}
-
-
void
intelInitTextureFuncs(struct dd_function_table *functions)
{
- functions->GenerateMipmap = intelGenerateMipmap;
-
functions->NewTextureObject = intelNewTextureObject;
functions->NewTextureImage = intelNewTextureImage;
functions->DeleteTextureImage = intelDeleteTextureImage;
}
}
-static void
-nouveau_generate_mipmap(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *t)
-{
- if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, t)) {
- _mesa_generate_mipmap(ctx, target, t);
- } else {
- _mesa_meta_GenerateMipmap(ctx, target, t);
- }
-}
-
void
nouveau_texture_functions_init(struct dd_function_table *functions)
{
functions->UnmapTexture = nouveau_texture_unmap;
functions->MapTextureImage = nouveau_map_texture_image;
functions->UnmapTextureImage = nouveau_unmap_texture_image;
- functions->GenerateMipmap = nouveau_generate_mipmap;
}
radeon_bo_unmap(image->mt->bo);
}
-void radeonGenerateMipmap(struct gl_context* ctx, GLenum target, struct gl_texture_object *texObj)
-{
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- struct radeon_bo *bo;
- GLuint face = _mesa_tex_target_to_face(target);
- radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[face][texObj->BaseLevel]);
- bo = !baseimage->mt ? baseimage->bo : baseimage->mt->bo;
-
- radeon_print(RADEON_TEXTURE, RADEON_TRACE,
- "%s(%p, target %s, tex %p)\n",
- __func__, ctx, _mesa_lookup_enum_by_nr(target),
- texObj);
-
- if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->cmdbuf.cs)) {
- radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
- "%s(%p, tex %p) Trying to generate mipmap for texture "
- "in processing by GPU.\n",
- __func__, ctx, texObj);
- radeon_firevertices(rmesa);
- }
-
- if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) {
- _mesa_generate_mipmap(ctx, target, texObj);
- } else {
- _mesa_meta_GenerateMipmap(ctx, target, texObj);
- }
-}
-
-
/* try to find a format which will only need a memcopy */
static gl_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
GLenum srcFormat,
functions->CompressedTexImage2D = radeonCompressedTexImage2D;
functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
- functions->GenerateMipmap = radeonGenerateMipmap;
-
functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
#if FEATURE_OES_EGL_image
void radeon_teximage_unmap(radeon_texture_image *image);
void radeonMapTexture(struct gl_context *ctx, struct gl_texture_object *texObj);
void radeonUnmapTexture(struct gl_context *ctx, struct gl_texture_object *texObj);
-void radeonGenerateMipmap(struct gl_context* ctx, GLenum target, struct gl_texture_object *texObj);
int radeon_validate_texture_miptree(struct gl_context * ctx, struct gl_texture_object *texObj);
gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,