mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
mesa/main: remove unused Log2 variants of width/height/depth
These are unused, and the comments about the relationships between it an the other variants seems to be seriously outdated. Let's get rid of it. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
This commit is contained in:
parent
81be60a233
commit
c67e6ea4c1
2 changed files with 8 additions and 25 deletions
|
|
@ -766,15 +766,12 @@ struct gl_texture_image
|
|||
mesa_format TexFormat; /**< The actual texture memory format */
|
||||
|
||||
GLuint Border; /**< 0 or 1 */
|
||||
GLuint Width; /**< = 2^WidthLog2 + 2*Border */
|
||||
GLuint Height; /**< = 2^HeightLog2 + 2*Border */
|
||||
GLuint Depth; /**< = 2^DepthLog2 + 2*Border */
|
||||
GLuint Width;
|
||||
GLuint Height;
|
||||
GLuint Depth;
|
||||
GLuint Width2; /**< = Width - 2*Border */
|
||||
GLuint Height2; /**< = Height - 2*Border */
|
||||
GLuint Depth2; /**< = Depth - 2*Border */
|
||||
GLuint WidthLog2; /**< = log2(Width2) */
|
||||
GLuint HeightLog2; /**< = log2(Height2) */
|
||||
GLuint DepthLog2; /**< = log2(Depth2) */
|
||||
GLuint MaxNumLevels; /**< = maximum possible number of mipmap
|
||||
levels, computed from the dimensions */
|
||||
|
||||
|
|
|
|||
|
|
@ -797,9 +797,6 @@ clear_teximage_fields(struct gl_texture_image *img)
|
|||
img->Width2 = 0;
|
||||
img->Height2 = 0;
|
||||
img->Depth2 = 0;
|
||||
img->WidthLog2 = 0;
|
||||
img->HeightLog2 = 0;
|
||||
img->DepthLog2 = 0;
|
||||
img->TexFormat = MESA_FORMAT_NONE;
|
||||
img->NumSamples = 0;
|
||||
img->FixedSampleLocations = GL_TRUE;
|
||||
|
|
@ -957,8 +954,7 @@ _mesa_init_teximage_fields_ms(struct gl_context *ctx,
|
|||
}
|
||||
_mesa_update_teximage_format_swizzle(ctx, img, depth_mode);
|
||||
|
||||
img->Width2 = width - 2 * border; /* == 1 << img->WidthLog2; */
|
||||
img->WidthLog2 = util_logbase2(img->Width2);
|
||||
img->Width2 = width - 2 * border;
|
||||
|
||||
switch(target) {
|
||||
case GL_TEXTURE_1D:
|
||||
|
|
@ -968,22 +964,18 @@ _mesa_init_teximage_fields_ms(struct gl_context *ctx,
|
|||
img->Height2 = 0;
|
||||
else
|
||||
img->Height2 = 1;
|
||||
img->HeightLog2 = 0;
|
||||
if (depth == 0)
|
||||
img->Depth2 = 0;
|
||||
else
|
||||
img->Depth2 = 1;
|
||||
img->DepthLog2 = 0;
|
||||
break;
|
||||
case GL_TEXTURE_1D_ARRAY:
|
||||
case GL_PROXY_TEXTURE_1D_ARRAY:
|
||||
img->Height2 = height; /* no border */
|
||||
img->HeightLog2 = 0; /* not used */
|
||||
if (depth == 0)
|
||||
img->Depth2 = 0;
|
||||
else
|
||||
img->Depth2 = 1;
|
||||
img->DepthLog2 = 0;
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
case GL_TEXTURE_RECTANGLE:
|
||||
|
|
@ -1000,13 +992,11 @@ _mesa_init_teximage_fields_ms(struct gl_context *ctx,
|
|||
case GL_PROXY_TEXTURE_CUBE_MAP:
|
||||
case GL_TEXTURE_2D_MULTISAMPLE:
|
||||
case GL_PROXY_TEXTURE_2D_MULTISAMPLE:
|
||||
img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
|
||||
img->HeightLog2 = util_logbase2(img->Height2);
|
||||
img->Height2 = height - 2 * border;
|
||||
if (depth == 0)
|
||||
img->Depth2 = 0;
|
||||
else
|
||||
img->Depth2 = 1;
|
||||
img->DepthLog2 = 0;
|
||||
break;
|
||||
case GL_TEXTURE_2D_ARRAY:
|
||||
case GL_PROXY_TEXTURE_2D_ARRAY:
|
||||
|
|
@ -1014,17 +1004,13 @@ _mesa_init_teximage_fields_ms(struct gl_context *ctx,
|
|||
case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY:
|
||||
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
|
||||
case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:
|
||||
img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
|
||||
img->HeightLog2 = util_logbase2(img->Height2);
|
||||
img->Height2 = height - 2 * border;
|
||||
img->Depth2 = depth; /* no border */
|
||||
img->DepthLog2 = 0; /* not used */
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
case GL_PROXY_TEXTURE_3D:
|
||||
img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
|
||||
img->HeightLog2 = util_logbase2(img->Height2);
|
||||
img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */
|
||||
img->DepthLog2 = util_logbase2(img->Depth2);
|
||||
img->Height2 = height - 2 * border;
|
||||
img->Depth2 = depth - 2 * border;
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(NULL, "invalid target 0x%x in _mesa_init_teximage_fields()",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue