static void
swap_fences_unref(struct dri_drawable *draw);
-static boolean
+static bool
dri_st_framebuffer_validate(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi,
const enum st_attachment_type *statts,
(struct dri_drawable *) stfbi->st_manager_private;
struct dri_screen *screen = dri_screen(drawable->sPriv);
unsigned statt_mask, new_mask;
- boolean new_stamp;
+ bool new_stamp;
int i;
unsigned int lastStamp;
struct pipe_resource **textures =
} while (lastStamp != drawable->dPriv->lastStamp);
if (!out)
- return TRUE;
+ return true;
/* Set the window-system buffers for the state tracker. */
for (i = 0; i < count; i++)
pipe_resource_reference(&out[i], textures[statts[i]]);
- return TRUE;
+ return true;
}
-static boolean
+static bool
dri_st_framebuffer_flush_front(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi,
enum st_attachment_type statt)
/* XXX remove this and just set the correct one on the framebuffer */
drawable->flush_frontbuffer(ctx, drawable, statt);
- return TRUE;
+ return true;
}
/**
* The state tracker framebuffer interface flush_swapbuffers callback
*/
-static boolean
+static bool
dri_st_framebuffer_flush_swapbuffers(struct st_context_iface *stctx,
struct st_framebuffer_iface *stfbi)
{
if (drawable->flush_swapbuffers)
drawable->flush_swapbuffers(ctx, drawable);
- return TRUE;
+ return true;
}
/**
* This is called when we need to set up GL rendering to a new X window.
*/
-boolean
+bool
dri_create_buffer(__DRIscreen * sPriv,
__DRIdrawable * dPriv,
- const struct gl_config * visual, boolean isPixmap)
+ const struct gl_config * visual, bool isPixmap)
{
struct dri_screen *screen = sPriv->driverPrivate;
struct dri_drawable *drawable = NULL;
drawable->base.ID = p_atomic_inc_return(&drifb_ID);
drawable->base.state_manager = &screen->base;
- return GL_TRUE;
+ return true;
fail:
FREE(drawable);
- return GL_FALSE;
+ return false;
}
void
if (format == __DRI_TEXTURE_FORMAT_RGB) {
/* only need to cover the formats recognized by dri_fill_st_visual */
switch (internal_format) {
+ case PIPE_FORMAT_B10G10R10A2_UNORM:
+ internal_format = PIPE_FORMAT_B10G10R10X2_UNORM;
+ break;
+ case PIPE_FORMAT_R10G10B10A2_UNORM:
+ internal_format = PIPE_FORMAT_R10G10B10X2_UNORM;
+ break;
case PIPE_FORMAT_BGRA8888_UNORM:
internal_format = PIPE_FORMAT_BGRX8888_UNORM;
break;
ctx->st->teximage(ctx->st,
(target == GL_TEXTURE_2D) ? ST_TEXTURE_2D : ST_TEXTURE_RECT,
- 0, internal_format, pt, FALSE);
+ 0, internal_format, pt, false);
}
}
struct dri_drawable *drawable = dri_drawable(dPriv);
struct st_context_iface *st;
unsigned flush_flags;
- boolean swap_msaa_buffers = FALSE;
+ bool swap_msaa_buffers = false;
if (!ctx) {
assert(0);
if (drawable->flushing)
return;
- drawable->flushing = TRUE;
+ drawable->flushing = true;
}
else {
flags &= ~__DRI2_FLUSH_DRAWABLE;
if (drawable->msaa_textures[ST_ATTACHMENT_FRONT_LEFT] &&
drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]) {
- swap_msaa_buffers = TRUE;
+ swap_msaa_buffers = true;
}
/* FRONT_LEFT is resolved in drawable->flush_frontbuffer. */
dri_postprocessing(ctx, drawable, ST_ATTACHMENT_BACK_LEFT);
- if (ctx->hud) {
- hud_run(ctx->hud, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
- }
-
- pipe->flush_resource(pipe, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
-
if (pipe->invalidate_resource &&
(flags & __DRI2_FLUSH_INVALIDATE_ANCILLARY)) {
if (drawable->textures[ST_ATTACHMENT_DEPTH_STENCIL])
if (drawable->msaa_textures[ST_ATTACHMENT_DEPTH_STENCIL])
pipe->invalidate_resource(pipe, drawable->msaa_textures[ST_ATTACHMENT_DEPTH_STENCIL]);
}
+
+ if (ctx->hud) {
+ hud_run(ctx->hud, ctx->st->cso_context,
+ drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
+ }
+
+ pipe->flush_resource(pipe, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
}
flush_flags = 0;
flush_flags |= ST_FLUSH_END_OF_FRAME;
/* Flush the context and throttle if needed. */
- if (dri_screen(ctx->sPriv)->throttling_enabled &&
+ if (dri_screen(ctx->sPriv)->default_throttle_frames &&
drawable &&
(reason == __DRI2_THROTTLE_SWAPBUFFER ||
reason == __DRI2_THROTTLE_FLUSHFRONT)) {
* flush method returns a fence even if there are no commands to flush.
*/
struct pipe_screen *screen = drawable->screen->base.screen;
- struct pipe_fence_handle *fence;
+ struct pipe_fence_handle *oldest_fence, *new_fence = NULL;
- fence = swap_fences_pop_front(drawable);
- if (fence) {
- (void) screen->fence_finish(screen, NULL, fence, PIPE_TIMEOUT_INFINITE);
- screen->fence_reference(screen, &fence, NULL);
- }
+ st->flush(st, flush_flags, &new_fence);
- st->flush(st, flush_flags, &fence);
+ oldest_fence = swap_fences_pop_front(drawable);
+ if (oldest_fence) {
+ screen->fence_finish(screen, NULL, oldest_fence, PIPE_TIMEOUT_INFINITE);
+ screen->fence_reference(screen, &oldest_fence, NULL);
+ }
- if (fence) {
- swap_fences_push_back(drawable, fence);
- screen->fence_reference(screen, &fence, NULL);
+ if (new_fence) {
+ swap_fences_push_back(drawable, new_fence);
+ screen->fence_reference(screen, &new_fence, NULL);
}
}
else if (flags & (__DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT)) {
}
if (drawable) {
- drawable->flushing = FALSE;
+ drawable->flushing = false;
}
/* Swap the MSAA front and back buffers, so that reading