[PATCH 4/6] gallium: extend resource_resolve to accommodate BlitFramebuffer

Christoph Bumiller e0425955 at student.tuwien.ac.at
Mon Jul 25 05:11:38 PDT 2011


Resolve via glBlitFramebuffer allows resolving a sub-region of a
renderbuffer to a different location in any mipmap level of some
other texture, therefore location and size parameters are needed.

The mask parameter was added because resolving only depth or only
stencil of a combined buffer is possible as well.

Copying from FBO to a window system buffer requires a vertical
so the yflip parameter was added.

Any kind of fallback instigated by a state tracker involving
temporary storage would be highly undesirable.
---
 src/gallium/include/pipe/p_context.h |   20 +++++++++++---------
 src/gallium/include/pipe/p_defines.h |    3 +++
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 3f6d90d..9376cdd 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -255,8 +255,7 @@ struct pipe_context {
 
    /**
     * 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.
+    * The resources must be of the same format and sample count.
     */
    void (*resource_copy_region)(struct pipe_context *pipe,
                                 struct pipe_resource *dst,
@@ -267,14 +266,17 @@ struct pipe_context {
                                 const struct pipe_box *src_box);
 
    /**
-    * Resolve a multisampled resource into a non-multisampled one.
-    * Source and destination must have the same size and same format.
+    * Resolve a multisampled resource into a non-multisampled one,
+    * or vice versa (in the latter case, values are just replicated).
+    * Source and destination must have the same format.
+    * Mask can be either PIPE_MASK_RGBA, Z, S or ZS.
+    * The mipmap level of the multisampled resource will be 0.
     */
-   void (*resource_resolve)(struct pipe_context *pipe,
-                            struct pipe_resource *dst,
-                            unsigned dst_layer,
-                            struct pipe_resource *src,
-                            unsigned src_layer);
+   void (*resource_resolve)(struct pipe_context *pipe, unsigned mask,
+                            struct pipe_resource *dst, unsigned dst_level,
+                            unsigned dstx, unsigned dsty, unsigned dst_layer,
+                            struct pipe_resource *src, unsigned src_level,
+                            const struct pipe_box *src_box, boolean yflip);
 
    /*@}*/
 
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 79b8969..080e6b9 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -99,6 +99,9 @@ enum pipe_error {
 #define PIPE_MASK_B  0x4
 #define PIPE_MASK_A  0x8
 #define PIPE_MASK_RGBA 0xf
+#define PIPE_MASK_Z  0x10
+#define PIPE_MASK_S  0x20
+#define PIPE_MASK_ZS 0x30
 
 
 /**
-- 
1.7.2.2


--------------000200050908000003070003--


More information about the mesa-dev mailing list