Commit 2b7d5c32 authored by Andrii Simiklit's avatar Andrii Simiklit Committed by Kenneth Graunke
Browse files

i965: consider a 'base level' when calculating width0, height0, depth0

I guess that when we calculating the width0, height0, depth0
to use for function 'intel_miptree_create' we need to consider
the 'base level' like it is done in the 'intel_miptree_create_for_teximage'
function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987

Signed-off-by: default avatarAndrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
parent 26aa4609
Pipeline #18146 passed with stage
in 22 minutes and 9 seconds
......@@ -119,8 +119,32 @@ intel_finalize_mipmap_tree(struct brw_context *brw,
/* May need to create a new tree:
*/
if (!intelObj->mt) {
const unsigned level = firstImage->base.Base.Level;
intel_get_image_dims(&firstImage->base.Base, &width, &height, &depth);
/* Figure out image dimensions at start level. */
switch(intelObj->base.Target) {
case GL_TEXTURE_2D_MULTISAMPLE:
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
case GL_TEXTURE_RECTANGLE:
case GL_TEXTURE_EXTERNAL_OES:
assert(level == 0);
break;
case GL_TEXTURE_3D:
depth = depth << level;
/* Fall through */
case GL_TEXTURE_2D:
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_CUBE_MAP:
case GL_TEXTURE_CUBE_MAP_ARRAY:
height = height << level;
/* Fall through */
case GL_TEXTURE_1D:
case GL_TEXTURE_1D_ARRAY:
width = width << level;
break;
default:
unreachable("Unexpected target");
}
perf_debug("Creating new %s %dx%dx%d %d-level miptree to handle "
"finalized texture miptree.\n",
_mesa_get_format_name(firstImage->base.Base.TexFormat),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment