diff options
author | Roland Scheidegger <[email protected]> | 2010-05-21 20:02:22 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2010-05-21 20:02:22 +0200 |
commit | 3293bcdc80cdfa20a2381aae2b94505bdf95d857 (patch) | |
tree | 16ab1ae66010f6d8b1325dbfa9006126a8e95771 /src/gallium/drivers | |
parent | 8504c5d931e47765a15fdaec2df2cb6502a1bd5c (diff) | |
parent | ce65caba846b03b5ef4144e311b85cfd48ab9bbb (diff) |
Merge branch 'gallium-msaa'
Conflicts:
src/mesa/state_tracker/st_gen_mipmap.c
src/mesa/state_tracker/st_texture.c
Diffstat (limited to 'src/gallium/drivers')
48 files changed, 537 insertions, 261 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_pipe_state.c b/src/gallium/drivers/cell/ppu/cell_pipe_state.c index f4c614eef95..03f84d295b5 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/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 750f0aa98ab..0f12e0667eb 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -134,13 +134,17 @@ cell_get_paramf(struct pipe_screen *screen, enum pipe_cap 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 6696a4591c1..8000eee88a3 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; } diff --git a/src/gallium/drivers/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c index 9515cd8938c..2246c1468ca 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; diff --git a/src/gallium/drivers/failover/fo_context.h b/src/gallium/drivers/failover/fo_context.h index 88ae5ad60d5..9d3e0d0dba0 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 272e683067e..12e42379f98 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 42bd6929a7f..147f23269ca 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_blit.c b/src/gallium/drivers/i915/i915_blit.c index 533fa81219b..6717e46e1b4 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 db576ed4c90..43f8e7c9aad 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_screen.c b/src/gallium/drivers/i915/i915_screen.c index 7cf627d975b..0897a863dbd 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -161,9 +161,10 @@ i915_get_paramf(struct pipe_screen *screen, enum pipe_cap 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[] = { @@ -183,17 +184,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_state.c b/src/gallium/drivers/i915/i915_state.c index cd963e4df75..e767aa9f8f0 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -812,6 +812,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 ) { @@ -843,6 +849,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/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index 453437b8090..41b1fed36d0 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) ); @@ -59,22 +85,34 @@ 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, + (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 +120,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 +175,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. diff --git a/src/gallium/drivers/i965/brw_pipe_depth.c b/src/gallium/drivers/i965/brw_pipe_depth.c index b7000d5e334..31c2c343d89 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/i965/brw_resource.c b/src/gallium/drivers/i965/brw_resource.c index 069a12b27f7..1efdb1e0b4d 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 3390c270d42..78defb37b2a 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 ca09d88fd12..ffd0f38672c 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 1890b640e90..7a7b9c1a5a9 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -220,9 +220,10 @@ brw_get_paramf(struct pipe_screen *screen, enum pipe_cap 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[] = { @@ -278,6 +279,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) diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 7e62213597c..9813170fb18 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -452,6 +452,17 @@ identity_set_clip_state(struct pipe_context *_pipe, } 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, uint index, @@ -601,55 +612,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) +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_surface *id_surface_dst = identity_surface(_dst); - struct identity_surface *id_surface_src = identity_surface(_src); + 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_surface *dst = id_surface_dst->surface; - struct pipe_surface *src = id_surface_src->surface; + struct pipe_resource *dst = id_resource_dst->resource; + struct pipe_resource *src = id_resource_src->resource; - pipe->surface_copy(pipe, - dst, - dstx, - dsty, - src, - srcx, - srcy, - width, - height); + pipe->resource_copy_region(pipe, + dst, + subdst, + dstx, + dsty, + dstz, + src, + subsrc, + srcx, + srcy, + srcz, + 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) +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_surface *id_surface_dst = identity_surface(_dst); + struct identity_resource *id_resource_dst = identity_resource(_dst); struct pipe_context *pipe = id_pipe->pipe; - struct pipe_surface *dst = id_surface_dst->surface; + struct pipe_resource *dst = id_resource_dst->resource; - pipe->surface_fill(pipe, - dst, - dstx, - dsty, - width, - height, - value); + pipe->resource_fill_region(pipe, + dst, + subdst, + dstx, + dsty, + dstz, + width, + height, + value); } static void @@ -880,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; @@ -888,8 +912,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 3c94e04a7a8..f71585e06f8 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); } diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 22fbf381ae0..cedc08e9292 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -204,8 +204,9 @@ llvmpipe_get_paramf(struct pipe_screen *screen, enum pipe_cap 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 ) { @@ -222,6 +223,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_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c index 8569507f4e5..5b39d9d1a91 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/llvmpipe/lp_surface.c b/src/gallium/drivers/llvmpipe/lp_surface.c index 245171120dd..85687ada1c4 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; } diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index a91b00b5ada..60bdd7276aa 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -52,8 +52,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 757f13b640a..2c0caada366 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -33,8 +33,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_state.c b/src/gallium/drivers/nv50/nv50_state.c index b20781fa1fb..f8bff764f27 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -661,6 +661,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 ) { @@ -805,6 +811,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/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index d905d95354f..40b8d255335 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 4ed574227d6..7acbb505df3 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 aeb88e9ac96..b5639bb4645 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 6cb8428e4b6..7e534a0c738 100644 --- a/src/gallium/drivers/nvfx/nvfx_screen.c +++ b/src/gallium/drivers/nvfx/nvfx_screen.c @@ -157,11 +157,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_state.c b/src/gallium/drivers/nvfx/nvfx_state.c index 17f3f701406..30322d46d93 100644 --- a/src/gallium/drivers/nvfx/nvfx_state.c +++ b/src/gallium/drivers/nvfx/nvfx_state.c @@ -479,6 +479,12 @@ nvfx_set_clip_state(struct pipe_context *pipe, } 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 ) { @@ -617,6 +623,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/nvfx/nvfx_surface.c b/src/gallium/drivers/nvfx/nvfx_surface.c index 2e115650aeb..fc3a670d400 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 b2ef27cf579..9ff0a93d307 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, diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 85c2c149016..2bf9317803e 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 029e4f98e7d..c97872662aa 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 9837deaa5e3..f771e10c64e 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -186,8 +186,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 640b3d34688..ef0255066b7 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -241,6 +241,7 @@ static float r300_get_paramf(struct pipe_screen* pscreen, enum pipe_cap 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) { @@ -264,6 +265,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_state.c b/src/gallium/drivers/r300/r300_state.c index 11c10e2f2a8..67e09362d8e 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, } } +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. @@ -1561,6 +1568,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/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c index 14a9bfd8650..beb321cb238 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* diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index fea3520fa56..2f10b46e989 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -254,6 +254,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_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 8c33efa1987..73987c913e5 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -178,8 +178,9 @@ softpipe_get_paramf(struct pipe_screen *screen, enum pipe_cap 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 ) { @@ -195,6 +196,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_state.h b/src/gallium/drivers/softpipe/sp_state.h index f97fc6eca8f..5b0faabeaef 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 c63a49e90b0..2a203f44e50 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/softpipe/sp_surface.c b/src/gallium/drivers/softpipe/sp_surface.c index 32cab06004f..0296c26ad26 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; } diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c index 889da29e28b..2dd99b46316 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_pipe_depthstencil.c b/src/gallium/drivers/svga/svga_pipe_depthstencil.c index c317bec6d57..c84615a1f3b 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/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index bef22f41ae5..99b419178b0 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -290,17 +290,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) { diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 066fa6b9ac9..5cc244d4b77 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -764,6 +764,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, @@ -1029,61 +1045,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(); } @@ -1412,6 +1439,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; @@ -1422,10 +1450,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 ac0b9060001..32e519a68a0 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -133,6 +133,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) { @@ -145,10 +146,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); |