#include "r200_reg.h"
#include "r200_vertprog.h"
-#define ENABLE_HW_3D_TEXTURE 1 /* XXX this is temporary! */
-
#ifndef R200_EMIT_VAP_PVS_CNTL
#error This driver requires a newer libdrm to compile
#endif
/* Note: we only plug in the functions we implement in the driver
* since _mesa_init_driver_functions() was already called.
*/
- functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa;
- functions->TexImage1D = radeonTexImage1D;
- functions->TexImage2D = radeonTexImage2D;
-#if ENABLE_HW_3D_TEXTURE
- functions->TexImage3D = radeonTexImage3D;
-#else
- functions->TexImage3D = _mesa_store_teximage3d;
-#endif
- functions->TexSubImage1D = radeonTexSubImage1D;
- functions->TexSubImage2D = radeonTexSubImage2D;
-#if ENABLE_HW_3D_TEXTURE
- functions->TexSubImage3D = radeonTexSubImage3D;
-#else
- functions->TexSubImage3D = _mesa_store_texsubimage3d;
-#endif
- functions->GetTexImage = radeonGetTexImage;
- functions->GetCompressedTexImage = radeonGetCompressedTexImage;
+
+ radeon_init_common_texture_funcs(radeon, functions);
+
functions->NewTextureObject = r200NewTextureObject;
// functions->BindTexture = r200BindTexture;
functions->DeleteTexture = r200DeleteTexture;
functions->TexEnv = r200TexEnv;
functions->TexParameter = r200TexParameter;
functions->TexGen = r200TexGen;
-
- functions->CompressedTexImage2D = radeonCompressedTexImage2D;
- functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
-
- if (radeon->radeonScreen->kernel_mm) {
- functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
- }
-
- functions->GenerateMipmap = radeonGenerateMipmap;
-
- functions->NewTextureImage = radeonNewTextureImage;
- functions->FreeTextureImageBuffer = radeonFreeTextureImageBuffer;
- functions->MapTexture = radeonMapTexture;
- functions->UnmapTexture = radeonUnmapTexture;
-
-#if FEATURE_OES_EGL_image
- functions->EGLImageTargetTexture2D = radeon_image_target_texture_2d;
-#endif
-
- driInitTextureFormats();
-
}
/* Note: we only plug in the functions we implement in the driver
* since _mesa_init_driver_functions() was already called.
*/
- functions->NewTextureImage = radeonNewTextureImage;
- functions->FreeTextureImageBuffer = radeonFreeTextureImageBuffer;
- functions->MapTexture = radeonMapTexture;
- functions->UnmapTexture = radeonUnmapTexture;
-
- functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa;
- functions->TexImage1D = radeonTexImage1D;
- functions->TexImage2D = radeonTexImage2D;
- functions->TexImage3D = radeonTexImage3D;
- functions->TexSubImage1D = radeonTexSubImage1D;
- functions->TexSubImage2D = radeonTexSubImage2D;
- functions->TexSubImage3D = radeonTexSubImage3D;
- functions->GetTexImage = radeonGetTexImage;
- functions->GetCompressedTexImage = radeonGetCompressedTexImage;
+
+ radeon_init_common_texture_funcs(radeon, functions);
+
functions->NewTextureObject = r300NewTextureObject;
functions->DeleteTexture = r300DeleteTexture;
functions->IsTextureResident = driIsTextureResident;
functions->TexParameter = r300TexParameter;
- functions->CompressedTexImage2D = radeonCompressedTexImage2D;
- functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
-
- if (radeon->radeonScreen->kernel_mm) {
- functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
- }
-
- functions->GenerateMipmap = radeonGenerateMipmap;
-
#if FEATURE_OES_EGL_image
functions->EGLImageTargetTexture2D = radeon_image_target_texture_2d;
#endif
-
- driInitTextureFormats();
}
/* Note: we only plug in the functions we implement in the driver
* since _mesa_init_driver_functions() was already called.
*/
- functions->NewTextureImage = radeonNewTextureImage;
- functions->FreeTextureImageBuffer = radeonFreeTextureImageBuffer;
- functions->MapTexture = radeonMapTexture;
- functions->UnmapTexture = radeonUnmapTexture;
-
- functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa;
- functions->TexImage1D = radeonTexImage1D;
- functions->TexImage2D = radeonTexImage2D;
- functions->TexImage3D = radeonTexImage3D;
- functions->TexSubImage1D = radeonTexSubImage1D;
- functions->TexSubImage2D = radeonTexSubImage2D;
- functions->TexSubImage3D = radeonTexSubImage3D;
- functions->GetTexImage = radeonGetTexImage;
- functions->GetCompressedTexImage = radeonGetCompressedTexImage;
+
+ radeon_init_common_texture_funcs(radeon, functions);
+
functions->NewTextureObject = evergreenNewTextureObject;
functions->DeleteTexture = evergreenDeleteTexture;
functions->IsTextureResident = driIsTextureResident;
functions->TexParameter = evergreenTexParameter;
-
- functions->CompressedTexImage2D = radeonCompressedTexImage2D;
- functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
-
- if (radeon->radeonScreen->kernel_mm) {
- functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
- }
-
- functions->GenerateMipmap = radeonGenerateMipmap;
-
- driInitTextureFormats();
}
/* Note: we only plug in the functions we implement in the driver
* since _mesa_init_driver_functions() was already called.
*/
- functions->NewTextureImage = radeonNewTextureImage;
- functions->FreeTextureImageBuffer = radeonFreeTextureImageBuffer;
- functions->MapTexture = radeonMapTexture;
- functions->UnmapTexture = radeonUnmapTexture;
-
- functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa;
- functions->TexImage1D = radeonTexImage1D;
- functions->TexImage2D = radeonTexImage2D;
- functions->TexImage3D = radeonTexImage3D;
- functions->TexSubImage1D = radeonTexSubImage1D;
- functions->TexSubImage2D = radeonTexSubImage2D;
- functions->TexSubImage3D = radeonTexSubImage3D;
- functions->GetTexImage = radeonGetTexImage;
- functions->GetCompressedTexImage = radeonGetCompressedTexImage;
+
+ radeon_init_common_texture_funcs(radeon, functions);
+
functions->NewTextureObject = r600NewTextureObject;
functions->DeleteTexture = r600DeleteTexture;
functions->IsTextureResident = driIsTextureResident;
functions->TexParameter = r600TexParameter;
-
- functions->CompressedTexImage2D = radeonCompressedTexImage2D;
- functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
-
- if (radeon->radeonScreen->kernel_mm) {
- functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
- }
-
- functions->GenerateMipmap = radeonGenerateMipmap;
-
-#if FEATURE_OES_EGL_image
- functions->EGLImageTargetTexture2D = radeon_image_target_texture_2d;
-#endif
-
- driInitTextureFormats();
}
void radeonInitTextureFuncs( radeonContextPtr radeon, struct dd_function_table *functions )
{
- functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa;
- functions->TexImage1D = radeonTexImage1D;
- functions->TexImage2D = radeonTexImage2D;
- functions->TexSubImage1D = radeonTexSubImage1D;
- functions->TexSubImage2D = radeonTexSubImage2D;
- functions->GetTexImage = radeonGetTexImage;
- functions->GetCompressedTexImage = radeonGetCompressedTexImage;
+ radeon_init_common_texture_funcs(radeon, functions);
functions->NewTextureObject = radeonNewTextureObject;
// functions->BindTexture = radeonBindTexture;
functions->TexEnv = radeonTexEnv;
functions->TexParameter = radeonTexParameter;
functions->TexGen = radeonTexGen;
-
- functions->CompressedTexImage2D = radeonCompressedTexImage2D;
- functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
-
- if (radeon->radeonScreen->kernel_mm) {
- functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
- }
-
- functions->GenerateMipmap = radeonGenerateMipmap;
-
- functions->NewTextureImage = radeonNewTextureImage;
- functions->FreeTextureImageBuffer = radeonFreeTextureImageBuffer;
- functions->MapTexture = radeonMapTexture;
- functions->UnmapTexture = radeonUnmapTexture;
-
-#if FEATURE_OES_EGL_image
- functions->EGLImageTargetTexture2D = radeon_image_target_texture_2d;
-#endif
-
- driInitTextureFormats();
}
fprintf(stderr, "miptree doesn't match image\n");
}
#endif
+
+void
+radeon_init_common_texture_funcs(radeonContextPtr radeon,
+ struct dd_function_table *functions)
+{
+ functions->NewTextureImage = radeonNewTextureImage;
+ functions->FreeTextureImageBuffer = radeonFreeTextureImageBuffer;
+ functions->MapTexture = radeonMapTexture;
+ functions->UnmapTexture = radeonUnmapTexture;
+
+ functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa;
+
+ functions->TexImage1D = radeonTexImage1D;
+ functions->TexImage2D = radeonTexImage2D;
+ functions->TexImage3D = radeonTexImage3D;
+ functions->TexSubImage1D = radeonTexSubImage1D;
+ functions->TexSubImage2D = radeonTexSubImage2D;
+ functions->TexSubImage3D = radeonTexSubImage3D;
+ functions->CompressedTexImage2D = radeonCompressedTexImage2D;
+ functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
+ functions->GetCompressedTexImage = radeonGetCompressedTexImage;
+ functions->GetTexImage = radeonGetTexImage;
+
+ functions->GenerateMipmap = radeonGenerateMipmap;
+
+ if (radeon->radeonScreen->kernel_mm) {
+ functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
+ }
+
+#if FEATURE_OES_EGL_image
+ functions->EGLImageTargetTexture2D = radeon_image_target_texture_2d;
+#endif
+
+ driInitTextureFormats();
+}
GLeglImageOES image_handle);
#endif
+void
+radeon_init_common_texture_funcs(radeonContextPtr radeon,
+ struct dd_function_table *functions);
+
#endif