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.
50 /* Otherwise, store it in memory if (Border != 0) or (any dimension ==
53 * Otherwise, if max_level >= level >= min_level, create tree with
54 * space for textures from min_level down to max_level.
56 * Otherwise, create tree with space for textures from (level
57 * 0)..(1x1). Consider pruning this tree at a validation if the
60 static struct intel_mipmap_tree
*
61 intel_miptree_create_for_teximage(struct intel_context
*intel
,
62 struct intel_texture_object
*intelObj
,
63 struct intel_texture_image
*intelImage
,
64 GLboolean expect_accelerated_upload
)
68 GLuint width
= intelImage
->base
.Width
;
69 GLuint height
= intelImage
->base
.Height
;
70 GLuint depth
= intelImage
->base
.Depth
;
71 GLuint i
, comp_byte
= 0;
74 DBG("%s\n", __FUNCTION__
);
76 if (intelImage
->base
.Border
)
79 if (intelImage
->level
> intelObj
->base
.BaseLevel
&&
80 (intelImage
->base
.Width
== 1 ||
81 (intelObj
->base
.Target
!= GL_TEXTURE_1D
&&
82 intelImage
->base
.Height
== 1) ||
83 (intelObj
->base
.Target
== GL_TEXTURE_3D
&&
84 intelImage
->base
.Depth
== 1))) {
85 /* For this combination, we're at some lower mipmap level and
86 * some important dimension is 1. We can't extrapolate up to a
87 * likely base level width/height/depth for a full mipmap stack
88 * from this info, so just allocate this one level.
90 firstLevel
= intelImage
->level
;
91 lastLevel
= intelImage
->level
;
93 /* If this image disrespects BaseLevel, allocate from level zero.
94 * Usually BaseLevel == 0, so it's unlikely to happen.
96 if (intelImage
->level
< intelObj
->base
.BaseLevel
)
99 firstLevel
= intelObj
->base
.BaseLevel
;
101 /* Figure out image dimensions at start level. */
102 for (i
= intelImage
->level
; i
> firstLevel
; i
--) {
110 /* Guess a reasonable value for lastLevel. This is probably going
111 * to be wrong fairly often and might mean that we have to look at
112 * resizable buffers, or require that buffers implement lazy
113 * pagetable arrangements.
115 if ((intelObj
->base
.MinFilter
== GL_NEAREST
||
116 intelObj
->base
.MinFilter
== GL_LINEAR
) &&
117 intelImage
->level
== firstLevel
&&
118 (intel
->gen
< 4 || firstLevel
== 0)) {
119 lastLevel
= firstLevel
;
121 lastLevel
= firstLevel
+ logbase2(MAX2(MAX2(width
, height
), depth
));
125 if (_mesa_is_format_compressed(intelImage
->base
.TexFormat
))
126 comp_byte
= intel_compressed_num_bytes(intelImage
->base
.TexFormat
);
128 texelBytes
= _mesa_get_format_bytes(intelImage
->base
.TexFormat
);
130 return intel_miptree_create(intel
,
131 intelObj
->base
.Target
,
132 intelImage
->base
._BaseFormat
,
133 intelImage
->base
.InternalFormat
,
141 expect_accelerated_upload
);
148 target_to_face(GLenum target
)
151 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
:
152 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB
:
153 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB
:
154 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
:
155 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB
:
156 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
:
157 return ((GLuint
) target
- (GLuint
) GL_TEXTURE_CUBE_MAP_POSITIVE_X
);
163 /* There are actually quite a few combinations this will work for,
164 * more than what I've listed here.
167 check_pbo_format(GLint internalFormat
,
168 GLenum format
, GLenum type
,
169 gl_format mesa_format
)
171 switch (internalFormat
) {
175 return (format
== GL_BGRA
&&
176 (type
== GL_UNSIGNED_BYTE
||
177 type
== GL_UNSIGNED_INT_8_8_8_8_REV
) &&
178 mesa_format
== MESA_FORMAT_ARGB8888
);
181 return (format
== GL_RGB
&&
182 type
== GL_UNSIGNED_SHORT_5_6_5
&&
183 mesa_format
== MESA_FORMAT_RGB565
);
186 return (format
== GL_LUMINANCE
&&
187 type
== GL_UNSIGNED_BYTE
&&
188 mesa_format
== MESA_FORMAT_L8
);
190 return (type
== GL_UNSIGNED_SHORT_8_8_MESA
|| type
== GL_UNSIGNED_BYTE
);
197 /* XXX: Do this for TexSubImage also:
200 try_pbo_upload(struct intel_context
*intel
,
201 struct intel_texture_image
*intelImage
,
202 const struct gl_pixelstore_attrib
*unpack
,
203 GLint internalFormat
,
204 GLint width
, GLint height
,
205 GLenum format
, GLenum type
, const void *pixels
)
207 struct intel_buffer_object
*pbo
= intel_buffer_object(unpack
->BufferObj
);
208 GLuint src_offset
, src_stride
;
209 GLuint dst_x
, dst_y
, dst_stride
;
210 drm_intel_bo
*dst_buffer
= intel_region_buffer(intel
,
211 intelImage
->mt
->region
,
214 if (!_mesa_is_bufferobj(unpack
->BufferObj
) ||
215 intel
->ctx
._ImageTransferState
||
216 unpack
->SkipPixels
|| unpack
->SkipRows
) {
217 DBG("%s: failure 1\n", __FUNCTION__
);
221 /* note: potential 64-bit ptr to 32-bit int cast */
222 src_offset
= (GLuint
) (unsigned long) pixels
;
224 if (unpack
->RowLength
> 0)
225 src_stride
= unpack
->RowLength
;
229 intel_miptree_get_image_offset(intelImage
->mt
, intelImage
->level
,
233 dst_stride
= intelImage
->mt
->region
->pitch
;
235 if (drm_intel_bo_references(intel
->batch
.bo
, dst_buffer
))
236 intel_flush(&intel
->ctx
);
240 drm_intel_bo
*src_buffer
=
241 intel_bufferobj_source(intel
, pbo
, 64, &offset
);
243 if (!intelEmitCopyBlit(intel
,
245 src_stride
, src_buffer
,
246 src_offset
+ offset
, GL_FALSE
,
247 dst_stride
, dst_buffer
, 0,
248 intelImage
->mt
->region
->tiling
,
249 0, 0, dst_x
, dst_y
, width
, height
,
260 try_pbo_zcopy(struct intel_context
*intel
,
261 struct intel_texture_image
*intelImage
,
262 const struct gl_pixelstore_attrib
*unpack
,
263 GLint internalFormat
,
264 GLint width
, GLint height
,
265 GLenum format
, GLenum type
, const void *pixels
)
267 struct intel_buffer_object
*pbo
= intel_buffer_object(unpack
->BufferObj
);
268 GLuint src_offset
, src_stride
;
269 GLuint dst_x
, dst_y
, dst_stride
;
271 if (!_mesa_is_bufferobj(unpack
->BufferObj
) ||
272 intel
->ctx
._ImageTransferState
||
273 unpack
->SkipPixels
|| unpack
->SkipRows
) {
274 DBG("%s: failure 1\n", __FUNCTION__
);
278 /* note: potential 64-bit ptr to 32-bit int cast */
279 src_offset
= (GLuint
) (unsigned long) pixels
;
281 if (unpack
->RowLength
> 0)
282 src_stride
= unpack
->RowLength
;
286 intel_miptree_get_image_offset(intelImage
->mt
, intelImage
->level
,
290 dst_stride
= intelImage
->mt
->region
->pitch
;
292 if (src_stride
!= dst_stride
|| dst_x
!= 0 || dst_y
!= 0 ||
294 DBG("%s: failure 2\n", __FUNCTION__
);
298 intel_region_attach_pbo(intel
, intelImage
->mt
->region
, pbo
);
305 intelTexImage(struct gl_context
* ctx
,
307 GLenum target
, GLint level
,
308 GLint internalFormat
,
309 GLint width
, GLint height
, GLint depth
,
311 GLenum format
, GLenum type
, const void *pixels
,
312 const struct gl_pixelstore_attrib
*unpack
,
313 struct gl_texture_object
*texObj
,
314 struct gl_texture_image
*texImage
, GLsizei imageSize
,
315 GLboolean compressed
)
317 struct intel_context
*intel
= intel_context(ctx
);
318 struct intel_texture_object
*intelObj
= intel_texture_object(texObj
);
319 struct intel_texture_image
*intelImage
= intel_texture_image(texImage
);
320 GLint texelBytes
, sizeInBytes
;
321 GLuint dstRowStride
= 0, srcRowStride
= texImage
->RowStride
;
323 DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__
,
324 _mesa_lookup_enum_by_nr(target
), level
, width
, height
, depth
, border
);
326 intelImage
->face
= target_to_face(target
);
327 intelImage
->level
= level
;
329 if (_mesa_is_format_compressed(texImage
->TexFormat
)) {
333 texelBytes
= _mesa_get_format_bytes(texImage
->TexFormat
);
335 if (!intelImage
->mt
) {
336 assert(texImage
->RowStride
== width
);
340 /* Release the reference to a potentially orphaned buffer.
341 * Release any old malloced memory.
343 if (intelImage
->mt
) {
344 intel_miptree_release(intel
, &intelImage
->mt
);
345 assert(!texImage
->Data
);
347 else if (texImage
->Data
) {
348 _mesa_free_texmemory(texImage
->Data
);
349 texImage
->Data
= NULL
;
352 assert(!intelImage
->mt
);
355 intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
)) {
356 /* Use an existing miptree when possible */
357 intel_miptree_reference(&intelImage
->mt
, intelObj
->mt
);
358 assert(intelImage
->mt
);
359 } else if (intelImage
->base
.Border
== 0) {
360 /* Didn't fit in the object miptree, but it's suitable for inclusion in
361 * a miptree, so create one just for our level and store it in the image.
362 * It'll get moved into the object miptree at validate time.
364 intelImage
->mt
= intel_miptree_create_for_teximage(intel
, intelObj
,
368 /* Even if the object currently has a mipmap tree associated
369 * with it, this one is a more likely candidate to represent the
370 * whole object since our level didn't fit what was there
371 * before, and any lower levels would fit into our miptree.
374 intel_miptree_reference(&intelObj
->mt
, intelImage
->mt
);
381 _mesa_is_bufferobj(unpack
->BufferObj
) &&
382 check_pbo_format(internalFormat
, format
,
383 type
, intelImage
->base
.TexFormat
)) {
385 DBG("trying pbo upload\n");
387 /* Attempt to texture directly from PBO data (zero copy upload).
389 * Currently disable as it can lead to worse as well as better
390 * performance (in particular when intel_region_cow() is
393 if (intelObj
->mt
== intelImage
->mt
&&
394 intelObj
->mt
->first_level
== level
&&
395 intelObj
->mt
->last_level
== level
) {
397 if (try_pbo_zcopy(intel
, intelImage
, unpack
,
399 width
, height
, format
, type
, pixels
)) {
401 DBG("pbo zcopy upload succeeded\n");
407 /* Otherwise, attempt to use the blitter for PBO image uploads.
409 if (try_pbo_upload(intel
, intelImage
, unpack
,
411 width
, height
, format
, type
, pixels
)) {
412 DBG("pbo upload succeeded\n");
416 DBG("pbo upload failed\n");
419 /* intelCopyTexImage calls this function with pixels == NULL, with
420 * the expectation that the mipmap tree will be set up but nothing
421 * more will be done. This is where those calls return:
424 pixels
= _mesa_validate_pbo_compressed_teximage(ctx
, imageSize
, pixels
,
426 "glCompressedTexImage");
428 pixels
= _mesa_validate_pbo_teximage(ctx
, dims
, width
, height
, 1,
430 pixels
, unpack
, "glTexImage");
433 if (intelImage
->mt
) {
434 if (pixels
!= NULL
) {
435 /* Flush any queued rendering with the texture before mapping. */
436 if (drm_intel_bo_references(intel
->batch
.bo
,
437 intelImage
->mt
->region
->buffer
)) {
440 texImage
->Data
= intel_miptree_image_map(intel
,
445 intelImage
->base
.ImageOffsets
);
448 texImage
->RowStride
= dstRowStride
/ intelImage
->mt
->cpp
;
451 /* Allocate regular memory and store the image there temporarily. */
452 if (_mesa_is_format_compressed(texImage
->TexFormat
)) {
453 sizeInBytes
= _mesa_format_image_size(texImage
->TexFormat
,
458 _mesa_format_row_stride(texImage
->TexFormat
, width
);
462 dstRowStride
= width
* texelBytes
;
463 sizeInBytes
= depth
* dstRowStride
* height
;
466 texImage
->Data
= _mesa_alloc_texmemory(sizeInBytes
);
469 DBG("Upload image %dx%dx%d row_len %d "
470 "pitch %d pixels %d compressed %d\n",
471 width
, height
, depth
, width
* texelBytes
, dstRowStride
,
472 pixels
? 1 : 0, compressed
);
474 /* Copy data. Would like to know when it's ok for us to eg. use
475 * the blitter to copy. Or, use the hardware to do the format
476 * conversion and copy:
480 if (intelImage
->mt
) {
481 struct intel_region
*dst
= intelImage
->mt
->region
;
482 _mesa_copy_rect(texImage
->Data
, dst
->cpp
, dst
->pitch
,
484 intelImage
->mt
->level
[level
].width
,
485 (intelImage
->mt
->level
[level
].height
+3)/4,
491 memcpy(texImage
->Data
, pixels
, imageSize
);
494 else if (!_mesa_texstore(ctx
, dims
,
495 texImage
->_BaseFormat
,
497 texImage
->Data
, 0, 0, 0, /* dstX/Y/Zoffset */
499 texImage
->ImageOffsets
,
500 width
, height
, depth
,
501 format
, type
, pixels
, unpack
)) {
502 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glTexImage");
506 _mesa_unmap_teximage_pbo(ctx
, unpack
);
508 if (intelImage
->mt
) {
510 intel_miptree_image_unmap(intel
, intelImage
->mt
);
511 texImage
->Data
= NULL
;
517 intelTexImage3D(struct gl_context
* ctx
,
518 GLenum target
, GLint level
,
519 GLint internalFormat
,
520 GLint width
, GLint height
, GLint depth
,
522 GLenum format
, GLenum type
, const void *pixels
,
523 const struct gl_pixelstore_attrib
*unpack
,
524 struct gl_texture_object
*texObj
,
525 struct gl_texture_image
*texImage
)
527 intelTexImage(ctx
, 3, target
, level
,
528 internalFormat
, width
, height
, depth
, border
,
529 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, GL_FALSE
);
534 intelTexImage2D(struct gl_context
* ctx
,
535 GLenum target
, GLint level
,
536 GLint internalFormat
,
537 GLint width
, GLint height
, GLint border
,
538 GLenum format
, GLenum type
, const void *pixels
,
539 const struct gl_pixelstore_attrib
*unpack
,
540 struct gl_texture_object
*texObj
,
541 struct gl_texture_image
*texImage
)
543 intelTexImage(ctx
, 2, target
, level
,
544 internalFormat
, width
, height
, 1, border
,
545 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, GL_FALSE
);
550 intelTexImage1D(struct gl_context
* ctx
,
551 GLenum target
, GLint level
,
552 GLint internalFormat
,
553 GLint width
, GLint border
,
554 GLenum format
, GLenum type
, const void *pixels
,
555 const struct gl_pixelstore_attrib
*unpack
,
556 struct gl_texture_object
*texObj
,
557 struct gl_texture_image
*texImage
)
559 intelTexImage(ctx
, 1, target
, level
,
560 internalFormat
, width
, 1, 1, border
,
561 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, GL_FALSE
);
566 intelCompressedTexImage2D( struct gl_context
*ctx
, GLenum target
, GLint level
,
567 GLint internalFormat
,
568 GLint width
, GLint height
, GLint border
,
569 GLsizei imageSize
, const GLvoid
*data
,
570 struct gl_texture_object
*texObj
,
571 struct gl_texture_image
*texImage
)
573 intelTexImage(ctx
, 2, target
, level
,
574 internalFormat
, width
, height
, 1, border
,
575 0, 0, data
, &ctx
->Unpack
, texObj
, texImage
, imageSize
, GL_TRUE
);
580 * Need to map texture image into memory before copying image data,
584 intel_get_tex_image(struct gl_context
* ctx
, GLenum target
, GLint level
,
585 GLenum format
, GLenum type
, GLvoid
* pixels
,
586 struct gl_texture_object
*texObj
,
587 struct gl_texture_image
*texImage
, GLboolean compressed
)
589 struct intel_context
*intel
= intel_context(ctx
);
590 struct intel_texture_image
*intelImage
= intel_texture_image(texImage
);
592 /* If we're reading from a texture that has been rendered to, need to
593 * make sure rendering is complete.
594 * We could probably predicate this on texObj->_RenderToTexture
599 if (intelImage
->mt
) {
600 /* Image is stored in hardware format in a buffer managed by the
601 * kernel. Need to explicitly map and unmap it.
603 intelImage
->base
.Data
=
604 intel_miptree_image_map(intel
,
608 &intelImage
->base
.RowStride
,
609 intelImage
->base
.ImageOffsets
);
610 intelImage
->base
.RowStride
/= intelImage
->mt
->cpp
;
613 /* Otherwise, the image should actually be stored in
614 * intelImage->base.Data. This is pretty confusing for
615 * everybody, I'd much prefer to separate the two functions of
616 * texImage->Data - storage for texture images in main memory
617 * and access (ie mappings) of images. In other words, we'd
618 * create a new texImage->Map field and leave Data simply for
621 assert(intelImage
->base
.Data
);
626 _mesa_get_compressed_teximage(ctx
, target
, level
, pixels
,
630 _mesa_get_teximage(ctx
, target
, level
, format
, type
, pixels
,
636 if (intelImage
->mt
) {
637 intel_miptree_image_unmap(intel
, intelImage
->mt
);
638 intelImage
->base
.Data
= NULL
;
644 intelGetTexImage(struct gl_context
* ctx
, GLenum target
, GLint level
,
645 GLenum format
, GLenum type
, GLvoid
* pixels
,
646 struct gl_texture_object
*texObj
,
647 struct gl_texture_image
*texImage
)
649 intel_get_tex_image(ctx
, target
, level
, format
, type
, pixels
,
650 texObj
, texImage
, GL_FALSE
);
655 intelGetCompressedTexImage(struct gl_context
*ctx
, GLenum target
, GLint level
,
657 struct gl_texture_object
*texObj
,
658 struct gl_texture_image
*texImage
)
660 intel_get_tex_image(ctx
, target
, level
, 0, 0, pixels
,
661 texObj
, texImage
, GL_TRUE
);
665 intelSetTexBuffer2(__DRIcontext
*pDRICtx
, GLint target
,
666 GLint texture_format
,
667 __DRIdrawable
*dPriv
)
669 struct gl_framebuffer
*fb
= dPriv
->driverPrivate
;
670 struct intel_context
*intel
= pDRICtx
->driverPrivate
;
671 struct gl_context
*ctx
= &intel
->ctx
;
672 struct intel_texture_object
*intelObj
;
673 struct intel_texture_image
*intelImage
;
674 struct intel_mipmap_tree
*mt
;
675 struct intel_renderbuffer
*rb
;
676 struct gl_texture_object
*texObj
;
677 struct gl_texture_image
*texImage
;
678 int level
= 0, internalFormat
;
681 texObj
= _mesa_get_current_tex_object(ctx
, target
);
682 intelObj
= intel_texture_object(texObj
);
687 if (dPriv
->lastStamp
!= dPriv
->dri2
.stamp
||
688 !pDRICtx
->driScreenPriv
->dri2
.useInvalidate
)
689 intel_update_renderbuffers(pDRICtx
, dPriv
);
691 rb
= intel_get_renderbuffer(fb
, BUFFER_FRONT_LEFT
);
692 /* If the region isn't set, then intel_update_renderbuffers was unable
693 * to get the buffers for the drawable.
695 if (rb
->region
== NULL
)
698 if (texture_format
== __DRI_TEXTURE_FORMAT_RGB
) {
699 internalFormat
= GL_RGB
;
700 texFormat
= MESA_FORMAT_XRGB8888
;
703 internalFormat
= GL_RGBA
;
704 texFormat
= MESA_FORMAT_ARGB8888
;
707 mt
= intel_miptree_create_for_region(intel
, target
,
708 internalFormat
, rb
->region
, 1, 0);
712 _mesa_lock_texture(&intel
->ctx
, texObj
);
714 texImage
= _mesa_get_tex_image(&intel
->ctx
, texObj
, target
, level
);
715 intelImage
= intel_texture_image(texImage
);
717 if (intelImage
->mt
) {
718 intel_miptree_release(intel
, &intelImage
->mt
);
719 assert(!texImage
->Data
);
722 intel_miptree_release(intel
, &intelObj
->mt
);
726 _mesa_init_teximage_fields(&intel
->ctx
, target
, texImage
,
727 rb
->region
->width
, rb
->region
->height
, 1,
728 0, internalFormat
, texFormat
);
730 intelImage
->face
= target_to_face(target
);
731 intelImage
->level
= level
;
732 texImage
->RowStride
= rb
->region
->pitch
;
733 intel_miptree_reference(&intelImage
->mt
, intelObj
->mt
);
735 if (!intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
)) {
736 fprintf(stderr
, "miptree doesn't match image\n");
739 _mesa_unlock_texture(&intel
->ctx
, texObj
);
743 intelSetTexBuffer(__DRIcontext
*pDRICtx
, GLint target
, __DRIdrawable
*dPriv
)
745 /* The old interface didn't have the format argument, so copy our
746 * implementation's behavior at the time.
748 intelSetTexBuffer2(pDRICtx
, target
, __DRI_TEXTURE_FORMAT_RGBA
, dPriv
);
751 #if FEATURE_OES_EGL_image
753 intel_image_target_texture_2d(struct gl_context
*ctx
, GLenum target
,
754 struct gl_texture_object
*texObj
,
755 struct gl_texture_image
*texImage
,
756 GLeglImageOES image_handle
)
758 struct intel_context
*intel
= intel_context(ctx
);
759 struct intel_texture_object
*intelObj
= intel_texture_object(texObj
);
760 struct intel_texture_image
*intelImage
= intel_texture_image(texImage
);
761 struct intel_mipmap_tree
*mt
;
765 screen
= intel
->intelScreen
->driScrnPriv
;
766 image
= screen
->dri2
.image
->lookupEGLImage(screen
, image_handle
,
767 screen
->loaderPrivate
);
771 mt
= intel_miptree_create_for_region(intel
, target
,
772 image
->internal_format
,
773 image
->region
, 1, 0);
777 if (intelImage
->mt
) {
778 intel_miptree_release(intel
, &intelImage
->mt
);
779 assert(!texImage
->Data
);
782 intel_miptree_release(intel
, &intelObj
->mt
);
785 _mesa_init_teximage_fields(&intel
->ctx
, target
, texImage
,
786 image
->region
->width
, image
->region
->height
, 1,
787 0, image
->internal_format
, image
->format
);
789 intelImage
->face
= target_to_face(target
);
790 intelImage
->level
= 0;
791 texImage
->RowStride
= image
->region
->pitch
;
792 intel_miptree_reference(&intelImage
->mt
, intelObj
->mt
);
794 if (!intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
))
795 fprintf(stderr
, "miptree doesn't match image\n");
800 intelInitTextureImageFuncs(struct dd_function_table
*functions
)
802 functions
->TexImage1D
= intelTexImage1D
;
803 functions
->TexImage2D
= intelTexImage2D
;
804 functions
->TexImage3D
= intelTexImage3D
;
805 functions
->GetTexImage
= intelGetTexImage
;
807 functions
->CompressedTexImage2D
= intelCompressedTexImage2D
;
808 functions
->GetCompressedTexImage
= intelGetCompressedTexImage
;
810 #if FEATURE_OES_EGL_image
811 functions
->EGLImageTargetTexture2D
= intel_image_target_texture_2d
;