mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
In i915/i830_update_tex_unit() get the firstImage pointer _after_ we've called
intel_finalize_mipmap_tree(). This fixes a problem where the wrong mipmap level was used when the texture's GL_TEXTURE_BASE_LEVEL value wasn't zero. But this only happened the first time the texture was used. That took a while to track down!
This commit is contained in:
parent
86042f53f2
commit
1266e633cc
2 changed files with 12 additions and 2 deletions
|
|
@ -124,7 +124,7 @@ static GLboolean i830_update_tex_unit( struct intel_context *intel,
|
|||
struct i830_context *i830 = i830_context(ctx);
|
||||
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
|
||||
struct intel_texture_object *intelObj = intel_texture_object(tObj);
|
||||
struct gl_texture_image *firstImage = tObj->Image[0][intelObj->firstLevel];
|
||||
struct gl_texture_image *firstImage;
|
||||
GLuint *state = i830->state.Tex[unit];
|
||||
|
||||
memset(state, 0, sizeof(state));
|
||||
|
|
@ -132,6 +132,11 @@ static GLboolean i830_update_tex_unit( struct intel_context *intel,
|
|||
if (!intel_finalize_mipmap_tree(intel, unit))
|
||||
return GL_FALSE;
|
||||
|
||||
/* Get first image here, since intelObj->firstLevel will get set in
|
||||
* the intel_finalize_mipmap_tree() call above.
|
||||
*/
|
||||
firstImage = tObj->Image[0][intelObj->firstLevel];
|
||||
|
||||
i830->state.tex_buffer[unit] = intelObj->mt->region->buffer;
|
||||
i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0,
|
||||
intelObj->firstLevel);
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ static GLboolean i915_update_tex_unit( struct intel_context *intel,
|
|||
struct i915_context *i915 = i915_context(ctx);
|
||||
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
|
||||
struct intel_texture_object *intelObj = intel_texture_object(tObj);
|
||||
struct gl_texture_image *firstImage = tObj->Image[0][intelObj->firstLevel];
|
||||
struct gl_texture_image *firstImage;
|
||||
GLuint *state = i915->state.Tex[unit];
|
||||
|
||||
memset(state, 0, sizeof(state));
|
||||
|
|
@ -128,6 +128,11 @@ static GLboolean i915_update_tex_unit( struct intel_context *intel,
|
|||
if (!intel_finalize_mipmap_tree(intel, unit))
|
||||
return GL_FALSE;
|
||||
|
||||
/* Get first image here, since intelObj->firstLevel will get set in
|
||||
* the intel_finalize_mipmap_tree() call above.
|
||||
*/
|
||||
firstImage = tObj->Image[0][intelObj->firstLevel];
|
||||
|
||||
/* intel_region_reference(&i915->state.tex_region[unit], */
|
||||
/* intelObj->mt->region); */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue