Chad Versace's XDC2012 Waffle Presentation included a demo of Dante running with a Waffle backend with dynamic switching of the window system (X11 && GLX) or Wayland (using an environment variable.)
I definitely intend to research and hopefully even contribute to Waffle in the future.
Chad quickly wrote 95% (or more) of the Waffle backend. I provided some guidance and a small patch to stubbed-out X11 input. Together, we managed to pull this together just under the wire! Chad, you're awesome! :-)
Showing posts with label Xorg. Show all posts
Showing posts with label Xorg. Show all posts
Saturday, September 22, 2012
Monday, July 11, 2011
Using dlopen() for fast engine prototyping...
I recently became tired of the cycle of hacking on the renderer, starting the whole engine, checking where and how it's failing, exiting the engine and the pointless time wasted during this process. Typically it's only a specific area I'm working on, thus perhaps one or two C source code files are actually changed, so it doesn't make sense to reload the entire engine and all media assets.
I started working on a smaller project for rapid-fire prototyping, μEngine. Currently it's a pretty basic project. It provides the basic framework for detecting that a shared object has changed, unloading the current version from memory, loading the new library, resolving the required symbols, and continuing the "rendering" loop (which actually doesn't perform any OpenGL rendering yet.)
Here's an example of the engine running:
While the engine was running, I edited libuengine.c, which is compiled by Automake into a shared object:
Now I want to terminate the program (and I'm too lazy to have written a signal handler yet) so μEngine's main-loop is setup to terminate when dlsym_main returns a zero value.
μEngine also links with libengine (which provides all of the math/geometry/etc functionality for Trinity), libdecl (which provides access to id Software style declaration files), and liblwo2 (which, well, loads LWO2 model files.)
This little experiment is far from complete. I still need to setup an OpenGL and GLX context, handle X11 input, and keep track of any ARB fp/vp or GLSL programs loaded. GPU programs will be reloaded in much the same way as the shared object itself.
There is of course a few frames delay between invocation of make and the new library being loaded, because should stat fail to obtain the file modification time (because it's still being written out) μEngine just continues with the old shared library until stat succeeds. The modification time is checked every "frame."
I think this should help with faster prototyping, since μEngine has the ability to access all of the assets and libengine library functions that Trinity can, but without the requirement of loading all the assets for a full world map into memory at start up.
I started working on a smaller project for rapid-fire prototyping, μEngine. Currently it's a pretty basic project. It provides the basic framework for detecting that a shared object has changed, unloading the current version from memory, loading the new library, resolving the required symbols, and continuing the "rendering" loop (which actually doesn't perform any OpenGL rendering yet.)
Here's an example of the engine running:
~/uengine/src (master) $ make && ./uengine make: Nothing to be done for `all'. ... .libs/libuengine.so 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef ... .libs/libuengine.so 0xcafebabe 0xcafebabe 0xcafebabe 0xcafebabe ... .libs/libuengine.so 0x0 $
While the engine was running, I edited libuengine.c, which is compiled by Automake into a shared object:
$ sed -i 's/0xdeadbeef/0xcafebabe/' libuengine.c && make CC libuengine.lo CCLD libuengine.la
Now I want to terminate the program (and I'm too lazy to have written a signal handler yet) so μEngine's main-loop is setup to terminate when dlsym_main returns a zero value.
$ sed -i 's/0xcafebabe/0x0/' libuengine.c && make CC libuengine.lo CCLD libuengine.la
μEngine also links with libengine (which provides all of the math/geometry/etc functionality for Trinity), libdecl (which provides access to id Software style declaration files), and liblwo2 (which, well, loads LWO2 model files.)
This little experiment is far from complete. I still need to setup an OpenGL and GLX context, handle X11 input, and keep track of any ARB fp/vp or GLSL programs loaded. GPU programs will be reloaded in much the same way as the shared object itself.
There is of course a few frames delay between invocation of make and the new library being loaded, because should stat fail to obtain the file modification time (because it's still being written out) μEngine just continues with the old shared library until stat succeeds. The modification time is checked every "frame."
I think this should help with faster prototyping, since μEngine has the ability to access all of the assets and libengine library functions that Trinity can, but without the requirement of loading all the assets for a full world map into memory at start up.
Labels:
Development,
Trinity,
Xorg
Thursday, December 24, 2009
Holiday boredom...
I don't have any plans for the Christmas holidays, and Helsinki is at just the right temperature to make doing anything outside really difficult. Some of the snow has melted and frozen into ice, making it feel a lot like walking on broken glass: physically and emotionally; I stopped counting the number of unintentional acrobatics after about the 5th or 6th time sliding in some way.
I might implement zlib compression for network traffic in my engine, which should only be a few dozen lines... or something a bit more interesting; stencil shadow volumes could still use more optimization, or some SIMD stuff...
There are at least a few dozen minor X server issues discovered by Coverity, but that's getting dangerously close to Nokia work over the holidays. The majority of the issues are error paths anyway, nothing really critical.
In the more being lazy and doing nothing area, Avatar looks like it could be an interesting movie...
I might implement zlib compression for network traffic in my engine, which should only be a few dozen lines... or something a bit more interesting; stencil shadow volumes could still use more optimization, or some SIMD stuff...
There are at least a few dozen minor X server issues discovered by Coverity, but that's getting dangerously close to Nokia work over the holidays. The majority of the issues are error paths anyway, nothing really critical.
In the more being lazy and doing nothing area, Avatar looks like it could be an interesting movie...
Monday, December 21, 2009
Static analysis For The Win!

I caught on about clang, which is both a compiler and static analyzer, after it was mentioned on the xorg-devel list. Since then I've been running it on my own code and gradually fixing up errors.
Now, usually such tools are less than impressive (excluding extremely expensive proprietary tools such as Coverity.) However, clang has been really useful in eliminating a lot of dead code, unused variables (and the overhead of calling expensive functions to calculate those variables.)
I even discovered one major bug in the expression evaluator in my game engine which had gone overlooked for some time, which would result in two opcodes giving incorrect results and ultimately effecting the rendering of the shaders.
Clang is currently lacking Inter-Procedural Analysis but it seems like it's on the to-do shortlist, which will be a very nice feature. Hopefully it won't be long before Coverity's eating it's heart out.
Saturday, December 19, 2009
New city, new job, new blog...
I decided to start blogging again, now that I've somewhat settled down in Helsinki, and hopefully I'll be able to keep some regularity in the postings this time. Picture is from Snellmaninkatu, near my apartment at about 14:00 yesterday.It's been an interesting year; moving to Finland, working for Nokia, speaking at this years X Developers Conference and Maemo Summit.
Maemo Summit was arguably the most interesting since I was giving a demo of an early version of Quake 3 running on the N900 (also another video.) The whole thing started from a weekend project after chatting to Phil Carmody, who wrote the touchscreen and accelerometer kernel drivers. Actually it ended up turning into a several weekend project, but I digress; funny what happens when engineers get bored after work...
Currently I'm working on fixing two XreaL bugs with projected lights; I did a quick patch for the first issue but the second one is being more troublesome; Robert will probably get that before I do, and when it's 05:30 in the morning, maybe it's time to call it quits for the day.
Although, tomorrow might see the N900 getting more of a workout than Quake 3...
Labels:
Bug,
Helsinki,
Maemo Summit,
Maesum,
N900,
Nokia,
Patch,
Quake 3,
Snellmaninkatu,
Winter,
X Developers Conference,
Xorg,
XreaL
Subscribe to:
Posts (Atom)