diff options
author | Roland Scheidegger <[email protected]> | 2010-04-26 19:50:57 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2010-04-26 19:51:25 +0200 |
commit | aac2cccccfd701ae8d7ce0813c28c64498d4a076 (patch) | |
tree | 31cbcdddf4263d086f376798a710eb2cb4e9ad5b /src/gallium/include/pipe/p_context.h | |
parent | 06574e45b418dab1ec106773c92b7d9e5af45c81 (diff) |
gallium: interface changes for multisampling
add function to set sample mask, and state for alpha-to-coverage and
alpha-to-one. Also make it possible to query for supported sample count
with is_msaa_supported().
Use explicit resource_resolve() to resolve a resource. Note that it is illegal
to bind a unresolved resource as a sampler view, must be resolved first (as per
d3d10 and OGL APIs, binding unresolved resource would mean that special texture
fetch functions need to be used which give explicit control over what samples
to fetch, which isn't supported yet).
Also change surface_fill() and surface_copy() to operate directly on resources.
Blits should operate directly on resources, most often state trackers just used
get_tex_surface() then did a blit. Note this also means the blit bind flags are
gone, if a driver implements this functionality it is expected to handle it for
all resources having depth_stencil/render_target/sampler_view bind flags (might
even require it for all bind flags?).
Might want to introduce quality levels for MSAA later.
Might need to revisit this for hw which does instant resolve.
Diffstat (limited to 'src/gallium/include/pipe/p_context.h')
-rw-r--r-- | src/gallium/include/pipe/p_context.h | 51 |
1 files changed, 36 insertions, 15 deletions
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 6f47845f3b8..c38548105ca 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -198,6 +198,9 @@ struct pipe_context { void (*set_stencil_ref)( struct pipe_context *, const struct pipe_stencil_ref * ); + void (*set_sample_mask)( struct pipe_context *, + unsigned sample_mask ); + void (*set_clip_state)( struct pipe_context *, const struct pipe_clip_state * ); @@ -233,32 +236,50 @@ struct pipe_context { /** - * Surface functions + * Resource functions for blit-like functionality * * The pipe driver is allowed to set these functions to NULL, and in that * case, they will not be available. + * If a driver supports multisampling, resource_resolve must be available. */ /*@{*/ /** - * Copy a block of pixels from one surface to another. - * The surfaces must be of the same format. + * Copy a block of pixels from one resource to another. + * The resource must be of the same format. + * Resources with nr_samples > 1 are not allowed. */ - void (*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); + void (*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); /** - * Fill a region of a surface with a constant value. + * Fill a region of a resource with a constant value. + * Resources with nr_samples > 1 are not allowed. */ - void (*surface_fill)(struct pipe_context *pipe, - struct pipe_surface *dst, - unsigned dstx, unsigned dsty, - unsigned width, unsigned height, - unsigned value); + void (*resource_fill_region)(struct pipe_context *pipe, + struct pipe_resource *dst, + struct pipe_subresource subdst, + struct pipe_box *dstbox, + unsigned srcx, unsigned srcy, unsigned srcz, + unsigned width, unsigned height, + unsigned value); + + /** + * Resolve a multisampled resource into a non-multisampled one. + * Source and destination must have the same size and same format. + */ + void (*resource_resolve)(struct pipe_context *pipe, + struct pipe_resource *dst, + struct pipe_subresource subdst, + struct pipe_resource *src, + struct pipe_subresource subsrc); + /*@}*/ /** |