i965: drop brw->has_llc in favor of devinfo->has_llc
[mesa.git] / src / mesa / drivers / dri / i965 / intel_tex_image.c
1
2 #include "main/macros.h"
3 #include "main/mtypes.h"
4 #include "main/enums.h"
5 #include "main/bufferobj.h"
6 #include "main/context.h"
7 #include "main/formats.h"
8 #include "main/glformats.h"
9 #include "main/image.h"
10 #include "main/pbo.h"
11 #include "main/renderbuffer.h"
12 #include "main/texcompress.h"
13 #include "main/texgetimage.h"
14 #include "main/texobj.h"
15 #include "main/teximage.h"
16 #include "main/texstore.h"
17
18 #include "drivers/common/meta.h"
19
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"
26 #include "intel_image.h"
27 #include "intel_tiled_memcpy.h"
28 #include "brw_context.h"
29
30 #define FILE_DEBUG_FLAG DEBUG_TEXTURE
31
32 /* Make sure one doesn't end up shrinking base level zero unnecessarily.
33 * Determining the base level dimension by shifting higher level dimension
34 * ends up in off-by-one value in case base level has NPOT size (for example,
35 * 293 != 146 << 1).
36 * Choose the original base level dimension when shifted dimensions agree.
37 * Otherwise assume real resize is intended and use the new shifted value.
38 */
39 static unsigned
40 get_base_dim(unsigned old_base_dim, unsigned new_level_dim, unsigned level)
41 {
42 const unsigned old_level_dim = old_base_dim >> level;
43 const unsigned new_base_dim = new_level_dim << level;
44
45 return old_level_dim == new_level_dim ? old_base_dim : new_base_dim;
46 }
47
48 /* Work back from the specified level of the image to the baselevel and create a
49 * miptree of that size.
50 */
51 struct intel_mipmap_tree *
52 intel_miptree_create_for_teximage(struct brw_context *brw,
53 struct intel_texture_object *intelObj,
54 struct intel_texture_image *intelImage,
55 enum intel_miptree_create_flags flags)
56 {
57 GLuint lastLevel;
58 int width, height, depth;
59 unsigned old_width = 0, old_height = 0, old_depth = 0;
60 const struct intel_mipmap_tree *old_mt = intelObj->mt;
61 const unsigned level = intelImage->base.Base.Level;
62
63 intel_get_image_dims(&intelImage->base.Base, &width, &height, &depth);
64
65 if (old_mt) {
66 old_width = old_mt->surf.logical_level0_px.width;
67 old_height = old_mt->surf.logical_level0_px.height;
68 old_depth = old_mt->surf.dim == ISL_SURF_DIM_3D ?
69 old_mt->surf.logical_level0_px.depth :
70 old_mt->surf.logical_level0_px.array_len;
71 }
72
73 DBG("%s\n", __func__);
74
75 /* Figure out image dimensions at start level. */
76 switch(intelObj->base.Target) {
77 case GL_TEXTURE_2D_MULTISAMPLE:
78 case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
79 case GL_TEXTURE_RECTANGLE:
80 case GL_TEXTURE_EXTERNAL_OES:
81 assert(level == 0);
82 break;
83 case GL_TEXTURE_3D:
84 depth = old_mt ? get_base_dim(old_depth, depth, level) :
85 depth << level;
86 /* Fall through */
87 case GL_TEXTURE_2D:
88 case GL_TEXTURE_2D_ARRAY:
89 case GL_TEXTURE_CUBE_MAP:
90 case GL_TEXTURE_CUBE_MAP_ARRAY:
91 height = old_mt ? get_base_dim(old_height, height, level) :
92 height << level;
93 /* Fall through */
94 case GL_TEXTURE_1D:
95 case GL_TEXTURE_1D_ARRAY:
96 width = old_mt ? get_base_dim(old_width, width, level) :
97 width << level;
98 break;
99 default:
100 unreachable("Unexpected target");
101 }
102
103 /* Guess a reasonable value for lastLevel. This is probably going
104 * to be wrong fairly often and might mean that we have to look at
105 * resizable buffers, or require that buffers implement lazy
106 * pagetable arrangements.
107 */
108 if ((intelObj->base.Sampler.MinFilter == GL_NEAREST ||
109 intelObj->base.Sampler.MinFilter == GL_LINEAR) &&
110 intelImage->base.Base.Level == 0 &&
111 !intelObj->base.GenerateMipmap) {
112 lastLevel = 0;
113 } else {
114 lastLevel = _mesa_get_tex_max_num_levels(intelObj->base.Target,
115 width, height, depth) - 1;
116 }
117
118 return intel_miptree_create(brw,
119 intelObj->base.Target,
120 intelImage->base.Base.TexFormat,
121 0,
122 lastLevel,
123 width,
124 height,
125 depth,
126 MAX2(intelImage->base.Base.NumSamples, 1),
127 flags);
128 }
129
130 static void
131 intelTexImage(struct gl_context * ctx,
132 GLuint dims,
133 struct gl_texture_image *texImage,
134 GLenum format, GLenum type, const void *pixels,
135 const struct gl_pixelstore_attrib *unpack)
136 {
137 struct intel_texture_image *intelImage = intel_texture_image(texImage);
138 bool ok;
139
140 bool tex_busy = intelImage->mt && brw_bo_busy(intelImage->mt->bo);
141
142 DBG("%s mesa_format %s target %s format %s type %s level %d %dx%dx%d\n",
143 __func__, _mesa_get_format_name(texImage->TexFormat),
144 _mesa_enum_to_string(texImage->TexObject->Target),
145 _mesa_enum_to_string(format), _mesa_enum_to_string(type),
146 texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
147
148 /* Allocate storage for texture data. */
149 if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage)) {
150 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims);
151 return;
152 }
153
154 assert(intelImage->mt);
155
156 if (intelImage->mt->format == MESA_FORMAT_S_UINT8)
157 intelImage->mt->r8stencil_needs_update = true;
158
159 ok = _mesa_meta_pbo_TexSubImage(ctx, dims, texImage, 0, 0, 0,
160 texImage->Width, texImage->Height,
161 texImage->Depth,
162 format, type, pixels,
163 tex_busy, unpack);
164 if (ok)
165 return;
166
167 ok = intel_texsubimage_tiled_memcpy(ctx, dims, texImage,
168 0, 0, 0, /*x,y,z offsets*/
169 texImage->Width,
170 texImage->Height,
171 texImage->Depth,
172 format, type, pixels, unpack,
173 false /*allocate_storage*/);
174 if (ok)
175 return;
176
177 DBG("%s: upload image %dx%dx%d pixels %p\n",
178 __func__, texImage->Width, texImage->Height, texImage->Depth,
179 pixels);
180
181 _mesa_store_teximage(ctx, dims, texImage,
182 format, type, pixels, unpack);
183 }
184
185
186 static void
187 intel_set_texture_image_mt(struct brw_context *brw,
188 struct gl_texture_image *image,
189 GLenum internal_format,
190 struct intel_mipmap_tree *mt)
191
192 {
193 struct gl_texture_object *texobj = image->TexObject;
194 struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
195 struct intel_texture_image *intel_image = intel_texture_image(image);
196
197 _mesa_init_teximage_fields(&brw->ctx, image,
198 mt->surf.logical_level0_px.width,
199 mt->surf.logical_level0_px.height, 1,
200 0, internal_format, mt->format);
201
202 brw->ctx.Driver.FreeTextureImageBuffer(&brw->ctx, image);
203
204 intel_texobj->needs_validate = true;
205 intel_image->base.RowStride = mt->surf.row_pitch / mt->cpp;
206 assert(mt->surf.row_pitch % mt->cpp == 0);
207
208 intel_miptree_reference(&intel_image->mt, mt);
209
210 /* Immediately validate the image to the object. */
211 intel_miptree_reference(&intel_texobj->mt, mt);
212 }
213
214
215 void
216 intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
217 GLint texture_format,
218 __DRIdrawable *dPriv)
219 {
220 struct gl_framebuffer *fb = dPriv->driverPrivate;
221 struct brw_context *brw = pDRICtx->driverPrivate;
222 struct gl_context *ctx = &brw->ctx;
223 struct intel_renderbuffer *rb;
224 struct gl_texture_object *texObj;
225 struct gl_texture_image *texImage;
226 mesa_format texFormat = MESA_FORMAT_NONE;
227 struct intel_mipmap_tree *mt;
228 GLenum internal_format = 0;
229
230 texObj = _mesa_get_current_tex_object(ctx, target);
231
232 if (!texObj)
233 return;
234
235 if (dPriv->lastStamp != dPriv->dri2.stamp ||
236 !pDRICtx->driScreenPriv->dri2.useInvalidate)
237 intel_update_renderbuffers(pDRICtx, dPriv);
238
239 rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
240 /* If the miptree isn't set, then intel_update_renderbuffers was unable
241 * to get the BO for the drawable from the window system.
242 */
243 if (!rb || !rb->mt)
244 return;
245
246 if (rb->mt->cpp == 4) {
247 if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
248 internal_format = GL_RGB;
249 texFormat = MESA_FORMAT_B8G8R8X8_UNORM;
250 }
251 else {
252 internal_format = GL_RGBA;
253 texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
254 }
255 } else if (rb->mt->cpp == 2) {
256 internal_format = GL_RGB;
257 texFormat = MESA_FORMAT_B5G6R5_UNORM;
258 }
259
260 intel_miptree_make_shareable(brw, rb->mt);
261 mt = intel_miptree_create_for_bo(brw, rb->mt->bo, texFormat, 0,
262 rb->Base.Base.Width,
263 rb->Base.Base.Height,
264 1, rb->mt->surf.row_pitch,
265 MIPTREE_CREATE_DEFAULT);
266 if (mt == NULL)
267 return;
268 mt->target = target;
269
270 _mesa_lock_texture(&brw->ctx, texObj);
271 texImage = _mesa_get_tex_image(ctx, texObj, target, 0);
272 intel_set_texture_image_mt(brw, texImage, internal_format, mt);
273 intel_miptree_release(&mt);
274 _mesa_unlock_texture(&brw->ctx, texObj);
275 }
276
277 static GLboolean
278 intel_bind_renderbuffer_tex_image(struct gl_context *ctx,
279 struct gl_renderbuffer *rb,
280 struct gl_texture_image *image)
281 {
282 struct intel_renderbuffer *irb = intel_renderbuffer(rb);
283 struct intel_texture_image *intel_image = intel_texture_image(image);
284 struct gl_texture_object *texobj = image->TexObject;
285 struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
286
287 /* We can only handle RB allocated with AllocRenderbufferStorage, or
288 * window-system renderbuffers.
289 */
290 assert(!rb->TexImage);
291
292 if (!irb->mt)
293 return false;
294
295 _mesa_lock_texture(ctx, texobj);
296 _mesa_init_teximage_fields(ctx, image,
297 rb->Width, rb->Height, 1,
298 0, rb->InternalFormat, rb->Format);
299 image->NumSamples = rb->NumSamples;
300
301 intel_miptree_reference(&intel_image->mt, irb->mt);
302
303 /* Immediately validate the image to the object. */
304 intel_miptree_reference(&intel_texobj->mt, intel_image->mt);
305
306 intel_texobj->needs_validate = true;
307 _mesa_unlock_texture(ctx, texobj);
308
309 return true;
310 }
311
312 void
313 intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
314 {
315 /* The old interface didn't have the format argument, so copy our
316 * implementation's behavior at the time.
317 */
318 intelSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
319 }
320
321 static void
322 intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
323 struct gl_texture_object *texObj,
324 struct gl_texture_image *texImage,
325 GLeglImageOES image_handle)
326 {
327 struct brw_context *brw = brw_context(ctx);
328 struct intel_mipmap_tree *mt;
329 __DRIscreen *dri_screen = brw->screen->driScrnPriv;
330 __DRIimage *image;
331
332 image = dri_screen->dri2.image->lookupEGLImage(dri_screen, image_handle,
333 dri_screen->loaderPrivate);
334 if (image == NULL)
335 return;
336
337 /* We support external textures only for EGLImages created with
338 * EGL_EXT_image_dma_buf_import. We may lift that restriction in the future.
339 */
340 if (target == GL_TEXTURE_EXTERNAL_OES && !image->dma_buf_imported) {
341 _mesa_error(ctx, GL_INVALID_OPERATION,
342 "glEGLImageTargetTexture2DOES(external target is enabled only "
343 "for images created with EGL_EXT_image_dma_buf_import");
344 return;
345 }
346
347 /* Disallow depth/stencil textures: we don't have a way to pass the
348 * separate stencil miptree of a GL_DEPTH_STENCIL texture through.
349 */
350 if (image->has_depthstencil) {
351 _mesa_error(ctx, GL_INVALID_OPERATION, __func__);
352 return;
353 }
354
355 mt = intel_miptree_create_for_dri_image(brw, image, target,
356 ISL_COLORSPACE_NONE, false);
357 if (mt == NULL)
358 return;
359
360 struct intel_texture_object *intel_texobj = intel_texture_object(texObj);
361 intel_texobj->planar_format = image->planar_format;
362
363 const GLenum internal_format =
364 image->internal_format != 0 ?
365 image->internal_format : _mesa_get_format_base_format(mt->format);
366 intel_set_texture_image_mt(brw, texImage, internal_format, mt);
367 intel_miptree_release(&mt);
368 }
369
370 /**
371 * \brief A fast path for glGetTexImage.
372 *
373 * \see intel_readpixels_tiled_memcpy()
374 */
375 bool
376 intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx,
377 struct gl_texture_image *texImage,
378 GLint xoffset, GLint yoffset,
379 GLsizei width, GLsizei height,
380 GLenum format, GLenum type,
381 GLvoid *pixels,
382 const struct gl_pixelstore_attrib *packing)
383 {
384 struct brw_context *brw = brw_context(ctx);
385 const struct gen_device_info *devinfo = &brw->screen->devinfo;
386 struct intel_texture_image *image = intel_texture_image(texImage);
387 int dst_pitch;
388
389 /* The miptree's buffer. */
390 struct brw_bo *bo;
391
392 uint32_t cpp;
393 mem_copy_fn mem_copy = NULL;
394
395 /* This fastpath is restricted to specific texture types:
396 * a 2D BGRA, RGBA, L8 or A8 texture. It could be generalized to support
397 * more types.
398 *
399 * FINISHME: The restrictions below on packing alignment and packing row
400 * length are likely unneeded now because we calculate the destination stride
401 * with _mesa_image_row_stride. However, before removing the restrictions
402 * we need tests.
403 */
404 if (!devinfo->has_llc ||
405 !(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV) ||
406 !(texImage->TexObject->Target == GL_TEXTURE_2D ||
407 texImage->TexObject->Target == GL_TEXTURE_RECTANGLE) ||
408 pixels == NULL ||
409 _mesa_is_bufferobj(packing->BufferObj) ||
410 packing->Alignment > 4 ||
411 packing->SkipPixels > 0 ||
412 packing->SkipRows > 0 ||
413 (packing->RowLength != 0 && packing->RowLength != width) ||
414 packing->SwapBytes ||
415 packing->LsbFirst ||
416 packing->Invert)
417 return false;
418
419 /* We can't handle copying from RGBX or BGRX because the tiled_memcpy
420 * function doesn't set the last channel to 1. Note this checks BaseFormat
421 * rather than TexFormat in case the RGBX format is being simulated with an
422 * RGBA format.
423 */
424 if (texImage->_BaseFormat == GL_RGB)
425 return false;
426
427 if (!intel_get_memcpy(texImage->TexFormat, format, type, &mem_copy, &cpp))
428 return false;
429
430 /* If this is a nontrivial texture view, let another path handle it instead. */
431 if (texImage->TexObject->MinLayer)
432 return false;
433
434 if (!image->mt ||
435 (image->mt->surf.tiling != ISL_TILING_X &&
436 image->mt->surf.tiling != ISL_TILING_Y0)) {
437 /* The algorithm is written only for X- or Y-tiled memory. */
438 return false;
439 }
440
441 /* tiled_to_linear() assumes that if the object is swizzled, it is using
442 * I915_BIT6_SWIZZLE_9_10 for X and I915_BIT6_SWIZZLE_9 for Y. This is only
443 * true on gen5 and above.
444 *
445 * The killer on top is that some gen4 have an L-shaped swizzle mode, where
446 * parts of the memory aren't swizzled at all. Userspace just can't handle
447 * that.
448 */
449 if (devinfo->gen < 5 && brw->has_swizzling)
450 return false;
451
452 int level = texImage->Level + texImage->TexObject->MinLevel;
453
454 /* Since we are going to write raw data to the miptree, we need to resolve
455 * any pending fast color clears before we start.
456 */
457 assert(image->mt->surf.logical_level0_px.depth == 1);
458 assert(image->mt->surf.logical_level0_px.array_len == 1);
459
460 intel_miptree_access_raw(brw, image->mt, level, 0, true);
461
462 bo = image->mt->bo;
463
464 if (brw_batch_references(&brw->batch, bo)) {
465 perf_debug("Flushing before mapping a referenced bo.\n");
466 intel_batchbuffer_flush(brw);
467 }
468
469 void *map = brw_bo_map(brw, bo, MAP_READ | MAP_RAW);
470 if (map == NULL) {
471 DBG("%s: failed to map bo\n", __func__);
472 return false;
473 }
474
475 dst_pitch = _mesa_image_row_stride(packing, width, format, type);
476
477 DBG("%s: level=%d x,y=(%d,%d) (w,h)=(%d,%d) format=0x%x type=0x%x "
478 "mesa_format=0x%x tiling=%d "
479 "packing=(alignment=%d row_length=%d skip_pixels=%d skip_rows=%d)\n",
480 __func__, texImage->Level, xoffset, yoffset, width, height,
481 format, type, texImage->TexFormat, image->mt->surf.tiling,
482 packing->Alignment, packing->RowLength, packing->SkipPixels,
483 packing->SkipRows);
484
485 /* Adjust x and y offset based on miplevel */
486 unsigned level_x, level_y;
487 intel_miptree_get_image_offset(image->mt, level, 0, &level_x, &level_y);
488 xoffset += level_x;
489 yoffset += level_y;
490
491 tiled_to_linear(
492 xoffset * cpp, (xoffset + width) * cpp,
493 yoffset, yoffset + height,
494 pixels - (ptrdiff_t) yoffset * dst_pitch - (ptrdiff_t) xoffset * cpp,
495 map,
496 dst_pitch, image->mt->surf.row_pitch,
497 brw->has_swizzling,
498 image->mt->surf.tiling,
499 mem_copy
500 );
501
502 brw_bo_unmap(bo);
503 return true;
504 }
505
506 static void
507 intel_get_tex_sub_image(struct gl_context *ctx,
508 GLint xoffset, GLint yoffset, GLint zoffset,
509 GLsizei width, GLsizei height, GLint depth,
510 GLenum format, GLenum type, GLvoid *pixels,
511 struct gl_texture_image *texImage)
512 {
513 struct brw_context *brw = brw_context(ctx);
514 bool ok;
515
516 DBG("%s\n", __func__);
517
518 if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
519 if (_mesa_meta_pbo_GetTexSubImage(ctx, 3, texImage,
520 xoffset, yoffset, zoffset,
521 width, height, depth, format, type,
522 pixels, &ctx->Pack)) {
523 /* Flush to guarantee coherency between the render cache and other
524 * caches the PBO could potentially be bound to after this point.
525 * See the related comment in intelReadPixels() for a more detailed
526 * explanation.
527 */
528 brw_emit_mi_flush(brw);
529 return;
530 }
531
532 perf_debug("%s: fallback to CPU mapping in PBO case\n", __func__);
533 }
534
535 ok = intel_gettexsubimage_tiled_memcpy(ctx, texImage, xoffset, yoffset,
536 width, height,
537 format, type, pixels, &ctx->Pack);
538
539 if(ok)
540 return;
541
542 _mesa_meta_GetTexSubImage(ctx, xoffset, yoffset, zoffset,
543 width, height, depth,
544 format, type, pixels, texImage);
545
546 DBG("%s - DONE\n", __func__);
547 }
548
549 static void
550 flush_astc_denorms(struct gl_context *ctx, GLuint dims,
551 struct gl_texture_image *texImage,
552 GLint xoffset, GLint yoffset, GLint zoffset,
553 GLsizei width, GLsizei height, GLsizei depth)
554 {
555 struct compressed_pixelstore store;
556 _mesa_compute_compressed_pixelstore(dims, texImage->TexFormat,
557 width, height, depth,
558 &ctx->Unpack, &store);
559
560 for (int slice = 0; slice < store.CopySlices; slice++) {
561
562 /* Map dest texture buffer */
563 GLubyte *dstMap;
564 GLint dstRowStride;
565 ctx->Driver.MapTextureImage(ctx, texImage, slice + zoffset,
566 xoffset, yoffset, width, height,
567 GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
568 &dstMap, &dstRowStride);
569 if (!dstMap)
570 continue;
571
572 for (int i = 0; i < store.CopyRowsPerSlice; i++) {
573
574 /* An ASTC block is stored in little endian mode. The byte that
575 * contains bits 0..7 is stored at the lower address in memory.
576 */
577 struct astc_void_extent {
578 uint16_t header : 12;
579 uint16_t dontcare[3];
580 uint16_t R;
581 uint16_t G;
582 uint16_t B;
583 uint16_t A;
584 } *blocks = (struct astc_void_extent*) dstMap;
585
586 /* Iterate over every copied block in the row */
587 for (int j = 0; j < store.CopyBytesPerRow / 16; j++) {
588
589 /* Check if the header matches that of an LDR void-extent block */
590 if (blocks[j].header == 0xDFC) {
591
592 /* Flush UNORM16 values that would be denormalized */
593 if (blocks[j].A < 4) blocks[j].A = 0;
594 if (blocks[j].B < 4) blocks[j].B = 0;
595 if (blocks[j].G < 4) blocks[j].G = 0;
596 if (blocks[j].R < 4) blocks[j].R = 0;
597 }
598 }
599
600 dstMap += dstRowStride;
601 }
602
603 ctx->Driver.UnmapTextureImage(ctx, texImage, slice + zoffset);
604 }
605 }
606
607
608 static void
609 intelCompressedTexSubImage(struct gl_context *ctx, GLuint dims,
610 struct gl_texture_image *texImage,
611 GLint xoffset, GLint yoffset, GLint zoffset,
612 GLsizei width, GLsizei height, GLsizei depth,
613 GLenum format,
614 GLsizei imageSize, const GLvoid *data)
615 {
616 /* Upload the compressed data blocks */
617 _mesa_store_compressed_texsubimage(ctx, dims, texImage,
618 xoffset, yoffset, zoffset,
619 width, height, depth,
620 format, imageSize, data);
621
622 /* Fix up copied ASTC blocks if necessary */
623 GLenum gl_format = _mesa_compressed_format_to_glenum(ctx,
624 texImage->TexFormat);
625 bool is_linear_astc = _mesa_is_astc_format(gl_format) &&
626 !_mesa_is_srgb_format(gl_format);
627 struct brw_context *brw = (struct brw_context*) ctx;
628 const struct gen_device_info *devinfo = &brw->screen->devinfo;
629 if (devinfo->gen == 9 && is_linear_astc)
630 flush_astc_denorms(ctx, dims, texImage,
631 xoffset, yoffset, zoffset,
632 width, height, depth);
633 }
634
635 void
636 intelInitTextureImageFuncs(struct dd_function_table *functions)
637 {
638 functions->TexImage = intelTexImage;
639 functions->CompressedTexSubImage = intelCompressedTexSubImage;
640 functions->EGLImageTargetTexture2D = intel_image_target_texture_2d;
641 functions->BindRenderbufferTexImage = intel_bind_renderbuffer_tex_image;
642 functions->GetTexSubImage = intel_get_tex_sub_image;
643 }