gallium: rename clearRT / clearDS to clear_render_target / clear_depth_stencil
more consistent with rest of gallium naming conventions. Also rename driver-internal names for these the same.
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Blitter utility to facilitate acceleration of the clear, clearRT, clearDS
|
* Blitter utility to facilitate acceleration of the clear, clear_render_target, clear_depth_stencil
|
||||||
* resource_copy_region functions.
|
* resource_copy_region functions.
|
||||||
*
|
*
|
||||||
* @author Marek Olšák
|
* @author Marek Olšák
|
||||||
@@ -781,11 +781,11 @@ void util_blitter_copy_region(struct blitter_context *blitter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Clear a region of a color surface to a constant value. */
|
/* Clear a region of a color surface to a constant value. */
|
||||||
void util_blitter_clearRT(struct blitter_context *blitter,
|
void util_blitter_clear_render_target(struct blitter_context *blitter,
|
||||||
struct pipe_surface *dstsurf,
|
struct pipe_surface *dstsurf,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
|
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
|
||||||
struct pipe_context *pipe = ctx->pipe;
|
struct pipe_context *pipe = ctx->pipe;
|
||||||
@@ -822,13 +822,13 @@ void util_blitter_clearRT(struct blitter_context *blitter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Clear a region of a depth stencil surface. */
|
/* Clear a region of a depth stencil surface. */
|
||||||
void util_blitter_clearDS(struct blitter_context *blitter,
|
void util_blitter_clear_depth_stencil(struct blitter_context *blitter,
|
||||||
struct pipe_surface *dstsurf,
|
struct pipe_surface *dstsurf,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
|
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
|
||||||
struct pipe_context *pipe = ctx->pipe;
|
struct pipe_context *pipe = ctx->pipe;
|
||||||
|
@@ -129,11 +129,11 @@ void util_blitter_copy_region(struct blitter_context *blitter,
|
|||||||
* already required to be saved:
|
* already required to be saved:
|
||||||
* - framebuffer state
|
* - framebuffer state
|
||||||
*/
|
*/
|
||||||
void util_blitter_clearRT(struct blitter_context *blitter,
|
void util_blitter_clear_render_target(struct blitter_context *blitter,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height);
|
unsigned width, unsigned height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear a region of a depth-stencil surface, both stencil and depth
|
* Clear a region of a depth-stencil surface, both stencil and depth
|
||||||
@@ -143,13 +143,13 @@ void util_blitter_clearRT(struct blitter_context *blitter,
|
|||||||
* already required to be saved:
|
* already required to be saved:
|
||||||
* - framebuffer state
|
* - framebuffer state
|
||||||
*/
|
*/
|
||||||
void util_blitter_clearDS(struct blitter_context *blitter,
|
void util_blitter_clear_depth_stencil(struct blitter_context *blitter,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height);
|
unsigned width, unsigned height);
|
||||||
|
|
||||||
/* The functions below should be used to save currently bound constant state
|
/* The functions below should be used to save currently bound constant state
|
||||||
* objects inside a driver. The objects are automatically restored at the end
|
* objects inside a driver. The objects are automatically restored at the end
|
||||||
|
@@ -46,14 +46,14 @@ util_clear(struct pipe_context *pipe,
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < framebuffer->nr_cbufs; i++) {
|
for (i = 0; i < framebuffer->nr_cbufs; i++) {
|
||||||
struct pipe_surface *ps = framebuffer->cbufs[i];
|
struct pipe_surface *ps = framebuffer->cbufs[i];
|
||||||
pipe->clearRT(pipe, ps, rgba, 0, 0, ps->width, ps->height);
|
pipe->clear_render_target(pipe, ps, rgba, 0, 0, ps->width, ps->height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
|
if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
|
||||||
struct pipe_surface *ps = framebuffer->zsbuf;
|
struct pipe_surface *ps = framebuffer->zsbuf;
|
||||||
pipe->clearDS(pipe, ps, buffers & PIPE_CLEAR_DEPTHSTENCIL,
|
pipe->clear_depth_stencil(pipe, ps, buffers & PIPE_CLEAR_DEPTHSTENCIL,
|
||||||
depth, stencil,
|
depth, stencil,
|
||||||
0, 0, ps->width, ps->height);
|
0, 0, ps->width, ps->height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -196,19 +196,19 @@ util_resource_copy_region(struct pipe_context *pipe,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fallback for pipe->clearRT() function.
|
* Fallback for pipe->clear_render_target() function.
|
||||||
* XXX this looks too hackish to be really useful.
|
* XXX this looks too hackish to be really useful.
|
||||||
* cpp > 4 looks like a gross hack at best...
|
* cpp > 4 looks like a gross hack at best...
|
||||||
* and we're missing the equivalent clearDS fallback.
|
* and we're missing the equivalent clear_depth_stencil fallback.
|
||||||
* Plus can't use these transfer fallbacks when clearing
|
* Plus can't use these transfer fallbacks when clearing
|
||||||
* multisampled surfaces for instance.
|
* multisampled surfaces for instance.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
util_clearRT(struct pipe_context *pipe,
|
util_clear_render_target(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct pipe_transfer *dst_trans;
|
struct pipe_transfer *dst_trans;
|
||||||
void *dst_map;
|
void *dst_map;
|
||||||
|
@@ -57,11 +57,11 @@ util_resource_copy_region(struct pipe_context *pipe,
|
|||||||
unsigned w, unsigned h);
|
unsigned w, unsigned h);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
util_clearRT(struct pipe_context *pipe,
|
util_clear_render_target(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height);
|
unsigned width, unsigned height);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -116,12 +116,12 @@ supports PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE.
|
|||||||
If a surface includes several layers/slices (XXX: not yet...) then all layers
|
If a surface includes several layers/slices (XXX: not yet...) then all layers
|
||||||
will be cleared.
|
will be cleared.
|
||||||
|
|
||||||
``clearRT`` clears a single color rendertarget with the specified color
|
``clear_render_target`` clears a single color rendertarget with the specified
|
||||||
value. While it is only possible to clear one surface at a time (which can
|
color value. While it is only possible to clear one surface at a time (which can
|
||||||
include several layers), this surface need not be bound to the framebuffer.
|
include several layers), this surface need not be bound to the framebuffer.
|
||||||
|
|
||||||
``clearDS``clears a single depth, stencil or depth/stencil surface with
|
``clear_depth_stencil``clears a single depth, stencil or depth/stencil surface
|
||||||
the specified depth and stencil values (for combined depth/stencil buffers,
|
with the specified depth and stencil values (for combined depth/stencil buffers,
|
||||||
is is also possible to only clear one or the other part). While it is only
|
is is also possible to only clear one or the other part). While it is only
|
||||||
possible to clear one surface at a time (which can include several layers),
|
possible to clear one surface at a time (which can include several layers),
|
||||||
this surface need not be bound to the framebuffer.
|
this surface need not be bound to the framebuffer.
|
||||||
|
@@ -146,8 +146,8 @@ struct pipe_context *failover_create( struct pipe_context *hw,
|
|||||||
failover->pipe.draw_arrays = failover_draw_arrays;
|
failover->pipe.draw_arrays = failover_draw_arrays;
|
||||||
failover->pipe.draw_elements = failover_draw_elements;
|
failover->pipe.draw_elements = failover_draw_elements;
|
||||||
failover->pipe.clear = hw->clear;
|
failover->pipe.clear = hw->clear;
|
||||||
failover->pipe.clearRT = hw->clearRT;
|
failover->pipe.clear_render_target = hw->clear_render_target;
|
||||||
failover->pipe.clearDS = hw->clearDS;
|
failover->pipe.clear_depth_stencil = hw->clear_depth_stencil;
|
||||||
|
|
||||||
/* No software occlusion fallback (or other optional functionality)
|
/* No software occlusion fallback (or other optional functionality)
|
||||||
* at this point - if the hardware doesn't support it, don't
|
* at this point - if the hardware doesn't support it, don't
|
||||||
|
@@ -95,11 +95,11 @@ i915_surface_copy(struct pipe_context *pipe,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
i915_clearRT(struct pipe_context *pipe,
|
i915_clear_render_target(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct i915_texture *tex = i915_texture(dst->texture);
|
struct i915_texture *tex = i915_texture(dst->texture);
|
||||||
struct pipe_resource *pt = &tex->b.b;
|
struct pipe_resource *pt = &tex->b.b;
|
||||||
@@ -120,13 +120,13 @@ i915_clearRT(struct pipe_context *pipe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
i915_clearDS(struct pipe_context *pipe,
|
i915_clear_depth_stencil(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct i915_texture *tex = i915_texture(dst->texture);
|
struct i915_texture *tex = i915_texture(dst->texture);
|
||||||
struct pipe_resource *pt = &tex->b.b;
|
struct pipe_resource *pt = &tex->b.b;
|
||||||
@@ -209,8 +209,8 @@ void
|
|||||||
i915_init_surface_functions(struct i915_context *i915)
|
i915_init_surface_functions(struct i915_context *i915)
|
||||||
{
|
{
|
||||||
i915->base.resource_copy_region = i915_surface_copy;
|
i915->base.resource_copy_region = i915_surface_copy;
|
||||||
i915->base.clearRT = i915_clearRT;
|
i915->base.clear_render_target = i915_clear_render_target;
|
||||||
i915->base.clearDS = i915_clearDS;
|
i915->base.clear_depth_stencil = i915_clear_depth_stencil;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No good reason for these to be in the screen.
|
/* No good reason for these to be in the screen.
|
||||||
|
@@ -227,11 +227,11 @@ static void brw_clear(struct pipe_context *pipe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* XXX should respect region */
|
/* XXX should respect region */
|
||||||
static void brw_clearRT(struct pipe_context *pipe,
|
static void brw_clear_render_target(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct brw_context *brw = brw_context( pipe );
|
struct brw_context *brw = brw_context( pipe );
|
||||||
|
|
||||||
@@ -241,13 +241,13 @@ static void brw_clearRT(struct pipe_context *pipe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* XXX should respect region */
|
/* XXX should respect region */
|
||||||
static void brw_clearDS(struct pipe_context *pipe,
|
static void brw_clear_depth_stencil(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct brw_context *brw = brw_context( pipe );
|
struct brw_context *brw = brw_context( pipe );
|
||||||
|
|
||||||
@@ -260,8 +260,8 @@ static void brw_clearDS(struct pipe_context *pipe,
|
|||||||
void brw_pipe_clear_init( struct brw_context *brw )
|
void brw_pipe_clear_init( struct brw_context *brw )
|
||||||
{
|
{
|
||||||
brw->base.clear = brw_clear;
|
brw->base.clear = brw_clear;
|
||||||
brw->base.clearRT = brw_clearRT;
|
brw->base.clear_render_target = brw_clear_render_target;
|
||||||
brw->base.clearDS = brw_clearDS;
|
brw->base.clear_depth_stencil = brw_clear_depth_stencil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -666,48 +666,48 @@ identity_clear(struct pipe_context *_pipe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
identity_clearRT(struct pipe_context *_pipe,
|
identity_clear_render_target(struct pipe_context *_pipe,
|
||||||
struct pipe_surface *_dst,
|
struct pipe_surface *_dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct identity_context *id_pipe = identity_context(_pipe);
|
struct identity_context *id_pipe = identity_context(_pipe);
|
||||||
struct identity_surface *id_surface_dst = identity_surface(_dst);
|
struct identity_surface *id_surface_dst = identity_surface(_dst);
|
||||||
struct pipe_context *pipe = id_pipe->pipe;
|
struct pipe_context *pipe = id_pipe->pipe;
|
||||||
struct pipe_surface *dst = id_surface_dst->surface;
|
struct pipe_surface *dst = id_surface_dst->surface;
|
||||||
|
|
||||||
pipe->clearRT(pipe,
|
pipe->clear_render_target(pipe,
|
||||||
dst,
|
dst,
|
||||||
rgba,
|
rgba,
|
||||||
dstx,
|
dstx,
|
||||||
dsty,
|
dsty,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
identity_clearDS(struct pipe_context *_pipe,
|
identity_clear_depth_stencil(struct pipe_context *_pipe,
|
||||||
struct pipe_surface *_dst,
|
struct pipe_surface *_dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct identity_context *id_pipe = identity_context(_pipe);
|
struct identity_context *id_pipe = identity_context(_pipe);
|
||||||
struct identity_surface *id_surface_dst = identity_surface(_dst);
|
struct identity_surface *id_surface_dst = identity_surface(_dst);
|
||||||
struct pipe_context *pipe = id_pipe->pipe;
|
struct pipe_context *pipe = id_pipe->pipe;
|
||||||
struct pipe_surface *dst = id_surface_dst->surface;
|
struct pipe_surface *dst = id_surface_dst->surface;
|
||||||
|
|
||||||
pipe->clearDS(pipe,
|
pipe->clear_depth_stencil(pipe,
|
||||||
dst,
|
dst,
|
||||||
clear_flags,
|
clear_flags,
|
||||||
depth,
|
depth,
|
||||||
stencil,
|
stencil,
|
||||||
dstx,
|
dstx,
|
||||||
dsty,
|
dsty,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -933,8 +933,8 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
|
|||||||
id_pipe->base.set_vertex_buffers = identity_set_vertex_buffers;
|
id_pipe->base.set_vertex_buffers = identity_set_vertex_buffers;
|
||||||
id_pipe->base.resource_copy_region = identity_resource_copy_region;
|
id_pipe->base.resource_copy_region = identity_resource_copy_region;
|
||||||
id_pipe->base.clear = identity_clear;
|
id_pipe->base.clear = identity_clear;
|
||||||
id_pipe->base.clearRT = identity_clearRT;
|
id_pipe->base.clear_render_target = identity_clear_render_target;
|
||||||
id_pipe->base.clearDS = identity_clearDS;
|
id_pipe->base.clear_depth_stencil = identity_clear_depth_stencil;
|
||||||
id_pipe->base.flush = identity_flush;
|
id_pipe->base.flush = identity_flush;
|
||||||
id_pipe->base.is_resource_referenced = identity_is_resource_referenced;
|
id_pipe->base.is_resource_referenced = identity_is_resource_referenced;
|
||||||
id_pipe->base.create_sampler_view = identity_context_create_sampler_view;
|
id_pipe->base.create_sampler_view = identity_context_create_sampler_view;
|
||||||
|
@@ -224,11 +224,11 @@ nv50_surface_copy(struct pipe_context *pipe,
|
|||||||
|
|
||||||
/* XXX this should probably look more along the lines of nv50_clear */
|
/* XXX this should probably look more along the lines of nv50_clear */
|
||||||
static void
|
static void
|
||||||
nv50_clearRT(struct pipe_context *pipe,
|
nv50_clear_render_target(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct nv50_context *nv50 = nv50_context(pipe);
|
struct nv50_context *nv50 = nv50_context(pipe);
|
||||||
struct nv50_screen *screen = nv50->screen;
|
struct nv50_screen *screen = nv50->screen;
|
||||||
@@ -264,7 +264,7 @@ void
|
|||||||
nv50_init_surface_functions(struct nv50_context *nv50)
|
nv50_init_surface_functions(struct nv50_context *nv50)
|
||||||
{
|
{
|
||||||
nv50->pipe.resource_copy_region = nv50_surface_copy;
|
nv50->pipe.resource_copy_region = nv50_surface_copy;
|
||||||
nv50->pipe.clearRT = nv50_clearRT;
|
nv50->pipe.clear_render_target = nv50_clear_render_target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -56,11 +56,11 @@ nvfx_surface_copy(struct pipe_context *pipe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nvfx_clearRT(struct pipe_context *pipe,
|
nvfx_clear_render_target(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct nvfx_context *nvfx = nvfx_context(pipe);
|
struct nvfx_context *nvfx = nvfx_context(pipe);
|
||||||
struct nv04_surface_2d *eng2d = nvfx->screen->eng2d;
|
struct nv04_surface_2d *eng2d = nvfx->screen->eng2d;
|
||||||
@@ -71,13 +71,13 @@ nvfx_clearRT(struct pipe_context *pipe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nvfx_clearDS(struct pipe_context *pipe,
|
nvfx_clear_depth_stencil(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct nvfx_context *nvfx = nvfx_context(pipe);
|
struct nvfx_context *nvfx = nvfx_context(pipe);
|
||||||
struct nv04_surface_2d *eng2d = nvfx->screen->eng2d;
|
struct nv04_surface_2d *eng2d = nvfx->screen->eng2d;
|
||||||
@@ -91,6 +91,6 @@ void
|
|||||||
nvfx_init_surface_functions(struct nvfx_context *nvfx)
|
nvfx_init_surface_functions(struct nvfx_context *nvfx)
|
||||||
{
|
{
|
||||||
nvfx->pipe.resource_copy_region = nvfx_surface_copy;
|
nvfx->pipe.resource_copy_region = nvfx_surface_copy;
|
||||||
nvfx->pipe.clearRT = nvfx_clearRT;
|
nvfx->pipe.clear_render_target = nvfx_clear_render_target;
|
||||||
nvfx->pipe.clearDS = nvfx_clearDS;
|
nvfx->pipe.clear_depth_stencil = nvfx_clear_depth_stencil;
|
||||||
}
|
}
|
||||||
|
@@ -189,43 +189,43 @@ static void r300_resource_copy_region(struct pipe_context *pipe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Clear a region of a color surface to a constant value. */
|
/* Clear a region of a color surface to a constant value. */
|
||||||
static void r300_clearRT(struct pipe_context *pipe,
|
static void r300_clear_render_target(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct r300_context *r300 = r300_context(pipe);
|
struct r300_context *r300 = r300_context(pipe);
|
||||||
|
|
||||||
r300_blitter_save_states(r300);
|
r300_blitter_save_states(r300);
|
||||||
util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state);
|
util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state);
|
||||||
|
|
||||||
util_blitter_clearRT(r300->blitter, dst, rgba,
|
util_blitter_clear_render_target(r300->blitter, dst, rgba,
|
||||||
dstx, dsty, width, height);
|
dstx, dsty, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear a region of a depth stencil surface. */
|
/* Clear a region of a depth stencil surface. */
|
||||||
static void r300_clearDS(struct pipe_context *pipe,
|
static void r300_clear_depth_stencil(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct r300_context *r300 = r300_context(pipe);
|
struct r300_context *r300 = r300_context(pipe);
|
||||||
|
|
||||||
r300_blitter_save_states(r300);
|
r300_blitter_save_states(r300);
|
||||||
util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state);
|
util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state);
|
||||||
|
|
||||||
util_blitter_clearDS(r300->blitter, dst, clear_flags, depth, stencil,
|
util_blitter_clear_depth_stencil(r300->blitter, dst, clear_flags, depth, stencil,
|
||||||
dstx, dsty, width, height);
|
dstx, dsty, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void r300_init_blit_functions(struct r300_context *r300)
|
void r300_init_blit_functions(struct r300_context *r300)
|
||||||
{
|
{
|
||||||
r300->context.clear = r300_clear;
|
r300->context.clear = r300_clear;
|
||||||
r300->context.clearRT = r300_clearRT;
|
r300->context.clear_render_target = r300_clear_render_target;
|
||||||
r300->context.clearDS = r300_clearDS;
|
r300->context.clear_depth_stencil = r300_clear_depth_stencil;
|
||||||
r300->context.resource_copy_region = r300_resource_copy_region;
|
r300->context.resource_copy_region = r300_resource_copy_region;
|
||||||
}
|
}
|
||||||
|
@@ -817,49 +817,49 @@ rbug_clear(struct pipe_context *_pipe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rbug_clearRT(struct pipe_context *_pipe,
|
rbug_clear_render_target(struct pipe_context *_pipe,
|
||||||
struct pipe_surface *_dst,
|
struct pipe_surface *_dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
||||||
struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
|
struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
|
||||||
struct pipe_context *pipe = rb_pipe->pipe;
|
struct pipe_context *pipe = rb_pipe->pipe;
|
||||||
struct pipe_surface *dst = rb_surface_dst->surface;
|
struct pipe_surface *dst = rb_surface_dst->surface;
|
||||||
|
|
||||||
pipe->clearRT(pipe,
|
pipe->clear_render_target(pipe,
|
||||||
dst,
|
dst,
|
||||||
rgba,
|
rgba,
|
||||||
dstx,
|
dstx,
|
||||||
dsty,
|
dsty,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rbug_clearDS(struct pipe_context *_pipe,
|
rbug_clear_depth_stencil(struct pipe_context *_pipe,
|
||||||
struct pipe_surface *_dst,
|
struct pipe_surface *_dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
||||||
struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
|
struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
|
||||||
struct pipe_context *pipe = rb_pipe->pipe;
|
struct pipe_context *pipe = rb_pipe->pipe;
|
||||||
struct pipe_surface *dst = rb_surface_dst->surface;
|
struct pipe_surface *dst = rb_surface_dst->surface;
|
||||||
|
|
||||||
pipe->clearDS(pipe,
|
pipe->clear_depth_stencil(pipe,
|
||||||
dst,
|
dst,
|
||||||
clear_flags,
|
clear_flags,
|
||||||
depth,
|
depth,
|
||||||
stencil,
|
stencil,
|
||||||
dstx,
|
dstx,
|
||||||
dsty,
|
dsty,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1095,8 +1095,8 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
|
|||||||
rb_pipe->base.set_sample_mask = rbug_set_sample_mask;
|
rb_pipe->base.set_sample_mask = rbug_set_sample_mask;
|
||||||
rb_pipe->base.resource_copy_region = rbug_resource_copy_region;
|
rb_pipe->base.resource_copy_region = rbug_resource_copy_region;
|
||||||
rb_pipe->base.clear = rbug_clear;
|
rb_pipe->base.clear = rbug_clear;
|
||||||
rb_pipe->base.clearRT = rbug_clearRT;
|
rb_pipe->base.clear_render_target = rbug_clear_render_target;
|
||||||
rb_pipe->base.clearDS = rbug_clearDS;
|
rb_pipe->base.clear_depth_stencil = rbug_clear_depth_stencil;
|
||||||
rb_pipe->base.flush = rbug_flush;
|
rb_pipe->base.flush = rbug_flush;
|
||||||
rb_pipe->base.is_resource_referenced = rbug_is_resource_referenced;
|
rb_pipe->base.is_resource_referenced = rbug_is_resource_referenced;
|
||||||
rb_pipe->base.create_sampler_view = rbug_context_create_sampler_view;
|
rb_pipe->base.create_sampler_view = rbug_context_create_sampler_view;
|
||||||
|
@@ -1109,18 +1109,18 @@ trace_context_clear(struct pipe_context *_pipe,
|
|||||||
|
|
||||||
|
|
||||||
static INLINE void
|
static INLINE void
|
||||||
trace_context_clearRT(struct pipe_context *_pipe,
|
trace_context_clear_render_target(struct pipe_context *_pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct trace_context *tr_ctx = trace_context(_pipe);
|
struct trace_context *tr_ctx = trace_context(_pipe);
|
||||||
struct pipe_context *pipe = tr_ctx->pipe;
|
struct pipe_context *pipe = tr_ctx->pipe;
|
||||||
|
|
||||||
dst = trace_surface_unwrap(tr_ctx, dst);
|
dst = trace_surface_unwrap(tr_ctx, dst);
|
||||||
|
|
||||||
trace_dump_call_begin("pipe_context", "clearRT");
|
trace_dump_call_begin("pipe_context", "clear_render_target");
|
||||||
|
|
||||||
trace_dump_arg(ptr, pipe);
|
trace_dump_arg(ptr, pipe);
|
||||||
trace_dump_arg(ptr, dst);
|
trace_dump_arg(ptr, dst);
|
||||||
@@ -1130,26 +1130,26 @@ trace_context_clearRT(struct pipe_context *_pipe,
|
|||||||
trace_dump_arg(uint, width);
|
trace_dump_arg(uint, width);
|
||||||
trace_dump_arg(uint, height);
|
trace_dump_arg(uint, height);
|
||||||
|
|
||||||
pipe->clearRT(pipe, dst, rgba, dstx, dsty, width, height);
|
pipe->clear_render_target(pipe, dst, rgba, dstx, dsty, width, height);
|
||||||
|
|
||||||
trace_dump_call_end();
|
trace_dump_call_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void
|
static INLINE void
|
||||||
trace_context_clearDS(struct pipe_context *_pipe,
|
trace_context_clear_depth_stencil(struct pipe_context *_pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct trace_context *tr_ctx = trace_context(_pipe);
|
struct trace_context *tr_ctx = trace_context(_pipe);
|
||||||
struct pipe_context *pipe = tr_ctx->pipe;
|
struct pipe_context *pipe = tr_ctx->pipe;
|
||||||
|
|
||||||
dst = trace_surface_unwrap(tr_ctx, dst);
|
dst = trace_surface_unwrap(tr_ctx, dst);
|
||||||
|
|
||||||
trace_dump_call_begin("pipe_context", "clearDS");
|
trace_dump_call_begin("pipe_context", "clear_depth_stencil");
|
||||||
|
|
||||||
trace_dump_arg(ptr, pipe);
|
trace_dump_arg(ptr, pipe);
|
||||||
trace_dump_arg(ptr, dst);
|
trace_dump_arg(ptr, dst);
|
||||||
@@ -1161,8 +1161,8 @@ trace_context_clearDS(struct pipe_context *_pipe,
|
|||||||
trace_dump_arg(uint, width);
|
trace_dump_arg(uint, width);
|
||||||
trace_dump_arg(uint, height);
|
trace_dump_arg(uint, height);
|
||||||
|
|
||||||
pipe->clearDS(pipe, dst, clear_flags, depth, stencil,
|
pipe->clear_depth_stencil(pipe, dst, clear_flags, depth, stencil,
|
||||||
dstx, dsty, width, height);
|
dstx, dsty, width, height);
|
||||||
|
|
||||||
trace_dump_call_end();
|
trace_dump_call_end();
|
||||||
}
|
}
|
||||||
@@ -1479,8 +1479,8 @@ trace_context_create(struct trace_screen *tr_scr,
|
|||||||
tr_ctx->base.set_vertex_buffers = trace_context_set_vertex_buffers;
|
tr_ctx->base.set_vertex_buffers = trace_context_set_vertex_buffers;
|
||||||
tr_ctx->base.resource_copy_region = trace_context_resource_copy_region;
|
tr_ctx->base.resource_copy_region = trace_context_resource_copy_region;
|
||||||
tr_ctx->base.clear = trace_context_clear;
|
tr_ctx->base.clear = trace_context_clear;
|
||||||
tr_ctx->base.clearRT = trace_context_clearRT;
|
tr_ctx->base.clear_render_target = trace_context_clear_render_target;
|
||||||
tr_ctx->base.clearDS = trace_context_clearDS;
|
tr_ctx->base.clear_depth_stencil = trace_context_clear_depth_stencil;
|
||||||
tr_ctx->base.flush = trace_context_flush;
|
tr_ctx->base.flush = trace_context_flush;
|
||||||
tr_ctx->base.is_resource_referenced = trace_is_resource_referenced;
|
tr_ctx->base.is_resource_referenced = trace_is_resource_referenced;
|
||||||
|
|
||||||
|
@@ -287,11 +287,11 @@ struct pipe_context {
|
|||||||
* Clear a color rendertarget surface.
|
* Clear a color rendertarget surface.
|
||||||
* \param rgba pointer to an array of one float for each of r, g, b, a.
|
* \param rgba pointer to an array of one float for each of r, g, b, a.
|
||||||
*/
|
*/
|
||||||
void (*clearRT)(struct pipe_context *pipe,
|
void (*clear_render_target)(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const float *rgba,
|
const float *rgba,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height);
|
unsigned width, unsigned height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear a depth-stencil surface.
|
* Clear a depth-stencil surface.
|
||||||
@@ -299,13 +299,13 @@ struct pipe_context {
|
|||||||
* \param depth depth clear value in [0,1].
|
* \param depth depth clear value in [0,1].
|
||||||
* \param stencil stencil clear value
|
* \param stencil stencil clear value
|
||||||
*/
|
*/
|
||||||
void (*clearDS)(struct pipe_context *pipe,
|
void (*clear_depth_stencil)(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height);
|
unsigned width, unsigned height);
|
||||||
|
|
||||||
/** Flush rendering
|
/** Flush rendering
|
||||||
* \param flags bitmask of PIPE_FLUSH_x tokens)
|
* \param flags bitmask of PIPE_FLUSH_x tokens)
|
||||||
|
@@ -447,10 +447,10 @@ error1:
|
|||||||
src->texture, subsrc, srcx, srcy, src->zslice, width, height);
|
src->texture, subsrc, srcx, srcy, src->zslice, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearRT(struct st_surface *dst,
|
void clear_render_target(struct st_surface *dst,
|
||||||
float *rgba,
|
float *rgba,
|
||||||
unsigned x, unsigned y,
|
unsigned x, unsigned y,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct pipe_surface *_dst = NULL;
|
struct pipe_surface *_dst = NULL;
|
||||||
|
|
||||||
@@ -458,18 +458,18 @@ error1:
|
|||||||
if(!_dst)
|
if(!_dst)
|
||||||
SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing");
|
SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing");
|
||||||
|
|
||||||
$self->pipe->clearRT($self->pipe, _dst, rgba, x, y, width, height);
|
$self->pipe->clear_render_target($self->pipe, _dst, rgba, x, y, width, height);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
pipe_surface_reference(&_dst, NULL);
|
pipe_surface_reference(&_dst, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearDS(struct st_surface *dst,
|
void clear_depth_stencil(struct st_surface *dst,
|
||||||
unsigned clear_flags,
|
unsigned clear_flags,
|
||||||
double depth,
|
double depth,
|
||||||
unsigned stencil,
|
unsigned stencil,
|
||||||
unsigned x, unsigned y,
|
unsigned x, unsigned y,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
struct pipe_surface *_dst = NULL;
|
struct pipe_surface *_dst = NULL;
|
||||||
|
|
||||||
@@ -477,8 +477,8 @@ error1:
|
|||||||
if(!_dst)
|
if(!_dst)
|
||||||
SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing");
|
SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing");
|
||||||
|
|
||||||
$self->pipe->clearDS($self->pipe, _dst, clear_flags, depth, stencil,
|
$self->pipe->clear_depth_stencil($self->pipe, _dst, clear_flags, depth, stencil,
|
||||||
x, y, width, height);
|
x, y, width, height);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
pipe_surface_reference(&_dst, NULL);
|
pipe_surface_reference(&_dst, NULL);
|
||||||
|
Reference in New Issue
Block a user