1 /**************************************************************************
3 * Copyright 2006 VMware, Inc.
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 VMWARE 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/enums.h"
30 #include "main/imports.h"
31 #include "main/macros.h"
32 #include "main/mtypes.h"
33 #include "main/fbobject.h"
34 #include "main/framebuffer.h"
35 #include "main/renderbuffer.h"
36 #include "main/context.h"
37 #include "main/teximage.h"
38 #include "main/image.h"
40 #include "swrast/swrast.h"
41 #include "drivers/common/meta.h"
43 #include "intel_context.h"
44 #include "intel_batchbuffer.h"
45 #include "intel_buffers.h"
46 #include "intel_blit.h"
47 #include "intel_fbo.h"
48 #include "intel_mipmap_tree.h"
49 #include "intel_regions.h"
50 #include "intel_tex.h"
52 #define FILE_DEBUG_FLAG DEBUG_FBO
54 static struct gl_renderbuffer
*
55 intel_new_renderbuffer(struct gl_context
* ctx
, GLuint name
);
58 intel_get_rb_region(struct gl_framebuffer
*fb
, GLuint attIndex
)
60 struct intel_renderbuffer
*irb
= intel_get_renderbuffer(fb
, attIndex
);
62 return irb
->mt
->region
;
67 /** Called by gl_renderbuffer::Delete() */
69 intel_delete_renderbuffer(struct gl_context
*ctx
, struct gl_renderbuffer
*rb
)
71 struct intel_renderbuffer
*irb
= intel_renderbuffer(rb
);
75 intel_miptree_release(&irb
->mt
);
77 _mesa_delete_renderbuffer(ctx
, rb
);
81 * \see dd_function_table::MapRenderbuffer
84 intel_map_renderbuffer(struct gl_context
*ctx
,
85 struct gl_renderbuffer
*rb
,
86 GLuint x
, GLuint y
, GLuint w
, GLuint h
,
91 struct intel_context
*intel
= intel_context(ctx
);
92 struct swrast_renderbuffer
*srb
= (struct swrast_renderbuffer
*)rb
;
93 struct intel_renderbuffer
*irb
= intel_renderbuffer(rb
);
98 /* this is a malloc'd renderbuffer (accum buffer), not an irb */
99 GLint bpp
= _mesa_get_format_bytes(rb
->Format
);
100 GLint rowStride
= srb
->RowStride
;
101 *out_map
= (GLubyte
*) srb
->Buffer
+ y
* rowStride
+ x
* bpp
;
102 *out_stride
= rowStride
;
106 intel_prepare_render(intel
);
108 /* For a window-system renderbuffer, we need to flip the mapping we receive
109 * upside-down. So we need to ask for a rectangle on flipped vertically, and
110 * we then return a pointer to the bottom of it with a negative stride.
113 y
= rb
->Height
- y
- h
;
116 intel_miptree_map(intel
, irb
->mt
, irb
->mt_level
, irb
->mt_layer
,
117 x
, y
, w
, h
, mode
, &map
, &stride
);
120 map
+= (h
- 1) * stride
;
124 DBG("%s: rb %d (%s) mt mapped: (%d, %d) (%dx%d) -> %p/%d\n",
125 __func__
, rb
->Name
, _mesa_get_format_name(rb
->Format
),
126 x
, y
, w
, h
, map
, stride
);
129 *out_stride
= stride
;
133 * \see dd_function_table::UnmapRenderbuffer
136 intel_unmap_renderbuffer(struct gl_context
*ctx
,
137 struct gl_renderbuffer
*rb
)
139 struct intel_context
*intel
= intel_context(ctx
);
140 struct swrast_renderbuffer
*srb
= (struct swrast_renderbuffer
*)rb
;
141 struct intel_renderbuffer
*irb
= intel_renderbuffer(rb
);
143 DBG("%s: rb %d (%s)\n", __func__
,
144 rb
->Name
, _mesa_get_format_name(rb
->Format
));
147 /* this is a malloc'd renderbuffer (accum buffer) */
152 intel_miptree_unmap(intel
, irb
->mt
, irb
->mt_level
, irb
->mt_layer
);
156 intel_renderbuffer_format(struct gl_context
* ctx
, GLenum internalFormat
)
158 struct intel_context
*intel
= intel_context(ctx
);
160 switch (internalFormat
) {
162 /* Use the same format-choice logic as for textures.
163 * Renderbuffers aren't any different from textures for us,
164 * except they're less useful because you can't texture with
167 return intel
->ctx
.Driver
.ChooseTextureFormat(ctx
, GL_TEXTURE_2D
,
171 case GL_DEPTH_COMPONENT16
:
172 return MESA_FORMAT_Z_UNORM16
;
173 case GL_DEPTH_COMPONENT
:
174 case GL_DEPTH_COMPONENT24
:
175 case GL_DEPTH_COMPONENT32
:
176 return MESA_FORMAT_Z24_UNORM_X8_UINT
;
177 case GL_DEPTH_STENCIL_EXT
:
178 case GL_DEPTH24_STENCIL8_EXT
:
179 case GL_STENCIL_INDEX
:
180 case GL_STENCIL_INDEX1_EXT
:
181 case GL_STENCIL_INDEX4_EXT
:
182 case GL_STENCIL_INDEX8_EXT
:
183 case GL_STENCIL_INDEX16_EXT
:
184 /* These aren't actual texture formats, so force them here. */
185 return MESA_FORMAT_Z24_UNORM_S8_UINT
;
190 intel_alloc_private_renderbuffer_storage(struct gl_context
* ctx
, struct gl_renderbuffer
*rb
,
191 GLenum internalFormat
,
192 GLuint width
, GLuint height
)
194 struct intel_context
*intel
= intel_context(ctx
);
195 struct intel_renderbuffer
*irb
= intel_renderbuffer(rb
);
197 assert(rb
->Format
!= MESA_FORMAT_NONE
);
201 rb
->_BaseFormat
= _mesa_base_fbo_format(ctx
, internalFormat
);
203 intel_miptree_release(&irb
->mt
);
205 DBG("%s: %s: %s (%dx%d)\n", __func__
,
206 _mesa_enum_to_string(internalFormat
),
207 _mesa_get_format_name(rb
->Format
), width
, height
);
209 if (width
== 0 || height
== 0)
212 irb
->mt
= intel_miptree_create_for_renderbuffer(intel
, rb
->Format
,
221 * Called via glRenderbufferStorageEXT() to set the format and allocate
222 * storage for a user-created renderbuffer.
225 intel_alloc_renderbuffer_storage(struct gl_context
* ctx
, struct gl_renderbuffer
*rb
,
226 GLenum internalFormat
,
227 GLuint width
, GLuint height
)
229 rb
->Format
= intel_renderbuffer_format(ctx
, internalFormat
);
230 return intel_alloc_private_renderbuffer_storage(ctx
, rb
, internalFormat
, width
, height
);
234 intel_image_target_renderbuffer_storage(struct gl_context
*ctx
,
235 struct gl_renderbuffer
*rb
,
238 struct intel_context
*intel
= intel_context(ctx
);
239 struct intel_renderbuffer
*irb
;
243 screen
= intel
->intelScreen
->driScrnPriv
;
244 image
= screen
->dri2
.image
->lookupEGLImage(screen
, image_handle
,
245 screen
->loaderPrivate
);
249 /* __DRIimage is opaque to the core so it has to be checked here */
250 switch (image
->format
) {
251 case MESA_FORMAT_R8G8B8A8_UNORM
:
252 _mesa_error(&intel
->ctx
, GL_INVALID_OPERATION
,
253 "glEGLImageTargetRenderbufferStorage(unsupported image format");
260 irb
= intel_renderbuffer(rb
);
261 intel_miptree_release(&irb
->mt
);
262 irb
->mt
= intel_miptree_create_for_bo(intel
,
266 image
->region
->width
,
267 image
->region
->height
,
268 image
->region
->pitch
,
269 image
->region
->tiling
);
273 rb
->InternalFormat
= image
->internal_format
;
274 rb
->Width
= image
->region
->width
;
275 rb
->Height
= image
->region
->height
;
276 rb
->Format
= image
->format
;
277 rb
->_BaseFormat
= _mesa_get_format_base_format(image
->format
);
278 rb
->NeedsFinishRenderTexture
= true;
282 * Called by _mesa_resize_framebuffer() for each hardware renderbuffer when a
283 * window system framebuffer is resized.
285 * Any actual buffer reallocations for hardware renderbuffers (which would
286 * have triggered _mesa_resize_framebuffer()) were done by
287 * intel_process_dri2_buffer().
290 intel_alloc_window_storage(UNUSED
struct gl_context
*ctx
, struct gl_renderbuffer
*rb
,
291 GLenum internalFormat
, GLuint width
, GLuint height
)
293 assert(rb
->Name
== 0);
296 rb
->InternalFormat
= internalFormat
;
301 /** Dummy function for gl_renderbuffer::AllocStorage() */
303 intel_nop_alloc_storage(UNUSED
struct gl_context
*ctx
,
304 UNUSED
struct gl_renderbuffer
*rb
,
305 UNUSED GLenum internalFormat
,
306 UNUSED GLuint width
, UNUSED GLuint height
)
308 _mesa_problem(ctx
, "intel_op_alloc_storage should never be called.");
313 * Create a new intel_renderbuffer which corresponds to an on-screen window,
314 * not a user-created renderbuffer.
316 struct intel_renderbuffer
*
317 intel_create_renderbuffer(mesa_format format
)
319 struct intel_renderbuffer
*irb
;
320 struct gl_renderbuffer
*rb
;
322 GET_CURRENT_CONTEXT(ctx
);
324 irb
= CALLOC_STRUCT(intel_renderbuffer
);
326 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "creating renderbuffer");
330 rb
= &irb
->Base
.Base
;
332 _mesa_init_renderbuffer(rb
, 0);
333 rb
->ClassID
= INTEL_RB_CLASS
;
334 rb
->_BaseFormat
= _mesa_get_format_base_format(format
);
336 rb
->InternalFormat
= rb
->_BaseFormat
;
338 /* intel-specific methods */
339 rb
->Delete
= intel_delete_renderbuffer
;
340 rb
->AllocStorage
= intel_alloc_window_storage
;
346 * Private window-system buffers (as opposed to ones shared with the display
347 * server created with intel_create_renderbuffer()) are most similar in their
348 * handling to user-created renderbuffers, but they have a resize handler that
349 * may be called at intel_update_renderbuffers() time.
351 struct intel_renderbuffer
*
352 intel_create_private_renderbuffer(mesa_format format
)
354 struct intel_renderbuffer
*irb
;
356 irb
= intel_create_renderbuffer(format
);
357 irb
->Base
.Base
.AllocStorage
= intel_alloc_private_renderbuffer_storage
;
363 * Create a new renderbuffer object.
364 * Typically called via glBindRenderbufferEXT().
366 static struct gl_renderbuffer
*
367 intel_new_renderbuffer(struct gl_context
* ctx
, GLuint name
)
369 /*struct intel_context *intel = intel_context(ctx); */
370 struct intel_renderbuffer
*irb
;
371 struct gl_renderbuffer
*rb
;
373 irb
= CALLOC_STRUCT(intel_renderbuffer
);
375 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "creating renderbuffer");
379 rb
= &irb
->Base
.Base
;
381 _mesa_init_renderbuffer(rb
, name
);
382 rb
->ClassID
= INTEL_RB_CLASS
;
384 /* intel-specific methods */
385 rb
->Delete
= intel_delete_renderbuffer
;
386 rb
->AllocStorage
= intel_alloc_renderbuffer_storage
;
387 /* span routines set in alloc_storage function */
394 * Called via glBindFramebufferEXT().
397 intel_bind_framebuffer(struct gl_context
* ctx
, GLenum target
,
398 UNUSED
struct gl_framebuffer
*fb
,
399 UNUSED
struct gl_framebuffer
*fbread
)
401 if (target
== GL_FRAMEBUFFER_EXT
|| target
== GL_DRAW_FRAMEBUFFER_EXT
) {
402 intel_draw_buffer(ctx
);
405 /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */
411 * Called via glFramebufferRenderbufferEXT().
414 intel_framebuffer_renderbuffer(struct gl_context
* ctx
,
415 struct gl_framebuffer
*fb
,
416 GLenum attachment
, struct gl_renderbuffer
*rb
)
418 DBG("Intel FramebufferRenderbuffer %u %u\n", fb
->Name
, rb
? rb
->Name
: 0);
420 _mesa_FramebufferRenderbuffer_sw(ctx
, fb
, attachment
, rb
);
421 intel_draw_buffer(ctx
);
425 intel_renderbuffer_update_wrapper(struct intel_renderbuffer
*irb
,
426 struct gl_texture_image
*image
,
429 struct gl_renderbuffer
*rb
= &irb
->Base
.Base
;
430 struct intel_texture_image
*intel_image
= intel_texture_image(image
);
431 struct intel_mipmap_tree
*mt
= intel_image
->mt
;
432 int level
= image
->Level
;
434 rb
->AllocStorage
= intel_nop_alloc_storage
;
436 intel_miptree_check_level_layer(mt
, level
, layer
);
437 irb
->mt_level
= level
;
438 irb
->mt_layer
= layer
;
440 intel_miptree_reference(&irb
->mt
, mt
);
442 intel_renderbuffer_set_draw_offset(irb
);
448 intel_renderbuffer_set_draw_offset(struct intel_renderbuffer
*irb
)
450 unsigned int dst_x
, dst_y
;
452 /* compute offset of the particular 2D image within the texture region */
453 intel_miptree_get_image_offset(irb
->mt
,
463 * Called by glFramebufferTexture[123]DEXT() (and other places) to
464 * prepare for rendering into texture memory. This might be called
465 * many times to choose different texture levels, cube faces, etc
466 * before intel_finish_render_texture() is ever called.
469 intel_render_texture(struct gl_context
* ctx
,
470 struct gl_framebuffer
*fb
,
471 struct gl_renderbuffer_attachment
*att
)
473 struct gl_renderbuffer
*rb
= att
->Renderbuffer
;
474 struct intel_renderbuffer
*irb
= intel_renderbuffer(rb
);
475 struct gl_texture_image
*image
= rb
->TexImage
;
476 struct intel_texture_image
*intel_image
= intel_texture_image(image
);
477 struct intel_mipmap_tree
*mt
= intel_image
->mt
;
482 if (att
->CubeMapFace
> 0) {
483 assert(att
->Zoffset
== 0);
484 layer
= att
->CubeMapFace
;
486 layer
= att
->Zoffset
;
489 if (!intel_image
->mt
) {
490 /* Fallback on drawing to a texture that doesn't have a miptree
491 * (has a border, width/height 0, etc.)
493 _swrast_render_texture(ctx
, fb
, att
);
497 intel_miptree_check_level_layer(mt
, att
->TextureLevel
, layer
);
499 if (!intel_renderbuffer_update_wrapper(irb
, image
, layer
)) {
500 _swrast_render_texture(ctx
, fb
, att
);
504 DBG("Begin render %s texture tex=%u w=%d h=%d d=%d refcount=%d\n",
505 _mesa_get_format_name(image
->TexFormat
),
506 att
->Texture
->Name
, image
->Width
, image
->Height
, image
->Depth
,
509 /* update drawing region, etc */
510 intel_draw_buffer(ctx
);
515 * Called by Mesa when rendering to a texture is done.
518 intel_finish_render_texture(struct gl_context
* ctx
, struct gl_renderbuffer
*rb
)
520 struct intel_context
*intel
= intel_context(ctx
);
522 DBG("Finish render %s texture\n", _mesa_get_format_name(rb
->Format
));
524 /* Since we've (probably) rendered to the texture and will (likely) use
525 * it in the texture domain later on in this batchbuffer, flush the
526 * batch. Once again, we wish for a domain tracker in libdrm to cover
527 * usage inside of a batchbuffer like GEM does in the kernel.
529 intel_batchbuffer_emit_mi_flush(intel
);
532 #define fbo_incomplete(fb, ...) do { \
533 static GLuint msg_id = 0; \
534 if (unlikely(ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) { \
535 _mesa_gl_debug(ctx, &msg_id, \
536 MESA_DEBUG_SOURCE_API, \
537 MESA_DEBUG_TYPE_OTHER, \
538 MESA_DEBUG_SEVERITY_MEDIUM, \
542 fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED; \
546 * Do additional "completeness" testing of a framebuffer object.
549 intel_validate_framebuffer(struct gl_context
*ctx
, struct gl_framebuffer
*fb
)
551 struct intel_context
*intel
= intel_context(ctx
);
552 struct intel_renderbuffer
*depthRb
=
553 intel_get_renderbuffer(fb
, BUFFER_DEPTH
);
554 struct intel_renderbuffer
*stencilRb
=
555 intel_get_renderbuffer(fb
, BUFFER_STENCIL
);
556 struct intel_mipmap_tree
*depth_mt
= NULL
, *stencil_mt
= NULL
;
559 DBG("%s() on fb %p (%s)\n", __func__
,
560 fb
, (fb
== ctx
->DrawBuffer
? "drawbuffer" :
561 (fb
== ctx
->ReadBuffer
? "readbuffer" : "other buffer")));
564 depth_mt
= depthRb
->mt
;
566 stencil_mt
= stencilRb
->mt
;
568 if (depth_mt
&& stencil_mt
) {
569 /* Make sure that the depth and stencil buffers are actually the same
570 * slice of the same miptree, since we only support packed
573 if (depth_mt
== stencil_mt
) {
574 if (depthRb
->mt_level
!= stencilRb
->mt_level
||
575 depthRb
->mt_layer
!= stencilRb
->mt_layer
) {
577 "FBO incomplete: depth image level/layer %d/%d != "
578 "stencil image %d/%d\n",
582 stencilRb
->mt_layer
);
585 fbo_incomplete(fb
, "FBO incomplete: separate stencil unsupported\n");
589 for (i
= 0; i
< ARRAY_SIZE(fb
->Attachment
); i
++) {
590 struct gl_renderbuffer
*rb
;
591 struct intel_renderbuffer
*irb
;
593 if (fb
->Attachment
[i
].Type
== GL_NONE
)
596 /* A supported attachment will have a Renderbuffer set either
597 * from being a Renderbuffer or being a texture that got the
598 * intel_wrap_texture() treatment.
600 rb
= fb
->Attachment
[i
].Renderbuffer
;
602 fbo_incomplete(fb
, "FBO incomplete: attachment without "
607 if (fb
->Attachment
[i
].Type
== GL_TEXTURE
) {
608 if (rb
->TexImage
->Border
) {
609 fbo_incomplete(fb
, "FBO incomplete: texture with border\n");
614 irb
= intel_renderbuffer(rb
);
616 fbo_incomplete(fb
, "FBO incomplete: software rendering "
621 if (!intel
->vtbl
.render_target_supported(intel
, rb
)) {
622 fbo_incomplete(fb
, "FBO incomplete: Unsupported HW "
623 "texture/renderbuffer format attached: %s\n",
624 _mesa_get_format_name(intel_rb_format(irb
)));
630 * Try to do a glBlitFramebuffer using glCopyTexSubImage2D
631 * We can do this when the dst renderbuffer is actually a texture and
632 * there is no scaling, mirroring or scissoring.
634 * \return new buffer mask indicating the buffers left to blit using the
638 intel_blit_framebuffer_with_blitter(struct gl_context
*ctx
,
639 const struct gl_framebuffer
*readFb
,
640 const struct gl_framebuffer
*drawFb
,
641 GLint srcX0
, GLint srcY0
,
642 GLint srcX1
, GLint srcY1
,
643 GLint dstX0
, GLint dstY0
,
644 GLint dstX1
, GLint dstY1
,
647 struct intel_context
*intel
= intel_context(ctx
);
649 /* Sync up the state of window system buffers. We need to do this before
650 * we go looking for the buffers.
652 intel_prepare_render(intel
);
654 if (mask
& GL_COLOR_BUFFER_BIT
) {
656 struct gl_renderbuffer
*src_rb
= readFb
->_ColorReadBuffer
;
657 struct intel_renderbuffer
*src_irb
= intel_renderbuffer(src_rb
);
660 perf_debug("glBlitFramebuffer(): missing src renderbuffer. "
661 "Falling back to software rendering.\n");
665 /* If the source and destination are the same size with no mirroring,
666 * the rectangles are within the size of the texture and there is no
667 * scissor, then we can probably use the blit engine.
669 if (!(srcX0
- srcX1
== dstX0
- dstX1
&&
670 srcY0
- srcY1
== dstY0
- dstY1
&&
673 srcX0
>= 0 && srcX1
<= readFb
->Width
&&
674 srcY0
>= 0 && srcY1
<= readFb
->Height
&&
675 dstX0
>= 0 && dstX1
<= drawFb
->Width
&&
676 dstY0
>= 0 && dstY1
<= drawFb
->Height
&&
677 !ctx
->Scissor
.EnableFlags
)) {
678 perf_debug("glBlitFramebuffer(): non-1:1 blit. "
679 "Falling back to software rendering.\n");
683 /* Blit to all active draw buffers. We don't do any pre-checking,
684 * because we assume that copying to MRTs is rare, and failure midway
685 * through copying is even more rare. Even if it was to occur, it's
686 * safe to let meta start the copy over from scratch, because
687 * glBlitFramebuffer completely overwrites the destination pixels, and
688 * results are undefined if any destination pixels have a dependency on
691 for (i
= 0; i
< drawFb
->_NumColorDrawBuffers
; i
++) {
692 struct gl_renderbuffer
*dst_rb
= drawFb
->_ColorDrawBuffers
[i
];
693 struct intel_renderbuffer
*dst_irb
= intel_renderbuffer(dst_rb
);
696 perf_debug("glBlitFramebuffer(): missing dst renderbuffer. "
697 "Falling back to software rendering.\n");
701 mesa_format src_format
= _mesa_get_srgb_format_linear(src_rb
->Format
);
702 mesa_format dst_format
= _mesa_get_srgb_format_linear(dst_rb
->Format
);
703 if (src_format
!= dst_format
) {
704 perf_debug("glBlitFramebuffer(): unsupported blit from %s to %s. "
705 "Falling back to software rendering.\n",
706 _mesa_get_format_name(src_format
),
707 _mesa_get_format_name(dst_format
));
711 if (!intel_miptree_blit(intel
,
713 src_irb
->mt_level
, src_irb
->mt_layer
,
714 srcX0
, srcY0
, src_rb
->Name
== 0,
716 dst_irb
->mt_level
, dst_irb
->mt_layer
,
717 dstX0
, dstY0
, dst_rb
->Name
== 0,
718 dstX1
- dstX0
, dstY1
- dstY0
, COLOR_LOGICOP_COPY
)) {
719 perf_debug("glBlitFramebuffer(): unknown blit failure. "
720 "Falling back to software rendering.\n");
725 mask
&= ~GL_COLOR_BUFFER_BIT
;
732 intel_blit_framebuffer(struct gl_context
*ctx
,
733 struct gl_framebuffer
*readFb
,
734 struct gl_framebuffer
*drawFb
,
735 GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
736 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
737 GLbitfield mask
, GLenum filter
)
739 /* Try using the BLT engine. */
740 mask
= intel_blit_framebuffer_with_blitter(ctx
, readFb
, drawFb
,
741 srcX0
, srcY0
, srcX1
, srcY1
,
742 dstX0
, dstY0
, dstX1
, dstY1
,
748 _mesa_meta_and_swrast_BlitFramebuffer(ctx
, readFb
, drawFb
,
749 srcX0
, srcY0
, srcX1
, srcY1
,
750 dstX0
, dstY0
, dstX1
, dstY1
,
755 * Do one-time context initializations related to GL_EXT_framebuffer_object.
756 * Hook in device driver functions.
759 intel_fbo_init(struct intel_context
*intel
)
761 intel
->ctx
.Driver
.NewRenderbuffer
= intel_new_renderbuffer
;
762 intel
->ctx
.Driver
.MapRenderbuffer
= intel_map_renderbuffer
;
763 intel
->ctx
.Driver
.UnmapRenderbuffer
= intel_unmap_renderbuffer
;
764 intel
->ctx
.Driver
.BindFramebuffer
= intel_bind_framebuffer
;
765 intel
->ctx
.Driver
.FramebufferRenderbuffer
= intel_framebuffer_renderbuffer
;
766 intel
->ctx
.Driver
.RenderTexture
= intel_render_texture
;
767 intel
->ctx
.Driver
.FinishRenderTexture
= intel_finish_render_texture
;
768 intel
->ctx
.Driver
.ValidateFramebuffer
= intel_validate_framebuffer
;
769 intel
->ctx
.Driver
.BlitFramebuffer
= intel_blit_framebuffer
;
770 intel
->ctx
.Driver
.EGLImageTargetRenderbufferStorage
=
771 intel_image_target_renderbuffer_storage
;