Hi,

+   pipe_resource_reference(&img->texture, tex);

You shouldn't reference the texture before we manage to get a correct 
dri_format,
in case we fail.

+   img->level = level;
+   img->layer = depth;
+   img->dri_format = driGLFormatToImageFormat(obj->_BufferObjectFormat);

This doesn't give me a correct dri_format.
I think a better way to get the dri_format is to
use tex->format (of type enum pipe_format).
in dri_image_allocate_textures, there is code to convert
such a type in a dri_format.

+
+   img->loader_private = loaderPrivate;
+
+   if (img->dri_format == MESA_FORMAT_NONE) {

I assume you meant __DRI_IMAGE_FORMAT_NONE

+      *error = __DRI_IMAGE_ERROR_BAD_PARAMETER;
+      free(img);
+      return NULL;
+   }
+
+   *error = __DRI_IMAGE_ERROR_SUCCESS;
+   return img;
+}
+
Axel Davy

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to