intel: If a tex image doesn't fit in the object's tree, make a temporary tree.
Previously, we would just store the data as malloced memory hanging off the object, which would get memcpyed in at validate time. This broke an oglconform render-to-texture test, since validate wasn't called but a miptree was expected.
This commit is contained in:
@@ -395,10 +395,25 @@ intelTexImage(GLcontext * ctx,
|
||||
|
||||
intel_miptree_reference(&intelImage->mt, intelObj->mt);
|
||||
assert(intelImage->mt);
|
||||
}
|
||||
} else if (intelImage->base.Border == 0) {
|
||||
int comp_byte = 0;
|
||||
|
||||
if (!intelImage->mt)
|
||||
DBG("XXX: Image did not fit into tree - storing in local memory!\n");
|
||||
if (intelImage->base.IsCompressed) {
|
||||
comp_byte =
|
||||
intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
|
||||
}
|
||||
|
||||
/* Didn't fit in the object miptree, but it's suitable for inclusion in
|
||||
* a miptree, so create one just for our level and store it in the image.
|
||||
* It'll get moved into the object miptree at validate time.
|
||||
*/
|
||||
intelImage->mt = intel_miptree_create(intel, target, internalFormat,
|
||||
level, level,
|
||||
width, height, depth,
|
||||
intelImage->base.TexFormat->TexelBytes,
|
||||
comp_byte);
|
||||
|
||||
}
|
||||
|
||||
/* PBO fastpaths:
|
||||
*/
|
||||
|
Reference in New Issue
Block a user