clr->surface = surfIndex;
clr->value = clearValue;
}
-
- /* Technically, the surface's contents are now known and cleared,
- * so we could set the status to PIPE_SURFACE_STATUS_CLEAR. But
- * it turns out it's quite painful to recognize when any particular
- * surface goes from PIPE_SURFACE_STATUS_CLEAR to
- * PIPE_SURFACE_STATUS_DEFINED (i.e. with known contents), because
- * the drawing commands could be operating on numerous draw buffers,
- * which we'd have to iterate through to set all their stati...
- * For now, we cheat a bit and set the surface's status to DEFINED
- * right here. Later we should revisit this and set the status to
- * CLEAR here, and find a better place to set the status to DEFINED.
- */
- ps->status = PIPE_SURFACE_STATUS_DEFINED;
}
unsigned clearValue)
{
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
- ps->status = PIPE_SURFACE_STATUS_DEFINED;
}
ps->height = pt->height[level];
ps->offset = offset;
ps->usage = flags;
- ps->status = PIPE_SURFACE_STATUS_DEFINED;
}
return ps;
}
static void
i915_tex_surface_destroy(struct pipe_surface *surf)
{
- /* This really should not be possible, but it's actually
- * happening quite a bit... Will fix.
- */
- if (surf->status == PIPE_SURFACE_STATUS_CLEAR) {
- debug_printf("XXX destroying a surface with pending clears...\n");
- assert(0);
- }
-
pipe_texture_reference(&surf->texture, NULL);
FREE(surf);
}
ps->nblocksy = pt->nblocksy[level];
ps->stride = tex->stride;
ps->offset = offset;
- ps->status = PIPE_SURFACE_STATUS_DEFINED;
}
return ps;
}
ns->base.width = pt->width[level];
ns->base.height = pt->height[level];
ns->base.usage = flags;
- ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
pipe_reference_init(&ns->base.reference, 1);
ns->base.face = face;
ns->base.level = level;
ns->base.width = pt->width[level];
ns->base.height = pt->height[level];
ns->base.usage = flags;
- ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
pipe_reference_init(&ns->base.reference, 1);
ns->base.face = face;
ns->base.level = level;
unsigned clearValue)
{
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
- ps->status = PIPE_SURFACE_STATUS_CLEAR;
}
ns->base.width = pt->width[level];
ns->base.height = pt->height[level];
ns->base.usage = flags;
- ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
pipe_reference_init(&ns->base.reference, 1);
ns->base.face = face;
ns->base.level = level;
unsigned clearValue)
{
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
- ps->status = PIPE_SURFACE_STATUS_CLEAR;
}
ns->base.width = pt->width[level];
ns->base.height = pt->height[level];
ns->base.usage = flags;
- ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
pipe_reference_init(&ns->base.reference, 1);
ns->base.face = face;
ns->base.level = level;
nv30_state_do_validate(struct nv30_context *nv30,
struct nv30_state_entry **states)
{
- const struct pipe_framebuffer_state *fb = &nv30->framebuffer;
- unsigned i;
-
- for (i = 0; i < fb->nr_cbufs; i++)
- fb->cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
- if (fb->zsbuf)
- fb->zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
-
while (*states) {
struct nv30_state_entry *e = *states;
unsigned clearValue)
{
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
- ps->status = PIPE_SURFACE_STATUS_CLEAR;
}
ns->base.width = pt->width[level];
ns->base.height = pt->height[level];
ns->base.usage = flags;
- ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
pipe_reference_init(&ns->base.reference, 1);
ns->base.face = face;
ns->base.level = level;
nv40_state_do_validate(struct nv40_context *nv40,
struct nv40_state_entry **states)
{
- const struct pipe_framebuffer_state *fb = &nv40->framebuffer;
- unsigned i;
-
- for (i = 0; i < fb->nr_cbufs; i++)
- fb->cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
- if (fb->zsbuf)
- fb->zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
-
while (*states) {
struct nv40_state_entry *e = *states;
pipe->set_framebuffer_state(pipe, &s_fb);
pipe->set_scissor_state(pipe, &s_sc);
nv50->dirty |= dirty;
-
- ps->status = PIPE_SURFACE_STATUS_CLEAR;
}
ps->width = pt->width[level];
ps->height = pt->height[level];
ps->usage = flags;
- ps->status = PIPE_SURFACE_STATUS_DEFINED;
pipe_reference_init(&ps->reference, 1);
ps->face = face;
ps->level = level;
boolean
nv50_state_validate(struct nv50_context *nv50)
{
- const struct pipe_framebuffer_state *fb = &nv50->framebuffer;
struct nouveau_grobj *tesla = nv50->screen->tesla;
struct nouveau_stateobj *so;
unsigned i;
- for (i = 0; i < fb->nr_cbufs; i++)
- fb->cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
-
- if (fb->zsbuf)
- fb->zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
-
if (nv50->dirty & NV50_NEW_FRAMEBUFFER)
nv50_state_validate_fb(nv50);
unsigned color)
{
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
- ps->status = PIPE_SURFACE_STATUS_DEFINED;
-}
\ No newline at end of file
+}
surface->height = texture->height[level];
surface->offset = offset;
surface->usage = flags;
- surface->status = PIPE_SURFACE_STATUS_DEFINED;
}
return surface;
if (ps == sp_tile_cache_get_surface(softpipe->zsbuf_cache)) {
sp_tile_cache_clear(softpipe->zsbuf_cache, clearValue);
- softpipe->framebuffer.zsbuf->status = PIPE_SURFACE_STATUS_CLEAR;
#if TILE_CLEAR_OPTIMIZATION
return;
#endif
cv = clearValue;
}
sp_tile_cache_clear(softpipe->cbuf_cache[i], cv);
- softpipe->framebuffer.cbufs[i]->status = PIPE_SURFACE_STATUS_CLEAR;
}
}
softpipe_update_derived(sp);
}
- /* Mark surfaces as defined now */
- for (i = 0; i < sp->framebuffer.nr_cbufs; i++){
- if (sp->framebuffer.cbufs[i]) {
- sp->framebuffer.cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
- }
- }
- if (sp->framebuffer.zsbuf) {
- sp->framebuffer.zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
- }
-
/* Note: nr_attrs is only used for debugging (vertex printing) */
setup->quad.nr_attrs = draw_num_vs_outputs(sp->draw);
trace_dump_reference(&state->reference);
trace_dump_member(format, state, format);
- trace_dump_member(uint, state, status);
- trace_dump_member(uint, state, clear_value);
trace_dump_member(uint, state, width);
trace_dump_member(uint, state, height);
#define PIPE_SURFACE_LAYOUT_LINEAR 0
-/**
- * Surface status
- */
-#define PIPE_SURFACE_STATUS_UNDEFINED 0
-#define PIPE_SURFACE_STATUS_DEFINED 1
-#define PIPE_SURFACE_STATUS_CLEAR 2
-
-
/**
* Transfer object usage flags
*/
{
struct pipe_reference reference;
enum pipe_format format; /**< PIPE_FORMAT_x */
- unsigned status; /**< PIPE_SURFACE_STATUS_x */
- unsigned clear_value; /**< XXX may be temporary */
unsigned width; /**< logical width in pixels */
unsigned height; /**< logical height in pixels */
unsigned layout; /**< PIPE_SURFACE_LAYOUT_x */
surf->user->pipe->flush(surf->user->pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_TEXTURE_CACHE, NULL);
/* TODO stuff here */
}
-
- st_notify_swapbuffers_complete(surf->stfb);
}
return EGL_TRUE;
static INLINE GLboolean
check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
{
- const struct st_renderbuffer *strb = st_renderbuffer(rb);
-
- if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
- return FALSE;
-
if (ctx->Scissor.Enabled)
return TRUE;
static INLINE GLboolean
check_clear_depth_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
{
- const struct st_renderbuffer *strb = st_renderbuffer(rb);
const GLuint stencilMax = (1 << rb->StencilBits) - 1;
GLboolean maskStencil
= (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
- if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
- return FALSE;
-
if (ctx->Scissor.Enabled)
return TRUE;
const struct st_renderbuffer *strb = st_renderbuffer(rb);
const GLboolean isDS = is_depth_stencil_format(strb->surface->format);
- if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
- return FALSE;
-
if (ctx->Scissor.Enabled)
return TRUE;
if (isDS &&
- strb->surface->status == PIPE_SURFACE_STATUS_DEFINED &&
ctx->DrawBuffer->Visual.stencilBits > 0)
return TRUE;
const GLboolean maskStencil
= (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
- if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
- return FALSE;
-
if (maskStencil)
return TRUE;
* current state.
*/
if (isDS &&
- strb->surface->status == PIPE_SURFACE_STATUS_DEFINED &&
ctx->DrawBuffer->Visual.depthBits > 0)
return TRUE;
}
-/**
- * Quick hack - allows the winsys to inform the driver that surface
- * states are now undefined after a glXSwapBuffers or similar.
- */
-void
-st_notify_swapbuffers_complete(struct st_framebuffer *stfb)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (ctx && ctx->DrawBuffer == &stfb->Base) {
- struct st_renderbuffer *strb;
-
- /* Mark back color buffers as undefined */
- strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_LEFT].
- Renderbuffer);
- if (strb && strb->surface)
- strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED;
-
- strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_RIGHT].
- Renderbuffer);
- if (strb && strb->surface)
- strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED;
- }
-}
-
-
void *st_framebuffer_private( struct st_framebuffer *stfb )
{
return stfb->Private;
void st_finish( struct st_context *st );
void st_notify_swapbuffers(struct st_framebuffer *stfb);
-void st_notify_swapbuffers_complete(struct st_framebuffer *stfb);
int st_set_teximage(struct pipe_texture *pt, int target);