GLenum format, GLenum type, const void *pixels)
{
struct intel_texture_image *intelImage = intel_texture_image(image);
- struct intel_context *intel = intel_context(ctx);
struct brw_context *brw = brw_context(ctx);
struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
GLuint src_offset;
DBG("trying pbo upload\n");
- if (intel->ctx._ImageTransferState ||
- unpack->SkipPixels || unpack->SkipRows) {
+ if (ctx->_ImageTransferState || unpack->SkipPixels || unpack->SkipRows) {
DBG("%s: image transfer\n", __FUNCTION__);
return false;
}
0, 0, false,
image->Width, image->Height, GL_COPY)) {
DBG("%s: blit failed\n", __FUNCTION__);
+ intel_miptree_release(&pbo_mt);
return false;
}
GLuint tile_x,
GLuint tile_y)
{
- struct intel_context *intel = intel_context(ctx);
struct brw_context *brw = brw_context(ctx);
struct intel_texture_image *intel_image = intel_texture_image(image);
struct gl_texture_object *texobj = image->TexObject;
struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
uint32_t draw_x, draw_y;
- _mesa_init_teximage_fields(&intel->ctx, image,
+ _mesa_init_teximage_fields(&brw->ctx, image,
width, height, 1,
0, internalFormat, format);
{
struct gl_framebuffer *fb = dPriv->driverPrivate;
struct brw_context *brw = pDRICtx->driverPrivate;
- struct intel_context *intel = &brw->intel;
- struct gl_context *ctx = &intel->ctx;
+ struct gl_context *ctx = &brw->ctx;
struct intel_texture_object *intelObj;
struct intel_renderbuffer *rb;
struct gl_texture_object *texObj;
if (!intelObj)
return;
- if (dPriv->lastStamp != dPriv->dri2.stamp)
+ if (dPriv->lastStamp != dPriv->dri2.stamp ||
+ !pDRICtx->driScreenPriv->dri2.useInvalidate)
intel_update_renderbuffers(pDRICtx, dPriv);
rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
texFormat = MESA_FORMAT_RGB565;
}
- _mesa_lock_texture(&intel->ctx, texObj);
+ _mesa_lock_texture(&brw->ctx, texObj);
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
intel_miptree_make_shareable(brw, rb->mt);
intel_set_texture_image_region(ctx, texImage, rb->mt->region, target,
rb->mt->region->width,
rb->mt->region->height,
0, 0);
- _mesa_unlock_texture(&intel->ctx, texObj);
+ _mesa_unlock_texture(&brw->ctx, texObj);
}
void
if (image == NULL)
return;
+ /**
+ * Images originating via EGL_EXT_image_dma_buf_import can be used only
+ * with GL_OES_EGL_image_external only.
+ */
+ if (image->dma_buf_imported && target != GL_TEXTURE_EXTERNAL_OES) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glEGLImageTargetTexture2DOES(dma buffers can be used with "
+ "GL_OES_EGL_image_external only");
+ return;
+ }
+
+ if (target == GL_TEXTURE_EXTERNAL_OES && !image->dma_buf_imported) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glEGLImageTargetTexture2DOES(external target is enabled only "
+ "for images created with EGL_EXT_image_dma_buf_import");
+ return;
+ }
+
/* Disallow depth/stencil textures: we don't have a way to pass the
* separate stencil miptree of a GL_DEPTH_STENCIL texture through.
*/