[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-dev
Subject:    [Mesa3d-dev] XCB in GL
From:       Jeremy Kolb <jkolb () brandeis ! edu>
Date:       2005-04-24 5:24:59
Message-ID: 426B2DAB.3080105 () brandeis ! edu
[Download RAW message or body]

Hey Ian, we spoke a few months ago when I was working on implementing 
the GLX extension for XCB (xcb.freedesktop.org).  Anyways, I've modified 
glX_proto_send.py to generate the code necessary for it to use the XCB 
library instead of Xlib.  It outputs the new code in between #ifdef 
USE_XCB / #endif.  So it you can compile with either xlib or xlib/xcb.

At the moment it only works with the single ops as we do not have 
support for render ops in xcb yet.  But I think it's a start.

Do the patches look okay?  If so could someone possibly commit it to cvs?

Included:
glX_proto_send.py.diff
Makefile.diff (for Mesa/Makefile)
linux-x86-xcb (place in Mesa/configs, basically just tells CFLAGS to 
define USE_XCB)

Thanks,
Jeremy

["glX_proto_send.py.diff" (text/plain)]

Index: glX_proto_send.py
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/glapi/glX_proto_send.py,v
retrieving revision 1.24
diff -r1.24 glX_proto_send.py
122a123,128
> 		print '#ifdef USE_XCB'
> 		print '#include <X11/xcl.h>'
> 		print '#include <X11/XCB/xcb.h>'
> 		print '#include <X11/XCB/extensions/glx.h>'
> 		print '#endif'
> 		
416a423,435
> 			
> 			
> 		# XCB specific:
> 		print '#ifdef USE_XCB'
> 		print '        XCBConnection *c = XCBConnectionOfDisplay(dpy);'
> 		xcb_name = 'XCBGlx%s' % (f.opcode_name().rsplit("_", 1)[1]);
> 		xcb_cookie = '        %sCookie cookie = %s(c, gc->currentContextTag' % (xcb_name, xcb_name)
> 
> 		xcb_req_params = f.parameters_by_name.keys()
> 		for i in range(len(xcb_req_params)):
> 			xcb_cookie = xcb_cookie + ', ' + xcb_req_params[i]
> 		xcb_cookie = xcb_cookie + ');'
> 		print xcb_cookie
417a437,443
> 		if f.needs_reply():
> 			print '        ' + xcb_name + 'Rep* reply = ' + xcb_name + 'Reply(c, cookie, NULL);'
> 			print '        retval = reply.return_value;'
> 			print '        free(reply);'
> 		print '#else'
> 		# End of XCB specific.
> 		
474a501,502
> 		print '        UnlockDisplay(dpy); SyncHandle();'
> 		print '#endif /* USE_XCB */'
477,479d504
< 
< 
< 		print '        UnlockDisplay(dpy); SyncHandle();'

["linux-x86-xcb" (text/plain)]

# Configuration for Linux with x86 optimizations

include $(TOP)/configs/default

CONFIG_NAME = linux-x86-xcb

# Compiler and flags
CC = gcc
CXX = g++

CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
-D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM \
-DUSE_SSE_ASM -DPTHREADS -DUSE_XCB -I/usr/X11R6/include

CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
-D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XCB

GLUT_CFLAGS = -fexceptions


ASM_SOURCES = $(X86_SOURCES) $(X86_API)

# Library/program dependencies
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lXCB
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu \
-lXt -lXi -lm GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm


["Makefile.diff" (text/plain)]

Index: Makefile
===================================================================
RCS file: /cvs/mesa/Mesa/Makefile,v
retrieving revision 1.39
diff -r1.39 Makefile
112a113
> linux-x86-xcb \

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic