2009/12/2 Stefan Dösinger stefan@codeweavers.com:
@@ -1082,6 +1082,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface, object->wineD3DDevice = This; object->parent = parent; object->ref = 1;
- object->render_to_fbo = FALSE;
This is redundant, the field is already initialized to 0.
@@ -1880,6 +1881,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
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.
@@ -959,22 +963,25 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
...
@@ -3102,7 +3109,7 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
...
@@ -3241,12 +3248,12 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine
Most of this should be part of patch 3. Note that since we have SFLAG_SWAPCHAIN we don't really need to pass the swapchain to surface_get_gl_buffer() anymore, we can just cast This->container directly to IWineD3DSwapChainImpl *.
+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?
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.
2009/12/3 Stefan Dösinger stefan@codeweavers.com:
Am 02.12.2009 um 22:10 schrieb Henri Verbeet:
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.
You should never need to do that, FBO ORM implies that you already have the data in a texture.
+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.
I think the more interesting part to share would be setting up the pipeline states for blitting, actually. CTXUSAGE_BLIT does that to some extent, but it assumes fixed function blits, and ignores the case where we support shaders, or can do the blit with fbo_blit. It can be done afterwards if you think it's too much work, but I think it's nicer to do first.
Am 03.12.2009 um 11:19 schrieb Henri Verbeet:
2009/12/3 Stefan Dösinger stefan@codeweavers.com:
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.
You should never need to do that, FBO ORM implies that you already have the data in a texture.
That doesn't help much if I want it in another texture(ie, StretchRect from offscreen target to offscreen target). Of course I could download and upload it, but a glCopyTexImage from an FBO to a texture works faster.
I think the more interesting part to share would be setting up the pipeline states for blitting, actually. CTXUSAGE_BLIT does that to some extent, but it assumes fixed function blits, and ignores the case where we support shaders, or can do the blit with fbo_blit. It can be done afterwards if you think it's too much work, but I think it's nicer to do first.
Well, we have the blit backend - I guess we should consistently use that rather than call glEnable(GL_TEXTURE_2D), and probably move the depth blit shader and the P8 unpack shader in there.