Am 02.12.2009 um 22:10 schrieb Henri Verbeet:
switch(wined3d_settings.offscreen_rendering_mode) { case ORM_FBO:
This->offscreenBuffer = GL_COLOR_ATTACHMENT0;
This change is probably correct, but note that if it matters you're probably doing something wrong.
It matters when reading back an offscreen render target if FBOs are enabled, but FBO_blit is not supported. The readback function calls glReadBuffer(device->offscreenBuffer) in this case, and is correct to do so because its needed with other ORM methods. Without this change copying the backbuffer from an FBO into a texture without FBO_blit support fails.
+static inline void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *context)
We have a number of functions now that do something very similar to what this function does. Perhaps it's time to spend some time on our blitter in order to unify those?
The part that's shared between those is the glBegin(); 4*texcoord, 4*vertex; glEnd() block, but I'm not convinced that putting this pretty simple piece of code into a shared function is worth the trouble. Most of the code in the blit functions is to find the proper coordinates for the specific problem.
Of course BltOverride is a pretty bad mess, but for a different reason. I have tried to restructure it in the past but didn't find any nice solution so far. I don't think this would affect this patch in any way though.