Commit Graph

249 Commits

Author SHA1 Message Date
Henri Verbeet 3068ae9e83 wined3d: Remove IWineD3DSwapChain::Destroy() from the public interface. 2011-04-13 14:13:51 +02:00
Henri Verbeet 84103460bd wined3d: Check FBO completeness after the read / draw buffers are specified.
Unless the driver implements ARB_ES2_compatibility / GL4.1, FBO completeness
depends on what read / draw buffers are set.
2011-04-11 11:50:51 +02:00
Henri Verbeet dd2c7d0d8c wined3d: Don't free D3D swapchains until the wined3d swapchain is destroyed.
This will allow us the get rid of the swapchain refcounting hacks in d3d9 in
particular. This is similar to the way we handle resources that are still in
use by a stateblock, but aren't referenced anywhere by the application.
2011-04-08 14:40:48 +02:00
Henri Verbeet d19c3588bc wined3d: Merge the IWineD3DSwapChain::Destroy() implementations.
They're mostly the same, except for the GL version also destroying its
contexts, and being a bit more careful about the order in which backbuffers
are destroyed.
2011-04-08 14:40:43 +02:00
Henri Verbeet 28137ba2e9 wined3d: Only create a swapchain context array for GL swapchains.
Lying about the number of contexts a swapchain has isn't very useful.
2011-04-08 14:40:39 +02:00
Henri Verbeet 032c374307 wined3d: Merge swapchain_base.c into swapchain.c. 2011-04-07 19:27:01 +02:00
Henri Verbeet 0a174ae542 wined3d: Merge swapchain_gdi.c into swapchain.c. 2011-04-07 19:26:50 +02:00
Henri Verbeet 85f2348549 wined3d: Get rid of the IWineD3DBase requirement for surface_set_container().
This made sense back when we needed the container's parent and didn't know the
container's type, but neither of those is true anymore.
2011-03-28 17:08:52 +02:00
Henri Verbeet ac9c592ca9 wined3d: Store all the resource desc information in struct wined3d_resource. 2011-03-09 12:29:17 +01:00
Henri Verbeet 36d4268e3c wined3d: Remove COM from IWineD3D. 2011-02-02 12:22:42 +01:00
Henri Verbeet 6f95f05aaf wined3d: Move swapchain context retrieval to swapchain.c. 2011-01-20 12:18:58 +01:00
Henri Verbeet b439fa9d8f wined3d: Pass an IWineD3DSwapChainImpl pointer to swapchain_create_context_for_thread(). 2011-01-19 12:22:38 +01:00
Andrew Nguyen 7e13b1afaf wined3d: Remove references to GLX_SGI_video_sync.
Usage of GLX_SGI_video_sync is problematic, and wined3d cannot use GLX extensions.
2010-12-27 15:39:41 +01:00
Henri Verbeet 0e3c60786e wined3d: Explicitly pass gl_info to unset_shader(). 2010-12-10 13:02:26 +01:00
Henri Verbeet ae7a20af2f wined3d: Explicitly pass blit_priv and gl_info to set_shader(). 2010-12-10 13:02:24 +01:00
Henri Verbeet 03f7a2d88e wined3d: Get rid of the remaining "Flags". 2010-11-23 13:15:36 +01:00
Henri Verbeet 027fdb31c2 wined3d: Rename the IWineD3DSurfaceImpl "Flags" field to "flags". 2010-11-12 15:43:07 +01:00
Henri Verbeet 7e3985e1fe ddraw: Setup the device window in SetCooperativeLevel(). 2010-11-08 13:30:54 +01:00
Henri Verbeet 45cee64295 wined3d: Move the fullscreen window setup / restore code to the device. 2010-11-08 13:30:40 +01:00
Henri Verbeet 0b15963b4e wined3d: Get rid of redundant comparisons against FALSE. 2010-09-14 11:43:44 -05:00
Henri Verbeet b68d257710 wined3d: Get rid of redundant comparisons against NULL / 0. 2010-09-14 09:43:33 -05:00
Henri Verbeet f49028d91c wined3d: GL_DRAW_FRAMEBUFFER depends on either ARB_framebuffer_object or EXT_framebuffer_blit. 2010-09-08 13:31:37 +02:00
Henri Verbeet bc2db78c3a wined3d: Explicitly document some more consequences of GL locking policy.
The basic rule is that you can't call anything that takes the user32 / gdi32
lock while under the GL (winex11) lock. As a consequence, you can't call
anything like context_acquire() or context_destroy() either.
2010-09-03 11:05:10 +02:00
Henri Verbeet 6c4c351791 wined3d: Don't require wined3d object parents to be COM objects. 2010-09-01 14:01:02 +02:00
Henri Verbeet 3a7f08a56f wined3d: Rename wined3d_format_desc to wined3d_format. 2010-08-31 14:23:47 +02:00
Henri Verbeet c568916f9e wined3d: Implicit depth/stencil surfaces don't have a container.
They're owned by the device instead of the swapchain.
2010-08-31 14:23:47 +02:00
Henri Verbeet b233e7b301 wined3d: Rename the "format" field in wined3d_format_desc to "id". 2010-08-26 12:41:44 +02:00
Henri Verbeet cc5271d1b7 wined3d: Rename WINED3DFORMAT to wined3d_format_id. 2010-08-24 12:25:01 +02:00
Henri Verbeet 3fd66bc650 wined3d: Make some lookup tables const. 2010-08-23 12:04:36 +02:00
Henri Verbeet 8292c687d8 wined3d: Get rid of the now redundant SFLAG_SWAPCHAIN surface flag. 2010-08-17 11:55:32 +02:00
Henri Verbeet 0b24db5db5 wined3d: Also store the subresource container type. 2010-08-17 11:55:32 +02:00
Henri Verbeet 61db577a4b wined3d: Remove SetContainer() from the public IWineD3DSurface interface. 2010-08-17 11:55:32 +02:00
Matteo Bruni 20f51c29a9 wined3d: Setup target if offscreen rendering setting changed. 2010-07-26 18:38:33 +02:00
Henri Verbeet 943fb2fb57 wined3d: Do RGB <=> sRGB transfers using FBO blits.
Concept based on a patch by Stefan.
2010-07-26 18:38:31 +02:00
Henri Verbeet 3d8ff7f27a wined3d: Framebuffer blits are affected by the color mask. 2010-07-22 10:13:36 +02:00
Henri Verbeet f7760656f3 wined3d: Remove LoadLocation() from the public wined3d surface interface. 2010-07-22 10:13:24 +02:00
Henri Verbeet 147f24dd78 wined3d: Remove ModifyLocation() from the public wined3d surface interface. 2010-07-22 10:13:13 +02:00
Henri Verbeet 1b5cc39a86 wined3d: Get rid of some dead code. 2010-06-01 11:03:56 +02:00
Dan Kegel f99e1d80e2 wined3d: Fix size of buffer in swapchain_create_context_for_thread(). 2010-05-31 12:46:08 +02:00
Henri Verbeet e8ac9bbd7f wined3d: Get rid of GLINFO_LOCATION. 2010-05-25 13:29:00 +02:00
Henri Verbeet bcc4603125 wined3d: Set the swapchain.c GLINFO_LOCATION to *gl_info. 2010-05-24 11:31:25 +02:00
Henri Verbeet 7bec8e1dcb wined3d: Correctly translate between coordinate systems in swapchain_blit(). 2010-05-18 18:42:09 +02:00
Henri Verbeet 7a2debe113 wined3d: Use the FBO cache in swapchain_blit(). 2010-05-06 14:17:30 +02:00
Stefan Dösinger ec3d2ba316 wined3d: Fall back to other depth stencil formats if D24S8 isn't supported. 2010-05-04 13:15:00 +02:00
Henri Verbeet 49e076eabd wined3d: Separate context acquisition and state application. 2010-05-04 13:14:59 +02:00
Henri Verbeet f09b8e454d wined3d: Avoid some needless depth buffer copies.
If an application switches between render targets of a different size, but
with the same depth/stencil surface it'll typically clear the depth/stencil
surface before drawing. However, in case of the smaller render target that
wouldn't be a full clear, so we'd have to do a depth copy if we also switched
between onscreen and offscreen rendering. Keeping track of which part of the
depth/stencil surface is current for onscreen/offscreen allows us to avoid
most of these kinds of copies. The current scheme requires the current/dirty
rectangle to have an origin at (0,0). This could be extended to an arbitrary
rectangle, but the bookkeeping becomes somewhat more complex in that case, and
it's not clear that there would be much of a benefit at this point.
2010-04-29 10:19:39 -05:00
Henri Verbeet d977e91b11 wined3d: Store back buffer surfaces as IWineD3DSurfaceImpl pointers in the swapchain. 2010-04-27 12:02:14 -05:00
Henri Verbeet 62acb2fdbc wined3d: Store the front buffer surface as an IWineD3DSurfaceImpl pointer in the swapchain. 2010-04-27 12:01:59 -05:00
Henri Verbeet 6b34b8e6d1 wined3d: Simply pass an IWineD3DSurfaceImpl pointer to context_acquire(). 2010-04-22 11:28:17 +02:00
Henri Verbeet 1c403e44b5 wined3d: Store the current render target as an IWineD3DSurfaceImpl pointer in the context. 2010-04-22 11:28:12 +02:00
Henri Verbeet 7b47dabd09 wined3d: Avoid some unnecessary invalidations of the the onscreen depth buffer.
This can happen for example when the application switches to a different
depth/stencil for offscreen rendering and back again.
2010-04-21 11:57:32 +02:00
Henri Verbeet c5de1e1045 wined3d: Store the depth/stencil surface as an IWineD3DSurfaceImpl pointer in the device. 2010-04-20 11:14:42 +02:00
Henri Verbeet 520f74de21 wined3d: Store the auto depth/stencil surface as an IWineD3DSurfaceImpl pointer in the device. 2010-04-20 11:14:35 +02:00
Henri Verbeet efb3993a3a wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_modify_ds_location(). 2010-04-19 14:55:24 +02:00
Henri Verbeet 95130a7d5e wined3d: Simply pass an IWineD3DSurfaceImpl pointer to context_attach_surface_fbo(). 2010-04-16 12:09:36 +02:00
Henri Verbeet 65797d7f75 wined3d: Get rid of glRect from IWineD3DSurfaceImpl.
604caf0caa supposedly removed the "oversized
texture" code, but this was still left over.
2010-04-16 12:09:14 +02:00
Roderick Colenbrander 3b6aea5934 wined3d: Move palette uploading code over to arbfp blit_shader. 2010-04-06 13:53:15 +02:00
Stefan Dösinger dc918d4394 wined3d: Use FBOs when the onscreen depth stencil format isn't suitable.
This allows proper support of float depth buffers when rendering to onscreen surfaces.
2010-03-31 16:12:32 +02:00
Stefan Dösinger 19b6f5ca75 wined3d: Control the onscreen depth stencil format in the swapchain.
This allows the swapchain to know what depth format its window contexts have to see if the
requested depth format is compatible or a FBO fallback is needed, and it will be needed to
set the onscreen format to the requested auto depth stencil format instead of the
let's-hope-it-fits D24_UNORM_S8_UINT format.
2010-03-31 16:12:31 +02:00
Henri Verbeet 3aaa6ee6e7 wined3d: Rename GlPixelFormatDesc to wined3d_format_desc. 2010-03-19 14:31:47 +01:00
Henri Verbeet 7c930589bc wined3d: Avoid some common invalid context accesses.
Unfortunately there are plenty of other places left. Perhaps we should
consider creating our own window when the context becomes invalid and making
the context current on that instead.
2010-03-18 10:25:09 +01:00
Henri Verbeet 570f865bad wined3d: Don't use framebuffer blit for backbuffer formats with fixups in swapchain_blit(). 2010-03-17 10:06:06 +01:00
Henri Verbeet 60e98cc3ad wined3d: Don't use filtering on textures that need complex fixups in swapchain_blit().
For example, interpolating palette indices doesn't have the desired result.
Should we really want filtering for these cases we could implement it inside
the relevant shaders, after the fixup, but I doubt it's worth the effort.
2010-03-17 10:06:03 +01:00
Henri Verbeet c48adfe201 wined3d: Use "gl_filter" in the non-FBO path of swapchain_blit() as well. 2010-03-17 10:05:59 +01:00
Henri Verbeet 78166b0b23 wined3d: Implement SetDestWindowOverride() by simply making the context current on a different window. 2010-03-16 11:45:15 +01:00
Henri Verbeet cd9a8b74b9 wined3d: Store the device window in the swapchain.
The swapchain's current window might be changed by SetDestWindowOverride().
2010-03-16 11:45:11 +01:00
Henri Verbeet 18ec2525a4 wined3d: Store the swapchain instead of the surface in the context. 2010-03-16 11:44:44 +01:00
Henri Verbeet 8a107bc63a wined3d: Kill pbuffer offscreen rendering support.
Our pbuffer support is broken, nobody cares.
2010-03-15 15:55:38 +01:00
Henri Verbeet ba8e6f713b wined3d: Use the HDC from the acquired context to call SwapBuffer().
These should be the same, but this way the relation is clearer.
2010-02-05 10:06:21 +01:00
Henri Verbeet d0afc7567b wined3d: Call SetDestWindowOverride() before acquiring a context. 2010-02-05 10:06:17 +01:00
Henri Verbeet daf0aeb34a wined3d: Make sure all contexts are finished drawing before calling SwapBuffers().
This causes a small performance hit when multiple GL contexts are used. As an
optimization we could use ARB_sync to only wait for the last draw call instead
of all GL commands.
2010-01-28 11:08:07 +01:00
Henri Verbeet ee1f2c4654 wined3d: Don't leak the context array in the swapchain_init() error path. 2010-01-20 15:29:57 +01:00
Henri Verbeet ce2c3ea6c7 wined3d: Handle source and destination rectangles in IWineD3DSwapChainImpl_Present(). 2010-01-04 11:41:29 +01:00
Henri Verbeet b5907e23cc wined3d: Add support for source and destination rectangles to swapchain_blit(). 2010-01-04 11:41:29 +01:00
Henri Verbeet 7160e56ab1 wined3d: Properly check for glBlitFramebuffer().
ARB_framebuffer_object can also provide this entry point.
2009-12-28 12:27:13 +01:00
Henri Verbeet b49e684f5d wined3d: Focus the focus window. 2009-12-23 14:27:29 +01:00
Henri Verbeet a0aa10eb5c wined3d: Filter messages for the device's focus window instead of the swapchain's device window.
Usually these will be the same window, but they don't have to be.
2009-12-23 14:27:29 +01:00
Stefan Dösinger 718e55b9a6 wined3d: Don't render single buffered swapchains to a FBO. 2009-12-16 12:42:40 +01:00
Henri Verbeet cd623036fc wined3d: Mark the draw buffer as dirty in context_create().
Currently callers of this function are responsible for setting the draw buffer
correctly, but they don't do a very good job:
  - swapchain_init() sets the draw buffer to GL_BACK if there's a back buffer,
    even though the context's target is always the front buffer.
  - swapchain_create_context_for_thread() depends on (eventually) being called
    by FindContext().
  - create_primary_opengl_context() and
    IWineD3DSwapChainImpl_SetDestWindowOverride() don't bother setting a draw
    buffer at all.
Just marking the draw buffer dirty lets the context management sort it all
out, and is much simpler.
2009-12-16 12:22:29 +01:00
Stefan Dösinger 2ee6bb1cbb wined3d: Frontbuffers are onscreen. 2009-12-15 11:58:53 +01:00
Henri Verbeet c24e48d937 wined3d: Filter window messages generated by switching to fullscreen and back. 2009-12-15 11:43:56 +01:00
Henri Verbeet 0e270bbd22 wined3d: Send window messages through the swapchain before sending them to the application. 2009-12-15 11:43:41 +01:00
Henri Verbeet 6bf79b885f wined3d: Let the context handle the draw buffer in swapchain_blit(). 2009-12-14 12:04:05 +01:00
Henri Verbeet cb076db8cc wined3d: Move IWineD3DDeviceImpl_RestoreWindow() to swapchain.c. 2009-12-11 12:16:25 +01:00
Henri Verbeet 542590cfc9 wined3d: Move IWineD3DDeviceImpl_SetupFullscreenWindow() to swapchain.c. 2009-12-11 12:16:25 +01:00
Henri Verbeet a9f2613d13 wined3d: Add a separate function for swapchain initialization. 2009-12-11 12:16:25 +01:00
Henri Verbeet b3defd4c80 wined3d: Rename "wineD3DDevice" to "device". 2009-12-10 11:54:47 +01:00
Stefan Dösinger 548b0bcda5 wined3d: Render to a FBO if the window size is changed. 2009-12-07 14:33:32 +01:00
Stefan Dösinger 817714912b wined3d: Infrastructure to render swapchains to a FBO. 2009-12-07 14:33:24 +01:00
Henri Verbeet 111307dfba wined3d: Get rid of the GL_SUPPORT macro. 2009-10-29 13:09:33 +01:00
Henri Verbeet e6ca176a48 wined3d: Rename DestroyContext() to context_destroy(). 2009-10-28 11:16:05 +01:00
Henri Verbeet 98027cb535 wined3d: Call context_release() for wined3d contexts made current by context_create(). 2009-10-28 11:15:27 +01:00
Henri Verbeet eeb54b9922 wined3d: Keep better track of where we're using wined3d contexts.
The idea here is that we can restore the thread's current GL context on
context_release() if it doesn't correspond to the current wined3d context on
context_acquire().
2009-10-28 11:15:19 +01:00
Henri Verbeet 47c84f4f7f wined3d: Use the DXGI naming convention for all formats. 2009-09-25 15:15:44 +02:00
Henri Verbeet a5214c306f wined3d: Don't free D3D surfaces until the wined3d surface is destroyed.
This prevents for example a d3d9 depth stencil from being destroyed when it
has no external references but is still in use by the device/stateblock. A
nice side effect is that it simplifies handling of "implicit" surfaces like
the frontbuffer and backbuffers, as well as the forwarding of reference counts
for surfaces that are part of a texture.
2009-09-16 13:04:32 -05:00
Henri Verbeet 3ec639e38c wined3d: Fix swapchain draw buffer cleanup.
Destroying the first back buffer before the other ones might cause an already
freed surface to be used as target in FindContext().
2009-08-12 13:22:25 +02:00
Henri Verbeet 7165bd19c1 wined3d: WINED3DTEXF_NONE only makes sense as a mip filter. 2009-08-05 11:20:43 +02:00
Henri Verbeet da1e5573da wined3d: Rename WineD3DContext to struct wined3d_context. 2009-08-03 15:01:48 +02:00
Henri Verbeet 43bfb240ad wined3d: Use the context's current render target the get the swapchain drawable size.
"surface" might point to the frontbuffer while we're rendering to the
backbuffer, etc.
2009-08-03 15:01:25 +02:00
Henri Verbeet 2c71b85334 wined3d: Explicitly pass the context to get_drawable_size(). 2009-07-24 13:10:37 +02:00