5 #include "main/glheader.h"
6 #include "main/macros.h"
7 #include "main/mtypes.h"
8 #include "main/enums.h"
9 #include "main/colortab.h"
10 #include "main/convolve.h"
11 #include "main/context.h"
12 #include "main/simple_list.h"
13 #include "main/texcompress.h"
14 #include "main/texformat.h"
15 #include "main/texobj.h"
16 #include "main/texstore.h"
17 #include "main/teximage.h"
19 #include "intel_context.h"
20 #include "intel_mipmap_tree.h"
21 #include "intel_buffer_objects.h"
22 #include "intel_batchbuffer.h"
23 #include "intel_tex.h"
24 #include "intel_blit.h"
25 #include "intel_fbo.h"
27 #define FILE_DEBUG_FLAG DEBUG_TEXTURE
29 /* Functions to store texture images. Where possible, mipmap_tree's
30 * will be created or further instantiated with image data, otherwise
31 * images will be stored in malloc'd memory. A validation step is
32 * required to pull those images into a mipmap tree, or otherwise
33 * decide a fallback is required.
52 /* Otherwise, store it in memory if (Border != 0) or (any dimension ==
55 * Otherwise, if max_level >= level >= min_level, create tree with
56 * space for textures from min_level down to max_level.
58 * Otherwise, create tree with space for textures from (level
59 * 0)..(1x1). Consider pruning this tree at a validation if the
63 guess_and_alloc_mipmap_tree(struct intel_context
*intel
,
64 struct intel_texture_object
*intelObj
,
65 struct intel_texture_image
*intelImage
,
66 GLboolean expect_accelerated_upload
)
70 GLuint width
= intelImage
->base
.Width
;
71 GLuint height
= intelImage
->base
.Height
;
72 GLuint depth
= intelImage
->base
.Depth
;
73 GLuint l2width
, l2height
, l2depth
;
74 GLuint i
, comp_byte
= 0;
76 DBG("%s\n", __FUNCTION__
);
78 if (intelImage
->base
.Border
||
79 ((intelImage
->base
._BaseFormat
== GL_DEPTH_COMPONENT
) &&
80 ((intelObj
->base
.WrapS
== GL_CLAMP_TO_BORDER
) ||
81 (intelObj
->base
.WrapT
== GL_CLAMP_TO_BORDER
))))
84 if (intelImage
->level
> intelObj
->base
.BaseLevel
&&
85 (intelImage
->base
.Width
== 1 ||
86 (intelObj
->base
.Target
!= GL_TEXTURE_1D
&&
87 intelImage
->base
.Height
== 1) ||
88 (intelObj
->base
.Target
== GL_TEXTURE_3D
&&
89 intelImage
->base
.Depth
== 1)))
92 /* If this image disrespects BaseLevel, allocate from level zero.
93 * Usually BaseLevel == 0, so it's unlikely to happen.
95 if (intelImage
->level
< intelObj
->base
.BaseLevel
)
98 firstLevel
= intelObj
->base
.BaseLevel
;
101 /* Figure out image dimensions at start level.
103 for (i
= intelImage
->level
; i
> firstLevel
; i
--) {
111 /* Guess a reasonable value for lastLevel. This is probably going
112 * to be wrong fairly often and might mean that we have to look at
113 * resizable buffers, or require that buffers implement lazy
114 * pagetable arrangements.
116 if ((intelObj
->base
.MinFilter
== GL_NEAREST
||
117 intelObj
->base
.MinFilter
== GL_LINEAR
) &&
118 intelImage
->level
== firstLevel
) {
119 lastLevel
= firstLevel
;
122 l2width
= logbase2(width
);
123 l2height
= logbase2(height
);
124 l2depth
= logbase2(depth
);
125 lastLevel
= firstLevel
+ MAX2(MAX2(l2width
, l2height
), l2depth
);
128 assert(!intelObj
->mt
);
129 if (intelImage
->base
.IsCompressed
)
130 comp_byte
= intel_compressed_num_bytes(intelImage
->base
.TexFormat
->MesaFormat
);
131 intelObj
->mt
= intel_miptree_create(intel
,
132 intelObj
->base
.Target
,
133 intelImage
->base
.InternalFormat
,
139 intelImage
->base
.TexFormat
->TexelBytes
,
141 expect_accelerated_upload
);
143 DBG("%s - success\n", __FUNCTION__
);
150 target_to_face(GLenum target
)
153 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
:
154 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB
:
155 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB
:
156 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
:
157 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB
:
158 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
:
159 return ((GLuint
) target
- (GLuint
) GL_TEXTURE_CUBE_MAP_POSITIVE_X
);
165 /* There are actually quite a few combinations this will work for,
166 * more than what I've listed here.
169 check_pbo_format(GLint internalFormat
,
170 GLenum format
, GLenum type
,
171 const struct gl_texture_format
*mesa_format
)
173 switch (internalFormat
) {
176 return (format
== GL_BGRA
&&
177 (type
== GL_UNSIGNED_BYTE
||
178 type
== GL_UNSIGNED_INT_8_8_8_8_REV
) &&
179 mesa_format
== &_mesa_texformat_argb8888
);
182 return (format
== GL_RGB
&&
183 type
== GL_UNSIGNED_SHORT_5_6_5
&&
184 mesa_format
== &_mesa_texformat_rgb565
);
186 return (type
== GL_UNSIGNED_SHORT_8_8_MESA
|| type
== GL_UNSIGNED_BYTE
);
193 /* XXX: Do this for TexSubImage also:
196 try_pbo_upload(struct intel_context
*intel
,
197 struct intel_texture_image
*intelImage
,
198 const struct gl_pixelstore_attrib
*unpack
,
199 GLint internalFormat
,
200 GLint width
, GLint height
,
201 GLenum format
, GLenum type
, const void *pixels
)
203 struct intel_buffer_object
*pbo
= intel_buffer_object(unpack
->BufferObj
);
204 GLuint src_offset
, src_stride
;
205 GLuint dst_offset
, dst_stride
;
208 intel
->ctx
._ImageTransferState
||
209 unpack
->SkipPixels
|| unpack
->SkipRows
) {
210 _mesa_printf("%s: failure 1\n", __FUNCTION__
);
214 /* note: potential 64-bit ptr to 32-bit int cast */
215 src_offset
= (GLuint
) (unsigned long) pixels
;
217 if (unpack
->RowLength
> 0)
218 src_stride
= unpack
->RowLength
;
222 dst_offset
= intel_miptree_image_offset(intelImage
->mt
,
226 dst_stride
= intelImage
->mt
->pitch
;
228 intelFlush(&intel
->ctx
);
229 LOCK_HARDWARE(intel
);
231 dri_bo
*src_buffer
= intel_bufferobj_buffer(intel
, pbo
, INTEL_READ
);
232 dri_bo
*dst_buffer
= intel_region_buffer(intel
,
233 intelImage
->mt
->region
,
237 intelEmitCopyBlit(intel
,
239 src_stride
, src_buffer
, src_offset
, GL_FALSE
,
240 dst_stride
, dst_buffer
, dst_offset
, GL_FALSE
,
241 0, 0, 0, 0, width
, height
,
244 UNLOCK_HARDWARE(intel
);
252 try_pbo_zcopy(struct intel_context
*intel
,
253 struct intel_texture_image
*intelImage
,
254 const struct gl_pixelstore_attrib
*unpack
,
255 GLint internalFormat
,
256 GLint width
, GLint height
,
257 GLenum format
, GLenum type
, const void *pixels
)
259 struct intel_buffer_object
*pbo
= intel_buffer_object(unpack
->BufferObj
);
260 GLuint src_offset
, src_stride
;
261 GLuint dst_offset
, dst_stride
;
264 intel
->ctx
._ImageTransferState
||
265 unpack
->SkipPixels
|| unpack
->SkipRows
) {
266 _mesa_printf("%s: failure 1\n", __FUNCTION__
);
270 /* note: potential 64-bit ptr to 32-bit int cast */
271 src_offset
= (GLuint
) (unsigned long) pixels
;
273 if (unpack
->RowLength
> 0)
274 src_stride
= unpack
->RowLength
;
278 dst_offset
= intel_miptree_image_offset(intelImage
->mt
,
282 dst_stride
= intelImage
->mt
->pitch
;
284 if (src_stride
!= dst_stride
|| dst_offset
!= 0 || src_offset
!= 0) {
285 _mesa_printf("%s: failure 2\n", __FUNCTION__
);
289 intel_region_attach_pbo(intel
, intelImage
->mt
->region
, pbo
);
300 intelTexImage(GLcontext
* ctx
,
302 GLenum target
, GLint level
,
303 GLint internalFormat
,
304 GLint width
, GLint height
, GLint depth
,
306 GLenum format
, GLenum type
, const void *pixels
,
307 const struct gl_pixelstore_attrib
*unpack
,
308 struct gl_texture_object
*texObj
,
309 struct gl_texture_image
*texImage
, GLsizei imageSize
, int compressed
)
311 struct intel_context
*intel
= intel_context(ctx
);
312 struct intel_texture_object
*intelObj
= intel_texture_object(texObj
);
313 struct intel_texture_image
*intelImage
= intel_texture_image(texImage
);
314 GLint postConvWidth
= width
;
315 GLint postConvHeight
= height
;
316 GLint texelBytes
, sizeInBytes
;
317 GLuint dstRowStride
, srcRowStride
= texImage
->RowStride
;
320 DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__
,
321 _mesa_lookup_enum_by_nr(target
), level
, width
, height
, depth
, border
);
325 intelImage
->face
= target_to_face(target
);
326 intelImage
->level
= level
;
328 if (ctx
->_ImageTransferState
& IMAGE_CONVOLUTION_BIT
) {
329 _mesa_adjust_image_for_convolution(ctx
, dims
, &postConvWidth
,
333 /* choose the texture format */
334 texImage
->TexFormat
= intelChooseTextureFormat(ctx
, internalFormat
,
337 _mesa_set_fetch_functions(texImage
, dims
);
339 if (texImage
->TexFormat
->TexelBytes
== 0) {
340 /* must be a compressed format */
342 texImage
->IsCompressed
= GL_TRUE
;
343 texImage
->CompressedSize
=
344 ctx
->Driver
.CompressedTextureSize(ctx
, texImage
->Width
,
345 texImage
->Height
, texImage
->Depth
,
346 texImage
->TexFormat
->MesaFormat
);
348 texelBytes
= texImage
->TexFormat
->TexelBytes
;
350 /* Minimum pitch of 32 bytes */
351 if (postConvWidth
* texelBytes
< 32) {
352 postConvWidth
= 32 / texelBytes
;
353 texImage
->RowStride
= postConvWidth
;
356 if (!intelImage
->mt
) {
357 assert(texImage
->RowStride
== postConvWidth
);
361 /* Release the reference to a potentially orphaned buffer.
362 * Release any old malloced memory.
364 if (intelImage
->mt
) {
365 intel_miptree_release(intel
, &intelImage
->mt
);
366 assert(!texImage
->Data
);
368 else if (texImage
->Data
) {
369 _mesa_free_texmemory(texImage
->Data
);
370 texImage
->Data
= NULL
;
373 /* If this is the only texture image in the tree, could call
374 * bmBufferData with NULL data to free the old block and avoid
375 * waiting on any outstanding fences.
378 intelObj
->mt
->first_level
== level
&&
379 intelObj
->mt
->last_level
== level
&&
380 intelObj
->mt
->target
!= GL_TEXTURE_CUBE_MAP_ARB
&&
381 !intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
,
382 intelImage
->face
, intelImage
->level
)) {
385 intel_miptree_release(intel
, &intelObj
->mt
);
386 assert(!intelObj
->mt
);
390 guess_and_alloc_mipmap_tree(intel
, intelObj
, intelImage
, pixels
== NULL
);
392 DBG("guess_and_alloc_mipmap_tree: failed\n");
396 assert(!intelImage
->mt
);
399 intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
,
400 intelImage
->face
, intelImage
->level
)) {
402 intel_miptree_reference(&intelImage
->mt
, intelObj
->mt
);
403 assert(intelImage
->mt
);
404 } else if (intelImage
->base
.Border
== 0) {
407 if (intelImage
->base
.IsCompressed
) {
409 intel_compressed_num_bytes(intelImage
->base
.TexFormat
->MesaFormat
);
412 /* Didn't fit in the object miptree, but it's suitable for inclusion in
413 * a miptree, so create one just for our level and store it in the image.
414 * It'll get moved into the object miptree at validate time.
416 intelImage
->mt
= intel_miptree_create(intel
, target
, internalFormat
,
418 width
, height
, depth
,
419 intelImage
->base
.TexFormat
->TexelBytes
,
420 comp_byte
, pixels
== NULL
);
428 intel_buffer_object(unpack
->BufferObj
) &&
429 check_pbo_format(internalFormat
, format
,
430 type
, intelImage
->base
.TexFormat
)) {
432 DBG("trying pbo upload\n");
434 /* Attempt to texture directly from PBO data (zero copy upload).
436 * Currently disable as it can lead to worse as well as better
437 * performance (in particular when intel_region_cow() is
440 if (intelObj
->mt
== intelImage
->mt
&&
441 intelObj
->mt
->first_level
== level
&&
442 intelObj
->mt
->last_level
== level
) {
444 if (try_pbo_zcopy(intel
, intelImage
, unpack
,
446 width
, height
, format
, type
, pixels
)) {
448 DBG("pbo zcopy upload succeeded\n");
454 /* Otherwise, attempt to use the blitter for PBO image uploads.
456 if (try_pbo_upload(intel
, intelImage
, unpack
,
458 width
, height
, format
, type
, pixels
)) {
459 DBG("pbo upload succeeded\n");
463 DBG("pbo upload failed\n");
468 /* intelCopyTexImage calls this function with pixels == NULL, with
469 * the expectation that the mipmap tree will be set up but nothing
470 * more will be done. This is where those calls return:
473 pixels
= _mesa_validate_pbo_compressed_teximage(ctx
, imageSize
, pixels
,
475 "glCompressedTexImage");
477 pixels
= _mesa_validate_pbo_teximage(ctx
, dims
, width
, height
, 1,
479 pixels
, unpack
, "glTexImage");
482 LOCK_HARDWARE(intel
);
484 if (intelImage
->mt
) {
485 texImage
->Data
= intel_miptree_image_map(intel
,
490 intelImage
->base
.ImageOffsets
);
491 texImage
->RowStride
= dstRowStride
/ intelImage
->mt
->cpp
;
494 /* Allocate regular memory and store the image there temporarily. */
495 if (texImage
->IsCompressed
) {
496 sizeInBytes
= texImage
->CompressedSize
;
498 _mesa_compressed_row_stride(texImage
->TexFormat
->MesaFormat
, width
);
502 dstRowStride
= postConvWidth
* texelBytes
;
503 sizeInBytes
= depth
* dstRowStride
* postConvHeight
;
506 texImage
->Data
= _mesa_alloc_texmemory(sizeInBytes
);
509 DBG("Upload image %dx%dx%d row_len %d "
511 width
, height
, depth
, width
* texelBytes
, dstRowStride
);
513 /* Copy data. Would like to know when it's ok for us to eg. use
514 * the blitter to copy. Or, use the hardware to do the format
515 * conversion and copy:
519 if (intelImage
->mt
) {
520 struct intel_region
*dst
= intelImage
->mt
->region
;
521 _mesa_copy_rect(texImage
->Data
, dst
->cpp
, dst
->pitch
,
523 intelImage
->mt
->level
[level
].width
,
524 intelImage
->mt
->level
[level
].height
/4,
529 memcpy(texImage
->Data
, pixels
, imageSize
);
530 } else if (!texImage
->TexFormat
->StoreImage(ctx
, dims
,
531 texImage
->_BaseFormat
,
533 texImage
->Data
, 0, 0, 0, /* dstX/Y/Zoffset */
535 texImage
->ImageOffsets
,
536 width
, height
, depth
,
537 format
, type
, pixels
, unpack
)) {
538 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glTexImage");
542 /* GL_SGIS_generate_mipmap */
543 if (level
== texObj
->BaseLevel
&& texObj
->GenerateMipmap
) {
544 intel_generate_mipmap(ctx
, target
, texObj
);
547 _mesa_unmap_teximage_pbo(ctx
, unpack
);
549 if (intelImage
->mt
) {
550 intel_miptree_image_unmap(intel
, intelImage
->mt
);
551 texImage
->Data
= NULL
;
554 UNLOCK_HARDWARE(intel
);
558 intelTexImage3D(GLcontext
* ctx
,
559 GLenum target
, GLint level
,
560 GLint internalFormat
,
561 GLint width
, GLint height
, GLint depth
,
563 GLenum format
, GLenum type
, const void *pixels
,
564 const struct gl_pixelstore_attrib
*unpack
,
565 struct gl_texture_object
*texObj
,
566 struct gl_texture_image
*texImage
)
568 intelTexImage(ctx
, 3, target
, level
,
569 internalFormat
, width
, height
, depth
, border
,
570 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, 0);
575 intelTexImage2D(GLcontext
* ctx
,
576 GLenum target
, GLint level
,
577 GLint internalFormat
,
578 GLint width
, GLint height
, GLint border
,
579 GLenum format
, GLenum type
, const void *pixels
,
580 const struct gl_pixelstore_attrib
*unpack
,
581 struct gl_texture_object
*texObj
,
582 struct gl_texture_image
*texImage
)
584 intelTexImage(ctx
, 2, target
, level
,
585 internalFormat
, width
, height
, 1, border
,
586 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, 0);
590 intelTexImage1D(GLcontext
* ctx
,
591 GLenum target
, GLint level
,
592 GLint internalFormat
,
593 GLint width
, GLint border
,
594 GLenum format
, GLenum type
, const void *pixels
,
595 const struct gl_pixelstore_attrib
*unpack
,
596 struct gl_texture_object
*texObj
,
597 struct gl_texture_image
*texImage
)
599 intelTexImage(ctx
, 1, target
, level
,
600 internalFormat
, width
, 1, 1, border
,
601 format
, type
, pixels
, unpack
, texObj
, texImage
, 0, 0);
604 void intelCompressedTexImage2D( GLcontext
*ctx
, GLenum target
, GLint level
,
605 GLint internalFormat
,
606 GLint width
, GLint height
, GLint border
,
607 GLsizei imageSize
, const GLvoid
*data
,
608 struct gl_texture_object
*texObj
,
609 struct gl_texture_image
*texImage
)
611 intelTexImage(ctx
, 2, target
, level
,
612 internalFormat
, width
, height
, 1, border
,
613 0, 0, data
, &ctx
->Unpack
, texObj
, texImage
, imageSize
, 1);
617 * Need to map texture image into memory before copying image data,
621 intel_get_tex_image(GLcontext
* ctx
, GLenum target
, GLint level
,
622 GLenum format
, GLenum type
, GLvoid
* pixels
,
623 struct gl_texture_object
*texObj
,
624 struct gl_texture_image
*texImage
, int compressed
)
626 struct intel_context
*intel
= intel_context(ctx
);
627 struct intel_texture_image
*intelImage
= intel_texture_image(texImage
);
630 if (intelImage
->mt
) {
631 /* Image is stored in hardware format in a buffer managed by the
632 * kernel. Need to explicitly map and unmap it.
634 intelImage
->base
.Data
=
635 intel_miptree_image_map(intel
,
639 &intelImage
->base
.RowStride
,
640 intelImage
->base
.ImageOffsets
);
641 intelImage
->base
.RowStride
/= intelImage
->mt
->cpp
;
644 /* Otherwise, the image should actually be stored in
645 * intelImage->base.Data. This is pretty confusing for
646 * everybody, I'd much prefer to separate the two functions of
647 * texImage->Data - storage for texture images in main memory
648 * and access (ie mappings) of images. In other words, we'd
649 * create a new texImage->Map field and leave Data simply for
652 assert(intelImage
->base
.Data
);
657 _mesa_get_compressed_teximage(ctx
, target
, level
, pixels
,
660 _mesa_get_teximage(ctx
, target
, level
, format
, type
, pixels
,
666 if (intelImage
->mt
) {
667 intel_miptree_image_unmap(intel
, intelImage
->mt
);
668 intelImage
->base
.Data
= NULL
;
673 intelGetTexImage(GLcontext
* ctx
, GLenum target
, GLint level
,
674 GLenum format
, GLenum type
, GLvoid
* pixels
,
675 struct gl_texture_object
*texObj
,
676 struct gl_texture_image
*texImage
)
678 intel_get_tex_image(ctx
, target
, level
, format
, type
, pixels
,
679 texObj
, texImage
, 0);
685 intelGetCompressedTexImage(GLcontext
*ctx
, GLenum target
, GLint level
,
687 struct gl_texture_object
*texObj
,
688 struct gl_texture_image
*texImage
)
690 intel_get_tex_image(ctx
, target
, level
, 0, 0, pixels
,
691 texObj
, texImage
, 1);
695 intelSetTexOffset(__DRIcontext
*pDRICtx
, GLint texname
,
696 unsigned long long offset
, GLint depth
, GLuint pitch
)
698 struct intel_context
*intel
= pDRICtx
->driverPrivate
;
699 struct gl_texture_object
*tObj
= _mesa_lookup_texture(&intel
->ctx
, texname
);
700 struct intel_texture_object
*intelObj
= intel_texture_object(tObj
);
706 intel_miptree_release(intel
, &intelObj
->mt
);
708 intelObj
->imageOverride
= GL_TRUE
;
709 intelObj
->depthOverride
= depth
;
710 intelObj
->pitchOverride
= pitch
;
713 intelObj
->textureOffset
= offset
;
717 intelSetTexBuffer2(__DRIcontext
*pDRICtx
, GLint target
,
718 GLint glx_texture_format
,
719 __DRIdrawable
*dPriv
)
721 struct intel_framebuffer
*intel_fb
= dPriv
->driverPrivate
;
722 struct intel_context
*intel
= pDRICtx
->driverPrivate
;
723 struct intel_texture_object
*intelObj
;
724 struct intel_texture_image
*intelImage
;
725 struct intel_mipmap_tree
*mt
;
726 struct intel_renderbuffer
*rb
;
727 struct gl_texture_unit
*texUnit
;
728 struct gl_texture_object
*texObj
;
729 struct gl_texture_image
*texImage
;
730 int level
= 0, type
, format
, internalFormat
;
732 texUnit
= &intel
->ctx
.Texture
.Unit
[intel
->ctx
.Texture
.CurrentUnit
];
733 texObj
= _mesa_select_tex_object(&intel
->ctx
, texUnit
, target
);
734 intelObj
= intel_texture_object(texObj
);
739 intel_update_renderbuffers(pDRICtx
, dPriv
);
741 rb
= intel_fb
->color_rb
[0];
742 /* If the region isn't set, then intel_update_renderbuffers was unable
743 * to get the buffers for the drawable.
745 if (rb
->region
== NULL
)
749 format
= GL_UNSIGNED_BYTE
;
750 if (glx_texture_format
== GLX_TEXTURE_FORMAT_RGB_EXT
)
751 internalFormat
= GL_RGB
;
753 internalFormat
= GL_RGBA
;
755 mt
= intel_miptree_create_for_region(intel
, target
,
757 0, 0, rb
->region
, 1, 0);
761 _mesa_lock_texture(&intel
->ctx
, texObj
);
763 texImage
= _mesa_get_tex_image(&intel
->ctx
, texObj
, target
, level
);
764 intelImage
= intel_texture_image(texImage
);
766 if (intelImage
->mt
) {
767 intel_miptree_release(intel
, &intelImage
->mt
);
768 assert(!texImage
->Data
);
771 intel_miptree_release(intel
, &intelObj
->mt
);
774 _mesa_init_teximage_fields(&intel
->ctx
, target
, texImage
,
775 rb
->region
->width
, rb
->region
->height
, 1,
778 intelImage
->face
= target_to_face(target
);
779 intelImage
->level
= level
;
780 texImage
->TexFormat
= intelChooseTextureFormat(&intel
->ctx
, internalFormat
,
782 _mesa_set_fetch_functions(texImage
, 2);
783 texImage
->RowStride
= rb
->region
->pitch
;
784 intel_miptree_reference(&intelImage
->mt
, intelObj
->mt
);
786 if (!intel_miptree_match_image(intelObj
->mt
, &intelImage
->base
,
787 intelImage
->face
, intelImage
->level
)) {
788 fprintf(stderr
, "miptree doesn't match image\n");
791 _mesa_unlock_texture(&intel
->ctx
, texObj
);
795 intelSetTexBuffer(__DRIcontext
*pDRICtx
, GLint target
, __DRIdrawable
*dPriv
)
797 /* The old interface didn't have the format argument, so copy our
798 * implementation's behavior at the time.
800 intelSetTexBuffer2(pDRICtx
, target
, GLX_TEXTURE_FORMAT_RGBA_EXT
, dPriv
);