swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)
[mesa.git] / src / mesa / drivers / dri / common / dri_util.c
index 0bce77ea9c72ccb6c2433980454169deec780966..fd2eca715c37b1051c36dc10a35ac60a73196eaf 100644 (file)
@@ -873,3 +873,18 @@ const __DRIimageDriverExtension driImageDriverExtension = {
     .getAPIMask                 = driGetAPIMask,
     .createContextAttribs       = driCreateContextAttribs,
 };
+
+/* swrast copy sub buffer entrypoint. */
+static void driCopySubBuffer(__DRIdrawable *pdp, int x, int y,
+                             int w, int h)
+{
+    assert(pdp->driScreenPriv->swrast_loader);
+
+    pdp->driScreenPriv->driver->CopySubBuffer(pdp, x, y, w, h);
+}
+
+/* for swrast only */
+const __DRIcopySubBufferExtension driCopySubBufferExtension = {
+   { __DRI_COPY_SUB_BUFFER, 1 },
+   .copySubBuffer = driCopySubBuffer,
+};