mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
mesa: fix error checking of TexStorage(levels) for array and rect textures
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 985f2aec4a)
Conflicts:
src/mesa/main/texstorage.c
This commit is contained in:
parent
efa6b5e42b
commit
5b007761fe
1 changed files with 1 additions and 3 deletions
|
|
@ -244,7 +244,6 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
|
|||
GLsizei width, GLsizei height, GLsizei depth)
|
||||
{
|
||||
struct gl_texture_object *texObj;
|
||||
GLuint maxDim;
|
||||
GLboolean legalFormat;
|
||||
|
||||
/* check internal format - note that only sized formats are allowed */
|
||||
|
|
@ -324,8 +323,7 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
|
|||
}
|
||||
|
||||
/* check levels against width/height/depth */
|
||||
maxDim = MAX3(width, height, depth);
|
||||
if (levels > _mesa_logbase2(maxDim) + 1) {
|
||||
if (levels > _mesa_get_tex_max_num_levels(target, width, height, depth)) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glTexStorage%uD(too many levels for max texture dimension)",
|
||||
dims);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue