struct pipe_surface *ps = framebuffer->cbufs[i];
if (ps) {
- pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width, ps->height);
+ pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width,
+ ps->height, true);
}
}
}
struct pipe_surface *ps = framebuffer->zsbuf;
pipe->clear_depth_stencil(pipe, ps, buffers & PIPE_CLEAR_DEPTHSTENCIL,
depth, stencil,
- 0, 0, ps->width, ps->height);
+ 0, 0, ps->width, ps->height, true);
}
}
filter->pipe->set_scissor_states(filter->pipe, 0, 1, &scissor);
filter->pipe->clear_render_target(filter->pipe, dst, &clear_color,
- 0, 0, dst->width, dst->height);
+ 0, 0, dst->width, dst->height, false);
pipe_set_constant_buffer(filter->pipe, PIPE_SHADER_FRAGMENT, 0, surface_size);
filter->pipe->bind_rasterizer_state(filter->pipe, filter->rs_state);
filter->pipe->bind_blend_state(filter->pipe, filter->blend);
(dirty_area->x0 < dirty_area->x1 || dirty_area->y0 < dirty_area->y1)) {
c->pipe->clear_render_target(c->pipe, dst_surface, &s->clear_color,
- 0, 0, dst_surface->width, dst_surface->height);
+ 0, 0, dst_surface->width, dst_surface->height, false);
dirty_area->x0 = dirty_area->y0 = MAX_DIRTY;
dirty_area->x1 = dirty_area->y1 = MIN_DIRTY;
}
(typically an occlusion query, or streamout overflow predicate).
The ``render_condition`` function specifies the query which should be checked
prior to rendering anything. Functions always honoring render_condition include
-(and are limited to) draw_vbo, clear, clear_render_target, clear_depth_stencil.
-The blit function (but not resource_copy_region, which seems inconsistent)
-can also optionally honor the current render condition.
+(and are limited to) draw_vbo and clear.
+The blit, clear_render_target and clear_depth_stencil functions (but
+not resource_copy_region, which seems inconsistent) can also optionally honor
+the current render condition.
If ``render_condition`` is called with ``query`` = NULL, conditional
rendering is disabled and drawing takes place normally.
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
call.type = CALL_CLEAR_RENDER_TARGET;
dd_before_draw(dctx);
- pipe->clear_render_target(pipe, dst, color, dstx, dsty, width, height);
+ pipe->clear_render_target(pipe, dst, color, dstx, dsty, width, height,
+ render_condition_enabled);
dd_after_draw(dctx, &call);
}
dd_context_clear_depth_stencil(struct pipe_context *_pipe,
struct pipe_surface *dst, unsigned clear_flags,
double depth, unsigned stencil, unsigned dstx,
- unsigned dsty, unsigned width, unsigned height)
+ unsigned dsty, unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
dd_before_draw(dctx);
pipe->clear_depth_stencil(pipe, dst, clear_flags, depth, stencil,
- dstx, dsty, width, height);
+ dstx, dsty, width, height,
+ render_condition_enabled);
dd_after_draw(dctx, &call);
}
static void
fd_clear_render_target(struct pipe_context *pctx, struct pipe_surface *ps,
const union pipe_color_union *color,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ unsigned x, unsigned y, unsigned w, unsigned h,
+ bool render_condition_enabled)
{
DBG("TODO: x=%u, y=%u, w=%u, h=%u", x, y, w, h);
}
static void
fd_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *ps,
unsigned buffers, double depth, unsigned stencil,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ unsigned x, unsigned y, unsigned w, unsigned h,
+ bool render_condition_enabled)
{
DBG("TODO: buffers=%u, depth=%f, stencil=%u, x=%u, y=%u, w=%u, h=%u",
buffers, depth, stencil, x, y, w, h);
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct i915_context *i915 = i915_context(pipe);
struct pipe_framebuffer_state fb_state;
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct i915_context *i915 = i915_context(pipe);
struct pipe_framebuffer_state fb_state;
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct i915_texture *tex = i915_texture(dst->texture);
struct pipe_resource *pt = &tex->b.b;
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct i915_texture *tex = i915_texture(dst->texture);
struct pipe_resource *pt = &tex->b.b;
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct ilo_context *ilo = ilo_context(pipe);
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct ilo_context *ilo = ilo_context(pipe);
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
}
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
}
static void
nv30_clear_render_target(struct pipe_context *pipe, struct pipe_surface *ps,
const union pipe_color_union *color,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ unsigned x, unsigned y, unsigned w, unsigned h,
+ bool render_condition_enabled)
{
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_surface *sf = nv30_surface(ps);
static void
nv30_clear_depth_stencil(struct pipe_context *pipe, struct pipe_surface *ps,
unsigned buffers, double depth, unsigned stencil,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ unsigned x, unsigned y, unsigned w, unsigned h,
+ bool render_condition_enabled)
{
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_surface *sf = nv30_surface(ps);
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct nv50_context *nv50 = nv50_context(pipe);
struct nouveau_pushbuf *push = nv50->base.pushbuf;
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct nv50_context *nv50 = nv50_context(pipe);
struct nouveau_pushbuf *push = nv50->base.pushbuf;
desc->unpack_s_8uint(&stencil, 0, data, 0, 1, 1);
}
pipe->clear_depth_stencil(pipe, sf, clear, depth, stencil,
- box->x, box->y, box->width, box->height);
+ box->x, box->y, box->width, box->height, false);
} else {
union pipe_color_union color;
}
pipe->clear_render_target(pipe, sf, &color,
- box->x, box->y, box->width, box->height);
+ box->x, box->y, box->width, box->height, false);
}
pipe->surface_destroy(pipe, sf);
}
mip.base.domain = NOUVEAU_BO_VRAM;
mip.base.bo = dec->mbring;
mip.base.address = dec->mbring->offset;
- context->clear_render_target(context, &surf.base, &color, 0, 0, 64, 4760);
+ context->clear_render_target(context, &surf.base, &color, 0, 0, 64, 4760, false);
surf.offset = dec->vpring->size / 2 - 0x1000;
surf.width = 1024;
surf.height = 1;
mip.level[0].pitch = surf.width * 4;
mip.base.bo = dec->vpring;
mip.base.address = dec->vpring->offset;
- context->clear_render_target(context, &surf.base, &color, 0, 0, 1024, 1);
+ context->clear_render_target(context, &surf.base, &color, 0, 0, 1024, 1, false);
surf.offset = dec->vpring->size - 0x1000;
- context->clear_render_target(context, &surf.base, &color, 0, 0, 1024, 1);
+ context->clear_render_target(context, &surf.base, &color, 0, 0, 1024, 1, false);
PUSH_SPACE(screen->pushbuf, 5);
PUSH_REFN(screen->pushbuf, dec->fence, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct r300_context *r300 = r300_context(pipe);
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct r300_context *r300 = r300_context(pipe);
struct pipe_framebuffer_state *fb =
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct r600_context *rctx = (struct r600_context *)ctx;
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct r600_context *rctx = (struct r600_context *)ctx;
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct si_context *sctx = (struct si_context *)ctx;
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct si_context *sctx = (struct si_context *)ctx;
struct pipe_surface *_dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
dstx,
dsty,
width,
- height);
+ height,
+ render_condition_enabled);
pipe_mutex_unlock(rb_pipe->call_mutex);
}
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
dstx,
dsty,
width,
- height);
+ height,
+ render_condition_enabled);
pipe_mutex_unlock(rb_pipe->call_mutex);
}
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
static void
swr_clear_render_target(struct pipe_context *pipe, struct pipe_surface *ps,
const union pipe_color_union *color,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ unsigned x, unsigned y, unsigned w, unsigned h,
+ bool render_condition_enabled)
{
struct swr_context *ctx = swr_context(pipe);
fprintf(stderr, "SWR swr_clear_render_target!\n");
static void
swr_clear_depth_stencil(struct pipe_context *pipe, struct pipe_surface *ps,
unsigned buffers, double depth, unsigned stencil,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ unsigned x, unsigned y, unsigned w, unsigned h,
+ bool render_condition_enabled)
{
struct swr_context *ctx = swr_context(pipe);
fprintf(stderr, "SWR swr_clear_depth_stencil!\n");
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
trace_dump_arg(uint, dsty);
trace_dump_arg(uint, width);
trace_dump_arg(uint, height);
+ trace_dump_arg(bool, render_condition_enabled);
- pipe->clear_render_target(pipe, dst, color, dstx, dsty, width, height);
+ pipe->clear_render_target(pipe, dst, color, dstx, dsty, width, height,
+ render_condition_enabled);
trace_dump_call_end();
}
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height)
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
trace_dump_arg(uint, dsty);
trace_dump_arg(uint, width);
trace_dump_arg(uint, height);
+ trace_dump_arg(bool, render_condition_enabled);
pipe->clear_depth_stencil(pipe, dst, clear_flags, depth, stencil,
- dstx, dsty, width, height);
+ dstx, dsty, width, height,
+ render_condition_enabled);
trace_dump_call_end();
}
static void
vc4_clear_render_target(struct pipe_context *pctx, struct pipe_surface *ps,
const union pipe_color_union *color,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ unsigned x, unsigned y, unsigned w, unsigned h,
+ bool render_condition_enabled)
{
fprintf(stderr, "unimpl: clear RT\n");
}
static void
vc4_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *ps,
unsigned buffers, double depth, unsigned stencil,
- unsigned x, unsigned y, unsigned w, unsigned h)
+ unsigned x, unsigned y, unsigned w, unsigned h,
+ bool render_condition_enabled)
{
fprintf(stderr, "unimpl: clear DS\n");
}
struct pipe_surface *dst,
const union pipe_color_union *color,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height);
+ unsigned width, unsigned height,
+ bool render_condition_enabled);
/**
* Clear a depth-stencil surface.
double depth,
unsigned stencil,
unsigned dstx, unsigned dsty,
- unsigned width, unsigned height);
+ unsigned width, unsigned height,
+ bool render_condition_enabled);
/**
* Clear the texture with the specified texel. Not guaranteed to be a
}
if (!fallback) {
- pipe->clear_render_target(pipe, psurf, &rgba, x, y, w, h);
+ pipe->clear_render_target(pipe, psurf, &rgba, x, y, w, h, false);
} else {
D3DLOCKED_RECT lock;
union util_color uc;
DBG("Clearing (%u..%u)x(%u..%u)\n", x1, x2, y1, y2);
pipe->clear_render_target(pipe, cbuf, &rgba,
- x1, y1, x2 - x1, y2 - y1);
+ x1, y1, x2 - x1, y2 - y1, false);
}
}
if (!(bufs & PIPE_CLEAR_DEPTHSTENCIL))
zsbuf = NineSurface9_GetSurface(zsbuf_surf, 0);
assert(zsbuf);
pipe->clear_depth_stencil(pipe, zsbuf, bufs, Z, Stencil,
- x1, y1, x2 - x1, y2 - y1);
+ x1, y1, x2 - x1, y2 - y1, false);
}
return D3D_OK;
}
/* TODO: investigate what else exactly needs to be cleared */
if (This->base.resource && (pDesc->Usage & D3DUSAGE_RENDERTARGET)) {
surf = NineSurface9_GetSurface(This, 0);
- pipe->clear_render_target(pipe, surf, &rgba, 0, 0, pDesc->Width, pDesc->Height);
+ pipe->clear_render_target(pipe, surf, &rgba, 0, 0, pDesc->Width, pDesc->Height, false);
}
NineSurface9_Dump(This);
c.f[0] = c.f[1] = c.f[2] = c.f[3] = 0.5f;
pipe->clear_render_target(pipe, surfaces[i], &c, 0, 0,
- surfaces[i]->width, surfaces[i]->height);
+ surfaces[i]->width, surfaces[i]->height, false);
}
pipe->flush(pipe, NULL, 0);
}