![]() |
|
DirectX VRAM-VRAM accelerated stretch blit |
GullRaDriel
Member #3,861
September 2003
![]() |
Please, you seem to be both competent to modify and test those file. Really, i think i'm not able to do this alone. I'm not enough 'competent' "Code is like shit - it only smells if it is not yours" |
Evert
Member #794
November 2000
![]() |
Quote: Please, you seem to be both competent to modify and test those file. I lack a suitable operating system. Quote: I can leave you my access throught a VNC client, and you'll have all you need to do it. You couldn't make that an ssh remote login, could you? Anyway, I'll see about attaching a patched up file for you. in a moment. EDIT: here you go! Replace allegro/src/win/wddaccel.c with the attached version and recompile Allegro. |
GullRaDriel
Member #3,861
September 2003
![]() |
i can grant you a telnet access, openssh isn't installed. EDIT: "Code is like shit - it only smells if it is not yours" |
Evert
Member #794
November 2000
![]() |
See my above edit. |
GullRaDriel
Member #3,861
September 2003
![]() |
ok EDIT: it is still OK for the access, if even you wanna test yourself "Code is like shit - it only smells if it is not yours" |
Evert
Member #794
November 2000
![]() |
This is the full patch I'm going to propose as soon as my provider's sendmail server is unblocked:
|
GullRaDriel
Member #3,861
September 2003
![]() |
do you wanna me to post it for you ? it's still compiling, i make a distclean before a make all EDIT: compiled, i'm uploading the whole compiled. "Code is like shit - it only smells if it is not yours" |
Neil Walker
Member #210
April 2000
![]() |
Remember to change the draw_sprite code to remove the offsets when you do the stretch_blit update. I guess the mystery of the masked_blit working/the clipping code can remain so. I don't know how often the CVS is updated but it would also be great to have a fix for it not crashing when you destroy a system sub-bitmap Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
GullRaDriel
Member #3,861
September 2003
![]() |
who wanna test? It's the whole library including source and compiled version of allegro-patched EDIT: when testing at my home, i just modify the exscale to load a pink masked pcx, and i use the masked_stretch_blit. How can we check what does it use ? hardware or software ? EDIT: attached is the modified exscale... i can ensure you that is it accelerated on my pc ! (now with source and modified mysha.pcx) I can't see what the picture is now, it's too fast ! "Code is like shit - it only smells if it is not yours" |
Neil Walker
Member #210
April 2000
![]() |
It doesn't work. I actually only tested it for the draw_sprite change, which works, but my sample code also does stretch_blit. If you have a memory bitmap and a memory buffer all is well, if you have a system/video buffer and/or a system/video bitmap you either end up with a crash or (in the case of sub-bitmaps) instead of stretching it it actually makes the sub-bitmap bigger so you simply get a larger area of the master image! Do you want a copy of my test program to try it, and you can modify the bitmap types easily to see? Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Evert
Member #794
November 2000
![]() |
Quote: it's still compiling, i make a distclean before a make all Next time, don't! That's the point in using make: it only recompiles what it has to to safe time. Quote: How can we check what does it use ? hardware or software ? Normally I'd put printf() or trace statements in the code and see if I get output from those. That doesn't work in Windows though, so I guess you'd have to check the framerate. Quote: Remember to change the draw_sprite code to remove the offsets when you do the stretch_blit update. Neil... please don't plug these things whenever you have a chance. Honestly, if it's know it's known. Don't start posting reminders for unapplied patches unless more than a week has passed since the last message about it or you get no feedback whatsoever. Also don't do it in threads about other topics. It's impolite. Quote: I don't know how often the CVS is updated The SVN repository gets updated whenever a patch is applied. I'm not sure what you mean? EDIT: Quote: It doesn't work. I actually only tested it for the draw_sprite change, which works, but my sample code also does stretch_blit. That doesn't make sense. The code for stretch_blit() and the code for draw_sprite() (and masked_stretch_blit) is the same. So as far as I can see it either works, or it doesn't. |
GullRaDriel
Member #3,861
September 2003
![]() |
yeah, of course ! (even if we talk here of a masked_stretch_blit) EDIT: Modified in 800x600 for Sev' attached "Code is like shit - it only smells if it is not yours" |
Neil Walker
Member #210
April 2000
![]() |
Quote: That doesn't make sense. The code for stretch_blit() and the code for draw_sprite() (and masked_stretch_blit) is the same. So as far as I can see it either works, or it doesn't. what you are saying is correct - none of them work when you are not using memory bitmaps, all of them work when you are using memory bitmaps. The errors you get are depenant upon whether you are using system/video for the graphics or the back-buffer or both and whether your graphics are sub-bitmaps Attached is a test program that will show bitmaps and a stretched bitmap. The current version you see is using sub-bitmaps and memory bitmap/buffer only that works fine. To change it to see how it crashes/fails then To change the back-buffer edit config.xml, change graphicsmode="0" (0=double, 1=system double, 2=paged, 3=triple). Obviously 2/3 use video. To change the graphics edit animations.xml and change bmp_type="1" (1 is memory, 2 is system, 3 is video). It will fail in different ways when you use anything other than memory bitmaps. After you've waded through those, rename the animations.xml file to animations.old or something and rename animations_single.xml to be animations.xml and repeat the tests. This will change the graphics from being sub-bitmaps to be individually loaded bitmaps. These have a different result again. btw, don't worry about the crash when you use system bitmaps and buffer with sub-bitmaps. This is a known error. Quote: Neil... please don't plug these things whenever you have a chance. Honestly, if it's know it's known. Don't start posting reminders for unapplied patches unless more than a week has passed since the last message about it or you get no feedback whatsoever. Also don't do it in threads about other topics. It's impolite. Ok, I'll address the first point - all I was doing was reminding someone as it wasn't a definite CVS update, just a thread conversation. Secondly, I wasn't posting about other topics, the stretch blit problems are linked to the draw_sprite problems, which in turn are linked to the subbitmaps of system bitmaps crashing fault. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
GullRaDriel
Member #3,861
September 2003
![]() |
i'll try to compil it tomorrow with the modified allegro. See you tomorow for the tests, All. EDIT: and for the 'windows' specific , i'm thinkin of providing a ssh access to my pc for AD. I'll keep you informed. I think i can easily provide a ftp-ssh-x11-vnc compliant access. "Code is like shit - it only smells if it is not yours" |
Neil Walker
Member #210
April 2000
![]() |
I've just this second modified my download file in the previous email as I included the wrong XML files, so if anyone has downloaded it before now you'll have to get it again. There is no compilation as it's a windows executable. See stretch working first then try the different modes by editing the xml files to see the new code fail. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Evert
Member #794
November 2000
![]() |
Quote: what you are saying is correct Wait... you said Quote: It doesn't work. I actually only tested it for the draw_sprite change, which works, but my sample code also does stretch_blit. I read this as `It doesn't work, but draw_sprite works. When I use stretch_blit it doesn't work'. I don't think that's what you meant and it certainly doesn't make any sense (as I said). So do I understand you correctly if I understand that hardware accelerated VRAM->VRAM streched blits do not work for you? Quote: - none of them work when you are not using memory bitmaps, all of them work when you are using memory bitmaps. The errors you get are depenant upon whether you are using system/video for the graphics or the back-buffer or both and whether your graphics are sub-bitmaps
Please keep it simple, or take a little more time to explain what you're doing! Quote: After you've waded through those, rename the animations.xml file to animations.old or something and rename animations_single.xml to be animations.xml and repeat the tests. This will change the graphics from being sub-bitmaps to be individually loaded bitmaps. These have a different result again. Please keep the test case simple. As I said, there's far too much going on here to keep track of what's going on and what's failing and what isn't and why. Quote: Ok, I'll address the first point - all I was doing was reminding someone as it wasn't a definite CVS update, just a thread conversation. I fail to see what that has to do with saying `Remember to change the draw_sprite code to remove the offsets when you do the stretch_blit update.' The current test has nothing to do with draw_sprite. Maybe I'm missing something? Quote: Secondly, I wasn't posting about other topics, the stretch blit problems are linked to the draw_sprite problems, which in turn are linked to the subbitmaps of system bitmaps crashing fault. I don't see that. There are no subbitmaps or system bitmaps in sight for this thread. Anyway, if that's causing the problems you're seeing (which I'm not saying it isn't), you have a patched version of Allegro, right? Does it work properly with that? Please try to describe in a clear, simple and concise manner if and when things work and when they don't. Don't try to test every possible case at once and if you do put some work in how you present the results (eg, make a table of the posibilities and results). As it is, I can't make heads or tails of it. |
Thomas Fjellstrom
Member #476
June 2000
![]() |
OT: This started me thinking about possible enhancments of the X driver(s), Besides just using standard X functions, theres a few extensions that may help, though I'm not sure how much.. The XDamage extension allows you to get detailed info about damaged areas, XRender allows you to render the window to an off screen surface (and other windows as well) as well as use various rendering modes, and the Xcomposite extension works with the other two to give us fancy compositing eye candy. I would be happy to work on integrating some of these (namely XDamage and XRender) into allegro, at least once the open source ATI drivers support XRender for my 9600xt. Though I probably won't beable to do it all myself. -- |
Thomas Harte
Member #33
April 2000
![]() |
Ahhh, I've found a potential problem. To cut a long story short: if ((ddcaps.dwCaps & DDCAPS_COLORKEY) && (ddcaps.dwCKeyCaps & DDCKEYCAPS_SRCBLT)) { _screen_vtable.masked_blit = ddraw_masked_blit; _screen_vtable.draw_sprite = ddraw_draw_sprite; /* new entry */ if (ddcaps.dwCaps&DDCAPS_BLTSTRETCH) _screen_vtable.do_stretch_blit = ddraw_do_stretch_blit; if (_screen_vtable.color_depth == 8) _screen_vtable.draw_256_sprite = ddraw_draw_sprite; gfx_capabilities |= (GFX_HW_VRAM_BLIT_MASKED | GFX_HW_SYS_TO_VRAM_BLIT_MASKED); } A better solution would allow non-masked stretch blitting where wither of DDCAPS_COLORKEY or DDCKEYCAPS_SRCBLT are not set. EDIT: Quote: OT: This started me thinking about possible enhancments of the X driver(s) Yeah, the only reason I'm suddenly so up on where Allegro does what is that I've been researching improvements to the OS X driver... [My site] [Tetrominoes] |
Evert
Member #794
November 2000
![]() |
Ok, how about the attached patch? |
Neil Walker
Member #210
April 2000
![]() |
ok, i'll make a simple table of what works and what doesn't with various bitmap types in windows, to try and make it easier to read. However, I don't have any CVS tools, any chance of someone doing the diff and sending me the three files or tell me where to find patch? Do you want me to limit the tests to just stretch_blit, or include masked_stretch or (dare I say it) draw_sprite? Will any of the pivot/rotate stretch blits be affected by the changes? Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Evert
Member #794
November 2000
![]() |
Quote: However, I don't have any CVS tools, any chance of someone doing the diff and sending me the three files or tell me where to find patch? I found http://gnuwin32.sourceforge.net/packages/patch.htm. You can also get http://unxutils.sourceforge.net/ for more useful utilities, like diff, grep, sed and awk. Quote: Do you want me to limit the tests to just stretch_blit, or include masked_stretch or (dare I say it) draw_sprite?
stretch_blit and masked_stretch_blit (or stretch_sprite). draw_sprite() is not affected by this patch so it's quite pointless to test anything with that. |
A J
Member #3,025
December 2002
![]() |
thanks to everyone for doing this, its fantastic ! trivia: this thread, appears in google, i was looking for something else, and this thread was top of the google results! I've been looking into whether the IDirectDrawSurface2_Blt() can accept a alpha channel value. ___________________________ |
Thomas Harte
Member #33
April 2000
![]() |
Quote: Will any of the pivot/rotate stretch blits be affected by the changes? Not by the current patches, but DirectDraw has the capability to accelerate this if the driver implements it. Certainly during the "classic" period of DirectDraw this was very rare, but perhaps things have changed now. I wouldn't be too surprised if modern DirectDraw isn't some sort of Microsoft generic implementation that utilises DirectGraphics, which should mean that rotation is there. If no-one else does, I'll see if I can knock anything up for rotation/pivot/etc tomorrow. Quote: I've been looking into whether the IDirectDrawSurface2_Blt() can accept a alpha channel value. Blt (and BltFast) certainly can't, I'm not sure if anything else exists that can which would not be too difficult to add into the existing code. [My site] [Tetrominoes] |
Neil Walker
Member #210
April 2000
![]() |
I just thought if the code for stretch_blit was being changed then maybe pivot/rotate stretch might call the same code and may be affected somehow. Anyway, I get an error running patch. I'm using the standard 4.2 allegro source code. I get the following error: Quote:
D:\DATA\allegro>patch -p0 < dx_stretch_blit.diff This application has requested the Runtime to terminate it in an unusual way. D:\DATA\allegro>
I'll see if I can work out from the diff what the actual changes are and make them manually unless someone is reading this and responds sharpish Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Evert
Member #794
November 2000
![]() |
Zip with modified files attached [for 4.2]. |
|
|