1 /**************************************************************************
3 * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 #include "main/imports.h"
30 #include "main/macros.h"
31 #include "main/mtypes.h"
32 #include "main/fbobject.h"
33 #include "main/framebuffer.h"
34 #include "main/renderbuffer.h"
35 #include "main/context.h"
36 #include "main/texrender.h"
37 #include "drivers/common/meta.h"
39 #include "intel_context.h"
40 #include "intel_batchbuffer.h"
41 #include "intel_buffers.h"
42 #include "intel_fbo.h"
43 #include "intel_mipmap_tree.h"
44 #include "intel_regions.h"
46 #define FILE_DEBUG_FLAG DEBUG_FBO
50 * Create a new framebuffer object.
52 static struct gl_framebuffer
*
53 intel_new_framebuffer(struct gl_context
* ctx
, GLuint name
)
55 /* Only drawable state in intel_framebuffer at this time, just use Mesa's
58 return _mesa_new_framebuffer(ctx
, name
);
62 /** Called by gl_renderbuffer::Delete() */
64 intel_delete_renderbuffer(struct gl_renderbuffer
*rb
)
66 GET_CURRENT_CONTEXT(ctx
);
67 struct intel_context
*intel
= intel_context(ctx
);
68 struct intel_renderbuffer
*irb
= intel_renderbuffer(rb
);
72 if (intel
&& irb
->region
) {
73 intel_region_release(&irb
->region
);
81 * Return a pointer to a specific pixel in a renderbuffer.
84 intel_get_pointer(struct gl_context
* ctx
, struct gl_renderbuffer
*rb
,
87 /* By returning NULL we force all software rendering to go through
95 * Called via glRenderbufferStorageEXT() to set the format and allocate
96 * storage for a user-created renderbuffer.
99 intel_alloc_renderbuffer_storage(struct gl_context
* ctx
, struct gl_renderbuffer
*rb
,
100 GLenum internalFormat
,
101 GLuint width
, GLuint height
)
103 struct intel_context
*intel
= intel_context(ctx
);
104 struct intel_renderbuffer
*irb
= intel_renderbuffer(rb
);
107 ASSERT(rb
->Name
!= 0);
109 switch (internalFormat
) {
112 rb
->Format
= MESA_FORMAT_R8
;
113 rb
->DataType
= GL_UNSIGNED_BYTE
;
116 rb
->Format
= MESA_FORMAT_R16
;
117 rb
->DataType
= GL_UNSIGNED_SHORT
;
121 rb
->Format
= MESA_FORMAT_RG88
;
122 rb
->DataType
= GL_UNSIGNED_BYTE
;
125 rb
->Format
= MESA_FORMAT_RG1616
;
126 rb
->DataType
= GL_UNSIGNED_SHORT
;
131 rb
->Format
= MESA_FORMAT_RGB565
;
132 rb
->DataType
= GL_UNSIGNED_BYTE
;
139 rb
->Format
= MESA_FORMAT_XRGB8888
;
140 rb
->DataType
= GL_UNSIGNED_BYTE
;
150 rb
->Format
= MESA_FORMAT_ARGB8888
;
151 rb
->DataType
= GL_UNSIGNED_BYTE
;
155 rb
->Format
= MESA_FORMAT_A8
;
156 rb
->DataType
= GL_UNSIGNED_BYTE
;
158 case GL_DEPTH_COMPONENT16
:
159 rb
->Format
= MESA_FORMAT_Z16
;
160 rb
->DataType
= GL_UNSIGNED_SHORT
;
162 case GL_STENCIL_INDEX
:
163 case GL_STENCIL_INDEX1_EXT
:
164 case GL_STENCIL_INDEX4_EXT
:
165 case GL_STENCIL_INDEX8_EXT
:
166 case GL_STENCIL_INDEX16_EXT
:
167 case GL_DEPTH_COMPONENT
:
168 case GL_DEPTH_COMPONENT24
:
169 case GL_DEPTH_COMPONENT32
:
170 case GL_DEPTH_STENCIL_EXT
:
171 case GL_DEPTH24_STENCIL8_EXT
:
172 /* alloc a depth+stencil buffer */
173 rb
->Format
= MESA_FORMAT_S8_Z24
;
174 rb
->DataType
= GL_UNSIGNED_INT_24_8_EXT
;
178 "Unexpected format in intel_alloc_renderbuffer_storage");
182 rb
->_BaseFormat
= _mesa_base_fbo_format(ctx
, internalFormat
);
183 cpp
= _mesa_get_format_bytes(rb
->Format
);
187 /* free old region */
189 intel_region_release(&irb
->region
);
192 /* allocate new memory region/renderbuffer */
194 /* alloc hardware renderbuffer */
195 DBG("Allocating %d x %d Intel RBO\n", width
, height
);
197 tiling
= I915_TILING_NONE
;
199 /* Gen6 requires depth must be tiling */
200 if (intel
->gen
>= 6 && rb
->Format
== MESA_FORMAT_S8_Z24
)
201 tiling
= I915_TILING_Y
;
203 irb
->region
= intel_region_alloc(intel
->intelScreen
, tiling
, cpp
,
204 width
, height
, GL_TRUE
);
206 return GL_FALSE
; /* out of memory? */
208 ASSERT(irb
->region
->buffer
);
217 #if FEATURE_OES_EGL_image
219 intel_image_target_renderbuffer_storage(struct gl_context
*ctx
,
220 struct gl_renderbuffer
*rb
,
223 struct intel_context
*intel
= intel_context(ctx
);
224 struct intel_renderbuffer
*irb
;
228 screen
= intel
->intelScreen
->driScrnPriv
;
229 image
= screen
->dri2
.image
->lookupEGLImage(screen
, image_handle
,
230 screen
->loaderPrivate
);
234 irb
= intel_renderbuffer(rb
);
236 intel_region_release(&irb
->region
);
237 intel_region_reference(&irb
->region
, image
->region
);
239 rb
->InternalFormat
= image
->internal_format
;
240 rb
->Width
= image
->region
->width
;
241 rb
->Height
= image
->region
->height
;
242 rb
->Format
= image
->format
;
243 rb
->DataType
= image
->data_type
;
244 rb
->_BaseFormat
= _mesa_base_fbo_format(&intel
->ctx
,
245 image
->internal_format
);
250 * Called for each hardware renderbuffer when a _window_ is resized.
251 * Just update fields.
252 * Not used for user-created renderbuffers!
255 intel_alloc_window_storage(struct gl_context
* ctx
, struct gl_renderbuffer
*rb
,
256 GLenum internalFormat
, GLuint width
, GLuint height
)
258 ASSERT(rb
->Name
== 0);
261 rb
->InternalFormat
= internalFormat
;
268 intel_resize_buffers(struct gl_context
*ctx
, struct gl_framebuffer
*fb
,
269 GLuint width
, GLuint height
)
273 _mesa_resize_framebuffer(ctx
, fb
, width
, height
);
275 fb
->Initialized
= GL_TRUE
; /* XXX remove someday */
282 /* Make sure all window system renderbuffers are up to date */
283 for (i
= BUFFER_FRONT_LEFT
; i
<= BUFFER_BACK_RIGHT
; i
++) {
284 struct gl_renderbuffer
*rb
= fb
->Attachment
[i
].Renderbuffer
;
286 /* only resize if size is changing */
287 if (rb
&& (rb
->Width
!= width
|| rb
->Height
!= height
)) {
288 rb
->AllocStorage(ctx
, rb
, rb
->InternalFormat
, width
, height
);
294 /** Dummy function for gl_renderbuffer::AllocStorage() */
296 intel_nop_alloc_storage(struct gl_context
* ctx
, struct gl_renderbuffer
*rb
,
297 GLenum internalFormat
, GLuint width
, GLuint height
)
299 _mesa_problem(ctx
, "intel_op_alloc_storage should never be called.");
305 intel_renderbuffer_set_region(struct intel_context
*intel
,
306 struct intel_renderbuffer
*rb
,
307 struct intel_region
*region
)
309 struct intel_region
*old
;
313 intel_region_reference(&rb
->region
, region
);
314 intel_region_release(&old
);
319 * Create a new intel_renderbuffer which corresponds to an on-screen window,
320 * not a user-created renderbuffer.
322 struct intel_renderbuffer
*
323 intel_create_renderbuffer(gl_format format
)
325 GET_CURRENT_CONTEXT(ctx
);
327 struct intel_renderbuffer
*irb
;
329 irb
= CALLOC_STRUCT(intel_renderbuffer
);
331 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "creating renderbuffer");
335 _mesa_init_renderbuffer(&irb
->Base
, 0);
336 irb
->Base
.ClassID
= INTEL_RB_CLASS
;
339 case MESA_FORMAT_RGB565
:
340 irb
->Base
._BaseFormat
= GL_RGB
;
341 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
343 case MESA_FORMAT_XRGB8888
:
344 irb
->Base
._BaseFormat
= GL_RGB
;
345 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
347 case MESA_FORMAT_ARGB8888
:
348 irb
->Base
._BaseFormat
= GL_RGBA
;
349 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
351 case MESA_FORMAT_Z16
:
352 irb
->Base
._BaseFormat
= GL_DEPTH_COMPONENT
;
353 irb
->Base
.DataType
= GL_UNSIGNED_SHORT
;
355 case MESA_FORMAT_X8_Z24
:
356 irb
->Base
._BaseFormat
= GL_DEPTH_COMPONENT
;
357 irb
->Base
.DataType
= GL_UNSIGNED_INT
;
359 case MESA_FORMAT_S8_Z24
:
360 irb
->Base
._BaseFormat
= GL_DEPTH_STENCIL
;
361 irb
->Base
.DataType
= GL_UNSIGNED_INT_24_8_EXT
;
364 irb
->Base
._BaseFormat
= GL_ALPHA
;
365 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
368 irb
->Base
._BaseFormat
= GL_RED
;
369 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
371 case MESA_FORMAT_RG88
:
372 irb
->Base
._BaseFormat
= GL_RG
;
373 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
377 "Unexpected intFormat in intel_create_renderbuffer");
382 irb
->Base
.Format
= format
;
383 irb
->Base
.InternalFormat
= irb
->Base
._BaseFormat
;
385 /* intel-specific methods */
386 irb
->Base
.Delete
= intel_delete_renderbuffer
;
387 irb
->Base
.AllocStorage
= intel_alloc_window_storage
;
388 irb
->Base
.GetPointer
= intel_get_pointer
;
395 * Create a new renderbuffer object.
396 * Typically called via glBindRenderbufferEXT().
398 static struct gl_renderbuffer
*
399 intel_new_renderbuffer(struct gl_context
* ctx
, GLuint name
)
401 /*struct intel_context *intel = intel_context(ctx); */
402 struct intel_renderbuffer
*irb
;
404 irb
= CALLOC_STRUCT(intel_renderbuffer
);
406 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "creating renderbuffer");
410 _mesa_init_renderbuffer(&irb
->Base
, name
);
411 irb
->Base
.ClassID
= INTEL_RB_CLASS
;
413 /* intel-specific methods */
414 irb
->Base
.Delete
= intel_delete_renderbuffer
;
415 irb
->Base
.AllocStorage
= intel_alloc_renderbuffer_storage
;
416 irb
->Base
.GetPointer
= intel_get_pointer
;
417 /* span routines set in alloc_storage function */
424 * Called via glBindFramebufferEXT().
427 intel_bind_framebuffer(struct gl_context
* ctx
, GLenum target
,
428 struct gl_framebuffer
*fb
, struct gl_framebuffer
*fbread
)
430 if (target
== GL_FRAMEBUFFER_EXT
|| target
== GL_DRAW_FRAMEBUFFER_EXT
) {
431 intel_draw_buffer(ctx
, fb
);
434 /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */
440 * Called via glFramebufferRenderbufferEXT().
443 intel_framebuffer_renderbuffer(struct gl_context
* ctx
,
444 struct gl_framebuffer
*fb
,
445 GLenum attachment
, struct gl_renderbuffer
*rb
)
447 DBG("Intel FramebufferRenderbuffer %u %u\n", fb
->Name
, rb
? rb
->Name
: 0);
451 _mesa_framebuffer_renderbuffer(ctx
, fb
, attachment
, rb
);
452 intel_draw_buffer(ctx
, fb
);
457 intel_update_wrapper(struct gl_context
*ctx
, struct intel_renderbuffer
*irb
,
458 struct gl_texture_image
*texImage
)
460 if (texImage
->TexFormat
== MESA_FORMAT_ARGB8888
) {
461 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
462 DBG("Render to RGBA8 texture OK\n");
464 else if (texImage
->TexFormat
== MESA_FORMAT_XRGB8888
) {
465 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
466 DBG("Render to XGBA8 texture OK\n");
468 else if (texImage
->TexFormat
== MESA_FORMAT_SARGB8
) {
469 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
470 DBG("Render to SARGB8 texture OK\n");
472 else if (texImage
->TexFormat
== MESA_FORMAT_RGB565
) {
473 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
474 DBG("Render to RGB5 texture OK\n");
476 else if (texImage
->TexFormat
== MESA_FORMAT_ARGB1555
) {
477 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
478 DBG("Render to ARGB1555 texture OK\n");
480 else if (texImage
->TexFormat
== MESA_FORMAT_ARGB4444
) {
481 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
482 DBG("Render to ARGB4444 texture OK\n");
484 else if (texImage
->TexFormat
== MESA_FORMAT_A8
) {
485 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
486 DBG("Render to A8 texture OK\n");
488 else if (texImage
->TexFormat
== MESA_FORMAT_R8
) {
489 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
490 DBG("Render to R8 texture OK\n");
492 else if (texImage
->TexFormat
== MESA_FORMAT_RG88
) {
493 irb
->Base
.DataType
= GL_UNSIGNED_BYTE
;
494 DBG("Render to RG88 texture OK\n");
496 else if (texImage
->TexFormat
== MESA_FORMAT_R16
) {
497 irb
->Base
.DataType
= GL_UNSIGNED_SHORT
;
498 DBG("Render to R8 texture OK\n");
500 else if (texImage
->TexFormat
== MESA_FORMAT_RG1616
) {
501 irb
->Base
.DataType
= GL_UNSIGNED_SHORT
;
502 DBG("Render to RG88 texture OK\n");
504 else if (texImage
->TexFormat
== MESA_FORMAT_Z16
) {
505 irb
->Base
.DataType
= GL_UNSIGNED_SHORT
;
506 DBG("Render to DEPTH16 texture OK\n");
508 else if (texImage
->TexFormat
== MESA_FORMAT_S8_Z24
) {
509 irb
->Base
.DataType
= GL_UNSIGNED_INT_24_8_EXT
;
510 DBG("Render to DEPTH_STENCIL texture OK\n");
513 DBG("Render to texture BAD FORMAT %s\n",
514 _mesa_get_format_name(texImage
->TexFormat
));
518 irb
->Base
.Format
= texImage
->TexFormat
;
520 irb
->Base
.InternalFormat
= texImage
->InternalFormat
;
521 irb
->Base
._BaseFormat
= _mesa_base_fbo_format(ctx
, irb
->Base
.InternalFormat
);
522 irb
->Base
.Width
= texImage
->Width
;
523 irb
->Base
.Height
= texImage
->Height
;
525 irb
->Base
.Delete
= intel_delete_renderbuffer
;
526 irb
->Base
.AllocStorage
= intel_nop_alloc_storage
;
533 * When glFramebufferTexture[123]D is called this function sets up the
534 * gl_renderbuffer wrapper around the texture image.
535 * This will have the region info needed for hardware rendering.
537 static struct intel_renderbuffer
*
538 intel_wrap_texture(struct gl_context
* ctx
, struct gl_texture_image
*texImage
)
540 const GLuint name
= ~0; /* not significant, but distinct for debugging */
541 struct intel_renderbuffer
*irb
;
543 /* make an intel_renderbuffer to wrap the texture image */
544 irb
= CALLOC_STRUCT(intel_renderbuffer
);
546 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glFramebufferTexture");
550 _mesa_init_renderbuffer(&irb
->Base
, name
);
551 irb
->Base
.ClassID
= INTEL_RB_CLASS
;
553 if (!intel_update_wrapper(ctx
, irb
, texImage
)) {
563 * Called by glFramebufferTexture[123]DEXT() (and other places) to
564 * prepare for rendering into texture memory. This might be called
565 * many times to choose different texture levels, cube faces, etc
566 * before intel_finish_render_texture() is ever called.
569 intel_render_texture(struct gl_context
* ctx
,
570 struct gl_framebuffer
*fb
,
571 struct gl_renderbuffer_attachment
*att
)
573 struct gl_texture_image
*newImage
574 = att
->Texture
->Image
[att
->CubeMapFace
][att
->TextureLevel
];
575 struct intel_renderbuffer
*irb
= intel_renderbuffer(att
->Renderbuffer
);
576 struct intel_texture_image
*intel_image
;
583 intel_image
= intel_texture_image(newImage
);
584 if (!intel_image
->mt
) {
585 /* Fallback on drawing to a texture that doesn't have a miptree
586 * (has a border, width/height 0, etc.)
588 _mesa_reference_renderbuffer(&att
->Renderbuffer
, NULL
);
589 _mesa_render_texture(ctx
, fb
, att
);
593 irb
= intel_wrap_texture(ctx
, newImage
);
595 /* bind the wrapper to the attachment point */
596 _mesa_reference_renderbuffer(&att
->Renderbuffer
, &irb
->Base
);
599 /* fallback to software rendering */
600 _mesa_render_texture(ctx
, fb
, att
);
605 if (!intel_update_wrapper(ctx
, irb
, newImage
)) {
606 _mesa_reference_renderbuffer(&att
->Renderbuffer
, NULL
);
607 _mesa_render_texture(ctx
, fb
, att
);
611 DBG("Begin render texture tid %lx tex=%u w=%d h=%d refcount=%d\n",
613 att
->Texture
->Name
, newImage
->Width
, newImage
->Height
,
616 /* point the renderbufer's region to the texture image region */
617 if (irb
->region
!= intel_image
->mt
->region
) {
619 intel_region_release(&irb
->region
);
620 intel_region_reference(&irb
->region
, intel_image
->mt
->region
);
623 /* compute offset of the particular 2D image within the texture region */
624 intel_miptree_get_image_offset(intel_image
->mt
,
630 intel_image
->mt
->region
->draw_offset
= (dst_y
* intel_image
->mt
->region
->pitch
+
631 dst_x
) * intel_image
->mt
->cpp
;
632 intel_image
->mt
->region
->draw_x
= dst_x
;
633 intel_image
->mt
->region
->draw_y
= dst_y
;
634 intel_image
->used_as_render_target
= GL_TRUE
;
636 /* update drawing region, etc */
637 intel_draw_buffer(ctx
, fb
);
642 * Called by Mesa when rendering to a texture is done.
645 intel_finish_render_texture(struct gl_context
* ctx
,
646 struct gl_renderbuffer_attachment
*att
)
648 struct intel_context
*intel
= intel_context(ctx
);
649 struct gl_texture_object
*tex_obj
= att
->Texture
;
650 struct gl_texture_image
*image
=
651 tex_obj
->Image
[att
->CubeMapFace
][att
->TextureLevel
];
652 struct intel_texture_image
*intel_image
= intel_texture_image(image
);
654 DBG("Finish render texture tid %lx tex=%u\n",
655 _glthread_GetID(), att
->Texture
->Name
);
657 /* Flag that this image may now be validated into the object's miptree. */
658 intel_image
->used_as_render_target
= GL_FALSE
;
660 /* Since we've (probably) rendered to the texture and will (likely) use
661 * it in the texture domain later on in this batchbuffer, flush the
662 * batch. Once again, we wish for a domain tracker in libdrm to cover
663 * usage inside of a batchbuffer like GEM does in the kernel.
665 intel_batchbuffer_emit_mi_flush(intel
->batch
);
669 * Do additional "completeness" testing of a framebuffer object.
672 intel_validate_framebuffer(struct gl_context
*ctx
, struct gl_framebuffer
*fb
)
674 const struct intel_renderbuffer
*depthRb
=
675 intel_get_renderbuffer(fb
, BUFFER_DEPTH
);
676 const struct intel_renderbuffer
*stencilRb
=
677 intel_get_renderbuffer(fb
, BUFFER_STENCIL
);
680 if (depthRb
&& stencilRb
&& stencilRb
!= depthRb
) {
681 if (ctx
->DrawBuffer
->Attachment
[BUFFER_DEPTH
].Type
== GL_TEXTURE
&&
682 ctx
->DrawBuffer
->Attachment
[BUFFER_STENCIL
].Type
== GL_TEXTURE
&&
683 (ctx
->DrawBuffer
->Attachment
[BUFFER_DEPTH
].Texture
->Name
==
684 ctx
->DrawBuffer
->Attachment
[BUFFER_STENCIL
].Texture
->Name
)) {
687 /* we only support combined depth/stencil buffers, not separate
690 DBG("Only supports combined depth/stencil (found %s, %s)\n",
691 depthRb
? _mesa_get_format_name(depthRb
->Base
.Format
): "NULL",
692 stencilRb
? _mesa_get_format_name(stencilRb
->Base
.Format
): "NULL");
693 fb
->_Status
= GL_FRAMEBUFFER_UNSUPPORTED_EXT
;
697 for (i
= 0; i
< ctx
->Const
.MaxDrawBuffers
; i
++) {
698 struct gl_renderbuffer
*rb
= ctx
->DrawBuffer
->_ColorDrawBuffers
[i
];
699 struct intel_renderbuffer
*irb
= intel_renderbuffer(rb
);
705 DBG("software rendering renderbuffer\n");
706 fb
->_Status
= GL_FRAMEBUFFER_UNSUPPORTED_EXT
;
710 switch (irb
->Base
.Format
) {
711 case MESA_FORMAT_ARGB8888
:
712 case MESA_FORMAT_XRGB8888
:
713 case MESA_FORMAT_SARGB8
:
714 case MESA_FORMAT_RGB565
:
715 case MESA_FORMAT_ARGB1555
:
716 case MESA_FORMAT_ARGB4444
:
719 case MESA_FORMAT_R16
:
720 case MESA_FORMAT_RG88
:
721 case MESA_FORMAT_RG1616
:
724 fb
->_Status
= GL_FRAMEBUFFER_UNSUPPORTED_EXT
;
731 * Do one-time context initializations related to GL_EXT_framebuffer_object.
732 * Hook in device driver functions.
735 intel_fbo_init(struct intel_context
*intel
)
737 intel
->ctx
.Driver
.NewFramebuffer
= intel_new_framebuffer
;
738 intel
->ctx
.Driver
.NewRenderbuffer
= intel_new_renderbuffer
;
739 intel
->ctx
.Driver
.BindFramebuffer
= intel_bind_framebuffer
;
740 intel
->ctx
.Driver
.FramebufferRenderbuffer
= intel_framebuffer_renderbuffer
;
741 intel
->ctx
.Driver
.RenderTexture
= intel_render_texture
;
742 intel
->ctx
.Driver
.FinishRenderTexture
= intel_finish_render_texture
;
743 intel
->ctx
.Driver
.ResizeBuffers
= intel_resize_buffers
;
744 intel
->ctx
.Driver
.ValidateFramebuffer
= intel_validate_framebuffer
;
745 intel
->ctx
.Driver
.BlitFramebuffer
= _mesa_meta_BlitFramebuffer
;
747 #if FEATURE_OES_EGL_image
748 intel
->ctx
.Driver
.EGLImageTargetRenderbufferStorage
=
749 intel_image_target_renderbuffer_storage
;