diff options
author | Keith Whitwell <[email protected]> | 2006-09-07 19:05:40 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2006-09-07 19:05:40 +0000 |
commit | 493b2ddecb47fdacc4b73d9c9a3ba2e46489105f (patch) | |
tree | 011c2f4570d336020c0db6562d294d638a981531 /src/mesa/drivers/dri/i965/intel_tex_validate.c | |
parent | c26f36c830cc6df1093a145eb43645f535004eb7 (diff) |
Cope with memory pool fragmentation by allowing a second attempt at
rendering operations to take place after evicting all resident
buffers.
Cope better with memory allocation failures throughout the driver and
improve tracking of failures.
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_tex_validate.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_tex_validate.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c index 5023aae1b8c..5f65242458a 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c @@ -89,21 +89,21 @@ static void intel_calculate_first_last_level( struct intel_texture_object *intel intelObj->lastLevel = lastLevel; } -static void copy_image_data_to_tree( struct intel_context *intel, - struct intel_texture_object *intelObj, - struct gl_texture_image *texImage, - GLuint face, - GLuint level) +static GLboolean copy_image_data_to_tree( struct intel_context *intel, + struct intel_texture_object *intelObj, + struct gl_texture_image *texImage, + GLuint face, + GLuint level) { - intel_miptree_image_data(intel, - intelObj->mt, - face, - level, - texImage->Data, - texImage->RowStride, - (texImage->RowStride * - texImage->Height * - texImage->TexFormat->TexelBytes)); + return intel_miptree_image_data(intel, + intelObj->mt, + face, + level, + texImage->Data, + texImage->RowStride, + (texImage->RowStride * + texImage->Height * + texImage->TexFormat->TexelBytes)); } static void intel_texture_invalidate( struct intel_texture_object *intelObj ) @@ -129,7 +129,6 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel, struct gl_texture_object *tObj ) { struct intel_texture_object *intelObj = intel_texture_object(tObj); - GLuint face, i; GLuint nr_faces = 0; struct gl_texture_image *firstImage; @@ -226,18 +225,24 @@ GLuint intel_finalize_mipmap_tree( struct intel_context *intel, i, texImage->Data); - copy_image_data_to_tree(intel, - intelObj, - texImage, - face, - i); + if (!copy_image_data_to_tree(intel, + intelObj, + texImage, + face, + i)) + return GL_FALSE; } } - intelObj->dirty_images[face] = 0; } } + /* Only clear the dirty flags if everything went ok: + */ + for (face = 0; face < nr_faces; face++) { + intelObj->dirty_images[face] = 0; + } + intelObj->dirty = 0; } |