Stefan Dösinger stefan@codeweavers.com writes:
@@ -4681,7 +4681,9 @@ static void viewport_miscpart(DWORD state, IWineD3DStateBlockImpl *stateblock, W stateblock->viewport.Width, stateblock->viewport.Height); } else { target = (IWineD3DSurfaceImpl *) stateblock->wineD3DDevice->render_targets[0];
LEAVE_GL(); target->get_drawable_size(target, &width, &height);
ENTER_GL();
That's ugly, the lock isn't even entered in that function. Can we please start to clean up the ENTER_GL mess to only grab the lock around GL calls and not over huge amounts of code including nested functions?
LEAVE_GL(); target->get_drawable_size(target, &width, &height);
ENTER_GL();
That's ugly, the lock isn't even entered in that function. Can we please start to clean up the ENTER_GL mess to only grab the lock around GL calls and not over huge amounts of code including nested functions?
Actually the problem with patch 2 made me unsure if using the Window size here is correct at all.
To stay on topic though, I oppose moving the lock into every state handler. There are just the scissorrect and viewport functions that may have to perform User32 calls(if the patch turns out to be correct). Moving the lock call into the state handlers would pollute the code with them and raise the locking costs considerably.
Stefan Dösinger stefan@codeweavers.com writes:
To stay on topic though, I oppose moving the lock into every state handler. There are just the scissorrect and viewport functions that may have to perform User32 calls(if the patch turns out to be correct). Moving the lock call into the state handlers would pollute the code with them and raise the locking costs considerably.
It would require adding more of them, but that's good, it makes the locking more explicit. We really have to stop taking a big global lock and executing thousands of lines of code inside it. As long as you are only moving the lock inside the individual functions the cost is the same.
It would require adding more of them, but that's good, it makes the locking more explicit. We really have to stop taking a big global lock and executing thousands of lines of code inside it. As long as you are only moving the lock inside the individual functions the cost is the same.
In the current form there's one lock call each time the states are applied, if the individual functions call the lock there's one call per applied state