summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-04-13 01:37:35 -0700
committerEric Anholt <[email protected]>2013-04-21 12:28:04 -0700
commit1842dd08b83269816fe8eb8f2dcc1252f606fe48 (patch)
tree61d1cca575fe3be59af5ad5c79d0a45e85479701 /src/mesa/drivers
parente86170c2b88f9970a124479bbf47b5a7cd43d628 (diff)
mesa: Generalize TexStorage allocator between swrast and intel.
This should be reusable for other non-gallium drivers, so we can make the extension always be available. v2: Add a more detailed comment than the old function had (recommended by Brian). Reviewed-by: Brian Paul <[email protected]> (v1)
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/common/driverfuncs.c3
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex.c26
2 files changed, 2 insertions, 27 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index a98dfc607c5..9112eb08d93 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -40,6 +40,7 @@
#include "main/texgetimage.h"
#include "main/teximage.h"
#include "main/texobj.h"
+#include "main/texstorage.h"
#include "main/texstore.h"
#include "main/bufferobj.h"
#include "main/fbobject.h"
@@ -209,7 +210,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->EndCallList = NULL;
/* GL_ARB_texture_storage */
- driver->AllocTextureStorage = _swrast_AllocTextureStorage;
+ driver->AllocTextureStorage = _mesa_alloc_texture_storage;
/* GL_ARB_texture_multisample */
driver->GetSamplePosition = NULL;
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 9bba9898b47..ee8db71372b 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -127,31 +127,6 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx,
return true;
}
-/**
- * Called via ctx->Driver.AllocTextureStorage()
- * Just have to allocate memory for the texture images.
- */
-static GLboolean
-intel_alloc_texture_storage(struct gl_context *ctx,
- struct gl_texture_object *texObj,
- GLsizei levels, GLsizei width,
- GLsizei height, GLsizei depth)
-{
- const int numFaces = _mesa_num_tex_faces(texObj->Target);
- int face;
- int level;
-
- for (face = 0; face < numFaces; face++) {
- for (level = 0; level < levels; level++) {
- struct gl_texture_image *const texImage = texObj->Image[face][level];
- if (!intel_alloc_texture_image_buffer(ctx, texImage))
- return false;
- }
- }
-
- return true;
-}
-
static void
intel_free_texture_image_buffer(struct gl_context * ctx,
struct gl_texture_image *texImage)
@@ -231,7 +206,6 @@ intelInitTextureFuncs(struct dd_function_table *functions)
functions->DeleteTexture = intelDeleteTextureObject;
functions->AllocTextureImageBuffer = intel_alloc_texture_image_buffer;
functions->FreeTextureImageBuffer = intel_free_texture_image_buffer;
- functions->AllocTextureStorage = intel_alloc_texture_storage;
functions->MapTextureImage = intel_map_texture_image;
functions->UnmapTextureImage = intel_unmap_texture_image;
}