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