Commit Graph

3867 Commits

Author SHA1 Message Date
Stefan Dösinger 2ee6bb1cbb wined3d: Frontbuffers are onscreen. 2009-12-15 11:58:53 +01:00
Henri Verbeet 2f56ef09e6 wined3d: Use surface_is_offscreen() in context_apply_draw_buffer(). 2009-12-15 11:44:20 +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 82556b613e wined3d: Let the context handle the draw buffer in fb_copy_to_texture_hwstretch(). 2009-12-14 12:04:05 +01:00
Henri Verbeet 59db3ecaa0 wined3d: Let the context handle the draw buffer in flush_to_framebuffer_drawpixels(). 2009-12-14 12:04:05 +01:00
Henri Verbeet 30f5883ef5 wined3d: Let the context handle the draw buffer in stretch_rect_fbo(). 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 75ef50e435 wined3d: Correctly calculate the extended style in IWineD3DDeviceImpl_RestoreWindow(). 2009-12-11 12:16:25 +01:00
Henri Verbeet 840b5af77e wined3d: Properly invalidate the context's draw buffer in color_fill_fbo(). 2009-12-11 12:16:25 +01:00
Henri Verbeet b85a070598 wined3d: Support more formats for display mode enumeration.
ddraw/d3d8/d3d9 only support a limited number of formats, but those already
limit the supported formats themselves.
2009-12-10 11:54:55 +01:00
Henri Verbeet b3defd4c80 wined3d: Rename "wineD3DDevice" to "device". 2009-12-10 11:54:47 +01:00
Henri Verbeet bd9828a039 wined3d: Don't restore the draw buffer in color_fill_fbo().
This should be done by the context management these days.
2009-12-10 11:54:29 +01:00
Henri Verbeet bfe6695d30 wined3d: Only disable blending for offscreen targets. 2009-12-09 13:51:08 +01:00
Henri Verbeet b6ef17f23d wined3d: Remove unused GetDevice() implementations. 2009-12-09 13:51:04 +01:00
Henri Verbeet d2ad2df637 wined3d: Remove a few redundant assignments. 2009-12-09 13:50:48 +01:00
Henri Verbeet 54f3dec8e6 wined3d: Rename the "wineD3D" device field to "wined3d". 2009-12-08 12:33:29 +01:00
Henri Verbeet a02f93defb wined3d: Remove the redundant "adapterNo" field from the device. 2009-12-08 12:33:23 +01:00
Henri Verbeet aed85222b5 wined3d: Rename the wined3d_adapter "num" field to "ordinal".
This makes it consistent with dxgi_adapter.
2009-12-08 12:33:17 +01:00
Henri Verbeet 8a833a2d75 wined3d: Pass the correct vertex count in DrawIndexedPrimitiveStrided().
This fixes a regression introduced by 2b2fc827ce.
2009-12-08 12:33:08 +01:00
Stefan Dösinger 740e2d403e Render to fbo when the size mismatches at creation time.
This is needed because the window(and thus the GL drawable) might be
smaller than the D3D backbuffer. If we waited for the FBO switch until
Present is called we'd lose data in the first frame.
2009-12-07 14:33:56 +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
Stefan Dösinger 2b0271b185 wined3d: Use GL_COLOR_ATTACHMENT0 as offscreen buffer with FBOs.
This is used by the offscreen render target->texture blit code if
FBOs are enabled, but FBO_blit is not supported
2009-12-07 14:33:04 +01:00
Stefan Dösinger 64291c60cb wined3d: A function for checking if a surface is offscreen. 2009-12-07 14:32:54 +01:00
Stefan Dösinger 54f0d3f785 wined3d: Add a function for initializing surface sysmem. 2009-12-07 14:32:29 +01:00
Francois Gouget 060934c557 wined3d: Don't define nameless structs or unions.
Fixes compilation on systems that don't support nameless unions or structs.
2009-12-07 14:18:25 +01:00
Henri Verbeet 0491fcce30 dxgi: Implement IDXGIAdapter::GetDesc(). 2009-12-04 14:34:59 +01:00
Henri Verbeet dd5fc79f56 wined3d: The stateblock doesn't really need a parent. 2009-12-04 14:34:59 +01:00
Stefan Dösinger 6a19339207 wined3d: Remove needless NULL checks (coverity). 2009-12-03 11:45:15 +01:00
Henri Verbeet ed73f0a1b0 d3d9: Implement IDirect3D9Ex::GetAdapterLUID(). 2009-12-02 13:06:08 +01:00
Henri Verbeet 36823dd96b wined3d: Set appropriate error codes in IWineD3DDeviceImpl_Init3D() on out of memory. 2009-12-02 13:06:07 +01:00
Marcus Meissner a7e599db45 wined3d: Handle NULL ptrs (Coverity). 2009-11-24 10:51:46 +01:00
Henri Verbeet 55f3c576d9 wined3d: Remove the effetively unused "state" field from the device. 2009-11-18 11:16:54 +01:00
Henri Verbeet 135e6cea7b wined3d: Add a separate function for device initialization. 2009-11-18 11:16:49 +01:00
Henri Verbeet e4d8a3f309 wined3d: Move the various backend selection utility functions to utils.c. 2009-11-18 11:16:43 +01:00
Henri Verbeet 7676c66431 wined3d: WINED3DFMT_FLAG_GETDC is a basic format flag.
It has nothing to do with OpenGL, so shouldn't be in "gl_formats_template".
This fixes a regression introduced by e1469961d4.
2009-11-17 15:14:54 +01:00
Henri Verbeet db2273652d wined3d: Add a format table for basic format flags like WINED3DFMT_FLAG_FOURCC. 2009-11-17 15:14:54 +01:00
Anders Jonsson 58b203e798 wined3d: Fix typo. 2009-11-16 13:47:49 +01:00
Stefan Dösinger 0e77a381ea wined3d: Create clip coords only if they are used.
If GL vertex shader clipping is supported (GLSL or NVvp), we currently
always calculate clipping results in the shader. They're gracefully
discarded by opengl, but we need 6 constants / uniforms to calculate
unused values.
2009-11-12 15:18:00 +01:00
Henri Verbeet 5487009624 wined3d: Report a driver version appropriate for the reported OS. 2009-11-12 13:14:39 +01:00
Henri Verbeet 8d351a1141 wined3d: Initialize "context[0]" in IWineD3DDeviceImpl_CreateSwapChain() when not using OpenGL (Valgrind). 2009-11-04 13:07:57 +01:00
Austin English 5f0940e08a wined3d: Add version resource. 2009-11-04 11:54:59 +01:00
Marcus Meissner 9f8a73ab96 wined3d: Check for NULL before context_release (Coverity). 2009-11-03 21:22:46 +01:00
Stefan Dösinger 8eef221d20 d3d: Handle the pointsize_min default difference in d3d8. 2009-11-03 21:22:12 +01:00
Stefan Dösinger d4275e87f1 wined3d: Add a usage flag for static buffer declarations. 2009-11-03 21:21:55 +01:00
Stefan Dösinger 63326b1925 wined3d: Add a usage flag for vertex buffer optimization. 2009-11-03 21:21:48 +01:00
Stefan Dösinger 90e443758a wined3d: Add a parameter for SetRenderTarget viewport setup. 2009-11-03 21:21:30 +01:00
Henri Verbeet bf10dbe8a6 wined3d: Map D3DFMT_D24S8 to WINED3DFMT_D24_UNORM_S8_UINT.
The internal order of the depth and stencil bits is unspecified since the
format isn't lockable.
2009-10-30 11:28:52 +01:00
Henri Verbeet fbae08672b wined3d: It's not an error to request multisampling. 2009-10-30 11:28:35 +01:00
Henri Verbeet be8026adf6 wined3d: directly pass gl_info to stream_info_element_from_strided(). 2009-10-29 13:09:37 +01:00
Henri Verbeet 111307dfba wined3d: Get rid of the GL_SUPPORT macro. 2009-10-29 13:09:33 +01:00
Henri Verbeet 48e03bc189 wined3d: Introduce a separate structure for various OpenGL implementation limits. 2009-10-29 13:09:27 +01:00
Henri Verbeet d7b087618b wined3d: Remove some unused GLINFO_LOCATION definitions. 2009-10-29 13:09:20 +01:00
Henri Verbeet e6ca176a48 wined3d: Rename DestroyContext() to context_destroy(). 2009-10-28 11:16:05 +01:00
Henri Verbeet c0050b8ec9 wined3d: Restore the thread's GL context on context_release() if it wasn't created by wined3d.
The background on this is that some applications use OpenGL and DirectDraw/Direct3D on
the same thread, typically using OpenGL for rendering and DirectDraw to get
the amount of available video memory. This means that we might replace the
application's current GL context with one with a completely different state,
but also that our current GL context might not be what we think it is.
2009-10-28 11:15:59 +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 401173ffde wined3d: Restore the thread's previous GL context in context_destroy_gl_resources(). 2009-10-28 11:15:00 +01:00
Henri Verbeet 30d2660d99 wined3d: Restore the thread's previous GL context in WineD3D_ReleaseFakeGLContext(). 2009-10-27 10:55:35 +01:00
Henri Verbeet 94509f85b5 wined3d: Restore the wglMakeCurrent() call in context_destroy_gl_resources().
e3ca576576 removed this call because we don't
need it to tell if the context is valid, but we still need it to actually make
the context current.
2009-10-27 10:55:27 +01:00
Henri Verbeet 13c4fe72ad wined3d: Set a driver name appropriate for the vendor in init_driver_info(). 2009-10-27 10:55:09 +01:00
Henri Verbeet 26ba212407 wined3d: Apply PCI ID overrides in init_driver_info() instead of IWineD3DImpl_GetAdapterIdentifier(). 2009-10-27 10:54:57 +01:00
Henri Verbeet 2447c8bc3e wined3d: Store PCI IDs in wined3d_driver_info instead of wined3d_gl_info. 2009-10-27 10:54:50 +01:00
Stefan Dösinger 0c72464abf wined3d: Use the native constant limit for fitting private constants. 2009-10-26 11:42:36 +01:00
Stefan Dösinger 9ee6508132 wined3d: Remove dead code. 2009-10-26 11:42:29 +01:00
Stefan Dösinger f15fc8f41c wined3d: Take native constants into account when reporting ARB limits. 2009-10-26 11:42:20 +01:00
Stefan Dösinger 641d6681d4 wined3d: Use the ARB native constant limit in the GLSL-ARB constants quirk.
Geforce 8 and Geforce 9 cards support 256 env and 1024 native
constants. 1024 is the hardware limit we want to use if we overwrite
the GLSL reported value with the ARB value on Mac OS (because Mac OS
reports more constants than supported by HW on some cards).
2009-10-26 11:42:10 +01:00
Stefan Dösinger f9c4d442a9 wined3d: Get rid of the general shader constant limit. 2009-10-26 11:41:51 +01:00
Stefan Dösinger 70d6304a21 wined3d: Use the shader backend reported constant limit outside the shader backend. 2009-10-26 11:41:43 +01:00
Henri Verbeet 483d5d0a0d wined3d: Print an ERR instead of crashing in context_check_fbo_status().
Some version of Mesa will claim the window system provided framebuffer is
incomplete when using indirect rendering, although the framebuffer objects
spec says this can never happen. Printing an ERR instead of crashing should
make it clearer that this isn't a wined3d problem.
2009-10-26 11:20:52 +01:00
Henri Verbeet d03a105c1a wined3d: Fix a typo. 2009-10-26 11:20:44 +01:00
Henri Verbeet de82b55b20 wined3d: Refuse to parse shaders with an invalid version token. 2009-10-26 11:20:39 +01:00
Henri Verbeet 5fbe5ee027 wined3d: Add a separate structure for driver info. 2009-10-26 11:20:33 +01:00
Henri Verbeet 69bf130476 wined3d: Remove a redundant ActivateContext() call. 2009-10-26 11:20:26 +01:00
Henri Verbeet ade350b4d4 wined3d: Compare and copy the actual palette in palette9_changed() (Valgrind). 2009-10-23 12:03:37 +02:00
Henri Verbeet 53104ac1e7 wined3d: Don't use the stack as cursor mask (Valgrind). 2009-10-23 12:03:30 +02:00
Henri Verbeet 342a71b281 wined3d: Replace the "stateLookup" tables with a single "wrap_lookup" table. 2009-10-23 12:03:15 +02:00
Henri Verbeet a927573395 wined3d: Free the context array in IWineGDISwapChainImpl_Destroy() (Valgrind). 2009-10-22 10:46:20 +02:00
Henri Verbeet 8d2512317f wined3d: Free the blitter private data in arbfp_blit_free() (Valgrind). 2009-10-22 10:46:15 +02:00
Henri Verbeet 6be41fd59a wined3d: Get rid of GL_LIMITS. 2009-10-22 10:46:05 +02:00
Henri Verbeet 55047f811a wined3d: Fix some GLINFO_LOCATION abuse. 2009-10-22 10:45:57 +02:00
Henri Verbeet fa548414f9 wined3d: Free the shader buffer in shader_glsl_free() (Valgrind). 2009-10-21 16:05:57 +02:00
Henri Verbeet 42eb516d96 wined3d: Free the adapter's format info in IWineD3DImpl_Release() (Valgrind). 2009-10-21 16:05:57 +02:00
Henri Verbeet f2aaca2f67 wined3d: Rename WineD3DAdapter to wined3d_adapter. 2009-10-21 16:05:57 +02:00
Stefan Dösinger 122ed40c2b wined3d: Use ARB constant limits in ARB. 2009-10-20 14:46:16 +02:00
Stefan Dösinger 435646550b wined3d: Use GLSL constant limits in GLSL. 2009-10-20 14:46:13 +02:00
Stefan Dösinger 2d802af4d9 wined3d: Make shader specific constants accessible via GL_LIMITS. 2009-10-20 14:46:08 +02:00
Henri Verbeet 94d33d3e86 wined3d: Destroy FBO entries from the context that created them.
EXT_framebuffer_object doesn't specify if FBOs are shareable between GL
contexts, but ARB_framebuffer_object explicitly prohibits it.
2009-10-20 14:00:37 +02:00
Henri Verbeet e3ca576576 wined3d: Use context->valid in context_destroy_gl_resources().
Instead of relying on wglMakeCurrent() to do what we want.
2009-10-20 14:00:36 +02:00
Henri Verbeet 43aaaa8a4b wined3d: Validate the D3D context in FindContext().
Apparently it's valid to use a D3D device after its window is destroyed.
OpenGL isn't always so forgiving, so this patch is a first step to avoid
making GL calls on a context without window.
2009-10-20 14:00:36 +02:00
Henri Verbeet 0cb6f28751 wined3d: Get rid of the useless "isPBuffer" bitfield in struct wined3d_context. 2009-10-20 14:00:36 +02:00
Henri Verbeet adf5bb5f6a wined3d: Cleanup IWineD3DDeviceImpl_UpdateTexture().
The root problem here is that with the original error handling a NULL
dereference occurs (IWineD3DBaseTexture_GetType()) when either the source or
destination texture is NULL. Rewriting the error handling changes the
indentation of almost the entire function though, so this patch ends up
rewriting the entire function.
2009-10-19 11:45:45 +02:00
Henri Verbeet 9dd78e13d5 wined3d: Printing a FIXME once only works if the relevant BOOL is static (LLVM/Clang). 2009-10-16 13:37:21 +02:00
Henri Verbeet 594497f4bb wined3d: Simplify IWineD3DStateBlockImpl_Apply().
Consistently use the stateblock's contained states to determine what to apply.
2009-10-15 12:06:18 +02:00
Henri Verbeet ce10d5f186 wined3d: Don't apply more than num_contained_render_states in IWineD3DStateBlockImpl_Apply(). 2009-10-15 12:06:18 +02:00
Henri Verbeet bac6486520 wined3d: Merge some bitfields in struct SAVEDSTATES. 2009-10-14 11:26:44 +02:00