2 #include "main/glheader.h"
3 #include "main/macros.h"
4 #include "main/mfeatures.h"
5 #include "main/mtypes.h"
6 #include "main/enums.h"
7 #include "main/bufferobj.h"
8 #include "main/context.h"
9 #include "main/formats.h"
11 #include "main/texcompress.h"
12 #include "main/texstore.h"
13 #include "main/texgetimage.h"
14 #include "main/texobj.h"
15 #include "main/teximage.h"
17 #include "intel_context.h"
18 #include "intel_mipmap_tree.h"
19 #include "intel_buffer_objects.h"
20 #include "intel_batchbuffer.h"
21 #include "intel_tex.h"
22 #include "intel_blit.h"
23 #include "intel_fbo.h"
25 #define FILE_DEBUG_FLAG DEBUG_TEXTURE
27 /* Functions to store texture images. Where possible, mipmap_tree's
28 * will be created or further instantiated with image data, otherwise
29 * images will be stored in malloc'd memory. A validation step is
30 * required to pull those images into a mipmap tree, or otherwise
31 * decide a fallback is required.
36 /* Otherwise, store it in memory if (Border != 0) or (any dimension ==
39 * Otherwise, if max_level >= level >= min_level, create tree with
40 * space for textures from min_level down to max_level.
42 * Otherwise, create tree with space for textures from (level
43 * 0)..(1x1). Consider pruning this tree at a validation if the
46 static struct intel_mipmap_tree
*
47 intel_miptree_create_for_teximage(struct intel_context
*intel
,
48 struct intel_texture_object
*intelObj
,
49 struct intel_texture_image
*intelImage
,
50 GLboolean expect_accelerated_upload
)
54 GLuint width
= intelImage
->base
.Width
;
55 GLuint height
= intelImage
->base
.Height
;
56 GLuint depth
= intelImage
->base
.Depth
;
59 DBG("%s\n", __FUNCTION__
);
61 if (intelImage
->base
.Border
)
64 if (intelImage
->level
> intelObj
->base
.BaseLevel
&&
65 (intelImage
->base
.Width
== 1 ||
66 (intelObj
->base
.Target
!= GL_TEXTURE_1D
&&
67 intelImage
->base
.Height
== 1) ||
68 (intelObj
->base
.Target
== GL_TEXTURE_3D
&&
69 intelImage
->base
.Depth
== 1))) {
70 /* For this combination, we're at some lower mipmap level and
71 * some important dimension is 1. We can't extrapolate up to a
72 * likely base level width/height/depth for a full mipmap stack
73 * from this info, so just allocate this one level.
75 firstLevel
= intelImage
->level
;
76 lastLevel
= intelImage
->level
;
78 /* If this image disrespects BaseLevel, allocate from level zero.
79 * Usually BaseLevel == 0, so it's unlikely to happen.
81 if (intelImage
->level
< intelObj
->base
.BaseLevel
)
84 firstLevel
= intelObj
->base
.BaseLevel
;
86 /* Figure out image dimensions at start level. */
87 for (i
= intelImage
->level
; i
> firstLevel
; i
--) {
95 /* Guess a reasonable value for lastLevel. This is probably going
96 * to be wrong fairly often and might mean that we have to look at
97 * resizable buffers, or require that buffers implement lazy
98 * pagetable arrangements.
100 if ((intelObj
->base
.Sampler
.MinFilter
== GL_NEAREST
||
101 intelObj
->base
.Sampler
.MinFilter
== GL_LINEAR
) &&
102 intelImage
->level
== firstLevel
&&
103 (intel
->gen
< 4 || firstLevel
== 0)) {
104 lastLevel
= firstLevel
;
106 lastLevel
= firstLevel
+ _mesa_logbase2(MAX2(MAX2(width
, height
), depth
));
110 return intel_miptree_create(intel
,
111 intelObj
->base
.Target
,
112 intelImage
->base
.TexFormat
,
118 expect_accelerated_upload
);
125 target_to_face(GLenum target
)
128 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
:
129 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB
:
130 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB
:
131 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
:
132 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB
:
133 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
:
134 return ((GLuint
) target
- (GLuint
) GL_TEXTURE_CUBE_MAP_POSITIVE_X
);
140 /* There are actually quite a few combinations this will work for,
141 * more than what I've listed here.
144 check_pbo_format(GLint internalFormat
,
145 GLenum format
, GLenum type
,
146 gl_format mesa_format
)
148 switch (internalFormat
) {
152 return (format
== GL_BGRA
&&
153 (type
== GL_UNSIGNED_BYTE
||
154 type
== GL_UNSIGNED_INT_8_8_8_8_REV
) &&
155 mesa_format
== MESA_FORMAT_ARGB8888
);
158 return (format
== GL_RGB
&&
159 type
== GL_UNSIGNED_SHORT_5_6_5
&&
160 mesa_format
== MESA_FORMAT_RGB565
);
163 return (format
== GL_LUMINANCE
&&
164 type
== GL_UNSIGNED_BYTE
&&
165 mesa_format
== MESA_FORMAT_L8
);
167 return (type
== GL_UNSIGNED_SHORT_8_8_MESA
|| type
== GL_UNSIGNED_BYTE
);
174 /* XXX: Do this for TexSubImage also:
177 try_pbo_upload(struct intel_context
*intel
,
178 struct intel_texture_image
*intelImage
,
179 const struct gl_pixelstore_attrib
*unpack
,
180 GLint internalFormat
,
181 GLint width
, GLint height
,
182 GLenum format
, GLenum type
, const void *pixels
)
184 struct intel_buffer_object
*pbo
= intel_buffer_object(unpack
->BufferObj
);
185 GLuint src_offset
, src_stride
;
186 GLuint dst_x
, dst_y
, dst_stride
;
187 drm_intel_bo
*dst_buffer
= intel_region_buffer(intel
,
188 intelImage
->mt
->region
,
191 if (!_mesa_is_bufferobj(unpack
->BufferObj
) ||
192 intel
->ctx
._ImageTransferState
||
193 unpack
->SkipPixels
|| unpack
->SkipRows
) {
194 DBG("%s: failure 1\n", __FUNCTION__
);
198 /* note: potential 64-bit ptr to 32-bit int cast */
199 src_offset
= (GLuint
) (unsigned long) pixels
;
201 if (unpack
->RowLength
> 0)
202 src_stride
= unpack
->RowLength
;
206 intel_miptree_get_image_offset(intelImage
->mt
, intelImage
->level
,
210 dst_stride
= intelImage
->mt
->region
->pitch
;
212 if (drm_intel_bo_references(intel
->batch
.bo
, dst_buffer
))
213 intel_flush(&intel
->ctx
);
217 drm_intel_bo
*src_buffer
=
218 intel_bufferobj_source(intel
, pbo
, 64, &offset
);
220 if (!intelEmitCopyBlit(intel
,
222 src_stride
, src_buffer
,
223 src_offset
+ offset
, GL_FALSE
,
224 dst_stride
, dst_buffer
, 0,
225 intelImage
->mt
->region
->tiling
,
226 0, 0, dst_x
, dst_y
, width
, height
,
237 try_pbo_zcopy(struct intel_context
*intel
,
238 struct intel_texture_image
*intelImage
,
239 const struct gl_pixelstore_attrib
*unpack
,
240 GLint internalFormat
,
241 GLint width
, GLint height
,
242 GLenum format
, GLenum type
, const void *pixels
)
244 struct intel_buffer_object
*pbo
= intel_buffer_object(unpack
->BufferObj
);
245 GLuint src_offset
, src_stride
;
246 GLuint dst_x
, dst_y
, dst_stride
;
248 if (!_mesa_is_bufferobj(unpack
->BufferObj
) ||
249 intel
->ctx
._ImageTransferState
||
250 unpack
->SkipPixels
|| unpack
->SkipRows
) {
251 DBG("%s: failure 1\n", __FUNCTION__
);
255 /* note: potential 64-bit ptr to 32-bit int cast */
256 src_offset
= (GLuint
) (unsigned long) pixels
;
258 if (unpack
->RowLength
> 0)
259 src_stride
= unpack
->RowLength
;
263 intel_miptree_get_image_offset(intelImage
->mt
, intelImage
->level
,
267 dst_stride
= intelImage
->mt
->region
->pitch
;
269 if (src_stride
!= dst_stride
|| dst_x
!= 0 || dst_y
!= 0 ||
271 DBG("%s: failure 2\n", __FUNCTION__
);
275 intel_region_attach_pbo(intel
, intelImage
->mt
->region
, pbo
);
282 intelTexImage(struct gl_context
* ctx
,
284 GLenum target
, GLint level
,
285 GLint internalFormat
,
286 GLint width
, GLint height
, GLint depth
,
288 GLenum format
, GLenum type
, const void *pixels
,
289 const struct gl_pixelstore_attrib
*unpack
,
290 struct gl_texture_object
*texObj
,
291 struct gl_texture_image
*texImage
, GLsizei imageSize
,
292 GLboolean compressed
)
294 struct intel_context
*intel
= intel_context(ctx
);
295 struct intel_texture_object
*intelObj
= intel_texture_object(texObj
);
296 struct intel_texture_image
*intelImage
= intel_texture_image(texImage
);
297 GLint texelBytes
, sizeInBytes
;
298 GLuint dstRowStride
= 0, srcRowStride
= texImage
->RowStride
;
300 DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__
,
301 _mesa_lookup_enum_by_nr(target
), level
, width
, height
, depth
, border
);
303 intelImage
->face
= target_to_face(target
);
304 intelImage
->level
= level
;
306 if (_mesa_is_format_compressed(texImage
->TexFormat
)) {
310 texelBytes
= _mesa_get_format_bytes(texImage
->TexFormat
);
312 if (!intelImage
->mt
) {
313 assert(texImage
->RowStride
== width
);
317 /* Release the reference to a potentially orphaned buffer.
318 * Release any old malloced memory.
320 if (intelImage
->mt
) {
321 intel_miptree_release(intel
, &intelImage
->mt
);
322 assert(!texImage
->Data
);
324 else if (texImage
->Data
) {
325 _mesa_free_texmemory(texImage
->Data
);
326 texImage
->Data
= NULL
;
329 assert(!intelImage
->mt
);
332 intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
)) {
333 /* Use an existing miptree when possible */
334 intel_miptree_reference(&intelImage
->mt
, intelObj
->mt
);
335 assert(intelImage
->mt
);
336 } else if (intelImage
->base
.Border
== 0) {
337 /* Didn't fit in the object miptree, but it's suitable for inclusion in
338 * a miptree, so create one just for our level and store it in the image.
339 * It'll get moved into the object miptree at validate time.
341 intelImage
->mt
= intel_miptree_create_for_teximage(intel
, intelObj
,
345 /* Even if the object currently has a mipmap tree associated
346 * with it, this one is a more likely candidate to represent the
347 * whole object since our level didn't fit what was there
348 * before, and any lower levels would fit into our miptree.
350 if (intelImage
->mt
) {
351 intel_miptree_release(intel
, &intelObj
->mt
);
352 intel_miptree_reference(&intelObj
->mt
, intelImage
->mt
);
360 _mesa_is_bufferobj(unpack
->BufferObj
) &&
361 check_pbo_format(internalFormat
, format
,
362 type
, intelImage
->base
.TexFormat
)) {
364 DBG("trying pbo upload\n");
366 /* Attempt to texture directly from PBO data (zero copy upload).
368 * Currently disable as it can lead to worse as well as better
369 * performance (in particular when intel_region_cow() is
372 if (intelObj
->mt
== intelImage
->mt
&&
373 intelObj
->mt
->first_level
== level
&&
374 intelObj
->mt
->last_level
== level
) {
376 if (try_pbo_zcopy(intel
, intelImage
, unpack
,
378 width
, height
, format
, type
, pixels
)) {
380 DBG("pbo zcopy upload succeeded\n");
386 /* Otherwise, attempt to use the blitter for PBO image uploads.
388 if (try_pbo_upload(intel
, intelImage
, unpack
,
390 width
, height
, format
, type
, pixels
)) {
391 DBG("pbo upload succeeded\n");
395 DBG("pbo upload failed\n");
398 /* intelCopyTexImage calls this function with pixels == NULL, with
399 * the expectation that the mipmap tree will be set up but nothing
400 * more will be done. This is where those calls return:
403 pixels
= _mesa_validate_pbo_compressed_teximage(ctx
, imageSize
, pixels
,
405 "glCompressedTexImage");
407 pixels
= _mesa_validate_pbo_teximage(ctx
, dims
, width
, height
, 1,
409 pixels
, unpack
, "glTexImage");
412 if (intelImage
->mt
) {
413 if (pixels
!= NULL
) {
414 /* Flush any queued rendering with the texture before mapping. */
415 if (drm_intel_bo_references(intel
->batch
.bo
,
416 intelImage
->mt
->region
->buffer
)) {
419 texImage
->Data
= intel_miptree_image_map(intel
,
424 intelImage
->base
.ImageOffsets
);
427 texImage
->RowStride
= dstRowStride
/ intelImage
->mt
->cpp
;
430 /* Allocate regular memory and store the image there temporarily. */
431 if (_mesa_is_format_compressed(texImage
->TexFormat
)) {
432 sizeInBytes
= _mesa_format_image_size(texImage
->TexFormat
,
437 _mesa_format_row_stride(texImage
->TexFormat
, width
);
441 dstRowStride
= width
* texelBytes
;
442 sizeInBytes
= depth
* dstRowStride
* height
;
445 texImage
->Data
= _mesa_alloc_texmemory(sizeInBytes
);
448 DBG("Upload image %dx%dx%d row_len %d "
449 "pitch %d pixels %d compressed %d\n",
450 width
, height
, depth
, width
* texelBytes
, dstRowStride
,
451 pixels
? 1 : 0, compressed
);
453 /* Copy data. Would like to know when it's ok for us to eg. use
454 * the blitter to copy. Or, use the hardware to do the format
455 * conversion and copy:
459 if (intelImage
->mt
) {
460 struct intel_region
*dst
= intelImage
->mt
->region
;
461 _mesa_copy_rect(texImage
->Data
, dst
->cpp
, dst
->pitch
,
463 intelImage
->mt
->level
[level
].width
,
464 (intelImage
->mt
->level
[level
].height
+3)/4,
470 memcpy(texImage
->Data
, pixels
, imageSize
);
473 else if (!_mesa_texstore(ctx
, dims
,
474 texImage
->_BaseFormat
,
476 texImage
->Data
, 0, 0, 0, /* dstX/Y/Zoffset */
478 texImage
->ImageOffsets
,
479 width
, height
, depth
,
480 format
, type
, pixels
, unpack
)) {
481 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glTexImage");
485 _mesa_unmap_teximage_pbo(ctx
, unpack
);
487 if (intelImage
->mt
) {
489 intel_miptree_image_unmap(intel
, intelImage
->mt
);
490 texImage
->Data
= NULL
;
496 intelTexImage3D(struct gl_context
* ctx
,
497 GLenum target
, GLint level
,
498 GLint internalFormat
,
499 GLint width
, GLint height
, GLint depth
,
501 GLenum format
, GLenum type
, const void *pixels
,
502 const struct gl_pixelstore_attrib
*unpack
,
503 struct gl_texture_object
*texObj
,
504 struct gl_texture_image
*texImage
)
506 intelTexImage(ctx
, 3, target
, level
,
507 internalFormat
, width
, height
, depth
, border
,
508 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, GL_FALSE
);
513 intelTexImage2D(struct gl_context
* ctx
,
514 GLenum target
, GLint level
,
515 GLint internalFormat
,
516 GLint width
, GLint height
, GLint border
,
517 GLenum format
, GLenum type
, const void *pixels
,
518 const struct gl_pixelstore_attrib
*unpack
,
519 struct gl_texture_object
*texObj
,
520 struct gl_texture_image
*texImage
)
522 intelTexImage(ctx
, 2, target
, level
,
523 internalFormat
, width
, height
, 1, border
,
524 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, GL_FALSE
);
529 intelTexImage1D(struct gl_context
* ctx
,
530 GLenum target
, GLint level
,
531 GLint internalFormat
,
532 GLint width
, GLint border
,
533 GLenum format
, GLenum type
, const void *pixels
,
534 const struct gl_pixelstore_attrib
*unpack
,
535 struct gl_texture_object
*texObj
,
536 struct gl_texture_image
*texImage
)
538 intelTexImage(ctx
, 1, target
, level
,
539 internalFormat
, width
, 1, 1, border
,
540 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, GL_FALSE
);
545 intelCompressedTexImage2D( struct gl_context
*ctx
, GLenum target
, GLint level
,
546 GLint internalFormat
,
547 GLint width
, GLint height
, GLint border
,
548 GLsizei imageSize
, const GLvoid
*data
,
549 struct gl_texture_object
*texObj
,
550 struct gl_texture_image
*texImage
)
552 intelTexImage(ctx
, 2, target
, level
,
553 internalFormat
, width
, height
, 1, border
,
554 0, 0, data
, &ctx
->Unpack
, texObj
, texImage
, imageSize
, GL_TRUE
);
559 * Need to map texture image into memory before copying image data,
563 intel_get_tex_image(struct gl_context
* ctx
, GLenum target
, GLint level
,
564 GLenum format
, GLenum type
, GLvoid
* pixels
,
565 struct gl_texture_object
*texObj
,
566 struct gl_texture_image
*texImage
, GLboolean compressed
)
568 struct intel_context
*intel
= intel_context(ctx
);
569 struct intel_texture_image
*intelImage
= intel_texture_image(texImage
);
571 /* If we're reading from a texture that has been rendered to, need to
572 * make sure rendering is complete.
573 * We could probably predicate this on texObj->_RenderToTexture
578 if (intelImage
->mt
) {
579 /* Image is stored in hardware format in a buffer managed by the
580 * kernel. Need to explicitly map and unmap it.
582 intelImage
->base
.Data
=
583 intel_miptree_image_map(intel
,
587 &intelImage
->base
.RowStride
,
588 intelImage
->base
.ImageOffsets
);
589 intelImage
->base
.RowStride
/= intelImage
->mt
->cpp
;
592 /* Otherwise, the image should actually be stored in
593 * intelImage->base.Data. This is pretty confusing for
594 * everybody, I'd much prefer to separate the two functions of
595 * texImage->Data - storage for texture images in main memory
596 * and access (ie mappings) of images. In other words, we'd
597 * create a new texImage->Map field and leave Data simply for
600 assert(intelImage
->base
.Data
);
605 _mesa_get_compressed_teximage(ctx
, target
, level
, pixels
,
609 _mesa_get_teximage(ctx
, target
, level
, format
, type
, pixels
,
615 if (intelImage
->mt
) {
616 intel_miptree_image_unmap(intel
, intelImage
->mt
);
617 intelImage
->base
.Data
= NULL
;
623 intelGetTexImage(struct gl_context
* ctx
, GLenum target
, GLint level
,
624 GLenum format
, GLenum type
, GLvoid
* pixels
,
625 struct gl_texture_object
*texObj
,
626 struct gl_texture_image
*texImage
)
628 intel_get_tex_image(ctx
, target
, level
, format
, type
, pixels
,
629 texObj
, texImage
, GL_FALSE
);
634 intelGetCompressedTexImage(struct gl_context
*ctx
, GLenum target
, GLint level
,
636 struct gl_texture_object
*texObj
,
637 struct gl_texture_image
*texImage
)
639 intel_get_tex_image(ctx
, target
, level
, 0, 0, pixels
,
640 texObj
, texImage
, GL_TRUE
);
644 intelSetTexBuffer2(__DRIcontext
*pDRICtx
, GLint target
,
645 GLint texture_format
,
646 __DRIdrawable
*dPriv
)
648 struct gl_framebuffer
*fb
= dPriv
->driverPrivate
;
649 struct intel_context
*intel
= pDRICtx
->driverPrivate
;
650 struct gl_context
*ctx
= &intel
->ctx
;
651 struct intel_texture_object
*intelObj
;
652 struct intel_texture_image
*intelImage
;
653 struct intel_mipmap_tree
*mt
;
654 struct intel_renderbuffer
*rb
;
655 struct gl_texture_object
*texObj
;
656 struct gl_texture_image
*texImage
;
657 int level
= 0, internalFormat
;
660 texObj
= _mesa_get_current_tex_object(ctx
, target
);
661 intelObj
= intel_texture_object(texObj
);
666 if (dPriv
->lastStamp
!= dPriv
->dri2
.stamp
||
667 !pDRICtx
->driScreenPriv
->dri2
.useInvalidate
)
668 intel_update_renderbuffers(pDRICtx
, dPriv
);
670 rb
= intel_get_renderbuffer(fb
, BUFFER_FRONT_LEFT
);
671 /* If the region isn't set, then intel_update_renderbuffers was unable
672 * to get the buffers for the drawable.
674 if (rb
->region
== NULL
)
677 if (texture_format
== __DRI_TEXTURE_FORMAT_RGB
) {
678 internalFormat
= GL_RGB
;
679 texFormat
= MESA_FORMAT_XRGB8888
;
682 internalFormat
= GL_RGBA
;
683 texFormat
= MESA_FORMAT_ARGB8888
;
686 mt
= intel_miptree_create_for_region(intel
, target
, texFormat
,
691 _mesa_lock_texture(&intel
->ctx
, texObj
);
693 texImage
= _mesa_get_tex_image(&intel
->ctx
, texObj
, target
, level
);
694 intelImage
= intel_texture_image(texImage
);
696 if (intelImage
->mt
) {
697 intel_miptree_release(intel
, &intelImage
->mt
);
698 assert(!texImage
->Data
);
701 intel_miptree_release(intel
, &intelObj
->mt
);
705 _mesa_init_teximage_fields(&intel
->ctx
, target
, texImage
,
706 rb
->region
->width
, rb
->region
->height
, 1,
707 0, internalFormat
, texFormat
);
709 intelImage
->face
= target_to_face(target
);
710 intelImage
->level
= level
;
711 texImage
->RowStride
= rb
->region
->pitch
;
712 intel_miptree_reference(&intelImage
->mt
, intelObj
->mt
);
714 if (!intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
)) {
715 fprintf(stderr
, "miptree doesn't match image\n");
718 _mesa_unlock_texture(&intel
->ctx
, texObj
);
722 intelSetTexBuffer(__DRIcontext
*pDRICtx
, GLint target
, __DRIdrawable
*dPriv
)
724 /* The old interface didn't have the format argument, so copy our
725 * implementation's behavior at the time.
727 intelSetTexBuffer2(pDRICtx
, target
, __DRI_TEXTURE_FORMAT_RGBA
, dPriv
);
730 #if FEATURE_OES_EGL_image
732 intel_image_target_texture_2d(struct gl_context
*ctx
, GLenum target
,
733 struct gl_texture_object
*texObj
,
734 struct gl_texture_image
*texImage
,
735 GLeglImageOES image_handle
)
737 struct intel_context
*intel
= intel_context(ctx
);
738 struct intel_texture_object
*intelObj
= intel_texture_object(texObj
);
739 struct intel_texture_image
*intelImage
= intel_texture_image(texImage
);
740 struct intel_mipmap_tree
*mt
;
744 screen
= intel
->intelScreen
->driScrnPriv
;
745 image
= screen
->dri2
.image
->lookupEGLImage(screen
, image_handle
,
746 screen
->loaderPrivate
);
750 mt
= intel_miptree_create_for_region(intel
, target
, image
->format
,
755 if (intelImage
->mt
) {
756 intel_miptree_release(intel
, &intelImage
->mt
);
757 assert(!texImage
->Data
);
760 intel_miptree_release(intel
, &intelObj
->mt
);
763 _mesa_init_teximage_fields(&intel
->ctx
, target
, texImage
,
764 image
->region
->width
, image
->region
->height
, 1,
765 0, image
->internal_format
, image
->format
);
767 intelImage
->face
= target_to_face(target
);
768 intelImage
->level
= 0;
769 texImage
->RowStride
= image
->region
->pitch
;
770 intel_miptree_reference(&intelImage
->mt
, intelObj
->mt
);
772 if (!intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
))
773 fprintf(stderr
, "miptree doesn't match image\n");
778 intelInitTextureImageFuncs(struct dd_function_table
*functions
)
780 functions
->TexImage1D
= intelTexImage1D
;
781 functions
->TexImage2D
= intelTexImage2D
;
782 functions
->TexImage3D
= intelTexImage3D
;
783 functions
->GetTexImage
= intelGetTexImage
;
785 functions
->CompressedTexImage2D
= intelCompressedTexImage2D
;
786 functions
->GetCompressedTexImage
= intelGetCompressedTexImage
;
788 #if FEATURE_OES_EGL_image
789 functions
->EGLImageTargetTexture2D
= intel_image_target_texture_2d
;