Hardware Based XRender Slower than Software Rendering? 297
Neon Spiral Injector writes "Rasterman of Enlightenment fame has finally updated the news page of his personal site. It seems that the behind the scenes work for E is coming along. He is investigating rendering backends for Evas. The default backend is a software renderer written by Raster. Trying to gain a little more speed he ported it to the XRender extension, only to find that it became 20-50 times slower on his NVidia card. He has placed some sample code on this same news page for people to try, and see if this is also experienced on other setups."
are the drivers installed? (Score:3, Funny)
Re:Can you learn to spell? (Score:2, Funny)
Replying to this post completely negates what I was trying to accomplish with my "x" trick, but I thought you'd like to know.
Re:are the drivers installed? (Score:2)
2D acceleration using OpenGL? (Score:5, Interesting)
Has anyone done that? Any interesting results? One would think that there's a lot of potential here...
One word: (Score:4, Informative)
IrisGL or OpenGL (I think OpenGL is based on IrisGL, so Irix probably now uses OpenGL) is used extensively in Irix, for both 2D and 3D.
Re:One word: (Score:3, Informative)
Re:One word: (Score:5, Insightful)
It's great for using 3D effects on 2D windows for what has normally been wasted horsepower. Finally, eye candy that won't slow down your system!
Re:One word: (Score:4, Interesting)
There are also third-party utilities (Stardock WindowFX, etc.) that create all sorts of nifty transitions, shadows, blending, etc. that are handled by the graphics device.
Re:One word: (Score:4, Informative)
Quartz Extreme in a few words (Score:5, Informative)
That's not accurate. Quartz is really made of two parts: Quartz 2D and the Quartz Compositor.
The Quartz Compositor is reponsible for compositing all the layers (desktop, windows, layers inside windows) on-screen. It offers Porter-Duff compositing, which was developped at Pixar more than 15 years ago. See this post [google.com] from Mike Paquette for details. Mr Paquette is one of the main developpers of Quartz. Quartz Extreme is "simply" an OpenGL implementation of Porter-Duff compositing and modern graphic cards offer the primitives needed to do that very efficiently.
The Quartz 2D layer is what offers drawing primitives following the Postscript drawing model. The same drawing model is used with PDF (no surprise), Java2D and SVG (and Microsoft's GDI+ ?). This part is not HW accelerated. I am sure Apple is working on it, but it wouldn't surprise me if new HW will be required to make this possible. There is a strong incentive for card manufacturers to offer acceleration, since Longhorn is supposed to use GDI+ extensively. I doubt that such acceleration will fit in the traditionnal OpenGL/Direct3D rendering pipeline.
The Apple JVM team implemented HW accelerated Java2D drawing in their 1.3.1 JVM. Their 1.4 JVM doesn't offer it (1.4.1 was a massive rewrite for them, 1.3.1 was more of a quick port to OS-X using some of their "old" carbon code). There were quite a few problems when HW acceleration was used. I hope they can and will wait for a system-wide Quartz-2D HW acceleration, it seems ludicrous to have the JVM team spend resources on an effort that will be wasted once Quartz2D is accelerated.
See Apple Marketing page [apple.com], another post from Mike Paquette [google.com], and the presentation from Apple at SIGgraph about Quartz Extreme and OpenGL [opengl.org].
If that post doesn't end-up rated +5 informative, I don't know what will !
Re:One word: (Score:3, Informative)
The file manager, for example, used resizable icons. Moving a slider would make the icons bigger or smaller. Those were definitely vector graphics. I'm not 100% sure, but I'd bet those were opengl objects.
About grandparent's comment, yes, SGI created IrisGL first, then moved onto OpenGL when they opened up the specs, and had a glue library for compatibility with old apps, called Igloo (IrisGL on OpenGL)
Btw, I've tried rasterman's test on my ancient Riva TNT card and software rendering is indeed a lot
Re:2D acceleration using OpenGL? (Score:5, Interesting)
One problem is that multi-window OpenGL doesn't work that well. Game-oriented graphics boards don't have good support for per-window unsynchronized buffer swapping, so you tend to get one window redraw per frame time under Windows. (How well does Linux do with this?) Try running a few OpenGL apps that don't stress the graphics hardware at the same time. Do they slow down?
One of the neater ways to do graphics is to use Flash for 2D and OpenGL for 3D. Quite a number of games work that way internally. The Flash rendering engine typically isn't Macromedia's, but Macromedia authoring tools are used. This gives the user interface designers great power without having to program.
Re:2D acceleration using OpenGL? (Score:5, Informative)
On using OpenGL in multiple windows....
While my graphics hardware is not quite representative (the Matrox G450 is not known for great 3D performance), I ran two instances of glxgears.
Short conclusion: MesaGL on Linux has the same problem. Long conclusion: the windows showed noticable slowdowns, up to the point where animation was suspended in one window while the other ran, with the system switching the running window at seemingly random intervals.
System specs:
Hope this helps,
Mart
Re:2D acceleration using OpenGL? (Score:5, Informative)
Single glxgears: 3600
3 glxgears: 1200
5 glxgears: 700
(All aprox numbers). So basically it scales almost perfectly with the number of open windows.
Re:2D acceleration using OpenGL? (Score:3, Informative)
I have a dual Athlon MP 2600 running w/ an nVidia GeForce 4 MX440. Here's what I get for 1 through 4 glxgears:
The fall-off is slightly more harsh than linear for 1 through 3, probably synchronization overhead. 4 seems to get faster in terms of total frame rate across all four instances. 2*3000 == 6000, 3*1500 = 4500, 4*1300 = 5200(!)
--JoeRe:2D acceleration using OpenGL? (Score:2, Interesting)
1: 1871
3: 630
5: 372
When you look at them it's obvious that they're not running simultaniously, but get a little bit of gfx-time each, stopping and waiting for the other gears to stop moving. Utterly useless!
Re:2D acceleration using OpenGL? (Score:5, Informative)
Which means it's broken. All the windows should run at full speed until the graphics pipeline saturates.
There are several problems. First, make sure that you're not running with "wait for VBLANK" off. There's a stupid overclocker mania for running the graphics system faster than the display can refresh. This leads to high, meaningless frame rates, and to lower system performance because the useless redraws are using up all the CPU time.
Once you're past that, the issues are more fundamental.
The real problem is that OpenGL is double-buffered, but most windowing systems don't understand double-buffering or frame-synchronous drawing very well. Even OpenGL has no notion of time. But this could be fixed.
Usually, each app draws into the back buffer, then makes the OpenGL call to swap the buffers. This blocks the app (older NVidia drivers for Windows spin-locked, but I got them to fix that), but worse, it typically locks up the OpenGL subsystem until the frame ends and the buffer swap occurs. Implementations like that can only draw one window per frame time, obviously.
What ought to happen is that a request for a buffer swap should schedule a buffer swap for the next frame cycle, block the app, then let other apps get in their draw time. At the end of the frame, when everybody is done drawing, all windows get buffer swapped, and all the apps stuck in the OpenGL buffer swap call then unblock simultaneously. That way, multiple OpenGL apps running in different windows all run at full frame rate, until the scene complexity hits the limits of the graphics hardware.
Part of the problem is that X and OpenGL are such drastically different architectures that making them play well together is tough. X assumes a network-centric model; OpenGL assumes you're local. X expects a weak terminal; OpenGL needs good graphics acceleration. X is built around a windowing concept; OpenGL doesn't know about windows. X and OpenGL are defined by different organizations.
Microsoft is pulling this together in the Windows world, but it's all done with Microsoft APIs, and, recently, undocumented hardware that favors those APIs.
Re: 2D acceleration using OpenGL? (Score:2)
> While my graphics hardware is not quite representative (the Matrox G450 is not known for great 3D performance), I ran two instances of glxgears. Short conclusion: MesaGL on Linux has the same problem. Long conclusion: the windows showed noticable slowdowns, up to the point where animation was suspended in one window while the other ran, with the system switching the running window at seemingly random intervals.
That's interesting. I also have a Matrox G450 AGP card, but running two instances of gears
Re:2D acceleration using OpenGL? (Score:2)
oh yeah, har de har har (Score:2)
Re:2D acceleration using OpenGL? (Score:2, Interesting)
Exactly, on modern hardware. If you have anything less than ATI 9700, NV "hottest and greatest" or the only third (but really expensive, why I won't name them) vendor OpenGL-supporting 3D cards, you are indeed screwed. Bigtime!
To explain what I'm talking about here: On a 2D card you can easily often move a full screen/vblank (OK, not true for PCI cards if you're like me using 1600x1200x32 ~= 7.32MB/frame, and at just 75Hz that's 549MB/second).
That's
Re:2D acceleration using OpenGL? (Score:2)
Re:2D acceleration using OpenGL? (Score:4, Informative)
The current version of Evas is actually the second iteration. The first version had a backend written for OpenGL, which performed quite well for large drawing areas, but was sluggish with many small areas (bad for window managers). The software engine easily outperformed in those cases, and will be used for the resulting window manager's border drawing.
For now, there is not an OpenGL engine in Evas, because of time constraints. E has a relatively small active development team atm, so it's difficult to say when someone will get around to adding the OpenGL engine. There should be one eventually, all nicely encapsulated except for a couple setup functions.
Re:2D acceleration using OpenGL? (Score:2)
Re:2D acceleration using OpenGL? (Score:3, Insightful)
Isn't that what Blender does? They implement their GUI using OpenGL, drawing all the widgets themselves, so that their interface is the same on all platforms they are ported to.
The damndest thing. (Score:5, Informative)
accelerated? (Score:4, Interesting)
Re:accelerated? (Score:3, Interesting)
The NVidia drivers say something about Render Accleration as someone already pointed out. However, there is definitely some glitch somewhere. I tried the benckmark with the RenderAccel both turned off and on on my GeForce 3 with the 4496 drivers and perceived no significant difference in the tests except for test 1. (11s for no accel, 2.5s for accel, 0.62 for imlib2). The rest of the tests sucked for the driver (11s, 215s, 183s, 356s for tests 2 to 5 -- both with and without render accel as opposed to 0.21s
Re:accelerated? (Score:2)
In the stuff I've done, I'd guess a factor of 4 increase in speed at least.
Re:accelerated? (Score:5, Informative)
Obviously XRender is getting crushed here by Imlib2. There are a million reasons this might be happening, it's definitely worth looking into. In the best Slashdot tradition, here's some wild speculation about what might be causing the slowdown:
Re:accelerated? (Score:2, Insightful)
I'm not so sure of that. Rasterman may have been the first person to write a window manager with quite that much eye candy -- but god, man, have you seen his code?
I can't speak for anything he's written within the last 18 months or so (maybe it's been longer now?), but last time I looked at his C it was ugly, unportable sh*t.
That said, I'll be curious to see what the XRender folks have to
Re:accelerated? (Score:2)
None of this has anything to do with efficiency. You sound like those people who say a clean desk is better then a cluttered one. It isn't it is just a reflection on style, not on work efficiency.
Of course you may be using ugly as in badly coded in wich case I hang my head in shame.
Re:accelerated? (Score:3, Insightful)
So no, I'm not talking about a
Re:accelerated? (Score:4, Informative)
Certain things seemed to trigger it, e.g. loading up OpenOffice would guarantee a lock-up.
So yes, hardware RENDER acceleration isn't really there at the moment. I expect this has something to do with the poor results the Rasterman got.
duh (Score:3, Interesting)
I'm more interested in using them for specific calculations. Imagine if one of these things was accidentally embued with the ability to factor gigantic numbers. The AGP slot is just an excuse to keep us from beowulfing them over PCI-X
Graphics cards and computation (Score:5, Interesting)
There has been some work on using graphics cards for computation [att.com]. The tough part is figuring out how to rephrase your algorithm in terms of what the GPU can handle. You'd expect matrix math [cs.sfu.ca] to work out but people have tried to implement more interesting algorithms too. :-)
- Amit [stanford.edu]Re:Graphics cards and computation (Score:2)
Re: Graphics cards and computation (Score:5, Informative)
> There has been some work on using graphics cards for computation. The tough part is figuring out how to rephrase your algorithm in terms of what the GPU can handle.
Isn't there a lot of sloth involved in reading your results back as well?
Meanwhile, users of GCC can exploit whatever multimedia SIMD instructions their processor supports by telling the processor you want to use them. For x86 see this [gnu.org] and this [gnu.org]; for other architectures start here [gnu.org]. (Notice the GCC version in the URL; the supported options sometimes change between versions, so you should look in a version of the GCC Manual that matches what you're actually using.)
I confess I haven't benchmarked these options, but in theory they should boost the performance of some kinds of number-crunching algorithms.
BTW, Linuxers can find what multimedia extensions their CPU supports with cat
And post us back if you do some benchmarking, or find some good ones on the Web.
Re: Graphics cards and computation (Score:2)
Meanwhile, users of GCC can exploit whatever multimedia SIMD instructions their processor supports
Yeah, I've always wondered about that. About how well it explots them, for example, and what GCC needs to recognize a SIMD-acceleratable bit of code. (I also wonder if it puts NaN and Inf traps around 3Dnow! instructions, or if compiling with 3Dnow! means you lose IEEE floating point.)
Anybody have links to this kind of info?
Re: Graphics cards and computation (Score:3, Interesting)
I've written MMX versions of algorithms (blending, intensity etc) that are 5 times faster than their C equivalent - I've yet to see that kind of improvement from GCC.
Not enough details (Score:5, Informative)
Here is the entry from the driver README:
Following that option, this one is noted:
Re:Not enough details (Score:4, Interesting)
I got weird glitches all over the screen, most notably in the window borders and wherever windows or menu's overlapped other things on the screen. There was an increase in speed however. As you might expect I disabled it after about 15 minutes. Ugh. I'll have another look at it when it's been fixed
Re:Not enough details (Score:4, Informative)
Re:Not enough details (Score:2)
I ran the benchmark with RenderAccel true (Score:5, Informative)
Here are the results for the interested:
Available XRENDER filters:
nearest
bilinear
fast
good
best
Se
*** ROUND 1 ***
Test: Test Xrender doing non-scaled Over blends Time: 0.190 sec.
Test: Test Xrender (offscreen) doing non-scaled Over blends Time: 0.303 sec.
Test: Test Imlib2 doing non-scaled Over blends Time: 0.697 sec.
*** ROUND 2 ***
Test: Test Xrender doing 1/2 scaled Over blends Time: 10.347 sec.
Test: Test Xrender (offscreen) doing 1/2 scaled Over blends Time: 10.231 sec.
Test: Test Imlib2 doing 1/2 scaled Over blends Time: 0.315 sec.
*** ROUND 3 ***
Test: Test Xrender doing 2* smooth scaled Over blends Time: 207.028 sec.
Test: Test Xrender (offscreen) doing 2* smooth scaled Over blends Time: 205.275 sec.
Test: Test Imlib2 doing 2* smooth scaled Over blends Time: 5.695 sec.
*** ROUND 4 ***
Test: Test Xrender doing 2* nearest scaled Over blends Time: 164.460 sec.
Test: Test Xrender (offscreen) doing 2* nearest scaled Over blends Time: 166.281 sec.
Test: Test Imlib2 doing 2* nearest scaled Over blends Time: 4.119 sec.
*** ROUND 6 ***
Test: Test Xrender doing general nearest scaled Over blends Time: 313.187 sec.
Test: Test Xrender (offscreen) doing general nearest scaled Over blends Time: 310.261 sec.
Test: Test Imlib2 doing general nearest scaled Over blends Time: 11.444 sec.
*** ROUND 7 ***
Test: Test Xrender doing general smooth scaled Over blends Time: 477.511 sec.
Test: Test Xrender (offscreen) doing general smooth scaled Over blends Time: 474.695 sec.
Test: Test Imlib2 doing general smooth scaled Over blends Time: 17.290 sec.
(reformatted to get past the lameness filter)
An important truth about X (Score:5, Funny)
Re:An important truth about X (Score:3, Informative)
Also, with any application, the code space doesn't take system RAM in the same sense as data space does. Normally you map in pages of memory that point straight to the I/O
3x for Banshee (Score:2)
The 16MB Banshee EvilQueen sitting across the room maps three copies of its 16MB into main RAM (so 48MB total, plus maybe another 4MB for a busy X server); apparently each copy is mapped in a different way optimised for different ops.
Re:An important truth about X (Score:2)
People always praise how fast WinXP is. The X way is no different than the Win32 way. Yet somehow you still say X is slow?
(I'll now wait what the hundreds of rabid anti-XFree zealots have to say)
is this the man who said that "Windows has won"? (Score:3, Insightful)
Thats a myth. (Score:2, Insightful)
What Apps can I not run under Linux?
My browser works, most of my games work, Photoshop works, Microsoft word works,
Do your research, Wine, Transgaming, Crossoveroffice
Re:Thats a myth. (Score:2)
Re:Thats why theres Lindows with ClickNRun (Score:2)
I don't? Damn. And here I thought I used it every day....
Here's a news flash: People don't upgrade because they got a worm. People often don't upgrade at all! How about that. They've ALREADY spent the money on Windows, so it's a pretty steep uphill battle to get them to switch, especially since Lindows isn't any cheaper.
Here's the best counterargument to what you're saying: Linux is dead on the desktop. It's market share is so small as to be a statistical abberat
Re:is this the man who said that "Windows has won" (Score:2)
Re:is this the man who said that "Windows has won" (Score:2)
Indeed.
Maybe "desktop linux profits" aren't so hot, but linux wasn't designed to make money with anyways.
On the contrary, I allege that lots of money are going to be made on Linux desktops. Support, mass deployment, customization, life cycle extension... so the money will be made in corporate space, and that's the way it should be. That's where the money in Linux servers is made at the moment.
Also, as an nvidia car
Re:is this the man who said that "Windows has won" (Score:3, Informative)
WRONG! Crashing was why I switched to Linux (Score:2)
I'm happy I made the jump, but for most people t
Re:is this the man who said that "Windows has won" (Score:2)
Comment removed (Score:4, Funny)
Re: (Score:2)
Raster's on holiday (Score:5, Informative)
I highly doubt he meant for this to get wide-spread exposure beyond developers of Enlightenment or X. Since it has, this is a good opportunity. I'll make this clear for anyone that didn't catch it, raster WANTS XRENDER TO BE FASTER! If there is a way to alter configuration or to recode the benchmark to do so, he wants to know about it.
Rather than posting questions about his configuration (which he can't answer right now), grab the benchmarks that he put up and get better results.
Now back to your regularly scheduled trolling...
Lessons from the ancient (Score:4, Interesting)
In those days of yore (only in the computer industry can one refer to something 20 years ago as "yore"...) there was the Commodore 64. It retains it's place as a pioneering home computer in that it offered very good (for the time) graphics and sound capability, and an amazing 64K of RAM, in an inexpensive unit. But then came its bastard son...
The 1541 floppy disk drive. It became the storage option for a home user once they became infuriated enough with the capabilites of cassette-tape backup to pony up for storage on a real medium. Unfortunately, the 1541 was slow. Unbelievably slow. Slow enough to think, just maybe, there were little dwarven people in your serial interface cable running your bits back and forth by hand.
Now, a very unique attribute of the 1541 drive was that it had its own 6502 processor and firmware. Plausibly, having in effect a "disk-drive-coprocessor" would accelerate your data transfer. It did not. Not remotely. Running through a disassembly of the 6502 firmware revealed endless, meandering code to provide what would appear, on the surface, to be a pretty straightforward piece of functionality: send data bits over the data pin and handshake it over the handshake signal pin.
As the market forces of installed base and demand for faster speed imposed themselves, solutions to the 1541 speed problem were found by third party companies. Software was released which performed such functions as loading from disk and backing up floppies as speeds that were many, many times faster than the 1541's base hardware and firmware could offer.
The top of this particular speed-enhancement heap was a nice strategy involving utilizing both the Commodore 64's and the 1541's processors, and the serial connection, optimally. Literally optimally. Assembly routines were written to run on the both 64 and the 1541 side to exactly synchronize the sending and receiving of bits on a clock-cycle by clock-cycle basis. Taking advantage of the fact both 6502's were running at 1 Mhz, the 1541's code would start blasting the data across the serial line to the corresponding 64 code, which would pull it off the serial bus within a 3-clock-cycle window (you could not write the two routines to be any more in sync than a couple 6502 instructions). This method used no handshaking whatsoever for large blocks of data being sent from the drive to the computer, and so, in an added speed coup, the handshaking line was also used for data, doubling the effective speed.
The 1541 still seems pertinent as an example of a computer function that one would probably think would best be done primarily on a software level (running on the Commodore 64), but was engineered instead to utilize a more-hardware approach (on the 1541), only to be rescued by better software to utilize the hardware (on both).
There's probably still a few design lessons from the "ancient" 1541, for both the hardware and the software guys.
Re:Lessons from the ancient (Score:2, Interesting)
IIRC, they originally tried (slave mode -- the only available thing then) DMA, and in general, it was faster to pump the data out by hand.
Re:Lessons from the ancient (Score:5, Insightful)
Unfortunately, the fast loaders assuming that the CPU and the drive both ran at exactly the same speed was a cause for problems. The PAL version of the C64 ran at a different speed (a bit slower, I believe), thus making fast loaders either NTSC or PAL specific (although there may have been one or two that could actually take the clock speed into consideration). The same fault meant that fast loaders sometimes didn't work with some variants of the drives (different CPU's, all supposedly 6502 compatible, but not necessarily so).
Additionally, because these fast loaders required exact timing, something had to be done with the VIC-II (interrupts from it would cause the 6510 in the C64 to lose it's timing) - usually the screen was blanked (basically turning off the VIC-II), or at the least, turning off sprites (sprites by the way, while nice, were a PITA becuase they disrupted everything, including raster timing).
Commodore did screw things up... They had four (or was it six?) connectors on each end of the cable, they could have made it at least quai-parallel, rather than the serial with handshaking. Unfortunately, they only hooked up two, CLK (handshaking clock) and DATA (for the data bit). However, seeing as the 1541 was the same hardware mechanism as the 1540 (it's predecessor for the VIC-20) and contained most of the same software (you could use a "user" command to change the speed for the VIC-20), they couldn't just go out and change the design. I almost get the feeling that they took the serial bus from the VIC-20, put it in the C64, figuring that they'd be able to use the 1540 drive. Then at the last minute, they realized that it wouldn't work and they made the 1541, as well as a ROM upgrade for the 1540 to work with the C64.
While getting rid of the handshaking and transferring an extra bit over that line made sense then, with modern computers, I wouldn't trust it. There's too many components from too many manufacturers, and I really like my MP3 and pr0n collections too much to lose them to one bit being corrupted.
-- Joe
Re:Lessons from the ancient (Score:3, Interesting)
The way I was told the story, Apple was buying lower-quality components than those on more expensive drives, and to compensate, would do each disk operation (like a read) seven times, and vote on the result.
Several patched drivers came out that merely read 5 or, if you were willing to risk data errors, 3 times. Greatly improved performance.
Of course, no mention of Apple ][ disks w
Re:Lessons from the ancient (Score:2, Funny)
Back to you, Jane.
-Rosanna
Re:Lessons from the ancient (Score:2)
Unfair comparison (Score:3, Informative)
Re:Unfair comparison (Score:2)
Simply blending the images and displaying them is faster than the off-screen variant and the imlib2 code.
So, the possible penalty seems to be irrelevant.
Also, the "overhead" of X seems to be unrelevant, too.
I'd say that the scaling and filtering implemented in either X or the drivers is suboptimal.
nVidia Linux woes (Score:4, Informative)
Re:nVidia Linux woes (Score:2, Redundant)
Oh how I agree with that statement.
Recently my motherboard died of bad caps, so decided to splash out on an nvidia motherboard. Damn thing had crap all linux support. I
Re:nVidia Linux woes (Score:2)
Re:nVidia Linux woes (Score:2)
That's wierd - I haven't noticed any lag in performance using my nVidia GF4 440 MX card under 2.5.73 ...
Well, yes (Score:3, Interesting)
As far as I know, only the Matrox G400 card has good hardware render accelaration. NVidia's support is still experimental and rather poor. Render is still considered experimental, and speed is not yet considered to be very important. Full accelerated support is planned for XFree86 5.
similar experience (Score:2)
The exception being the G400, then the Radeon, and only very recently (on Windows) the GeForce. It's entirely an issue of how well the drivers are implemented, and since many of these 2d acceleration functions aren't widely used they're often overlooked in favor of the (traditionally) co
It takes time to talk to hardware (Score:4, Interesting)
General purpose graphics libraries such as ours ended up spending most of the time dealing with the cool features than the features saved. For example, if a plotter had a 2D perspective transform built in, was it better to do the 3D projection ourselves and just feed it untransformed vectors, or map the 3D in such a way as to allow the 2D processing of the plotter to help out? This might require pre-computing sample data.
Also, since the plotter had 2D transforms we have to do a lot more work including reading the plotter's status and inverting the plotter's transform matrix to make sure that the resulting output didn't end up outside the plotter's viewport.
A code analysis found that over 90% of the code and 90% of the processing time was spent preventing and dealing with input errors and handling compatibility issues.
Nowadays, it's harder in many ways with a wide variety of hardware based texturing and other rendering - do we do the lighting model ourselves, or let the HW do it? It may depend on whether we're going for speed and 'looks' or photometric correctness.
Show of Hands (Score:2)
I actually downloaded and ran his benchmark (Score:3, Interesting)
Here are the test scores from one of the rounds -
*** ROUND 3 ***
Test: Test Xrender doing 2* smooth scaled Over blends
Time: 196.868 sec.
Test: Test Xrender (offscreen) doing 2* smooth scaled Over blends
Time: 196.347 sec.
Test: Test Imlib2 doing 2* smooth scaled Over blends
Time: 6.434 sec.
Now for the strange thing. For the first platform, I watched as the program drew the enlightenment logo thousands of times in the test window, as you would expect. For the second test, it took about the same amount of time, but drew offscreen, again, as the test's name would indicate. However, for the imlib2 test, it also didn't draw anything in the test window.
I got the impression (perhaps wrongly?) that Imlib2 would actually draw to the screen as well. Since it doesn't change the screen, I have no way of telling if imlib2 is doing any drawing at all.
So, I'm digging into the benchmark's code... I'll let you guys know what I find.
Re:I actually downloaded and ran his benchmark (Score:2, Informative)
The results are not obviously broken (Score:5, Insightful)
A lot of people are questioning the results claimed by Rasterman; however try downloading the thing and running it for yourself. I see the same trend that Rasterman claims when I do it.
My system: Athlon 800, nVidia 2-GTS.
Drivers: nVidia driver, 1.0.4363 (Gentoo)
Kernel: 2.4.20-r6 (Gentoo)
X11: XFree86 4.3.0
I've checked and:
The benchmark consists of rendering an alphablended bitmap to the screen repeatedly using Render extension (on- and off-screen) and imlib2. Various scaling modes are also tried.
When there's no scaling involved, the hardware Render extension wins; it's over twice as fast. That's only the first round of tests though. The rest of the rounds all involve scaling (half- and double-size, various antialiasing modes). For these, imlib2 walks all over the Render extension; we're talking three and a half minutes versus 6 seconds in one of the rounds; the rest are similar.
I'm not posting the exact figures since the benchmark isn't scientific and worrying about exact numbers isn't the point; the trend is undeniable. Things like agpgart versus nVidia's internal AGP driver should not account for the wide gap.
Given that at least one of the rounds in the benchmark shows the Render extension winning, I'm going to take a stab at explaining the results by suggesting that the hardware is probably performing the scaling operations each and every time, while imlib2 caches the results (or something). The results seem to suggest that scaling the thing once and then reverting to non-scaling blitting would improve at least some of the rounds; this is too easy, however, since while it helps the application that knows it's going to repeatedly blit the same scaled bitmap, not all applications know this a priori.
- Andrew
Re:The results are not obviously broken (Score:3, Informative)
Well, you have the means at hand to confirm it.
A quick glance reveals, no, the result is not cached in the sense you probably assume.
The Imlib2 scales and fitlers the image in each of the REPS iterations.
Render Bench (Score:5, Informative)
I've experienced this myself. (Score:4, Insightful)
== Hardware ==
Vertex coordinates, texture coordinates and primative types are DMA'd to the video card. The video card finds the texture and loads all the information into it's registers. It the executes triangle setup, then the triangle fill operation - twice (because it's drawing a quad).
== Software ==
Source texture is copied by the CPU to hardware memory, line by line.
Actual peak fill rate in software will be lower than hardware - but if your code is structured correctly (textures in the right format, etc) - there's no setup. The hardware latency looses out to the speed of your CPU's cache - the software copy has the same complexity as making the calls to the graphics card.
The trick is to *batch* your commands. Sending several hundred primatives to the hardware at the same time will blow software away - especially as the area to be filled increases. Well.. most of the time, but it really depends on what you're doing.
the usual superficial analyses of X11 (Score:4, Interesting)
It will be a while until XRender beats client-side software implementations. Furthermore, you can't just take a client-side renderer and hack in XRender calls and expect it to run fast--code that works efficiently with a client-server window system like X11 needs to be written differently than something that moves around pixels locally.
Nothing is wrong with XRender? (Score:2, Informative)
Test: Test Xrender doing non-scaled Over blends
Time: 16.234 sec.
Test: Test Xrender (offscreen) doing non-scaled Over blends
Time: 16.108 sec.
Test: Test Imlib2 doing non-scaled Over blends
Time: 1.932 sec.
That was with hardware acceleratio
Works nice and fast for me (Score:5, Funny)
cc -g -I/usr/X11R6/include `imlib2-config --cflags` -c main.c -o main.o
main.c: In function `xrender_surf_new':
main.c:67: `PictStandardARGB32' undeclared (first use in this function)
main.c:67: (Each undeclared identifier is reported only once
main.c:67: for each function it appears in.)
main.c:67: warning: assignment makes pointer from integer without a cast
main.c:69: `PictStandardRGB24' undeclared (first use in this function)
main.c:69: warning: assignment makes pointer from integer without a cast
main.c: In function `xrender_surf_blend':
main.c:153: `XFilters' undeclared (first use in this function)
main.c:153: `flt' undeclared (first use in this function)
main.c:154: `XTransform' undeclared (first use in this function)
main.c:154: parse error before `xf'
main.c:156: `xf' undeclared (first use in this function)
main.c: In function `main_loop':
main.c:439: `XFilters' undeclared (first use in this function)
main.c:439: `flt' undeclared (first use in this function)
make: *** [main.o] Error 1
It seems to do this at the same speed, whether or not I have render acceleration enabled.
Couldn't even get XRENDER to work. (Score:2)
Available XRENDER filters:
Memory fault
This was on Debian sid. Anyone else get something similar?
Caching (Score:4, Insightful)
The first time the scale test is called, I rendered the image to an offscreen buffer with the correct transformations set. Then after that I just XRenderComposite to the screen from the offscreen buffer. The results (NVidia 4496, RenderAccel=true, geforce2 MX,athlon XP 1800+) for one test are:
*** ROUND 2 ***
Test: Test Xrender doing 1/2 scaled Over blends - caching implementation
Time: 0.126 sec.
Test: Test Xrender doing 1/2 scaled Over blends - original implementation
Time: 6.993 sec.
Test: Test Imlib2 doing 1/2 scaled Over blends
Time: 0.191 sec.
Which shows Xrender taking two-thirds the time of imlib.
My guess is that imlib is probably caching something. This is supported by the fact that Xrender is faster for the non-scaled composition in the original code.
Re:Caching (Score:2)
simple solution (Score:3, Funny)
Re:Some Suggestions for Rasterman (Score:2)
Hey and at least this comment will make someone browse at -1.
Keith IS being paid. (Score:3, Insightful)
Also the only reason its taking so long is because they wont fork, theres millions of developers who Redhat, Suse, Lindows etc would love to pay to develop Xrender, you think Keith Packard is the only developer in the world qualified to do this? No hes not, and neither is Carl Worth, but until there is a fork, everything goes through this core group of developers who decide everything.
Its a management issue moreso than lack of developers or lack of money, believe me if Transgaming can get money, Xfree cou
Re:Keith IS being paid. (Score:2)
Re:Keith IS being paid. (Score:2, Interesting)
Interesting, but how can we fund them? They dont accept donations, they dont have a way for someone like me who doesnt have the skills to develop Xrender to pay people who do.
2 people on Xrender is why its taking so long.
Re:Keith IS being paid. (Score:3)
Re:Putting the "wine" back in whining. (Score:3, Insightful)
Besides we shouldn't be competing with MacOS or Windows. We don't need to clone those OS's or desktops. We need to create our own desktop that is unique. Make it work.. don't make it just to attract Windows and Mac users.
Re:Yawn (Score:2, Interesting)
X11 uses unix sockets (or optionally slower, less secure TCP) and shared memory.
Win32 uses shared memory and messaging.
MacOS X
QNX Photon uses qnx kernel messages and shared memory.
The real difference is the layer at which the windowing system exists. in the case of X11, MacOS X and Photon. the windowing system is just another process.
In Win32 it's a kernel thr
Dude! tell us WHY!! (Score:2)
Re:It's wrong to use 3D functionality for 2D graph (Score:2, Informative)
Re:It's RIGHT to use 3D functionality for 2D graph (Score:4, Informative)
This ends up being even more true if you do any sort of complex compositing (eg: alpha blending, hardware accelerated mpeg / video, openGL windows, etc, etc). Enlightenment uses alpha channels, it would be fater to composite in hardware than software. These sorts of operations are not accelerated at all on the 2d path, and have to be done in software.
Go check out Quartz Extreme at http://www.apple.com/macosx/jaguar/quartzextreme.h tml (excuse the space in html).
Having used Xfree86 and Quartz extreme on the same graphics hardware, I can tell you there's no comparison. Quartz is much faster and much more capable.