summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe/sp_context.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-11-06 09:41:45 -0700
committerBrian <[email protected]>2007-11-06 09:41:45 -0700
commite2feb80a90f3e9300c70a4a4eb3e966131f5c313 (patch)
treed407028c34268b686e0c5802c07e09bac0d57ece /src/mesa/pipe/softpipe/sp_context.c
parent24ac9c30ebfd2edabdd21bfc9cf4e9db21cd10df (diff)
Remove pipe->max_texture_size(), use get_param() instead.
Also, in st_init_limits(), clamp driver's values against Mesa's internal limits.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_context.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index effecda87e5..954884e7e9a 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -83,39 +83,6 @@ softpipe_is_format_supported( struct pipe_context *pipe,
}
-/** XXX remove these? */
-#define MAX_TEXTURE_LEVELS 11
-#define MAX_TEXTURE_RECT_SIZE 2048
-#define MAX_3D_TEXTURE_LEVELS 8
-
-static void
-softpipe_max_texture_size(struct pipe_context *pipe, unsigned textureType,
- unsigned *maxWidth, unsigned *maxHeight,
- unsigned *maxDepth)
-{
- switch (textureType) {
- case PIPE_TEXTURE_1D:
- *maxWidth = 1 << (MAX_TEXTURE_LEVELS - 1);
- break;
- case PIPE_TEXTURE_2D:
- *maxWidth =
- *maxHeight = 1 << (MAX_TEXTURE_LEVELS - 1);
- break;
- case PIPE_TEXTURE_3D:
- *maxWidth =
- *maxHeight =
- *maxDepth = 1 << (MAX_3D_TEXTURE_LEVELS - 1);
- break;
- case PIPE_TEXTURE_CUBE:
- *maxWidth =
- *maxHeight = MAX_TEXTURE_RECT_SIZE;
- break;
- default:
- assert(0);
- }
-}
-
-
/**
* Map any drawing surfaces which aren't already mapped
*/
@@ -297,6 +264,12 @@ static int softpipe_get_param(struct pipe_context *pipe, int param)
return 1;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
return 1;
+ case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
+ return 12; /* max 2Kx2K */
+ case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
+ return 8; /* max 128x128x128 */
+ case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
+ return 12; /* max 2Kx2K */
default:
return 0;
}
@@ -321,7 +294,7 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
/* queries */
softpipe->pipe.is_format_supported = softpipe_is_format_supported;
- softpipe->pipe.max_texture_size = softpipe_max_texture_size;
+ //softpipe->pipe.max_texture_size = softpipe_max_texture_size;
softpipe->pipe.get_param = softpipe_get_param;
/* state setters */