__DRIextension base;
/**
- * Method to override base texture image with a DRM memory manager
- * buffer object. The depth passed in allows e.g. to ignore the
- * alpha channel of texture images where the non-alpha components
- * don't occupy a whole texel.
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*setTexBuffer)(__DRIcontext *pDRICtx,
- GLint target, unsigned long handle,
- GLint cpp, GLuint pitch, GLuint height);
+ GLint target,
+ __DRIdrawable *pDraw);
};
*/
/*@{*/
-#define __DRI_INTERFACE_VERSION 20080226
+#define __DRI_INTERFACE_VERSION 20080310
typedef void *(CREATENEWSCREENFUNC)(int scr, __DRIscreen *psc,
const __DRIversion * ddx_version, const __DRIversion * dri_version,
void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch);
void intelSetTexBuffer(__DRIcontext *pDRICtx,
- GLint target, unsigned long handle,
- GLint cpp, GLuint pitch, GLuint height);
+ GLint target, __DRIdrawable *pDraw);
GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit);
#include "intel_tex.h"
#include "intel_ioctl.h"
#include "intel_blit.h"
+#include "intel_fbo.h"
#define FILE_DEBUG_FLAG DEBUG_TEXTURE
}
void
-intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target,
- unsigned long handle, GLint cpp, GLuint pitch, GLuint height)
+intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *pDraw)
{
__DRIcontextPrivate *driContext = pDRICtx->private;
+ __DRIdrawablePrivate *dPriv = pDraw->private;
+ struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
struct intel_context *intel = driContext->driverPrivate;
struct intel_texture_object *intelObj;
struct intel_texture_image *intelImage;
struct intel_mipmap_tree *mt;
- struct intel_region *region;
+ struct intel_renderbuffer *rb;
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
- int level = 0;
-
- /* FIXME: type, format, internalFormat */
- int type = GL_BGRA;
- int format = GL_UNSIGNED_BYTE;
- int internalFormat = (cpp == 3 ? 3 : 4);
- cpp = 4;
- pitch /= 4;
+ int level = 0, type, format, internalFormat;
texUnit = &intel->ctx.Texture.Unit[intel->ctx.Texture.CurrentUnit];
texObj = _mesa_select_tex_object(&intel->ctx, texUnit, target);
if (!intelObj)
return;
- region = intel_region_alloc_for_handle(intel, cpp, pitch, height,
- 0, handle);
+ __driParseEvents(driContext, dPriv);
+
+ rb = intel_fb->color_rb[0];
+ type = GL_BGRA;
+ format = GL_UNSIGNED_BYTE;
+ internalFormat = (rb->region->cpp == 3 ? 3 : 4);
mt = intel_miptree_create_for_region(intel, target,
internalFormat,
- 0, 0, region, 1, 0);
+ 0, 0, rb->region, 1, 0);
if (mt == NULL)
return;
intelObj->mt = mt;
texImage = _mesa_get_tex_image(&intel->ctx, texObj, target, level);
_mesa_init_teximage_fields(&intel->ctx, target, texImage,
- pitch, height, 1,
+ rb->region->pitch, rb->region->height, 1,
0, internalFormat);
intelImage = intel_texture_image(texImage);
texImage->TexFormat = intelChooseTextureFormat(&intel->ctx, internalFormat,
type, format);
_mesa_set_fetch_functions(texImage, 2);
- texImage->RowStride = pitch;
+ texImage->RowStride = rb->region->pitch;
intel_miptree_reference(&intelImage->mt, intelObj->mt);
if (!intel_miptree_match_image(intelObj->mt, &intelImage->base,