}
for (i = 0; i < intel_fb->pf_num_pages; i++) {
- if (!intel_fb->color_rb[i] ||
- (intel_fb->vbl_waited - intel_fb->vbl_pending[i]) <=
- (1<<23))
+ if ((intel_fb->vbl_waited - intel_fb->vbl_pending[i]) <= (1<<23))
continue;
vbl.request.sequence = intel_fb->vbl_pending[i];
intel_fb->vbl_waited = intel_fb->vbl_seq;
for (i = 0; i < intel_fb->pf_num_pages; i++) {
- if (intel_fb->color_rb[i])
- intel_fb->vbl_pending[i] = intel_fb->vbl_waited;
+ intel_fb->vbl_pending[i] = intel_fb->vbl_waited;
}
}
}
intel_fb->vbl_waited = intel_fb->vbl_seq;
for (i = 0; i < 2; i++) {
-#if 1
intel_fb->vbl_pending[i] = intel_fb->vbl_seq;
-#else
- if (intel_fb->color_rb[i])
- intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_seq;
-#endif
}
}
}
}
-struct intel_renderbuffer *
-intel_get_renderbuffer(struct gl_framebuffer *fb, GLuint attIndex)
-{
- return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
-}
-
-#if 0
-void
-intel_flip_renderbuffers(struct intel_framebuffer *intel_fb)
-{
- int current_page = intel_fb->pf_current_page;
- int next_page = (current_page + 1) % intel_fb->pf_num_pages;
- struct gl_renderbuffer *tmp_rb;
-
- /* Exchange renderbuffers if necessary but make sure their reference counts
- * are preserved.
- */
- if (intel_fb->color_rb[current_page] &&
- intel_fb->Base.Attachment[BUFFER_FRONT_LEFT].Renderbuffer !=
- &intel_fb->color_rb[current_page]->Base) {
- tmp_rb = NULL;
- _mesa_reference_renderbuffer(&tmp_rb,
- intel_fb->Base.Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
- tmp_rb = &intel_fb->color_rb[current_page]->Base;
- _mesa_reference_renderbuffer(
- &intel_fb->Base.Attachment[BUFFER_FRONT_LEFT].Renderbuffer, tmp_rb);
- _mesa_reference_renderbuffer(&tmp_rb, NULL);
- }
-
- if (intel_fb->color_rb[next_page] &&
- intel_fb->Base.Attachment[BUFFER_BACK_LEFT].Renderbuffer !=
- &intel_fb->color_rb[next_page]->Base) {
- tmp_rb = NULL;
- _mesa_reference_renderbuffer(&tmp_rb,
- intel_fb->Base.Attachment[BUFFER_BACK_LEFT].Renderbuffer);
- tmp_rb = &intel_fb->color_rb[next_page]->Base;
- _mesa_reference_renderbuffer(
- &intel_fb->Base.Attachment[BUFFER_BACK_LEFT].Renderbuffer, tmp_rb);
- _mesa_reference_renderbuffer(&tmp_rb, NULL);
- }
-}
-#endif
-
-
-#if 0
-struct pipe_region *
-intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
-{
- struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex);
-
- if (irb)
- return irb->Base.surface->region;
- else
- return NULL;
-}
-#endif
-
-
/**
* Create a new framebuffer object.
*/
{
struct gl_framebuffer Base;
- struct intel_renderbuffer *color_rb[3];
-
/* Drawable page flipping state */
GLboolean pf_active;
GLuint pf_seq;
struct intel_renderbuffer
{
struct gl_renderbuffer Base;
-#if 0
- struct pipe_region *region;
-
- void *pfMap; /* possibly paged flipped map pointer */
- GLuint pfPitch; /* possibly paged flipped pitch */
- GLboolean RenderToTexture; /* RTT? */
-
- GLuint PairedDepth; /**< only used if this is a depth renderbuffer */
- GLuint PairedStencil; /**< only used if this is a stencil renderbuffer */
-
- GLuint pf_pending; /**< sequence number of pending flip */
-
- GLuint vbl_pending; /**< vblank sequence number of pending flip */
-
- struct intel_surface *surface;
-#endif
};
-#if 0
-extern struct intel_renderbuffer *intel_create_renderbuffer(GLenum intFormat,
- GLsizei width,
- GLsizei height,
- int offset,
- int pitch,
- int cpp,
- void *map);
-#endif
extern struct intel_renderbuffer *intel_new_renderbuffer_fb(GLuint intFormat);
extern void intel_fbo_init(struct intel_context *intel);
-/* XXX make inline or macro */
-extern struct intel_renderbuffer *intel_get_renderbuffer(struct gl_framebuffer
- *fb,
- GLuint attIndex);
-
-extern void intel_flip_renderbuffers(struct intel_framebuffer *intel_fb);
-
-
-/* XXX make inline or macro */
-extern struct pipe_region *intel_get_rb_region(struct gl_framebuffer *fb,
- GLuint attIndex);
-
-
-
extern struct pipe_surface *
intel_new_surface(GLuint intFormat);
/* fake frontbuffer */
/* XXX allocation should only happen in the unusual case
it's actually needed */
- intel_fb->color_rb[0]
+ struct intel_renderbuffer *irb
= intel_new_renderbuffer_fb(rgbFormat);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_FRONT_LEFT,
- &intel_fb->color_rb[0]->Base);
+ &irb->Base);
}
if (mesaVis->doubleBufferMode) {
-#if 01
- intel_fb->color_rb[1]
+ struct intel_renderbuffer *irb
= intel_new_renderbuffer_fb(rgbFormat);
_mesa_add_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT,
- &intel_fb->color_rb[1]->Base);
-#else
- intel_fb->color_rb[1]
- = st_new_renderbuffer_fb(rgbFormat);
- _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT,
- &intel_fb->color_rb[1]->Base);
-#endif
+ &irb->Base);
}
if (mesaVis->depthBits == 24 && mesaVis->stencilBits == 8) {