From 57a01712258c9d6063ef36bc359cffba3e7f9be1 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:22:23 +0200 Subject: cell: adapt to interface changes not even compile tested but fairly trivial --- src/gallium/drivers/cell/ppu/cell_screen.c | 8 ++++++-- src/gallium/drivers/cell/ppu/cell_surface.c | 16 ++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index b4fd8d7235..9bb3abfc9d 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -132,13 +132,17 @@ cell_get_paramf(struct pipe_screen *screen, int param) static boolean cell_is_format_supported( struct pipe_screen *screen, - enum pipe_format format, + enum pipe_format format, enum pipe_texture_target target, - unsigned tex_usage, + unsigned sample_count, + unsigned tex_usage, unsigned geom_flags ) { struct sw_winsys *winsys = cell_screen(screen)->winsys; + if (sample_count > 1) + return FALSE; + if (tex_usage & (PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | PIPE_BIND_SHARED)) { diff --git a/src/gallium/drivers/cell/ppu/cell_surface.c b/src/gallium/drivers/cell/ppu/cell_surface.c index 6696a4591c..8000eee88a 100644 --- a/src/gallium/drivers/cell/ppu/cell_surface.c +++ b/src/gallium/drivers/cell/ppu/cell_surface.c @@ -30,21 +30,9 @@ #include "cell_surface.h" -static void -cell_surface_copy(struct pipe_context *pipe, - struct pipe_surface *dest, unsigned destx, unsigned desty, - struct pipe_surface *src, unsigned srcx, unsigned srcy, - unsigned width, unsigned height) -{ - util_surface_copy(pipe, FALSE, - dest, destx, desty, - src, srcx, srcy, - width, height); -} - void cell_init_surface_functions(struct cell_context *cell) { - cell->pipe.surface_copy = cell_surface_copy; - cell->pipe.surface_fill = util_surface_fill; + cell->pipe.resource_copy_region = util_resource_copy_region; + cell->pipe.resource_fill_region = util_resource_fill_region; } -- cgit v1.2.3 From e121a73d629856240a9676a4f0dff832d95c90c3 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:23:31 +0200 Subject: llvmpipe: adapt to interface changes --- src/gallium/drivers/llvmpipe/lp_screen.c | 6 ++++- src/gallium/drivers/llvmpipe/lp_surface.c | 41 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 20 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 111eedc4f2..5f50446f84 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -168,8 +168,9 @@ llvmpipe_get_paramf(struct pipe_screen *screen, int param) */ static boolean llvmpipe_is_format_supported( struct pipe_screen *_screen, - enum pipe_format format, + enum pipe_format format, enum pipe_texture_target target, + unsigned sample_count, unsigned bind, unsigned geom_flags ) { @@ -186,6 +187,9 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, target == PIPE_TEXTURE_3D || target == PIPE_TEXTURE_CUBE); + if (sample_count > 1) + return FALSE; + if (bind & PIPE_BIND_RENDER_TARGET) { if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS) return FALSE; diff --git a/src/gallium/drivers/llvmpipe/lp_surface.c b/src/gallium/drivers/llvmpipe/lp_surface.c index 245171120d..85687ada1c 100644 --- a/src/gallium/drivers/llvmpipe/lp_surface.c +++ b/src/gallium/drivers/llvmpipe/lp_surface.c @@ -51,24 +51,27 @@ adjust_to_tile_bounds(unsigned x, unsigned y, unsigned width, unsigned height, static void -lp_surface_copy(struct pipe_context *pipe, - struct pipe_surface *dst, unsigned dstx, unsigned dsty, - struct pipe_surface *src, unsigned srcx, unsigned srcy, - unsigned width, unsigned height) +lp_resource_copy(struct pipe_context *pipe, + struct pipe_resource *dst, struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource *src, struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, + unsigned width, unsigned height) { - struct llvmpipe_resource *src_tex = llvmpipe_resource(src->texture); - struct llvmpipe_resource *dst_tex = llvmpipe_resource(dst->texture); + /* XXX what about the dstz/srcz parameters - zslice wasn't used... */ + struct llvmpipe_resource *src_tex = llvmpipe_resource(src); + struct llvmpipe_resource *dst_tex = llvmpipe_resource(dst); const enum pipe_format format = src_tex->base.format; llvmpipe_flush_resource(pipe, - dst->texture, dst->face, dst->level, + dst, subdst.face, subdst.level, 0, /* flush_flags */ FALSE, /* read_only */ FALSE, /* cpu_access */ FALSE); /* do_not_block */ llvmpipe_flush_resource(pipe, - src->texture, src->face, src->level, + src, subsrc.face, subsrc.level, 0, /* flush_flags */ TRUE, /* read_only */ FALSE, /* cpu_access */ @@ -90,8 +93,8 @@ lp_surface_copy(struct pipe_context *pipe, for (y = 0; y < th; y += TILE_SIZE) { for (x = 0; x < tw; x += TILE_SIZE) { (void) llvmpipe_get_texture_tile_linear(src_tex, - src->face, src->level, - LP_TEX_USAGE_READ, + subsrc.face, subsrc.level, + LP_TEX_USAGE_READ, tx + x, ty + y); } } @@ -117,7 +120,7 @@ lp_surface_copy(struct pipe_context *pipe, for (y = 0; y < th; y += TILE_SIZE) { for (x = 0; x < tw; x += TILE_SIZE) { (void) llvmpipe_get_texture_tile_linear(dst_tex, - dst->face, dst->level, + subdst.face, subdst.level, usage, tx + x, ty + y); } @@ -127,20 +130,20 @@ lp_surface_copy(struct pipe_context *pipe, /* copy */ { const ubyte *src_linear_ptr - = llvmpipe_get_texture_image_address(src_tex, src->face, - src->level, + = llvmpipe_get_texture_image_address(src_tex, subsrc.face, + subsrc.level, LP_TEX_LAYOUT_LINEAR); ubyte *dst_linear_ptr - = llvmpipe_get_texture_image_address(dst_tex, dst->face, - dst->level, + = llvmpipe_get_texture_image_address(dst_tex, subdst.face, + subdst.level, LP_TEX_LAYOUT_LINEAR); util_copy_rect(dst_linear_ptr, format, - llvmpipe_resource_stride(&dst_tex->base, dst->level), + llvmpipe_resource_stride(&dst_tex->base, subdst.level), dstx, dsty, width, height, src_linear_ptr, - llvmpipe_resource_stride(&src_tex->base, src->level), + llvmpipe_resource_stride(&src_tex->base, subsrc.level), srcx, srcy); } } @@ -149,6 +152,6 @@ lp_surface_copy(struct pipe_context *pipe, void llvmpipe_init_surface_functions(struct llvmpipe_context *lp) { - lp->pipe.surface_copy = lp_surface_copy; - lp->pipe.surface_fill = util_surface_fill; + lp->pipe.resource_copy_region = lp_resource_copy; + lp->pipe.resource_fill_region = util_resource_fill_region; } -- cgit v1.2.3 From 6c32670706e8ed3855ff2187f0eadee43b5b8742 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:23:46 +0200 Subject: softpipe: adapt to interface changes --- src/gallium/drivers/softpipe/sp_screen.c | 6 +++++- src/gallium/drivers/softpipe/sp_surface.c | 17 ++--------------- 2 files changed, 7 insertions(+), 16 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 8bb0294238..ad59ee9093 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -145,8 +145,9 @@ softpipe_get_paramf(struct pipe_screen *screen, int param) */ static boolean softpipe_is_format_supported( struct pipe_screen *screen, - enum pipe_format format, + enum pipe_format format, enum pipe_texture_target target, + unsigned sample_count, unsigned bind, unsigned geom_flags ) { @@ -162,6 +163,9 @@ softpipe_is_format_supported( struct pipe_screen *screen, if (!format_desc) return FALSE; + if (sample_count > 1) + return FALSE; + if (bind & (PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | PIPE_BIND_SHARED)) { diff --git a/src/gallium/drivers/softpipe/sp_surface.c b/src/gallium/drivers/softpipe/sp_surface.c index 32cab06004..0296c26ad2 100644 --- a/src/gallium/drivers/softpipe/sp_surface.c +++ b/src/gallium/drivers/softpipe/sp_surface.c @@ -29,22 +29,9 @@ #include "sp_context.h" #include "sp_surface.h" - -static void -sp_surface_copy(struct pipe_context *pipe, - struct pipe_surface *dest, unsigned destx, unsigned desty, - struct pipe_surface *src, unsigned srcx, unsigned srcy, - unsigned width, unsigned height) -{ - util_surface_copy(pipe, FALSE, - dest, destx, desty, - src, srcx, srcy, - width, height); -} - void sp_init_surface_functions(struct softpipe_context *sp) { - sp->pipe.surface_copy = sp_surface_copy; - sp->pipe.surface_fill = util_surface_fill; + sp->pipe.resource_copy_region = util_resource_copy_region; + sp->pipe.resource_fill_region = util_resource_fill_region; } -- cgit v1.2.3 From bccf31bf5f2d6c9516a4c073d735b5056ff1d608 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:24:04 +0200 Subject: i915g: adapt to interface changes --- src/gallium/drivers/i915/i915_screen.c | 19 ++++++--- src/gallium/drivers/i915/i915_surface.c | 69 +++++++++++++++++++++++++-------- 2 files changed, 67 insertions(+), 21 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index 9086f9fc3b..c10ba25d2d 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -159,9 +159,10 @@ i915_get_paramf(struct pipe_screen *screen, int param) static boolean i915_is_format_supported(struct pipe_screen *screen, - enum pipe_format format, + enum pipe_format format, enum pipe_texture_target target, - unsigned tex_usage, + unsigned sample_count, + unsigned tex_usage, unsigned geom_flags) { static const enum pipe_format tex_supported[] = { @@ -181,17 +182,25 @@ i915_is_format_supported(struct pipe_screen *screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED, PIPE_FORMAT_NONE /* list terminator */ }; - static const enum pipe_format surface_supported[] = { + static const enum pipe_format render_supported[] = { PIPE_FORMAT_B8G8R8A8_UNORM, PIPE_FORMAT_B5G6R5_UNORM, + PIPE_FORMAT_NONE /* list terminator */ + }; + static const enum pipe_format depth_supported[] = { PIPE_FORMAT_Z24_UNORM_S8_USCALED, PIPE_FORMAT_NONE /* list terminator */ }; const enum pipe_format *list; uint i; - if(tex_usage & PIPE_BIND_RENDER_TARGET) - list = surface_supported; + if (sample_count > 1) + return FALSE; + + if(tex_usage & PIPE_BIND_DEPTH_STENCIL) + list = depth_supported; + else if (tex_usage & PIPE_BIND_RENDER_TARGET) + list = render_supported; else list = tex_supported; diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index 453437b809..0deee24754 100644 --- a/src/gallium/drivers/i915/i915_surface.c +++ b/src/gallium/drivers/i915/i915_surface.c @@ -41,15 +41,41 @@ */ static void i915_surface_copy(struct pipe_context *pipe, - struct pipe_surface *dst, - unsigned dstx, unsigned dsty, - struct pipe_surface *src, - unsigned srcx, unsigned srcy, unsigned width, unsigned height) + struct pipe_resource *dst, struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource *src, struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, + unsigned width, unsigned height) { - struct i915_texture *dst_tex = i915_texture(dst->texture); - struct i915_texture *src_tex = i915_texture(src->texture); + struct i915_texture *dst_tex = i915_texture(dst); + struct i915_texture *src_tex = i915_texture(src); struct pipe_resource *dpt = &dst_tex->b.b; struct pipe_resource *spt = &src_tex->b.b; + unsigned dst_offset, src_offset; /* in bytes */ + + if (dst->target == PIPE_TEXTURE_CUBE) { + dst_offset = dst_tex->image_offset[subdst.level][subdst.face]; + } + else if (dst->target == PIPE_TEXTURE_3D) { + dst_offset = dst_tex->image_offset[subdst.level][dstz]; + } + else { + dst_offset = dst_tex->image_offset[subdst.level][0]; + assert(subdst.face == 0); + assert(dstz == 0); + } + if (src->target == PIPE_TEXTURE_CUBE) { + src_offset = src_tex->image_offset[subsrc.level][subsrc.face]; + } + else if (src->target == PIPE_TEXTURE_3D) { + src_offset = src_tex->image_offset[subsrc.level][srcz]; + } + else { + src_offset = src_tex->image_offset[subsrc.level][0]; + assert(subsrc.face == 0); + assert(srcz == 0); + } + assert( dst != src ); assert( util_format_get_blocksize(dpt->format) == util_format_get_blocksize(spt->format) ); @@ -61,20 +87,33 @@ i915_surface_copy(struct pipe_context *pipe, i915_copy_blit( i915_context(pipe), FALSE, util_format_get_blocksize(dpt->format), - (unsigned short) src_tex->stride, src_tex->buffer, src->offset, - (unsigned short) dst_tex->stride, dst_tex->buffer, dst->offset, + (unsigned short) src_tex->stride, src_tex->buffer, src_offset, + (unsigned short) dst_tex->stride, dst_tex->buffer, dst_offset, (short) srcx, (short) srcy, (short) dstx, (short) dsty, (short) width, (short) height ); } static void i915_surface_fill(struct pipe_context *pipe, - struct pipe_surface *dst, - unsigned dstx, unsigned dsty, + struct pipe_resource *dst, struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, unsigned width, unsigned height, unsigned value) { - struct i915_texture *tex = i915_texture(dst->texture); + struct i915_texture *tex = i915_texture(dst); struct pipe_resource *pt = &tex->b.b; + unsigned dst_offset; /* in bytes */ + + if (dst->target == PIPE_TEXTURE_CUBE) { + dst_offset = tex->image_offset[subdst.level][subdst.face]; + } + else if (dst->target == PIPE_TEXTURE_3D) { + dst_offset = tex->image_offset[subdst.level][dstz]; + } + else { + dst_offset = tex->image_offset[subdst.level][0]; + assert(subdst.face == 0); + assert(dstz == 0); + } assert(util_format_get_blockwidth(pt->format) == 1); assert(util_format_get_blockheight(pt->format) == 1); @@ -82,7 +121,7 @@ i915_surface_fill(struct pipe_context *pipe, i915_fill_blit( i915_context(pipe), util_format_get_blocksize(pt->format), (unsigned short) tex->stride, - tex->buffer, dst->offset, + tex->buffer, dst_offset, (short) dstx, (short) dsty, (short) width, (short) height, value ); @@ -137,13 +176,11 @@ i915_tex_surface_destroy(struct pipe_surface *surf) } -/* Probably going to make blits work on textures rather than surfaces. - */ void i915_init_surface_functions(struct i915_context *i915) { - i915->base.surface_copy = i915_surface_copy; - i915->base.surface_fill = i915_surface_fill; + i915->base.resource_copy_region = i915_surface_copy; + i915->base.resource_fill_region = i915_surface_fill; } /* No good reason for these to be in the screen. -- cgit v1.2.3 From a02ddd48c5f7350366115ac07c15113402a79ee2 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:24:50 +0200 Subject: i965g: adapt to interface changes --- src/gallium/drivers/i965/brw_resource.c | 3 +++ src/gallium/drivers/i965/brw_resource.h | 3 ++- src/gallium/drivers/i965/brw_resource_texture.c | 3 ++- src/gallium/drivers/i965/brw_screen.c | 8 ++++++-- 4 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/i965/brw_resource.c b/src/gallium/drivers/i965/brw_resource.c index d601f42dd1..3b9854be58 100644 --- a/src/gallium/drivers/i965/brw_resource.c +++ b/src/gallium/drivers/i965/brw_resource.c @@ -1,4 +1,5 @@ #include "util/u_debug.h" +#include "util/u_surface.h" #include "brw_resource.h" #include "brw_context.h" @@ -37,6 +38,8 @@ brw_init_resource_functions(struct brw_context *brw ) brw->base.transfer_unmap = u_transfer_unmap_vtbl; brw->base.transfer_destroy = u_transfer_destroy_vtbl; brw->base.transfer_inline_write = u_transfer_inline_write_vtbl; + brw->base.resource_copy_region = util_resource_copy_region; + brw->base.resource_fill_region = util_resource_fill_region; } void diff --git a/src/gallium/drivers/i965/brw_resource.h b/src/gallium/drivers/i965/brw_resource.h index 3390c270d4..78defb37b2 100644 --- a/src/gallium/drivers/i965/brw_resource.h +++ b/src/gallium/drivers/i965/brw_resource.h @@ -124,7 +124,8 @@ boolean brw_is_format_supported( struct pipe_screen *screen, enum pipe_format format, enum pipe_texture_target target, - unsigned tex_usage, + unsigned sample_count, + unsigned tex_usage, unsigned geom_flags ); */ diff --git a/src/gallium/drivers/i965/brw_resource_texture.c b/src/gallium/drivers/i965/brw_resource_texture.c index 07537fe44e..4fbb0c2484 100644 --- a/src/gallium/drivers/i965/brw_resource_texture.c +++ b/src/gallium/drivers/i965/brw_resource_texture.c @@ -594,7 +594,8 @@ fail: boolean brw_is_format_supported( struct pipe_screen *screen, enum pipe_format format, enum pipe_texture_target target, - unsigned tex_usage, + unsigned sample_count, + unsigned tex_usage, unsigned geom_flags ) { return translate_tex_format(format) != BRW_SURFACEFORMAT_INVALID; diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index 0a7151bde4..172e222c05 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -218,9 +218,10 @@ brw_get_paramf(struct pipe_screen *screen, int param) static boolean brw_is_format_supported(struct pipe_screen *screen, - enum pipe_format format, + enum pipe_format format, enum pipe_texture_target target, - unsigned tex_usage, + unsigned sample_count, + unsigned tex_usage, unsigned geom_flags) { static const enum pipe_format tex_supported[] = { @@ -276,6 +277,9 @@ brw_is_format_supported(struct pipe_screen *screen, const enum pipe_format *list; uint i; + if (sample_count > 1) + return FALSE; + if (tex_usage & PIPE_BIND_DEPTH_STENCIL) list = depth_supported; else if (tex_usage & PIPE_BIND_RENDER_TARGET) -- cgit v1.2.3 From bd771cda8e11a5f9a8bc5b8eab9ef4293df316e0 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:25:07 +0200 Subject: trace: adapt to interface changes --- src/gallium/drivers/trace/tr_context.c | 63 +++++++++++++++++++--------------- src/gallium/drivers/trace/tr_screen.c | 5 ++- 2 files changed, 40 insertions(+), 28 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 3d1fb96b91..0edb685ac7 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -1157,61 +1157,72 @@ trace_context_set_vertex_buffers(struct pipe_context *_pipe, static INLINE void -trace_context_surface_copy(struct pipe_context *_pipe, - struct pipe_surface *dest, - unsigned destx, unsigned desty, - struct pipe_surface *src, - unsigned srcx, unsigned srcy, - unsigned width, unsigned height) +trace_context_resource_copy_region(struct pipe_context *_pipe, + struct pipe_resource *dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource *src, + struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, + unsigned width, unsigned height) { struct trace_context *tr_ctx = trace_context(_pipe); struct pipe_context *pipe = tr_ctx->pipe; - dest = trace_surface_unwrap(tr_ctx, dest); - src = trace_surface_unwrap(tr_ctx, src); + dst = trace_resource_unwrap(tr_ctx, dst); + src = trace_resource_unwrap(tr_ctx, src); - trace_dump_call_begin("pipe_context", "surface_copy"); + trace_dump_call_begin("pipe_context", "resource_copy_region"); trace_dump_arg(ptr, pipe); - trace_dump_arg(ptr, dest); - trace_dump_arg(uint, destx); - trace_dump_arg(uint, desty); + trace_dump_arg(ptr, dst); + trace_dump_arg_struct(subresource, subdst); + trace_dump_arg(uint, dstx); + trace_dump_arg(uint, dsty); + trace_dump_arg(uint, dstz); trace_dump_arg(ptr, src); + trace_dump_arg_struct(subresource, subsrc); trace_dump_arg(uint, srcx); trace_dump_arg(uint, srcy); + trace_dump_arg(uint, srcz); trace_dump_arg(uint, width); trace_dump_arg(uint, height); - pipe->surface_copy(pipe, - dest, destx, desty, - src, srcx, srcy, width, height); + pipe->resource_copy_region(pipe, + dst, subdst, dstx, dsty, dstz, + src, subsrc, srcx, srcy, srcz, width, height); trace_dump_call_end(); } static INLINE void -trace_context_surface_fill(struct pipe_context *_pipe, - struct pipe_surface *dst, - unsigned dstx, unsigned dsty, - unsigned width, unsigned height, - unsigned value) +trace_context_resource_fill_region(struct pipe_context *_pipe, + struct pipe_resource *dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + unsigned width, unsigned height, + unsigned value) { struct trace_context *tr_ctx = trace_context(_pipe); struct pipe_context *pipe = tr_ctx->pipe; - dst = trace_surface_unwrap(tr_ctx, dst); + dst = trace_resource_unwrap(tr_ctx, dst); - trace_dump_call_begin("pipe_context", "surface_fill"); + trace_dump_call_begin("pipe_context", "resource_fill_region"); trace_dump_arg(ptr, pipe); trace_dump_arg(ptr, dst); + trace_dump_arg_struct(subresource, subdst); trace_dump_arg(uint, dstx); trace_dump_arg(uint, dsty); + trace_dump_arg(uint, dstz); trace_dump_arg(uint, width); trace_dump_arg(uint, height); + trace_dump_arg(uint, value); - pipe->surface_fill(pipe, dst, dstx, dsty, width, height, value); + pipe->resource_fill_region(pipe, dst, subdst, dstx, dsty, dstz, + width, height, value); trace_dump_call_end(); } @@ -1560,10 +1571,8 @@ trace_context_create(struct trace_screen *tr_scr, tr_ctx->base.create_sampler_view = trace_create_sampler_view; tr_ctx->base.sampler_view_destroy = trace_sampler_view_destroy; tr_ctx->base.set_vertex_buffers = trace_context_set_vertex_buffers; - if (pipe->surface_copy) - tr_ctx->base.surface_copy = trace_context_surface_copy; - if (pipe->surface_fill) - tr_ctx->base.surface_fill = trace_context_surface_fill; + tr_ctx->base.resource_copy_region = trace_context_resource_copy_region; + tr_ctx->base.resource_fill_region = trace_context_resource_fill_region; tr_ctx->base.clear = trace_context_clear; tr_ctx->base.flush = trace_context_flush; tr_ctx->base.is_resource_referenced = trace_is_resource_referenced; diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 63a45d7e51..ffae6e94d1 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -134,6 +134,7 @@ static boolean trace_screen_is_format_supported(struct pipe_screen *_screen, enum pipe_format format, enum pipe_texture_target target, + unsigned sample_count, unsigned tex_usage, unsigned geom_flags) { @@ -146,10 +147,12 @@ trace_screen_is_format_supported(struct pipe_screen *_screen, trace_dump_arg(ptr, screen); trace_dump_arg(format, format); trace_dump_arg(int, target); + trace_dump_arg(uint, sample_count); trace_dump_arg(uint, tex_usage); trace_dump_arg(uint, geom_flags); - result = screen->is_format_supported(screen, format, target, tex_usage, geom_flags); + result = screen->is_format_supported(screen, format, target, sample_count, + tex_usage, geom_flags); trace_dump_ret(bool, result); -- cgit v1.2.3 From fd578be828e1dd7c25160e7748b30b1421f4d0c7 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:25:16 +0200 Subject: identity: adapt to interface changes --- src/gallium/drivers/identity/id_context.c | 114 +++++++++++++++++------------- src/gallium/drivers/identity/id_screen.c | 2 + 2 files changed, 65 insertions(+), 51 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 7e62213597..bd1b5ea2d0 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -601,55 +601,67 @@ identity_set_vertex_buffers(struct pipe_context *_pipe, buffers); } static void -identity_surface_copy(struct pipe_context *_pipe, - struct pipe_surface *_dst, - unsigned dstx, - unsigned dsty, - struct pipe_surface *_src, - unsigned srcx, - unsigned srcy, - unsigned width, - unsigned height) -{ - struct identity_context *id_pipe = identity_context(_pipe); - struct identity_surface *id_surface_dst = identity_surface(_dst); - struct identity_surface *id_surface_src = identity_surface(_src); - struct pipe_context *pipe = id_pipe->pipe; - struct pipe_surface *dst = id_surface_dst->surface; - struct pipe_surface *src = id_surface_src->surface; - - pipe->surface_copy(pipe, - dst, - dstx, - dsty, - src, - srcx, - srcy, - width, - height); -} - -static void -identity_surface_fill(struct pipe_context *_pipe, - struct pipe_surface *_dst, - unsigned dstx, - unsigned dsty, - unsigned width, - unsigned height, - unsigned value) -{ - struct identity_context *id_pipe = identity_context(_pipe); - struct identity_surface *id_surface_dst = identity_surface(_dst); - struct pipe_context *pipe = id_pipe->pipe; - struct pipe_surface *dst = id_surface_dst->surface; - - pipe->surface_fill(pipe, - dst, - dstx, - dsty, - width, - height, - value); +identity_resource_copy_region(struct pipe_context *_pipe, + struct pipe_resource *_dst, + struct pipe_subresource subdst, + unsigned dstx, + unsigned dsty, + unsigned dstz, + struct pipe_resource *_src, + struct pipe_subresource subsrc, + unsigned srcx, + unsigned srcy, + unsigned srcz, + unsigned width, + unsigned height) +{ + struct identity_context *id_pipe = identity_context(_pipe); + struct identity_resource *id_resource_dst = identity_resource(_dst); + struct identity_resource *id_resource_src = identity_resource(_src); + struct pipe_context *pipe = id_pipe->pipe; + struct pipe_resource *dst = id_resource_dst->resource; + struct pipe_resource *src = id_resource_src->resource; + + pipe->resource_copy_region(pipe, + dst, + subdst, + dstx, + dsty, + dstz, + src, + subsrc, + srcx, + srcy, + srcz, + width, + height); +} + +static void +identity_resource_fill_region(struct pipe_context *_pipe, + struct pipe_resource *_dst, + struct pipe_subresource subdst, + unsigned dstx, + unsigned dsty, + unsigned dstz, + unsigned width, + unsigned height, + unsigned value) +{ + struct identity_context *id_pipe = identity_context(_pipe); + struct identity_resource *id_resource_dst = identity_resource(_dst); + struct pipe_context *pipe = id_pipe->pipe; + struct pipe_resource *dst = id_resource_dst->resource; + + pipe->resource_fill_region(pipe, + dst, + subdst, + dstx, + dsty, + dstz, + width, + height, + value); } static void @@ -888,8 +900,8 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) id_pipe->base.set_fragment_sampler_views = identity_set_fragment_sampler_views; id_pipe->base.set_vertex_sampler_views = identity_set_vertex_sampler_views; id_pipe->base.set_vertex_buffers = identity_set_vertex_buffers; - id_pipe->base.surface_copy = identity_surface_copy; - id_pipe->base.surface_fill = identity_surface_fill; + id_pipe->base.resource_copy_region = identity_resource_copy_region; + id_pipe->base.resource_fill_region = identity_resource_fill_region; id_pipe->base.clear = identity_clear; id_pipe->base.flush = identity_flush; id_pipe->base.is_resource_referenced = identity_is_resource_referenced; diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c index 7671bded98..7082d60d1c 100644 --- a/src/gallium/drivers/identity/id_screen.c +++ b/src/gallium/drivers/identity/id_screen.c @@ -91,6 +91,7 @@ static boolean identity_screen_is_format_supported(struct pipe_screen *_screen, enum pipe_format format, enum pipe_texture_target target, + unsigned sample_count, unsigned tex_usage, unsigned geom_flags) { @@ -100,6 +101,7 @@ identity_screen_is_format_supported(struct pipe_screen *_screen, return screen->is_format_supported(screen, format, target, + sample_count, tex_usage, geom_flags); } -- cgit v1.2.3 From 433701a7214fb792c3e8bdd71a0d025c09328f87 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:25:27 +0200 Subject: fo: adapt to interface changes --- src/gallium/drivers/failover/fo_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c index 9515cd8938..2246c1468c 100644 --- a/src/gallium/drivers/failover/fo_context.c +++ b/src/gallium/drivers/failover/fo_context.c @@ -156,8 +156,8 @@ struct pipe_context *failover_create( struct pipe_context *hw, failover_init_state_functions( failover ); - failover->pipe.surface_copy = hw->surface_copy; - failover->pipe.surface_fill = hw->surface_fill; + failover->pipe.resource_copy_region = hw->resource_copy_region; + failover->pipe.resource_fill_region = hw->resource_fill_region; #if 0 failover->pipe.texture_create = hw->texture_create; -- cgit v1.2.3 From b59b23a51dc17da59ccff0b3f8a73009056746e5 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:28:14 +0200 Subject: nouveau: adapt to interface changes this probably needs further cleanup (just getting a surface for the resource seems quite nonoptimal and potentially cause unnecessary copies I think) --- src/gallium/drivers/nouveau/nouveau_screen.c | 2 -- src/gallium/drivers/nv50/nv50_screen.c | 4 +++ src/gallium/drivers/nv50/nv50_surface.c | 38 ++++++++++++++++++++-------- src/gallium/drivers/nvfx/nv04_surface_2d.c | 9 +++---- src/gallium/drivers/nvfx/nvfx_miptree.c | 2 +- src/gallium/drivers/nvfx/nvfx_screen.c | 4 +++ src/gallium/drivers/nvfx/nvfx_surface.c | 37 ++++++++++++++++++++------- src/gallium/drivers/nvfx/nvfx_transfer.c | 6 +++-- 8 files changed, 72 insertions(+), 30 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index 233a91a2ff..89d5ffa8aa 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -51,8 +51,6 @@ nouveau_screen_bo_new(struct pipe_screen *pscreen, unsigned alignment, if (bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL | - PIPE_BIND_BLIT_SOURCE | - PIPE_BIND_BLIT_DESTINATION | PIPE_BIND_SCANOUT | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SAMPLER_VIEW)) diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 2dd1042424..a8cb1e25d8 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -32,8 +32,12 @@ static boolean nv50_screen_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format, enum pipe_texture_target target, + unsigned sample_count, unsigned tex_usage, unsigned geom_flags) { + if (sample_count > 1) + return FALSE; + if (tex_usage & PIPE_BIND_RENDER_TARGET) { switch (format) { case PIPE_FORMAT_B8G8R8X8_UNORM: diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index d905d95354..40b8d25533 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -195,27 +195,40 @@ nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst, static void nv50_surface_copy(struct pipe_context *pipe, - struct pipe_surface *dest, unsigned destx, unsigned desty, - struct pipe_surface *src, unsigned srcx, unsigned srcy, + struct pipe_resource *dest, struct pipe_subresource subdst, + unsigned destx, unsigned desty, unsigned destz, + struct pipe_resource *src, struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, unsigned width, unsigned height) { struct nv50_context *nv50 = nv50_context(pipe); struct nv50_screen *screen = nv50->screen; + struct pipe_surface *ps_dst, *ps_src; assert((src->format == dest->format) || (nv50_2d_format_faithful(src->format) && nv50_2d_format_faithful(dest->format))); - nv50_surface_do_copy(screen, dest, destx, desty, src, srcx, - srcy, width, height); + ps_src = nv50_miptree_surface_new(pipe->screen, dest, subsrc.face, + subsrc.level, srcz, 0 /* bind flags */); + ps_dst = nv50_miptree_surface_new(pipe->screen, dest, subdst.face, + subdst.level, destz, 0 /* bindflags */); + + nv50_surface_do_copy(screen, ps_dst, destx, desty, ps_src, srcx, + srcy, width, height); + + nv50_miptree_surface_del(ps_src); + nv50_miptree_surface_del(ps_dst); } static void -nv50_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, - unsigned destx, unsigned desty, unsigned width, - unsigned height, unsigned value) +nv50_surface_fill(struct pipe_context *pipe, struct pipe_resource *dest, + struct pipe_subresource subdst, + unsigned destx, unsigned desty, unsigned destz, + unsigned width, unsigned height, unsigned value) { struct nv50_context *nv50 = nv50_context(pipe); + struct pipe_surface *ps; struct nv50_screen *screen = nv50->screen; struct nouveau_channel *chan = screen->eng2d->channel; struct nouveau_grobj *eng2d = screen->eng2d; @@ -225,9 +238,12 @@ nv50_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, if (format < 0) return; + ps = nv50_miptree_surface_new(pipe->screen, dest, subdst.face, + subdst.level, destz, 0 /* bind flags */); + WAIT_RING (chan, 32); - ret = nv50_surface_set(screen, dest, 1); + ret = nv50_surface_set(screen, ps, 1); if (ret) return; @@ -240,13 +256,15 @@ nv50_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, OUT_RING (chan, desty); OUT_RING (chan, width); OUT_RING (chan, height); + + nv50_miptree_surface_del(ps); } void nv50_init_surface_functions(struct nv50_context *nv50) { - nv50->pipe.surface_copy = nv50_surface_copy; - nv50->pipe.surface_fill = nv50_surface_fill; + nv50->pipe.resource_copy_region = nv50_surface_copy; + nv50->pipe.resource_fill_region = nv50_surface_fill; } diff --git a/src/gallium/drivers/nvfx/nv04_surface_2d.c b/src/gallium/drivers/nvfx/nv04_surface_2d.c index 4ed574227d..7acbb505df 100644 --- a/src/gallium/drivers/nvfx/nv04_surface_2d.c +++ b/src/gallium/drivers/nvfx/nv04_surface_2d.c @@ -502,12 +502,9 @@ nv04_surface_wrap_for_render(struct pipe_screen *pscreen, struct nv04_surface* temp_ns; int temp_flags; - temp_flags = (ns->base.usage | - PIPE_BIND_BLIT_SOURCE | - PIPE_BIND_BLIT_DESTINATION); + temp_flags = ns->base.usage; - ns->base.usage = (PIPE_BIND_BLIT_SOURCE | - PIPE_BIND_BLIT_DESTINATION); + ns->base.usage = 0; memset(&templ, 0, sizeof(templ)); templ.format = ns->base.texture->format; @@ -526,7 +523,7 @@ nv04_surface_wrap_for_render(struct pipe_screen *pscreen, temp_ns = (struct nv04_surface*)pscreen->get_tex_surface(pscreen, temp_tex, 0, 0, 0, temp_flags); temp_ns->backing = ns; - if(ns->base.usage & PIPE_BIND_BLIT_SOURCE) + if(1) /* hmm */ eng2d->copy(eng2d, &temp_ns->backing->base, 0, 0, &ns->base, 0, 0, ns->base.width, ns->base.height); diff --git a/src/gallium/drivers/nvfx/nvfx_miptree.c b/src/gallium/drivers/nvfx/nvfx_miptree.c index aeb88e9ac9..b5639bb464 100644 --- a/src/gallium/drivers/nvfx/nvfx_miptree.c +++ b/src/gallium/drivers/nvfx/nvfx_miptree.c @@ -300,7 +300,7 @@ nvfx_miptree_surface_del(struct pipe_surface *ps) if(ns->backing) { struct nvfx_screen* screen = (struct nvfx_screen*)ps->texture->screen; - if(ns->backing->base.usage & PIPE_BIND_BLIT_DESTINATION) + if(1 /*ns->backing->base.usage & PIPE_BIND_BLIT_DESTINATION*/) screen->eng2d->copy(screen->eng2d, &ns->backing->base, 0, 0, ps, 0, 0, ns->base.width, ns->base.height); nvfx_miptree_surface_del(&ns->backing->base); } diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c index 9f03ab1833..1786af776a 100644 --- a/src/gallium/drivers/nvfx/nvfx_screen.c +++ b/src/gallium/drivers/nvfx/nvfx_screen.c @@ -115,11 +115,15 @@ static boolean nvfx_screen_surface_format_supported(struct pipe_screen *pscreen, enum pipe_format format, enum pipe_texture_target target, + unsigned sample_count, unsigned tex_usage, unsigned geom_flags) { struct nvfx_screen *screen = nvfx_screen(pscreen); struct pipe_surface *front = ((struct nouveau_winsys *) pscreen->winsys)->front; + if (sample_count > 1) + return FALSE; + if (tex_usage & PIPE_BIND_RENDER_TARGET) { switch (format) { case PIPE_FORMAT_B8G8R8A8_UNORM: diff --git a/src/gallium/drivers/nvfx/nvfx_surface.c b/src/gallium/drivers/nvfx/nvfx_surface.c index 2e115650ae..fc3a670d40 100644 --- a/src/gallium/drivers/nvfx/nvfx_surface.c +++ b/src/gallium/drivers/nvfx/nvfx_surface.c @@ -27,35 +27,54 @@ **************************************************************************/ #include "nvfx_context.h" +#include "nvfx_resource.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" static void nvfx_surface_copy(struct pipe_context *pipe, - struct pipe_surface *dest, unsigned destx, unsigned desty, - struct pipe_surface *src, unsigned srcx, unsigned srcy, + struct pipe_resource *dest, struct pipe_subresource subdst, + unsigned destx, unsigned desty, unsigned destz, + struct pipe_resource *src, struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, unsigned width, unsigned height) { struct nvfx_context *nvfx = nvfx_context(pipe); struct nv04_surface_2d *eng2d = nvfx->screen->eng2d; + struct pipe_surface *ps_dst, *ps_src; - eng2d->copy(eng2d, dest, destx, desty, src, srcx, srcy, width, height); + ps_src = nvfx_miptree_surface_new(pipe->screen, dest, subsrc.face, + subsrc.level, srcz, 0 /* bind flags */); + ps_dst = nvfx_miptree_surface_new(pipe->screen, dest, subdst.face, + subdst.level, destz, 0 /* bindflags */); + + eng2d->copy(eng2d, ps_dst, destx, desty, ps_src, srcx, srcy, width, height); + + nvfx_miptree_surface_del(ps_src); + nvfx_miptree_surface_del(ps_dst); } static void -nvfx_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest, - unsigned destx, unsigned desty, unsigned width, - unsigned height, unsigned value) +nvfx_surface_fill(struct pipe_context *pipe, struct pipe_resource *dest, + struct pipe_subresource subdst, + unsigned destx, unsigned desty, unsigned destz, + unsigned width, unsigned height, unsigned value) { struct nvfx_context *nvfx = nvfx_context(pipe); + struct pipe_surface *ps; struct nv04_surface_2d *eng2d = nvfx->screen->eng2d; - eng2d->fill(eng2d, dest, destx, desty, width, height, value); + ps = nvfx_miptree_surface_new(pipe->screen, dest, subdst.face, + subdst.level, destz, 0 /* bind flags */); + + eng2d->fill(eng2d, ps, destx, desty, width, height, value); + + nvfx_miptree_surface_del(ps); } void nvfx_init_surface_functions(struct nvfx_context *nvfx) { - nvfx->pipe.surface_copy = nvfx_surface_copy; - nvfx->pipe.surface_fill = nvfx_surface_fill; + nvfx->pipe.resource_copy_region = nvfx_surface_copy; + nvfx->pipe.resource_fill_region = nvfx_surface_fill; } diff --git a/src/gallium/drivers/nvfx/nvfx_transfer.c b/src/gallium/drivers/nvfx/nvfx_transfer.c index b2ef27cf57..9ff0a93d30 100644 --- a/src/gallium/drivers/nvfx/nvfx_transfer.c +++ b/src/gallium/drivers/nvfx/nvfx_transfer.c @@ -40,11 +40,13 @@ static unsigned nvfx_transfer_bind_flags( unsigned transfer_usage ) { unsigned bind = 0; +#if 0 if (transfer_usage & PIPE_TRANSFER_WRITE) bind |= PIPE_BIND_BLIT_SOURCE; if (transfer_usage & PIPE_TRANSFER_READ) bind |= PIPE_BIND_BLIT_DESTINATION; +#endif return bind; } @@ -128,7 +130,7 @@ nvfx_miptree_transfer_new(struct pipe_context *pipe, src = pscreen->get_tex_surface(pscreen, pt, sr.face, sr.level, box->z, - PIPE_BIND_BLIT_SOURCE); + 0 /*PIPE_BIND_BLIT_SOURCE*/); /* TODO: Check if SIFM can deal with x,y,w,h when swizzling */ /* TODO: Check if SIFM can un-swizzle */ @@ -160,7 +162,7 @@ nvfx_miptree_transfer_del(struct pipe_context *pipe, ptx->sr.face, ptx->sr.level, ptx->box.z, - PIPE_BIND_BLIT_DESTINATION); + 0 /*PIPE_BIND_BLIT_DESTINATION*/); /* TODO: Check if SIFM can deal with x,y,w,h when swizzling */ nvscreen->eng2d->copy(nvscreen->eng2d, -- cgit v1.2.3 From 39b4bf71b55ce4553e877868dcbf6e7502cbc696 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:29:17 +0200 Subject: r300g: adapt to interface changes might need further cleanup. Using surfaces internally for the u_blitter code seems nonoptimal. --- src/gallium/drivers/r300/r300_blit.c | 73 ++++++++++++++++++++++++-------- src/gallium/drivers/r300/r300_blit.h | 18 +++++--- src/gallium/drivers/r300/r300_context.c | 4 +- src/gallium/drivers/r300/r300_screen.c | 4 ++ src/gallium/drivers/r300/r300_transfer.c | 51 +++++++--------------- 5 files changed, 89 insertions(+), 61 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 85c2c14901..2bf9317803 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -117,25 +117,36 @@ static void r300_hw_copy(struct pipe_context* pipe, /* Copy a block of pixels from one surface to another. */ void r300_surface_copy(struct pipe_context* pipe, - struct pipe_surface* dst, - unsigned dstx, unsigned dsty, - struct pipe_surface* src, - unsigned srcx, unsigned srcy, + struct pipe_resource* dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource* src, + struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, unsigned width, unsigned height) { - enum pipe_format old_format = dst->texture->format; + struct pipe_screen *screen = pipe->screen; + enum pipe_format old_format = dst->format; enum pipe_format new_format = old_format; + struct pipe_surface *srcsurf, *dstsurf; + unsigned bind; - if (dst->texture->format != src->texture->format) { + if (util_format_is_depth_or_stencil(dst->format)) + bind = PIPE_BIND_DEPTH_STENCIL; + else + bind = PIPE_BIND_RENDER_TARGET; + + if (dst->format != src->format) { debug_printf("r300: Implementation error: Format mismatch in %s\n" " : src: %s dst: %s\n", __FUNCTION__, - util_format_short_name(src->texture->format), - util_format_short_name(dst->texture->format)); + util_format_short_name(src->format), + util_format_short_name(dst->format)); debug_assert(0); } if (!pipe->screen->is_format_supported(pipe->screen, - old_format, src->texture->target, + old_format, src->target, + src->nr_samples, PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW, 0) && util_format_is_plain(old_format)) { @@ -164,36 +175,64 @@ void r300_surface_copy(struct pipe_context* pipe, src->format = new_format; r300_texture_reinterpret_format(pipe->screen, - dst->texture, new_format); + dst, new_format); r300_texture_reinterpret_format(pipe->screen, - src->texture, new_format); + src, new_format); } - r300_hw_copy(pipe, dst, dstx, dsty, src, srcx, srcy, width, height); + srcsurf = screen->get_tex_surface(screen, src, + subsrc.face, subsrc.level, srcz, + PIPE_BIND_SAMPLER_VIEW); + + dstsurf = screen->get_tex_surface(screen, dst, + subdst.face, subdst.level, dstz, + bind); + + r300_hw_copy(pipe, dstsurf, dstx, dsty, srcsurf, srcx, srcy, width, height); + + pipe_surface_reference(&srcsurf, NULL); + pipe_surface_reference(&dstsurf, NULL); if (old_format != new_format) { dst->format = old_format; src->format = old_format; r300_texture_reinterpret_format(pipe->screen, - dst->texture, old_format); + dst, old_format); r300_texture_reinterpret_format(pipe->screen, - src->texture, old_format); + src, old_format); } } /* Fill a region of a surface with a constant value. */ void r300_surface_fill(struct pipe_context* pipe, - struct pipe_surface* dst, - unsigned dstx, unsigned dsty, + struct pipe_resource* dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, unsigned width, unsigned height, unsigned value) { + struct pipe_screen *screen = pipe->screen; struct r300_context* r300 = r300_context(pipe); + struct pipe_surface *dstsurf; + unsigned bind; + + if (util_format_is_depth_or_stencil(dst->format)) + bind = PIPE_BIND_DEPTH_STENCIL; + else + bind = PIPE_BIND_RENDER_TARGET; + + dstsurf = screen->get_tex_surface(screen, dst, + subdst.face, + subdst.level, + dstz, + bind); r300_blitter_save_states(r300); util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state); util_blitter_fill(r300->blitter, - dst, dstx, dsty, width, height, value); + dstsurf, dstx, dsty, width, height, value); + + pipe_surface_reference(&dstsurf, NULL); } diff --git a/src/gallium/drivers/r300/r300_blit.h b/src/gallium/drivers/r300/r300_blit.h index 029e4f98e7..c97872662a 100644 --- a/src/gallium/drivers/r300/r300_blit.h +++ b/src/gallium/drivers/r300/r300_blit.h @@ -24,7 +24,8 @@ #define R300_BLIT_H struct pipe_context; -struct pipe_surface; +struct pipe_resource; +struct pipe_subresource; void r300_clear(struct pipe_context* pipe, unsigned buffers, @@ -33,15 +34,18 @@ void r300_clear(struct pipe_context* pipe, unsigned stencil); void r300_surface_copy(struct pipe_context* pipe, - struct pipe_surface* dst, - unsigned dstx, unsigned dsty, - struct pipe_surface* src, - unsigned srcx, unsigned srcy, + struct pipe_resource* dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource* src, + struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, unsigned width, unsigned height); void r300_surface_fill(struct pipe_context* pipe, - struct pipe_surface* dst, - unsigned dstx, unsigned dsty, + struct pipe_resource* dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, unsigned width, unsigned height, unsigned value); diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index e84bce0010..b3ef97fa52 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -173,8 +173,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->context.destroy = r300_destroy_context; r300->context.clear = r300_clear; - r300->context.surface_copy = r300_surface_copy; - r300->context.surface_fill = r300_surface_fill; + r300->context.resource_copy_region = r300_surface_copy; + r300->context.resource_fill_region = r300_surface_fill; if (r300screen->caps.has_tcl) { r300->context.draw_arrays = r300_draw_arrays; diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index c039126703..b7f1c617f0 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -198,6 +198,7 @@ static float r300_get_paramf(struct pipe_screen* pscreen, int param) static boolean r300_is_format_supported(struct pipe_screen* screen, enum pipe_format format, enum pipe_texture_target target, + unsigned sample_count, unsigned usage, unsigned geom_flags) { @@ -221,6 +222,9 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, return FALSE; } + if (sample_count > 1) + return FALSE; + /* Check sampler format support. */ if ((usage & PIPE_BIND_SAMPLER_VIEW) && /* Z24 cannot be sampled from on non-r5xx. */ diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c index 0dae9ef98b..f0f87c5e2b 100644 --- a/src/gallium/drivers/r300/r300_transfer.c +++ b/src/gallium/drivers/r300/r300_transfer.c @@ -56,63 +56,44 @@ r300_transfer(struct pipe_transfer* transfer) static void r300_copy_from_tiled_texture(struct pipe_context *ctx, struct r300_transfer *r300transfer) { - struct pipe_screen *screen = ctx->screen; struct pipe_transfer *transfer = (struct pipe_transfer*)r300transfer; struct pipe_resource *tex = transfer->resource; - struct pipe_surface *src, *dst; + struct pipe_subresource subdst; - src = screen->get_tex_surface(screen, tex, - transfer->sr.face, - transfer->sr.level, - transfer->box.z, - PIPE_BIND_BLIT_SOURCE); + subdst.face = 0; + subdst.level = 0; - dst = screen->get_tex_surface(screen, &r300transfer->detiled_texture->b.b, - 0, 0, 0, - PIPE_BIND_BLIT_DESTINATION); - - ctx->surface_copy(ctx, dst, 0, 0, src, - transfer->box.x, transfer->box.y, - transfer->box.width, transfer->box.height); - - pipe_surface_reference(&src, NULL); - pipe_surface_reference(&dst, NULL); + ctx->resource_copy_region(ctx, &r300transfer->detiled_texture->b.b, subdst, + 0, 0, 0, + tex, transfer->sr, + transfer->box.x, transfer->box.y, transfer->box.z, + transfer->box.width, transfer->box.height); } /* Copy a detiled texture to a tiled one. */ static void r300_copy_into_tiled_texture(struct pipe_context *ctx, struct r300_transfer *r300transfer) { - struct pipe_screen *screen = ctx->screen; struct pipe_transfer *transfer = (struct pipe_transfer*)r300transfer; struct pipe_resource *tex = transfer->resource; - struct pipe_surface *src, *dst; + struct pipe_subresource subsrc; - src = screen->get_tex_surface(screen, &r300transfer->detiled_texture->b.b, - 0, 0, 0, - PIPE_BIND_BLIT_SOURCE); - - dst = screen->get_tex_surface(screen, tex, - transfer->sr.face, - transfer->sr.level, - transfer->box.z, - PIPE_BIND_BLIT_DESTINATION); + subsrc.face = 0; + subsrc.level = 0; /* XXX this flush prevents the following DRM error from occuring: * [drm:radeon_cs_ioctl] *ERROR* Failed to parse relocation ! * Reproducible with perf/copytex. */ ctx->flush(ctx, 0, NULL); - ctx->surface_copy(ctx, dst, - transfer->box.x, transfer->box.y, - src, 0, 0, - transfer->box.width, transfer->box.height); + ctx->resource_copy_region(ctx, tex, transfer->sr, + transfer->box.x, transfer->box.y, transfer->box.z, + &r300transfer->detiled_texture->b.b, subsrc, + 0, 0, 0, + transfer->box.width, transfer->box.height); /* XXX this flush fixes a few piglit tests (e.g. glean/pixelFormats). */ ctx->flush(ctx, 0, NULL); - - pipe_surface_reference(&src, NULL); - pipe_surface_reference(&dst, NULL); } struct pipe_transfer* -- cgit v1.2.3 From eb2b668b3705f8091df716f342d72d32d9f31aea Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:30:01 +0200 Subject: svga: adapt to interface changes might need further cleanup. Using surfaces internally just to be able to use the existing code might cause unnecessary copies afaict. --- src/gallium/drivers/svga/svga_pipe_blit.c | 51 +++++++++++++++++++++---------- src/gallium/drivers/svga/svga_screen.c | 10 ++++-- 2 files changed, 42 insertions(+), 19 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c index 889da29e28..2dd99b4631 100644 --- a/src/gallium/drivers/svga/svga_pipe_blit.c +++ b/src/gallium/drivers/svga/svga_pipe_blit.c @@ -28,33 +28,47 @@ #include "svga_debug.h" #include "svga_cmd.h" #include "svga_surface.h" +#include "util/u_surface.h" #define FILE_DEBUG_FLAG DEBUG_BLIT +/* XXX I got my doubts about this, should maybe use svga_texture_copy_handle directly? */ static void svga_surface_copy(struct pipe_context *pipe, - struct pipe_surface *dest, - unsigned destx, unsigned desty, - struct pipe_surface *src, - unsigned srcx, unsigned srcy, + struct pipe_resource* dst_tex, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource* src_tex, + struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, unsigned width, unsigned height) { struct svga_context *svga = svga_context(pipe); + struct pipe_screen *screen = pipe->screen; SVGA3dCopyBox *box; enum pipe_error ret; + struct pipe_surface *srcsurf, *dstsurf; svga_hwtnl_flush_retry( svga ); + srcsurf = screen->get_tex_surface(screen, src_tex, + subsrc.face, subsrc.level, srcz, + PIPE_BIND_SAMPLER_VIEW); + + dstsurf = screen->get_tex_surface(screen, dst_tex, + subdst.face, subdst.level, dstz, + PIPE_BIND_RENDER_TARGET); + SVGA_DBG(DEBUG_DMA, "blit to sid %p (%d,%d), from sid %p (%d,%d) sz %dx%d\n", - svga_surface(dest)->handle, - destx, desty, - svga_surface(src)->handle, + svga_surface(dstsurf)->handle, + dstx, dsty, + svga_surface(srcsurf)->handle, srcx, srcy, width, height); ret = SVGA3D_BeginSurfaceCopy(svga->swc, - src, - dest, + srcsurf, + dstsurf, &box, 1); if(ret != PIPE_OK) { @@ -62,15 +76,15 @@ static void svga_surface_copy(struct pipe_context *pipe, svga_context_flush(svga, NULL); ret = SVGA3D_BeginSurfaceCopy(svga->swc, - src, - dest, + srcsurf, + dstsurf, &box, 1); assert(ret == PIPE_OK); } - box->x = destx; - box->y = desty; + box->x = dstx; + box->y = dsty; box->z = 0; box->w = width; box->h = height; @@ -81,13 +95,18 @@ static void svga_surface_copy(struct pipe_context *pipe, SVGA_FIFOCommitAll(svga->swc); - svga_surface(dest)->dirty = TRUE; - svga_propagate_surface(pipe, dest); + svga_surface(dstsurf)->dirty = TRUE; + svga_propagate_surface(pipe, dstsurf); + + pipe_surface_reference(&srcsurf, NULL); + pipe_surface_reference(&dstsurf, NULL); + } void svga_init_blit_functions(struct svga_context *svga) { - svga->pipe.surface_copy = svga_surface_copy; + svga->pipe.resource_copy_region = svga_surface_copy; + svga->pipe.resource_fill_region = util_resource_fill_region; } diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 27ac09e275..b24af32921 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -237,17 +237,21 @@ svga_translate_format_cap(enum pipe_format format) static boolean svga_is_format_supported( struct pipe_screen *screen, - enum pipe_format format, + enum pipe_format format, enum pipe_texture_target target, - unsigned tex_usage, + unsigned sample_count, + unsigned tex_usage, unsigned geom_flags ) { struct svga_winsys_screen *sws = svga_screen(screen)->sws; SVGA3dDevCapIndex index; SVGA3dDevCapResult result; - + assert(tex_usage); + if (sample_count > 1) + return FALSE; + /* Override host capabilities */ if (tex_usage & PIPE_BIND_RENDER_TARGET) { switch(format) { -- cgit v1.2.3 From 43234cee40c48e14a3eab4268181d9b0b2b7cf79 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 18 May 2010 16:20:44 +0200 Subject: gallium: implement set_sample_mask() in all drivers prevents segfault when state trackers try to set default mask. Other option would be to make this required only for drivers supporting multisampling, but this seems more clean. Only dummy implementations (for normal drivers) provided (no driver supports multisampling yet neither). --- src/gallium/drivers/cell/ppu/cell_pipe_state.c | 9 ++++++++- src/gallium/drivers/failover/fo_context.h | 2 ++ src/gallium/drivers/failover/fo_state.c | 14 ++++++++++++++ src/gallium/drivers/failover/fo_state_emit.c | 3 +++ src/gallium/drivers/i915/i915_state.c | 7 +++++++ src/gallium/drivers/i965/brw_pipe_depth.c | 7 +++++++ src/gallium/drivers/identity/id_context.c | 12 ++++++++++++ src/gallium/drivers/llvmpipe/lp_state_blend.c | 6 ++++++ src/gallium/drivers/nv50/nv50_state.c | 7 +++++++ src/gallium/drivers/nvfx/nvfx_state.c | 7 +++++++ src/gallium/drivers/r300/r300_state.c | 8 ++++++++ src/gallium/drivers/softpipe/sp_context.c | 1 + src/gallium/drivers/softpipe/sp_state.h | 3 +++ src/gallium/drivers/softpipe/sp_state_blend.c | 7 +++++++ src/gallium/drivers/svga/svga_pipe_depthstencil.c | 7 +++++++ src/gallium/drivers/trace/tr_context.c | 17 +++++++++++++++++ 16 files changed, 116 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/cell/ppu/cell_pipe_state.c b/src/gallium/drivers/cell/ppu/cell_pipe_state.c index 8c975c6ae2..ecc9de4df6 100644 --- a/src/gallium/drivers/cell/ppu/cell_pipe_state.c +++ b/src/gallium/drivers/cell/ppu/cell_pipe_state.c @@ -125,6 +125,7 @@ cell_set_stencil_ref(struct pipe_context *pipe, cell->dirty |= CELL_NEW_DEPTH_STENCIL; } + static void cell_set_clip_state(struct pipe_context *pipe, const struct pipe_clip_state *clip) @@ -136,6 +137,12 @@ cell_set_clip_state(struct pipe_context *pipe, } +static void +cell_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + /* Called when driver state tracker notices changes to the viewport * matrix: @@ -430,7 +437,6 @@ cell_set_framebuffer_state(struct pipe_context *pipe, } - void cell_init_state_functions(struct cell_context *cell) { @@ -457,6 +463,7 @@ cell_init_state_functions(struct cell_context *cell) cell->pipe.set_blend_color = cell_set_blend_color; cell->pipe.set_stencil_ref = cell_set_stencil_ref; cell->pipe.set_clip_state = cell_set_clip_state; + cell->pipe.set_sample_mask = cell_set_sample_mask; cell->pipe.set_framebuffer_state = cell_set_framebuffer_state; diff --git a/src/gallium/drivers/failover/fo_context.h b/src/gallium/drivers/failover/fo_context.h index 88ae5ad60d..9d3e0d0dba 100644 --- a/src/gallium/drivers/failover/fo_context.h +++ b/src/gallium/drivers/failover/fo_context.h @@ -55,6 +55,7 @@ #define FO_NEW_CLEAR_COLOR 0x20000 #define FO_NEW_VERTEX_BUFFER 0x40000 #define FO_NEW_VERTEX_ELEMENT 0x80000 +#define FO_NEW_SAMPLE_MASK 0x100000 @@ -90,6 +91,7 @@ struct failover_context { struct pipe_blend_color blend_color; struct pipe_stencil_ref stencil_ref; struct pipe_clip_state clip; + unsigned sample_mask; struct pipe_framebuffer_state framebuffer; struct pipe_poly_stipple poly_stipple; struct pipe_scissor_state scissor; diff --git a/src/gallium/drivers/failover/fo_state.c b/src/gallium/drivers/failover/fo_state.c index 272e683067..12e42379f9 100644 --- a/src/gallium/drivers/failover/fo_state.c +++ b/src/gallium/drivers/failover/fo_state.c @@ -125,6 +125,19 @@ failover_set_clip_state( struct pipe_context *pipe, failover->hw->set_clip_state( failover->hw, clip ); } +static void +failover_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ + struct failover_context *failover = failover_context(pipe); + + failover->sample_mask = sample_mask; + failover->dirty |= FO_NEW_SAMPLE_MASK; + failover->sw->set_sample_mask( failover->sw, sample_mask ); + failover->hw->set_sample_mask( failover->hw, sample_mask ); + +} + static void * failover_create_depth_stencil_state(struct pipe_context *pipe, @@ -614,6 +627,7 @@ failover_init_state_functions( struct failover_context *failover ) failover->pipe.set_blend_color = failover_set_blend_color; failover->pipe.set_stencil_ref = failover_set_stencil_ref; failover->pipe.set_clip_state = failover_set_clip_state; + failover->pipe.set_sample_mask = failover_set_sample_mask; failover->pipe.set_framebuffer_state = failover_set_framebuffer_state; failover->pipe.set_polygon_stipple = failover_set_polygon_stipple; failover->pipe.set_scissor_state = failover_set_scissor_state; diff --git a/src/gallium/drivers/failover/fo_state_emit.c b/src/gallium/drivers/failover/fo_state_emit.c index 42bd6929a7..147f23269c 100644 --- a/src/gallium/drivers/failover/fo_state_emit.c +++ b/src/gallium/drivers/failover/fo_state_emit.c @@ -63,6 +63,9 @@ failover_state_emit( struct failover_context *failover ) if (failover->dirty & FO_NEW_CLIP) failover->sw->set_clip_state( failover->sw, &failover->clip ); + if (failover->dirty & FO_NEW_SAMPLE_MASK) + failover->sw->set_sample_mask( failover->sw, failover->sample_mask ); + if (failover->dirty & FO_NEW_DEPTH_STENCIL) failover->sw->bind_depth_stencil_alpha_state( failover->sw, failover->depth_stencil->sw_state ); diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index f883883852..e008195a91 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -806,6 +806,12 @@ i915_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) FREE( velems ); } +static void +i915_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + void i915_init_state_functions( struct i915_context *i915 ) { @@ -837,6 +843,7 @@ i915_init_state_functions( struct i915_context *i915 ) i915->base.set_blend_color = i915_set_blend_color; i915->base.set_stencil_ref = i915_set_stencil_ref; i915->base.set_clip_state = i915_set_clip_state; + i915->base.set_sample_mask = i915_set_sample_mask; i915->base.set_constant_buffer = i915_set_constant_buffer; i915->base.set_framebuffer_state = i915_set_framebuffer_state; diff --git a/src/gallium/drivers/i965/brw_pipe_depth.c b/src/gallium/drivers/i965/brw_pipe_depth.c index b7000d5e33..31c2c343d8 100644 --- a/src/gallium/drivers/i965/brw_pipe_depth.c +++ b/src/gallium/drivers/i965/brw_pipe_depth.c @@ -167,12 +167,19 @@ static void brw_set_stencil_ref(struct pipe_context *pipe, brw->state.dirty.mesa |= PIPE_NEW_DEPTH_STENCIL_ALPHA; } +static void +brw_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + void brw_pipe_depth_stencil_init( struct brw_context *brw ) { brw->base.set_stencil_ref = brw_set_stencil_ref; brw->base.create_depth_stencil_alpha_state = brw_create_depth_stencil_state; brw->base.bind_depth_stencil_alpha_state = brw_bind_depth_stencil_state; brw->base.delete_depth_stencil_alpha_state = brw_delete_depth_stencil_state; + brw->base.set_sample_mask = brw_set_sample_mask; } void brw_pipe_depth_stencil_cleanup( struct brw_context *brw ) diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index bd1b5ea2d0..9813170fb1 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -451,6 +451,17 @@ identity_set_clip_state(struct pipe_context *_pipe, clip); } +static void +identity_set_sample_mask(struct pipe_context *_pipe, + unsigned sample_mask) +{ + struct identity_context *id_pipe = identity_context(_pipe); + struct pipe_context *pipe = id_pipe->pipe; + + pipe->set_sample_mask(pipe, + sample_mask); +} + static void identity_set_constant_buffer(struct pipe_context *_pipe, uint shader, @@ -892,6 +903,7 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) id_pipe->base.set_blend_color = identity_set_blend_color; id_pipe->base.set_stencil_ref = identity_set_stencil_ref; id_pipe->base.set_clip_state = identity_set_clip_state; + id_pipe->base.set_sample_mask = identity_set_sample_mask; id_pipe->base.set_constant_buffer = identity_set_constant_buffer; id_pipe->base.set_framebuffer_state = identity_set_framebuffer_state; id_pipe->base.set_polygon_stipple = identity_set_polygon_stipple; diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c index 8569507f4e..5b39d9d1a9 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c @@ -148,6 +148,11 @@ llvmpipe_set_stencil_ref(struct pipe_context *pipe, llvmpipe->dirty |= LP_NEW_DEPTH_STENCIL_ALPHA; } +static void +llvmpipe_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} void llvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe) @@ -163,4 +168,5 @@ llvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe) llvmpipe->pipe.set_blend_color = llvmpipe_set_blend_color; llvmpipe->pipe.set_stencil_ref = llvmpipe_set_stencil_ref; + llvmpipe->pipe.set_sample_mask = llvmpipe_set_sample_mask; } diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index e885a2b719..3fde859214 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -688,6 +688,12 @@ nv50_set_clip_state(struct pipe_context *pipe, { } +static void +nv50_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + static void nv50_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, struct pipe_resource *buf ) @@ -833,6 +839,7 @@ nv50_init_state_functions(struct nv50_context *nv50) nv50->pipe.set_blend_color = nv50_set_blend_color; nv50->pipe.set_stencil_ref = nv50_set_stencil_ref; nv50->pipe.set_clip_state = nv50_set_clip_state; + nv50->pipe_set_sample_mask = nv50_set_sample_mask; nv50->pipe.set_constant_buffer = nv50_set_constant_buffer; nv50->pipe.set_framebuffer_state = nv50_set_framebuffer_state; nv50->pipe.set_polygon_stipple = nv50_set_polygon_stipple; diff --git a/src/gallium/drivers/nvfx/nvfx_state.c b/src/gallium/drivers/nvfx/nvfx_state.c index 315de492da..3c566808d0 100644 --- a/src/gallium/drivers/nvfx/nvfx_state.c +++ b/src/gallium/drivers/nvfx/nvfx_state.c @@ -505,6 +505,12 @@ nvfx_set_clip_state(struct pipe_context *pipe, nvfx->draw_dirty |= NVFX_NEW_UCP; } +static void +nvfx_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + static void nvfx_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, struct pipe_resource *buf ) @@ -644,6 +650,7 @@ nvfx_init_state_functions(struct nvfx_context *nvfx) nvfx->pipe.set_blend_color = nvfx_set_blend_color; nvfx->pipe.set_stencil_ref = nvfx_set_stencil_ref; nvfx->pipe.set_clip_state = nvfx_set_clip_state; + nvfx->pipe.set_sample_mask = nvfx_set_sample_mask; nvfx->pipe.set_constant_buffer = nvfx_set_constant_buffer; nvfx->pipe.set_framebuffer_state = nvfx_set_framebuffer_state; nvfx->pipe.set_polygon_stipple = nvfx_set_polygon_stipple; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 446422ca0f..4f41530c16 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -404,6 +404,13 @@ static void r300_set_clip_state(struct pipe_context* pipe, r300->clip_state.dirty = TRUE; } +static void +r300_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + + /* Create a new depth, stencil, and alpha state based on the CSO dsa state. * * This contains the depth buffer, stencil buffer, alpha test, and such. @@ -1502,6 +1509,7 @@ void r300_init_state_functions(struct r300_context* r300) r300->context.set_blend_color = r300_set_blend_color; r300->context.set_clip_state = r300_set_clip_state; + r300->context.set_sample_mask = r300_set_sample_mask; r300->context.set_constant_buffer = r300_set_constant_buffer; diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index f6e2b80d46..0f1bcc21bd 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -251,6 +251,7 @@ softpipe_create_context( struct pipe_screen *screen, softpipe->pipe.set_blend_color = softpipe_set_blend_color; softpipe->pipe.set_stencil_ref = softpipe_set_stencil_ref; softpipe->pipe.set_clip_state = softpipe_set_clip_state; + softpipe->pipe.set_sample_mask = softpipe_set_sample_mask; softpipe->pipe.set_constant_buffer = softpipe_set_constant_buffer; softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state; softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple; diff --git a/src/gallium/drivers/softpipe/sp_state.h b/src/gallium/drivers/softpipe/sp_state.h index f97fc6eca8..5b0faabeae 100644 --- a/src/gallium/drivers/softpipe/sp_state.h +++ b/src/gallium/drivers/softpipe/sp_state.h @@ -148,6 +148,9 @@ void softpipe_set_stencil_ref( struct pipe_context *pipe, void softpipe_set_clip_state( struct pipe_context *, const struct pipe_clip_state * ); +void softpipe_set_sample_mask( struct pipe_context *, + unsigned sample_mask ); + void softpipe_set_constant_buffer(struct pipe_context *, uint shader, uint index, struct pipe_resource *buf); diff --git a/src/gallium/drivers/softpipe/sp_state_blend.c b/src/gallium/drivers/softpipe/sp_state_blend.c index c63a49e90b..2a203f44e5 100644 --- a/src/gallium/drivers/softpipe/sp_state_blend.c +++ b/src/gallium/drivers/softpipe/sp_state_blend.c @@ -111,3 +111,10 @@ void softpipe_set_stencil_ref( struct pipe_context *pipe, softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA; } + +void +softpipe_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + diff --git a/src/gallium/drivers/svga/svga_pipe_depthstencil.c b/src/gallium/drivers/svga/svga_pipe_depthstencil.c index c317bec6d5..c84615a1f3 100644 --- a/src/gallium/drivers/svga/svga_pipe_depthstencil.c +++ b/src/gallium/drivers/svga/svga_pipe_depthstencil.c @@ -147,6 +147,12 @@ static void svga_set_stencil_ref( struct pipe_context *pipe, svga->dirty |= SVGA_NEW_STENCIL_REF; } +static void +svga_set_sample_mask(struct pipe_context *pipe, + unsigned sample_mask) +{ +} + void svga_init_depth_stencil_functions( struct svga_context *svga ) { @@ -155,6 +161,7 @@ void svga_init_depth_stencil_functions( struct svga_context *svga ) svga->pipe.delete_depth_stencil_alpha_state = svga_delete_depth_stencil_state; svga->pipe.set_stencil_ref = svga_set_stencil_ref; + svga->pipe.set_sample_mask = svga_set_sample_mask; } diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 0edb685ac7..64a4316984 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -876,6 +876,22 @@ trace_context_set_clip_state(struct pipe_context *_pipe, trace_dump_call_end(); } +static INLINE void +trace_context_set_sample_mask(struct pipe_context *_pipe, + unsigned sample_mask) +{ + struct trace_context *tr_ctx = trace_context(_pipe); + struct pipe_context *pipe = tr_ctx->pipe; + + trace_dump_call_begin("pipe_context", "set_sample_mask"); + + trace_dump_arg(ptr, pipe); + trace_dump_arg(uint, sample_mask); + + pipe->set_sample_mask(pipe, sample_mask); + + trace_dump_call_end(); +} static INLINE void trace_context_set_constant_buffer(struct pipe_context *_pipe, @@ -1561,6 +1577,7 @@ trace_context_create(struct trace_screen *tr_scr, tr_ctx->base.set_blend_color = trace_context_set_blend_color; tr_ctx->base.set_stencil_ref = trace_context_set_stencil_ref; tr_ctx->base.set_clip_state = trace_context_set_clip_state; + tr_ctx->base.set_sample_mask = trace_context_set_sample_mask; tr_ctx->base.set_constant_buffer = trace_context_set_constant_buffer; tr_ctx->base.set_framebuffer_state = trace_context_set_framebuffer_state; tr_ctx->base.set_polygon_stipple = trace_context_set_polygon_stipple; -- cgit v1.2.3 From 1adbe2c82dc64b85398d04784ee10c899551479c Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 19 May 2010 17:14:06 +0200 Subject: i915g: remove unused flip parameter --- src/gallium/drivers/i915/i915_blit.c | 1 - src/gallium/drivers/i915/i915_blit.h | 1 - src/gallium/drivers/i915/i915_surface.c | 1 - 3 files changed, 3 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/i915/i915_blit.c b/src/gallium/drivers/i915/i915_blit.c index 533fa81219..6717e46e1b 100644 --- a/src/gallium/drivers/i915/i915_blit.c +++ b/src/gallium/drivers/i915/i915_blit.c @@ -84,7 +84,6 @@ i915_fill_blit(struct i915_context *i915, void i915_copy_blit(struct i915_context *i915, - unsigned do_flip, unsigned cpp, unsigned short src_pitch, struct i915_winsys_buffer *src_buffer, diff --git a/src/gallium/drivers/i915/i915_blit.h b/src/gallium/drivers/i915/i915_blit.h index db576ed4c9..43f8e7c9aa 100644 --- a/src/gallium/drivers/i915/i915_blit.h +++ b/src/gallium/drivers/i915/i915_blit.h @@ -31,7 +31,6 @@ #include "i915_context.h" extern void i915_copy_blit(struct i915_context *i915, - unsigned do_flip, unsigned cpp, unsigned short src_pitch, struct i915_winsys_buffer *src_buffer, diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index 0deee24754..41b1fed36d 100644 --- a/src/gallium/drivers/i915/i915_surface.c +++ b/src/gallium/drivers/i915/i915_surface.c @@ -85,7 +85,6 @@ i915_surface_copy(struct pipe_context *pipe, assert( util_format_get_blockheight(dpt->format) == 1 ); i915_copy_blit( i915_context(pipe), - FALSE, util_format_get_blocksize(dpt->format), (unsigned short) src_tex->stride, src_tex->buffer, src_offset, (unsigned short) dst_tex->stride, dst_tex->buffer, dst_offset, -- cgit v1.2.3 From 23808f1b5e88373534c7ff546cdd89030ce1e935 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 19 May 2010 09:30:25 -0600 Subject: nv50: fix typo: s/_/./ --- src/gallium/drivers/nv50/nv50_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 3fde859214..cf4105bcb7 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -839,7 +839,7 @@ nv50_init_state_functions(struct nv50_context *nv50) nv50->pipe.set_blend_color = nv50_set_blend_color; nv50->pipe.set_stencil_ref = nv50_set_stencil_ref; nv50->pipe.set_clip_state = nv50_set_clip_state; - nv50->pipe_set_sample_mask = nv50_set_sample_mask; + nv50->pipe.set_sample_mask = nv50_set_sample_mask; nv50->pipe.set_constant_buffer = nv50_set_constant_buffer; nv50->pipe.set_framebuffer_state = nv50_set_framebuffer_state; nv50->pipe.set_polygon_stipple = nv50_set_polygon_stipple; -- cgit v1.2.3