#include "fbobject.h"
#include "formats.h"
#include "hash.h"
-#include "imports.h"
+
#include "macros.h"
#include "shaderimage.h"
#include "teximage.h"
#include "mtypes.h"
#include "program/prog_instruction.h"
#include "texturebindless.h"
+#include "util/u_memory.h"
/* Adjust max level for views: the data store may have more levels than
* the view exposes.
*/
- t->_MaxLevel = MIN2(t->_MaxLevel, t->NumLevels - 1);
+ t->_MaxLevel = MAX2(MIN2(t->_MaxLevel, t->NumLevels - 1), 0);
}
/* Compute _MaxLambda = q - p in the spec used during mipmapping */
*/
_mesa_HashRemove(ctx->Shared->TexObjects, delObj->Name);
+ if (ctx->Driver.TextureRemovedFromShared) {
+ ctx->Driver.TextureRemovedFromShared(ctx, delObj);
+ }
+
/* Unreference the texobj. If refcount hits zero, the texture
* will be deleted.
*/