mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 17:58:26 +02:00
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:
parent
82e289d355
commit
bc50336b6a
3 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue