1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
27 **************************************************************************/
34 #include "xlib_trace.h"
35 #include "xlib_softpipe.h"
37 #include "xm_winsys.h"
42 /* Todo, replace all this with callback-structs provided by the
43 * individual implementations.
53 static enum mode xlib_mode
;
55 static enum mode
get_mode()
57 if (getenv("XMESA_TRACE"))
60 if (getenv("XMESA_BRW"))
64 if (!getenv("GALLIUM_NOCELL"))
73 xmesa_create_pipe_winsys( void )
75 xlib_mode
= get_mode();
79 return xlib_create_trace_winsys();
81 return xlib_create_brw_winsys();
83 return xlib_create_cell_winsys();
85 return xlib_create_softpipe_winsys();
93 xmesa_create_pipe_screen( struct pipe_winsys
*winsys
)
97 return xlib_create_trace_screen( winsys
);
99 return xlib_create_brw_screen( winsys
);
101 return xlib_create_cell_screen( winsys
);
103 return xlib_create_softpipe_screen( winsys
);
110 struct pipe_context
*
111 xmesa_create_pipe_context( struct pipe_screen
*screen
,
116 return xlib_create_trace_context( screen
, priv
);
118 return xlib_create_brw_context( screen
, priv
);
120 return xlib_create_cell_context( screen
, priv
);
122 return xlib_create_softpipe_context( screen
, priv
);
130 xmesa_display_surface( struct xmesa_buffer
*buffer
,
131 struct pipe_surface
*surf
)
135 xlib_trace_display_surface( buffer
, surf
);
138 xlib_brw_display_surface( buffer
, surf
);
141 xlib_cell_display_surface( buffer
, surf
);
144 xlib_softpipe_display_surface( buffer
, surf
);
154 /***********************************************************************
156 * Butt-ugly hack to convince the linker not to throw away public GL
157 * symbols (they are all referenced from getprocaddress, I guess).
159 extern void (*linker_foo(const unsigned char *procName
))();
160 extern void (*glXGetProcAddress(const unsigned char *procName
))();
162 extern void (*linker_foo(const unsigned char *procName
))()
164 return glXGetProcAddress(procName
);