From f836a5f60b700fca051c6f7cc36fb77965226408 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Apr 2010 12:44:40 -0600 Subject: gallium/docs: many updates to screen.rst Put PIPE_BIND_ and PIPE_TEXTURE_GEOM_ prefixes on token names so that they can be found with grep. This needs to be done in more places. Corrected/improved a lot of information and grammer. I don't know how to properly format everything - someone else can take care of that. --- src/gallium/docs/source/screen.rst | 154 ++++++++++++++++++++++--------------- 1 file changed, 93 insertions(+), 61 deletions(-) (limited to 'src/gallium/docs') diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index b6efd1d40cf..05688cc1f23 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -3,16 +3,19 @@ Screen A screen is an object representing the context-independent part of a device. -Useful Flags ------------- +Flags and enumerations +---------------------- + +XXX some of these don't belong in this section. + .. _pipe_cap: -PIPE_CAP -^^^^^^^^ +PIPE_CAP_* +^^^^^^^^^^ -Pipe capabilities help expose hardware functionality not explicitly required -by Gallium. For floating-point values, use :ref:`get_paramf`, and for boolean +Capability queries return information about the features and limits of the +driver/GPU. For floating-point values, use :ref:`get_paramf`, and for boolean or integer values, use :ref:`get_param`. The integer capabilities: @@ -56,6 +59,19 @@ The integer capabilities: to any shader stage using ``set_constant_buffer``. If 0 or 1, the pipe will only permit binding one constant buffer per shader, and the shaders will not permit two-dimensional access to constants. + +If a value greater than 0 is returned, the driver can have multiple +constant buffers bound to shader stages. The CONST register file can +be accessed with two-dimensional indices, like in the example below. + +DCL CONST[0][0..7] # declare first 8 vectors of constbuf 0 +DCL CONST[3][0] # declare first vector of constbuf 3 +MOV OUT[0], CONST[0][3] # copy vector 3 of constbuf 0 + +For backwards compatibility, one-dimensional access to CONST register +file is still supported. In that case, the constbuf index is assumed +to be 0. + * ``MAX_CONST_BUFFER_SIZE``: Maximum byte size of a single constant buffer. * ``INDEP_BLEND_ENABLE``: Whether per-rendertarget blend enabling and channel masks are supported. If 0, then the first rendertarget's blend mask is @@ -85,64 +101,54 @@ The floating-point capabilities: * ``GUARD_BAND_LEFT``, ``GUARD_BAND_TOP``, ``GUARD_BAND_RIGHT``, ``GUARD_BAND_BOTTOM``: XXX -XXX Is there a better home for this? vvv - -If 0 is returned, the driver is not aware of multiple constant buffers, -supports binding of only one constant buffer, and does not support -two-dimensional CONST register file access in TGSI shaders. - -If a value greater than 0 is returned, the driver can have multiple -constant buffers bound to shader stages. The CONST register file can -be accessed with two-dimensional indices, like in the example below. - -DCL CONST[0][0..7] # declare first 8 vectors of constbuf 0 -DCL CONST[3][0] # declare first vector of constbuf 3 -MOV OUT[0], CONST[0][3] # copy vector 3 of constbuf 0 -For backwards compatibility, one-dimensional access to CONST register -file is still supported. In that case, the constbuf index is assumed -to be 0. .. _pipe_bind: -PIPE_BIND -^^^^^^^^^ +PIPE_BIND_* +^^^^^^^^^^^ -These flags control resource creation. Resources may be used in different roles +These flags indicate how a resource will be used and are specified at resource +creation time. Resources may be used in different roles during their lifecycle. Bind flags are cumulative and may be combined to create -a resource which can be used as multiple things. -Depending on the pipe driver's memory management, depending on these bind flags +a resource which can be used for multiple things. +Depending on the pipe driver's memory management and these bind flags, resources might be created and handled quite differently. -* ``RENDER_TARGET``: A color buffer or pixel buffer which will be rendered to. -* ``DISPLAY_TARGET``: A sharable buffer that can be given to another process. -* ``DEPTH_STENCIL``: A depth (Z) buffer or stencil buffer. Gallium does - not explicitly provide for stencil-only buffers, so any stencil buffer - validated here is implicitly also a depth buffer. -* ``SAMPLER_VIEW``: A texture that may be sampled from in a fragment or vertex - shader. -* ``VERTEX_BUFFER``: A vertex buffer. -* ``INDEX_BUFFER``: An element buffer. -* ``CONSTANT_BUFFER``: A buffer of shader constants. -* ``BLIT_SOURCE``: A blit source, as given to surface_copy. -* ``BLIT_DESTINATION``: A blit destination, as given to surface_copy and surface_fill. -* ``TRANSFER_WRITE``: A transfer object which will be written to. -* ``TRANSFER_READ``: A transfer object which will be read from. -* ``CUSTOM``: -* ``SCANOUT``: A front color buffer or scanout buffer. -* ``SHARED``: +* ``PIPE_BIND_RENDER_TARGET``: A color buffer or pixel buffer which will be + rendered to. Any surface/resource attached to pipe_framebuffer_state::cbufs + must have this flag set. +* ``PIPE_BIND_DEPTH_STENCIL``: A depth (Z) buffer and/or stencil buffer. Any + depth/stencil surface/resource attached to pipe_framebuffer_state::zsbuf must + have this flag set. +* ``PIPE_BIND_DISPLAY_TARGET``: A sharable buffer that can be given to another + process. +* ``PIPE_BIND_SAMPLER_VIEW``: A texture that may be sampled from in a fragment + or vertex shader. +* ``PIPE_BIND_VERTEX_BUFFER``: A vertex buffer. +* ``PIPE_BIND_INDEX_BUFFER``: An vertex index/element buffer. +* ``PIPE_BIND_CONSTANT_BUFFER``: A buffer of shader constants. +* ``PIPE_BIND_BLIT_SOURCE``: A blit source, as given to surface_copy. +* ``PIPE_BIND_BLIT_DESTINATION``: A blit destination, as given to surface_copy + and surface_fill. +* ``PIPE_BIND_TRANSFER_WRITE``: A transfer object which will be written to. +* ``PIPE_BIND_TRANSFER_READ``: A transfer object which will be read from. +* ``PIPE_BIND_CUSTOM``: +* ``PIPE_BIND_SCANOUT``: A front color buffer or scanout buffer. +* ``PIPE_BIND_SHARED``: .. _pipe_usage: -PIPE_USAGE -^^^^^^^^^^ +PIPE_USAGE_* +^^^^^^^^^^^^ + +The PIPE_USAGE enums are hints about the expected usage pattern of a resource. -The PIPE_USAGE enums are hints about the expected lifecycle of a resource. -* ``DEFAULT``: Expect many uploads to the resource, intermixed with draws. -* ``DYNAMIC``: Expect many uploads to the resource, intermixed with draws. -* ``STATIC``: Same as immutable (?) -* ``IMMUTABLE``: Resource will not be changed after first upload. -* ``STREAM``: Upload will be followed by draw, followed by upload, ... +* ``PIPE_USAGE_DEFAULT``: Expect many uploads to the resource, intermixed with draws. +* ``PIPE_USAGE_DYNAMIC``: Expect many uploads to the resource, intermixed with draws. +* ``PIPE_USAGE_STATIC``: Same as immutable (?) +* ``PIPE_USAGE_IMMUTABLE``: Resource will not be changed after first upload. +* ``PIPE_USAGE_STREAM``: Upload will be followed by draw, followed by upload, ... @@ -162,7 +168,7 @@ For example, a compressed format might only be used for POT textures. Methods ------- -XXX moar; got bored +XXX to-do get_name ^^^^^^^^ @@ -204,9 +210,15 @@ and/or front-buffer rendering. is_format_supported ^^^^^^^^^^^^^^^^^^^ -See if a format can be used in a specific manner. +Determine if a resource in the given format can be used in a specific manner. -**tex_usage** is a bitmask of :ref:`PIPE_BIND` flags. +**format** the resource format + +**target** one of the PIPE_TEXTURE_x flags + +**bindings** is a bitmask of :ref:`PIPE_BIND` flags. + +**geom_flags** is a bitmask of PIPE_TEXTURE_GEOM_x flags. Returns TRUE if all usages can be satisfied. @@ -214,15 +226,35 @@ Returns TRUE if all usages can be satisfied. .. _resource_create: resource_create -^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^ + +Create a new resource from a template. +The following fields of the pipe_resource must be specified in the template: + +target + +format + +width0 + +height0 + +depth0 + +last_level + +nr_samples + +usage + +bind + +flags + -Given a template of texture setup, create a resource. -The way a resource may be used is specifed by bind flags, :ref:`pipe_bind`. -and hints are used to indicate to the driver what access pattern might be -likely, :ref:`pipe_usage`. resource_destroy -^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^ Destroy a resource. A resource is destroyed if it has no more references. -- cgit v1.2.3 From cb384ae8b2028016d66ebf92c9cb2ae3be7d3595 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 22 Apr 2010 19:51:10 +0100 Subject: gallium/docs: Unswap PIPE_BIND_SHARED's comment. --- src/gallium/docs/source/screen.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gallium/docs') diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 05688cc1f23..c5815f8939c 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -121,8 +121,8 @@ resources might be created and handled quite differently. * ``PIPE_BIND_DEPTH_STENCIL``: A depth (Z) buffer and/or stencil buffer. Any depth/stencil surface/resource attached to pipe_framebuffer_state::zsbuf must have this flag set. -* ``PIPE_BIND_DISPLAY_TARGET``: A sharable buffer that can be given to another - process. +* ``PIPE_BIND_DISPLAY_TARGET``: A surface that can be presented to screen. Arguments to + pipe_screen::flush_front_buffer must have this flag set. * ``PIPE_BIND_SAMPLER_VIEW``: A texture that may be sampled from in a fragment or vertex shader. * ``PIPE_BIND_VERTEX_BUFFER``: A vertex buffer. @@ -135,7 +135,8 @@ resources might be created and handled quite differently. * ``PIPE_BIND_TRANSFER_READ``: A transfer object which will be read from. * ``PIPE_BIND_CUSTOM``: * ``PIPE_BIND_SCANOUT``: A front color buffer or scanout buffer. -* ``PIPE_BIND_SHARED``: +* ``PIPE_BIND_SHARED``: A sharable buffer that can be given to another + process. .. _pipe_usage: -- cgit v1.2.3 From dda8046a6460cbdcfd0ed8a78a443077296a29d2 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 24 Apr 2010 00:19:22 -0700 Subject: gallium/docs: Update Gallium version number to 0.4. --- src/gallium/docs/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/docs') diff --git a/src/gallium/docs/source/conf.py b/src/gallium/docs/source/conf.py index 59c19ed98dd..ccc84405c41 100644 --- a/src/gallium/docs/source/conf.py +++ b/src/gallium/docs/source/conf.py @@ -45,9 +45,9 @@ copyright = u'2009, VMWare, X.org, Nouveau' # built documents. # # The short X.Y version. -version = '0.3' +version = '0.4' # The full version, including alpha/beta/rc tags. -release = '0.3' +release = '0.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- cgit v1.2.3 From aac2cccccfd701ae8d7ce0813c28c64498d4a076 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 26 Apr 2010 19:50:57 +0200 Subject: 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. --- src/gallium/auxiliary/cso_cache/cso_context.c | 11 ++++++ src/gallium/auxiliary/cso_cache/cso_context.h | 2 ++ src/gallium/docs/source/context.rst | 16 ++++++--- src/gallium/docs/source/screen.rst | 13 +++++-- src/gallium/include/pipe/p_context.h | 51 +++++++++++++++++++-------- src/gallium/include/pipe/p_defines.h | 2 -- src/gallium/include/pipe/p_screen.h | 11 +++++- src/gallium/include/pipe/p_state.h | 2 ++ 8 files changed, 82 insertions(+), 26 deletions(-) (limited to 'src/gallium/docs') diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 6d0b4207986..50736f06b32 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -98,6 +98,7 @@ struct cso_context { struct pipe_framebuffer_state fb, fb_saved; struct pipe_viewport_state vp, vp_saved; struct pipe_blend_color blend_color; + unsigned sample_mask sample_mask; struct pipe_stencil_ref stencil_ref, stencil_ref_saved; }; @@ -984,6 +985,16 @@ enum pipe_error cso_set_blend_color(struct cso_context *ctx, return PIPE_OK; } +enum pipe_error cso_set_sample_mask(struct cso_context *ctx, + unsigned sample_mask) +{ + if (ctx->sample_mask != sample_mask) { + ctx->sample_mask = sample_mask; + ctx->pipe->set_sample_mask(ctx->pipe, sample_mask); + } + return PIPE_OK; +} + enum pipe_error cso_set_stencil_ref(struct cso_context *ctx, const struct pipe_stencil_ref *sr) { diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h index d6bcb1fe8f7..f0b07f73765 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.h +++ b/src/gallium/auxiliary/cso_cache/cso_context.h @@ -159,6 +159,8 @@ void cso_restore_viewport(struct cso_context *cso); enum pipe_error cso_set_blend_color(struct cso_context *cso, const struct pipe_blend_color *bc); +enum pipe_error cso_set_sample_mask(struct cso_context *cso, + unsigned stencil_mask); enum pipe_error cso_set_stencil_ref(struct cso_context *cso, const struct pipe_stencil_ref *sr); diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst index c82e681a254..374711b3c5c 100644 --- a/src/gallium/docs/source/context.rst +++ b/src/gallium/docs/source/context.rst @@ -54,6 +54,7 @@ objects. They all follow simple, one-method binding calls, e.g. * ``set_stencil_ref`` sets the stencil front and back reference values which are used as comparison values in stencil test. * ``set_blend_color`` +* ``set_sample_mask`` * ``set_clip_state`` * ``set_polygon_stipple`` * ``set_scissor_state`` sets the bounds for the scissor test, which culls @@ -255,15 +256,20 @@ Blitting These methods emulate classic blitter controls. They are not guaranteed to be available; if they are set to NULL, then they are not present. -These methods operate directly on ``pipe_surface`` objects, and stand +These methods operate directly on ``pipe_resource`` objects, and stand apart from any 3D state in the context. Blitting functionality may be moved to a separate abstraction at some point in the future. -``surface_fill`` performs a fill operation on a section of a surface. +``resource_fill_region`` performs a fill operation on a section of a resource. -``surface_copy`` blits a region of a surface to a region of another surface, -provided that both surfaces are the same format. The source and destination -may be the same surface, and overlapping blits are permitted. +``resource_copy_region`` blits a region of a subresource of a resource to a +region of another subresource of a resource, provided that both resources have the +same format. The source and destination may be the same resource, and overlapping +blits are permitted. + +``resource_resolve`` resolves a multisampled resource into a non-multisampled +one. Formats and dimensions must match. This function must be present if a driver +supports multisampling. The interfaces to these calls are likely to change to make it easier for a driver to batch multiple blits with the same source and diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index c5815f8939c..2a8f6967ea9 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -128,9 +128,6 @@ resources might be created and handled quite differently. * ``PIPE_BIND_VERTEX_BUFFER``: A vertex buffer. * ``PIPE_BIND_INDEX_BUFFER``: An vertex index/element buffer. * ``PIPE_BIND_CONSTANT_BUFFER``: A buffer of shader constants. -* ``PIPE_BIND_BLIT_SOURCE``: A blit source, as given to surface_copy. -* ``PIPE_BIND_BLIT_DESTINATION``: A blit destination, as given to surface_copy - and surface_fill. * ``PIPE_BIND_TRANSFER_WRITE``: A transfer object which will be written to. * ``PIPE_BIND_TRANSFER_READ``: A transfer object which will be read from. * ``PIPE_BIND_CUSTOM``: @@ -223,6 +220,16 @@ Determine if a resource in the given format can be used in a specific manner. Returns TRUE if all usages can be satisfied. +is_msaa_supported +^^^^^^^^^^^^^^^^^ + +Determine if a format supports multisampling with a given number of samples. + +**format** the resource format + +**sample_count** the number of samples. Valid query range is 2-32. + +Returns TRUE if sample_count number of samples is supported with this format. .. _resource_create: 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); + /*@}*/ /** diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 48edfbfcce7..3223e8d844c 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -284,8 +284,6 @@ enum pipe_transfer_usage { #define PIPE_BIND_VERTEX_BUFFER (1 << 3) /* set_vertex_buffers */ #define PIPE_BIND_INDEX_BUFFER (1 << 4) /* draw_elements */ #define PIPE_BIND_CONSTANT_BUFFER (1 << 5) /* set_constant_buffer */ -#define PIPE_BIND_BLIT_SOURCE (1 << 6) /* surface_copy */ -#define PIPE_BIND_BLIT_DESTINATION (1 << 7) /* surface_copy, fill */ #define PIPE_BIND_DISPLAY_TARGET (1 << 8) /* flush_front_buffer */ #define PIPE_BIND_TRANSFER_WRITE (1 << 9) /* get_transfer */ #define PIPE_BIND_TRANSFER_READ (1 << 10) /* get_transfer */ diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index beff1ae8a92..1bad045b162 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -99,9 +99,18 @@ struct pipe_screen { boolean (*is_format_supported)( struct pipe_screen *, enum pipe_format format, enum pipe_texture_target target, - unsigned bindings, + unsigned bindings, unsigned geom_flags ); + /** + * Check if the given pipe_format is supported with a requested + * number of samples for msaa. + * \param sample_count number of samples for multisampling + */ + boolean (*is_msaa_supported)( struct pipe_screen *, + enum pipe_format format, + unsigned sample_count ); + /** * Create a new texture object, using the given template info. */ diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index a504757c472..f9ad07d8f87 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -218,6 +218,8 @@ struct pipe_blend_state unsigned logicop_enable:1; unsigned logicop_func:4; /**< PIPE_LOGICOP_x */ unsigned dither:1; + unsigned alpha_to_coverage:1; + unsigned alpha_to_one:1; struct pipe_rt_blend_state rt[PIPE_MAX_COLOR_BUFS]; }; -- cgit v1.2.3 From 6272d7632a8d2948e45698d1c75eae8c441c3916 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 20:52:08 +0200 Subject: gallium: another interface change for multisampling due to popular request, use nr_samples parameter in is_format_supported() instead of new is_msaa_supported() query. This makes it easily possible to query if a format with a given sample count is also supported not only as render target, but for sampler views (note that texture sampling from multisampled resources isn't supported yet). It is not quite how dx10 format msaa queries work, but we might need to revisit format queries completely in the future anyway. --- src/gallium/docs/source/screen.rst | 14 +++----------- src/gallium/include/pipe/p_screen.h | 12 ++---------- 2 files changed, 5 insertions(+), 21 deletions(-) (limited to 'src/gallium/docs') diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 2a8f6967ea9..5a60ee00a69 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -214,23 +214,15 @@ Determine if a resource in the given format can be used in a specific manner. **target** one of the PIPE_TEXTURE_x flags +**sample_count** the number of samples. 0 and 1 mean no multisampling, +the maximum allowed legal value is 32. + **bindings** is a bitmask of :ref:`PIPE_BIND` flags. **geom_flags** is a bitmask of PIPE_TEXTURE_GEOM_x flags. Returns TRUE if all usages can be satisfied. -is_msaa_supported -^^^^^^^^^^^^^^^^^ - -Determine if a format supports multisampling with a given number of samples. - -**format** the resource format - -**sample_count** the number of samples. Valid query range is 2-32. - -Returns TRUE if sample_count number of samples is supported with this format. - .. _resource_create: resource_create diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 1bad045b162..9cb949a4465 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -89,7 +89,7 @@ struct pipe_screen { struct pipe_context * (*context_create)( struct pipe_screen *, void *priv ); - + /** * Check if the given pipe_format is supported as a texture or * drawing surface. @@ -99,18 +99,10 @@ struct pipe_screen { boolean (*is_format_supported)( struct pipe_screen *, enum pipe_format format, enum pipe_texture_target target, + unsigned sample_count, unsigned bindings, unsigned geom_flags ); - /** - * Check if the given pipe_format is supported with a requested - * number of samples for msaa. - * \param sample_count number of samples for multisampling - */ - boolean (*is_msaa_supported)( struct pipe_screen *, - enum pipe_format format, - unsigned sample_count ); - /** * Create a new texture object, using the given template info. */ -- cgit v1.2.3 From 379db6a36b32912be8fd8808ceb95ca5cffa7850 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 May 2010 21:02:24 +0200 Subject: gallium: clean up resource_copy_region function Previously, surface_copy was said to allow overlapping blits, and it was "optional". However, some state trackers actually assumed it is always present, and quite some code (like in u_blit) assumed overlapping isn't allowed. Hence, resource_copy_region (and in the same spirit, resource_fill_region) is now mandatory, but overlapping blits are no longer allowed. A driver can plug in the cpu fallback util_resource_copy_region if it does not want to provide its own implementation, though this is not optimal. --- src/gallium/docs/source/context.rst | 7 +++---- src/gallium/include/pipe/p_context.h | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/gallium/docs') diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst index 374711b3c5c..ac3c3c7bdbd 100644 --- a/src/gallium/docs/source/context.rst +++ b/src/gallium/docs/source/context.rst @@ -253,8 +253,7 @@ Resource Busy Queries Blitting ^^^^^^^^ -These methods emulate classic blitter controls. They are not guaranteed to be -available; if they are set to NULL, then they are not present. +These methods emulate classic blitter controls. These methods operate directly on ``pipe_resource`` objects, and stand apart from any 3D state in the context. Blitting functionality may be @@ -264,8 +263,8 @@ moved to a separate abstraction at some point in the future. ``resource_copy_region`` blits a region of a subresource of a resource to a region of another subresource of a resource, provided that both resources have the -same format. The source and destination may be the same resource, and overlapping -blits are permitted. +same format. The source and destination may be the same resource, but overlapping +blits are not permitted. ``resource_resolve`` resolves a multisampled resource into a non-multisampled one. Formats and dimensions must match. This function must be present if a driver diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 6ce8ba953a7..6b729831768 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -238,8 +238,6 @@ struct pipe_context { /** * 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. */ /*@{*/ -- cgit v1.2.3 From db0ddb7c0196c11cd47066bbf6af3febbefb7100 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 18 May 2010 21:42:09 +0200 Subject: docs: update differences to d3d11 --- src/gallium/docs/d3d11ddi.txt | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/gallium/docs') diff --git a/src/gallium/docs/d3d11ddi.txt b/src/gallium/docs/d3d11ddi.txt index 8f2509ce035..d9c2b441a94 100644 --- a/src/gallium/docs/d3d11ddi.txt +++ b/src/gallium/docs/d3d11ddi.txt @@ -79,7 +79,7 @@ set_clip_state set_polygon_stipple + Gallium supports polygon stipple -surface_fill +resource_fill_region + Gallium supports subrectangle fills of surfaces, D3D10 only supports full clears of views * DirectX 10/11 DDI functions and Gallium equivalents @@ -114,11 +114,10 @@ CheckDeferredContextHandleSizes (D3D11 only) CheckFormatSupport -> screen->is_format_supported ! Gallium passes usages to this function, D3D11 returns them - Gallium does not differentiate between blendable and non-blendable render targets - - Gallium lacks multisampled-texture and multisampled-render-target usages + ! Gallium includes sample count directly, D3D11 uses additional query CheckMultisampleQualityLevels - * could merge this with is_format_supported - - Gallium lacks multisampling support + ! is merged with is_format_supported CommandListExecute (D3D11 only) - Gallium does not support command lists @@ -139,7 +138,6 @@ ClearUnorderedAccessViewUint (D3D11 only) CreateBlendState (extended in D3D10.1) -> create_blend_state # D3D10 does not support per-RT blend modes (but per-RT blending), only D3D10.1 does - - Gallium lacks alpha-to-coverage + Gallium supports logic ops + Gallium supports dithering + Gallium supports using the broadcast alpha component of the blend constant color @@ -198,7 +196,6 @@ CreateQuery -> create_query CreateRasterizerState - Gallium lacks clamping of polygon offset depth biases - Gallium lacks support to disable depth clipping - - Gallium lacks multisampling + Gallium, like OpenGL, supports PIPE_POLYGON_MODE_POINT + Gallium, like OpenGL, supports per-face polygon fill modes + Gallium, like OpenGL, supports culling everything @@ -228,7 +225,6 @@ CreateResource -> texture_create or buffer_create ! D3D11 specifies mapping flags (i.e. read/write/discard);:it's unclear what they are used for here - D3D11 supports odd things in the D3D10_DDI_RESOURCE_MISC_FLAG enum (D3D10_DDI_RESOURCE_MISC_DISCARD_ON_PRESENT, D3D11_DDI_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS, D3D11_DDI_RESOURCE_MISC_BUFFER_STRUCTURED) - Gallium does not support indirect draw call parameter buffers - - Gallium lacks multisampling - Gallium lacks array textures ! D3D11 supports specifying hardware modes and other stuff here for scanout resources + Gallium allows specifying minimum buffer alignment @@ -400,7 +396,7 @@ ResourceCopy ResourceCopyRegion ResourceConvert (D3D10.1+ only) ResourceConvertRegion (D3D10.1+ only) - -> surface_copy + -> resource_copy_region - Gallium does not support hardware buffer copies - Gallium does not support copying 3D texture subregions in a single call @@ -410,8 +406,7 @@ ResourceIsStagingBusy -> is_texture_referenced, is_buffer_referenced ResourceReadAfterWriteHazard ! Gallium specifies hides this, except for the render and texture caches -ResourceResolveSubresource - - Gallium does not support multisample sample resolution +ResourceResolveSubresource -> resource_resolve ResourceMap ResourceUnmap @@ -433,9 +428,8 @@ StagingResourceUnmap ResourceUpdateSubresourceUP -> transfer functionality, transfer_inline_write in gallium-resources DefaultConstantBufferUpdateSubresourceUP -> transfer functionality, transfer_inline_write in gallium-resources -SetBlendState -> bind_blend_state and set_blend_color - ! D3D11 fuses bind_blend_state and set_blend_color in a single function - - Gallium lacks the sample mask +SetBlendState -> bind_blend_state, set_blend_color and set_sample_mask + ! D3D11 fuses bind_blend_state, set_blend_color and set_sample_mask in a single function SetDepthStencilState -> bind_depth_stencil_alpha_state and set_stencil_ref ! D3D11 fuses bind_depth_stencil_alpha_state and set_stencil_ref in a single function -- cgit v1.2.3