llvmpipe: limit max texture size to 2Kx2K for now

MAXWIDTH/HEIGHT were 2048 but the max texture size was 4096.
This caused a crash if a 4Kx4K texture was created and rendered to.
See comment about max framebuffer size in lp_scene.h.

Also added assertions to catch this inconsistancy in the future.
This commit is contained in:
Brian Paul 2010-04-02 09:17:47 -06:00
parent 82e289d355
commit bc50336b6a
3 changed files with 8 additions and 1 deletions

View file

@ -483,6 +483,9 @@ void lp_scene_begin_binning( struct lp_scene *scene,
scene->tiles_x = align(fb->width, TILE_SIZE) / TILE_SIZE;
scene->tiles_y = align(fb->height, TILE_SIZE) / TILE_SIZE;
assert(scene->tiles_x <= TILES_X);
assert(scene->tiles_y <= TILES_Y);
}

View file

@ -32,6 +32,7 @@
#include "util/u_inlines.h"
#include "util/u_surface.h"
#include "lp_context.h"
#include "lp_scene.h"
#include "lp_state.h"
#include "lp_setup.h"
@ -51,6 +52,9 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
boolean changed = !util_framebuffer_state_equal(&lp->framebuffer, fb);
assert(fb->width <= MAXWIDTH);
assert(fb->height <= MAXHEIGHT);
if (changed) {
util_copy_framebuffer_state(&lp->framebuffer, fb);

View file

@ -32,7 +32,7 @@
#include "pipe/p_state.h"
#define LP_MAX_TEXTURE_2D_LEVELS 13 /* 4K x 4K for now */
#define LP_MAX_TEXTURE_2D_LEVELS 12 /* 2K x 2K for now */
#define LP_MAX_TEXTURE_3D_LEVELS 10 /* 512 x 512 x 512 for now */