mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
Fix zero-size texture checking in _mesa_test_proxy_teximage(), bug 11309
This commit is contained in:
parent
d65110f352
commit
c1938a60f7
2 changed files with 17 additions and 12 deletions
|
|
@ -40,6 +40,7 @@ Mesa 7.0.1 is a stable release with bug fixes since version 7.0.
|
|||
<li>GLSL bug fix: .strq and .rgba writemasks didn't always work
|
||||
<li>Stencil pixel map didn't always work for glDrawPixels (bug 11475)
|
||||
<li>Fixed polygon stipple bug in i915 driver
|
||||
<li>Binding a zero-sized texture didn't disable texturing (bug 11309)
|
||||
</ul>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5.1
|
||||
* Version: 7.0.1
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
@ -1207,6 +1207,10 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
|
|||
* A hardware driver might override this function if, for example, the
|
||||
* max 3D texture size is 512x512x64 (i.e. not a cube).
|
||||
*
|
||||
* Note that width, height, depth == 0 is not an error. However, a
|
||||
* texture with zero width/height/depth will be considered "incomplete"
|
||||
* and texturing will effectively be disabled.
|
||||
*
|
||||
* \param target one of GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D,
|
||||
* GL_PROXY_TEXTURE_3D, GL_PROXY_TEXTURE_RECTANGLE_NV,
|
||||
* GL_PROXY_TEXTURE_CUBE_MAP_ARB.
|
||||
|
|
@ -1236,7 +1240,7 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
|
|||
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
|
||||
if (width < 2 * border || width > 2 + maxSize ||
|
||||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
_mesa_bitcount(width - 2 * border) != 1) ||
|
||||
width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
|
||||
level >= ctx->Const.MaxTextureLevels) {
|
||||
/* bad width or level */
|
||||
return GL_FALSE;
|
||||
|
|
@ -1246,10 +1250,10 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
|
|||
maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
|
||||
if (width < 2 * border || width > 2 + maxSize ||
|
||||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
_mesa_bitcount(width - 2 * border) != 1) ||
|
||||
width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
|
||||
height < 2 * border || height > 2 + maxSize ||
|
||||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
_mesa_bitcount(height - 2 * border) != 1) ||
|
||||
height > 0 && _mesa_bitcount(height - 2 * border) != 1) ||
|
||||
level >= ctx->Const.MaxTextureLevels) {
|
||||
/* bad width or height or level */
|
||||
return GL_FALSE;
|
||||
|
|
@ -1259,21 +1263,21 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
|
|||
maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
|
||||
if (width < 2 * border || width > 2 + maxSize ||
|
||||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
_mesa_bitcount(width - 2 * border) != 1) ||
|
||||
width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
|
||||
height < 2 * border || height > 2 + maxSize ||
|
||||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
_mesa_bitcount(height - 2 * border) != 1) ||
|
||||
height > 0 && _mesa_bitcount(height - 2 * border) != 1) ||
|
||||
depth < 2 * border || depth > 2 + maxSize ||
|
||||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
_mesa_bitcount(depth - 2 * border) != 1) ||
|
||||
depth > 0 && _mesa_bitcount(depth - 2 * border) != 1) ||
|
||||
level >= ctx->Const.Max3DTextureLevels) {
|
||||
/* bad width or height or depth or level */
|
||||
return GL_FALSE;
|
||||
}
|
||||
return GL_TRUE;
|
||||
case GL_PROXY_TEXTURE_RECTANGLE_NV:
|
||||
if (width < 1 || width > ctx->Const.MaxTextureRectSize ||
|
||||
height < 1 || height > ctx->Const.MaxTextureRectSize ||
|
||||
if (width < 0 || width > ctx->Const.MaxTextureRectSize ||
|
||||
height < 0 || height > ctx->Const.MaxTextureRectSize ||
|
||||
level != 0) {
|
||||
/* bad width or height or level */
|
||||
return GL_FALSE;
|
||||
|
|
@ -1283,10 +1287,10 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
|
|||
maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1);
|
||||
if (width < 2 * border || width > 2 + maxSize ||
|
||||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
_mesa_bitcount(width - 2 * border) != 1) ||
|
||||
width > 0 && _mesa_bitcount(width - 2 * border) != 1) ||
|
||||
height < 2 * border || height > 2 + maxSize ||
|
||||
(!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
_mesa_bitcount(height - 2 * border) != 1) ||
|
||||
height > 0 && _mesa_bitcount(height - 2 * border) != 1) ||
|
||||
level >= ctx->Const.MaxCubeTextureLevels) {
|
||||
/* bad width or height */
|
||||
return GL_FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue