winsys/sw/wrapper: implement is_displaytarget_format_supported for swrast
authorChristoph Bumiller <christoph.bumiller@speed.at>
Mon, 17 Nov 2014 15:58:23 +0000 (16:58 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 18 Nov 2014 02:02:53 +0000 (02:02 +0000)
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c

index e552ac243525a720b4149ed95364a1dbcb689a6e..a6bf4985e1e6921d6da0451d5a09249e3a290e80 100644 (file)
@@ -84,6 +84,19 @@ wrapper_sw_displaytarget(struct sw_displaytarget *dt)
  */
 
 
+static boolean
+wsw_is_dt_format_supported(struct sw_winsys *ws,
+                           unsigned tex_usage,
+                           enum pipe_format format)
+{
+   struct wrapper_sw_winsys *wsw = wrapper_sw_winsys(ws);
+
+   return wsw->screen->is_format_supported(wsw->screen, format,
+                                           PIPE_TEXTURE_2D, 0,
+                                           PIPE_BIND_RENDER_TARGET |
+                                           PIPE_BIND_DISPLAY_TARGET);
+}
+
 static boolean
 wsw_dt_get_stride(struct wrapper_sw_displaytarget *wdt, unsigned *stride)
 {
@@ -276,6 +289,7 @@ wrapper_sw_winsys_wrap_pipe_screen(struct pipe_screen *screen)
    if (!wsw)
       goto err;
 
+   wsw->base.is_displaytarget_format_supported = wsw_is_dt_format_supported;
    wsw->base.displaytarget_create = wsw_dt_create;
    wsw->base.displaytarget_from_handle = wsw_dt_from_handle;
    wsw->base.displaytarget_get_handle = wsw_dt_get_handle;