Re: ENTER_GL and ActivateContext question

2007-12-16 Thread Alexander Dorofeyev
Hi. Stefan Dösinger wrote: > Am Samstag, 15. Dezember 2007 12:19:36 schrieb Alexander Dorofeyev: >> This seems to be specific to front buffer. Maybe >> glFlush really should be called in BltOverride (or clearing subroutine) if >> the target is front buffer? > Yes, glFlush() has to be called when w

Re: ENTER_GL and ActivateContext question

2007-12-15 Thread Stefan Dösinger
Am Samstag, 15. Dezember 2007 12:19:36 schrieb Alexander Dorofeyev: > This seems to be specific to front buffer. Maybe > glFlush really should be called in BltOverride (or clearing subroutine) if > the target is front buffer? Yes, glFlush() has to be called when writing to the front buffer. SwapBuf

Re: ENTER_GL and ActivateContext question

2007-12-14 Thread Alexander Dorofeyev
Hi. Here's preliminary version of a changes to BltOverride/Clear, with Clear subroutine approach discussed previously. Please look through it if you can. Basically everything except a check for error condition and deciding the target surface moved from Clear to subroutine. Another thing I did

Re: ENTER_GL and ActivateContext question

2007-12-14 Thread Stefan Dösinger
Am Freitag, 14. Dezember 2007 10:55:10 schrieb Michael Stefaniuc: > I don't know what you mean with proper inline. It's true that "inline" > is only a hint to the compiler but normally the compiler knows anyway > better what to inline and what not. > > If you really want to force an inline you have

Re: ENTER_GL and ActivateContext question

2007-12-14 Thread Michael Stefaniuc
Stefan Dösinger wrote: > Am Freitag, 14. Dezember 2007 02:46:42 schrieb Ivan Gyurdiev: >> As for the "object oriented programmer" - I would hope every programmer >> thinks in terms of objects, even when writing C code. >> The GLSL backend wouldn't be available today if the shader compiler was >> st

Re: ENTER_GL and ActivateContext question

2007-12-14 Thread Stefan Dösinger
Am Freitag, 14. Dezember 2007 02:46:42 schrieb Ivan Gyurdiev: > Your codebase is constantly getting more complex, and now you're having > threading issues, which will only get more important with multi-core and > other such things becoming standard. Meanwhile graphics cards are > getting a lot mor

Re: ENTER_GL and ActivateContext question

2007-12-13 Thread Ivan Gyurdiev
> A lot of code in WineD3D avoids the getters and setters, and just accesses > the > implementation structure. While any object oriented programmer screams when > doing that, we need it for performance reasons. Currently we spend 10 to 20 > per cent of the CPU time spent in WineD3D just in sur

Re: ENTER_GL and ActivateContext question

2007-12-13 Thread Stefan Dösinger
Hi, You are right, there is some problem here. I think that the code originates from times when this codepath in colorfill was only entered when iface == device->render_targets[0], or when Clear didn't set any draw buffer itself. But you have spotted correctly, if iface is the device's front b

Re: ENTER_GL and ActivateContext question

2007-12-13 Thread Alexander Dorofeyev
Hello. I've spent some time trying to get into this stuff and what can be improved in IWineD3DSurfaceImpl_BltOverride. Code that does glDrawBuffer in the Colorfill path and possibly elsewhere indeed appears to be redundant to ActivateContext and probably should go. That's in theory :), in pract

Re: ENTER_GL and ActivateContext question

2007-12-10 Thread Stefan Dösinger
Am Dienstag, 11. Dezember 2007 07:06:02 schrieb Alexander Dorofeyev: > Ok, thank you and Roderick for useful info. I figure that my previous patch > wasn't ideal, unfortunately it introduced one more of such recursive > ENTERGL / ActivateContext situations. I'll try to improve that and send > anoth

Re: ENTER_GL and ActivateContext question

2007-12-10 Thread Alexander Dorofeyev
Ok, thank you and Roderick for useful info. I figure that my previous patch wasn't ideal, unfortunately it introduced one more of such recursive ENTERGL / ActivateContext situations. I'll try to improve that and send another patch. Regarding moving code around - I wish I was so competent in Direct

Re: ENTER_GL and ActivateContext question

2007-12-10 Thread Roderick Colenbrander
> Hello. > > I was recently experimenting with a fix that involved ActivateContext and > needed > to figure out whether it is ok if ActivateContext is called inside > ENTER_GL()... LEAVE_GL() (also if recursive ENTER_GL is ok). At first I > tried to > look for example code in wined3d/surface.

Re: ENTER_GL and ActivateContext question

2007-12-09 Thread Stefan Dösinger
Am Montag, 10. Dezember 2007 18:39:49 schrieb Alexander Dorofeyev: > Hello. > > I was recently experimenting with a fix that involved ActivateContext and > needed to figure out whether it is ok if ActivateContext is called inside > ENTER_GL()... LEAVE_GL() (also if recursive ENTER_GL is ok). At fir

ENTER_GL and ActivateContext question

2007-12-09 Thread Alexander Dorofeyev
Hello. I was recently experimenting with a fix that involved ActivateContext and needed to figure out whether it is ok if ActivateContext is called inside ENTER_GL()... LEAVE_GL() (also if recursive ENTER_GL is ok). At first I tried to look for example code in wined3d/surface.c, which seeme