From e2feb80a90f3e9300c70a4a4eb3e966131f5c313 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 6 Nov 2007 09:41:45 -0700 Subject: Remove pipe->max_texture_size(), use get_param() instead. Also, in st_init_limits(), clamp driver's values against Mesa's internal limits. --- src/mesa/pipe/softpipe/sp_context.c | 41 +++++++------------------------------ 1 file changed, 7 insertions(+), 34 deletions(-) (limited to 'src/mesa/pipe/softpipe') diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c index effecda87e..954884e7e9 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 */ -- cgit v1.2.3