Commit Graph

402 Commits

Author SHA1 Message Date
Stefan Dösinger ba58adaaf6 wined3d: Remove a few texture initializations.
This is done by LoadLocation now.
2008-08-25 12:24:33 +02:00
H. Verbeet 05931f4a5a wined3d: Track FBOs per-context.
Although sharing FBOs across contexts is allowed by EXT_framebuffer_object
(issue 76), it causes issues with nVidia drivers. Considering the GL 3 spec
explicitly disallows sharing of FBOs accross contexts (Appendix D), this
patch is probably the right thing to do.
2008-08-22 10:38:59 +02:00
Stefan Dösinger bab367e1a0 wined3d: Update the overlay when the destination was drawn to. 2008-08-21 13:27:47 +02:00
Stefan Dösinger bfe7067973 wined3d: Ask the ffp/shader/blit implementation about format support.
If a format is not supported natively by opengl, a shader may be able
to convert it. Up to now, CheckDeviceFormat had magic knowldge which
GL extensions lead to which supported format. This patch adds
functions that allow CheckDeviceFormat to ask the actual
implementation for its capabilities.
2008-08-20 12:26:02 +02:00
Stefan Dösinger fc6b977486 wined3d: Start a framework for color conversion shaders in blits. 2008-08-20 12:25:26 +02:00
Roderick Colenbrander 4421e3ebe5 wined3d: Fix BltOverride regression. 2008-08-20 11:45:41 +02:00
H. Verbeet f71fdecdc7 wined3d: Move creating a texture id from PreLoad to BindTexture.
This is consistent with BindTexture in basetexture/texture/etc. and has the
added benefit that it makes LoadLocation work properly.
2008-08-20 10:26:19 +02:00
Stefan Dösinger 25c07dc86c wined3d: Remove the ddraw_window device member. 2008-08-19 12:25:05 +02:00
Stefan Dösinger e178ddd9e1 wined3d: Use a swapchain for GDI surfaces.
This is a long-needed cleanup aimed at removing the ddraw_primary,
ddraw_window, ddraw_width and ddraw_height members from
IWineD3DDeviceImpl, which just do not belong there.  Destination
window and screen handling is supposed to be done by swapchains.
2008-08-19 12:21:32 +02:00
Stefan Dösinger dff3a42233 wined3d: Track overlay surfaces in the overlayed surface. 2008-08-05 14:09:37 +02:00
Stefan Dösinger 851dd7339e wined3d: Implement overlay flipping. 2008-08-05 14:09:36 +02:00
Stefan Dösinger fad3f9ba98 wined3d: Basic overlay emulation with opengl. 2008-08-05 14:09:36 +02:00
Stefan Dösinger eb0264e2b3 wined3d: Remove a glFlush. 2008-08-05 14:09:36 +02:00
Stefan Dösinger 44d419ad8e wined3d: Call glFlush outside the GL lock. 2008-08-05 14:09:36 +02:00
Stefan Dösinger 474e7ed98c wined3d: Beware of the frontbuffer coordinate system difference. 2008-08-04 13:09:43 +02:00
Stefan Dösinger dc25a86cc5 wined3d: Support ATI's D3DFMT_ATI2N format.
This is an ATI specific format designed for compressed normal maps,
and quite a few games check for its existence. While it is an
ATI-specific "extension" in d3d9, it is a core part of
D3D10(DXGI_FORMAT_BC5), and supported on Geforce 8 cards.
2008-07-24 11:56:24 +02:00
Stefan Dösinger c088edeae7 wined3d: Use GL_ARB_texture_non_power_of_two emulation.
ATI cards prior to the radeon HD series did not have unconditional non
power of two support. So far we've used texture_rectangle for that, or
created a bigger power of two texture with padding. This had the
disadvantage that we had to correct the coordinates, which causes
extreme problems with shaders(doesn't work, pretty much).

Both the MacOS and the fglrx driver have support for
GL_ARB_texture_non_power_of_two, and run it on the hardware as long as
we stay within the texture_rectangle limitations. This allows us to
have conditional non power of two textures with normalized
coordinates. This patch adds an internal extension, and the code
creates a regular GL_TEXTURE_2D texture with NP2 size, but refuses
mipmapping, filtering and texture_rectangle incompatible
operations. This makes np2 textures work with shaders on fglrx and
macos.
2008-07-18 11:41:09 +02:00
H. Verbeet 7f741f0414 wined3d: Use rev_tex_unit_map instead of assuming there's a 1:1 mapping between samplers and texture units. 2008-07-16 17:54:41 +02:00
H. Verbeet 4f77c29bcf wined3d: Track depth stencil location per-surface.
This gets rid of depth_copy_state in the device, and instead tracks
the most up to date location per-surface. This makes things a lot
easier to follow, and allows us to make a copy when switching depth
stencils in SetDepthStencilSurface().
2008-07-03 11:50:52 +02:00
Stefan Dösinger 1c7f39ed1e wined3d: Use CTXUSAGE_RESOURCELOAD for fb->texture reads.
There is no need for _BLIT usage. RESOURCELOAD should be faster.
2008-07-02 12:24:54 +02:00
H. Verbeet d5cbb8375e wined3d: Use ModifyLocation() to force a reload on color key change.
Just unsetting SFLAG_INTEXTURE doesn't work for FBOs because the
drawable and texture are the same there (and ModifyLocation() is the
correct way to do this anyway). Fixes another ddraw test failure with
FBO ORM.
2008-07-01 12:25:54 +02:00
H. Verbeet 8d6dc9daa7 wined3d: Move setting a palette up a couple of lines in BltOverride().
This prevents a few failures in the ddraw tests when using FBOs due to
using P8 surfaces without a palette set.
2008-06-30 12:47:34 +02:00
H. Verbeet 469e791f00 wined3d: Invert "upsidedown" in fb_copy_to_texture_direct() and fb_copy_to_texture_hwstretch() rather than BltOverride().
This inversion is specific to the blit implementation being used,
stretch_rect_fbo() doesn't need it.
2008-06-30 12:47:25 +02:00
Stefan Dösinger 6ab3d17104 wined3d: Remove a broken AddDirtyRect call. 2008-06-13 10:15:02 +02:00
H. Verbeet 35bdc00479 wined3d: Set the surface location to SFLAG_INSYSMEM for depth stencils on Reset. 2008-06-03 11:11:44 +02:00
Andrew Talbot c58e59f40f wined3d: Remove unneeded "extern" from function definition. 2008-05-22 11:29:05 +02:00
Alexander Dorofeyev a25651138a wined3d: Activate context for the right target in surface_blt_to_drawable. 2008-05-12 13:27:44 +02:00
Alexander Dorofeyev e1c60caa42 wined3d: glFlush when updating front buffer.
Fixes screen not updating or getting updated inconsistently when apps blit to 
front buffer or lock it when RenderTargetLockMode=readtex, as happens in e.g. 
Red Alert 2 and also in p8_primary_test in ddraw tests.
2008-05-12 13:27:40 +02:00
Alexander Dorofeyev b8a5742358 wined3d: Set alpha to index even when there is no palette.
Fixes a failure in p8_primary_test when running with opengl ddraw renderer.
2008-05-09 11:20:01 +02:00
Alexander Dorofeyev 6d86e7f861 wined3d: Use source colorkey when passed KEYSRC or KEYSRCOVERRIDE.
Fixes failure in p8_primary_test when using opengl ddraw renderer.
2008-05-09 11:19:39 +02:00
Andrew Talbot 0de14c37e5 wined3d: Remove unused variables. 2008-04-30 10:25:47 +02:00
Stefan Dösinger 5d49dea373 d3d9: Add a test for NP2 stretchrect. 2008-04-24 11:43:18 +02:00
Stefan Dösinger 1c9f1f8ddd wined3d: Support framebuffer reading from texture_rectangle sources. 2008-04-24 11:43:18 +02:00
Austin English 6e59cd2c34 Spelling fixes. 2008-04-22 12:20:12 +02:00
Alexander Dorofeyev db36665be5 wined3d: Add missing check for p8 primary in surface_download_data. 2008-04-21 14:22:35 +02:00
Roderick Colenbrander f2753d7189 wined3d: Add palette re-upload support for cards with hardware palette support.
Before it was broken and when it worked it was slow due to unneeded
gpu -> cpu -> gpu copying.
2008-04-21 13:36:19 +02:00
Stefan Dösinger a22203adeb wined3d: Make the mag filter lookup a separate array.
This makes it easier to make this a per texture / per adapter property.
Somewhen we should rename the remaining lookup type in the general
lookup table to wraplookup.
2008-04-09 11:48:30 +02:00
Stefan Dösinger 67e0943ba3 wined3d: Store the number of aux buffers in the context. 2008-04-09 11:47:24 +02:00
Stefan Dösinger 0de167db9e wined3d: Put implicit surfaces into drawable on unload.
If we mark the sysmem copy up to date we would have to take care about
allocating it. As explained in the comment, INDRAWABLE is a saner
choice
2008-04-08 11:59:28 +02:00
Alexander Dorofeyev 65f9abc88d wined3d: Move PreLoad to avoid calling it with gl lock held. 2008-04-07 21:18:47 +02:00
Alexander Dorofeyev 7f2257ca55 wined3d: Add device->isInDraw checks in LoadLocation.
Prevents calling ActivateContext while holding gl lock, e.g. when preloading 
texture in sampler().
2008-04-07 21:18:36 +02:00
Alexander Dorofeyev 29b38bc886 wined3d: Implement CONVERT_RGB32_888 conversion. 2008-04-07 21:17:15 +02:00
Roderick Colenbrander f04d870a8d wined3d: Remove a PBO when a converted surface is detected.
This can happen e.g. when suddenly color keying is activated and at
some stages we don't know if we will need conversion at PBO creation
time.
2008-04-07 12:05:54 +02:00
Roderick Colenbrander 0efefef34b wined3d: Use the render target its palette when performing a texture copy as the texture doesn't hold one. 2008-04-07 12:05:39 +02:00
Allan Tong a68637b59b wined3d: Call ActivateContext before any gl call in IWineD3DSurfaceImpl_Release. 2008-04-04 11:43:50 +02:00
Alexander Dorofeyev d6ba069d9e wined3d: Improve detection of device palette change. 2008-04-03 11:31:57 +02:00
Alexander Dorofeyev 1c89795438 wined3d: Support index in alpha in BltOverride colorfill codepath.
Fixes a failure in ddraw p8_primary_test when running with opengl ddraw renderer.
2008-04-03 11:31:43 +02:00
Alexander Dorofeyev b54553a253 wined3d: Avoid calling LoadTexture with gl lock held in IWineD3DSurfaceImpl_PreLoad.
Needed to prevent ActivateContext being called while holding gl lock.
2008-04-03 11:31:09 +02:00
Alexander Dorofeyev 1e6f02ed2b wined3d: Add ENTER_GL/LEAVE_GL in IWineD3DSurfaceImpl_Release. 2008-04-03 11:30:55 +02:00
Alexander Dorofeyev 088c34ec1c wined3d: Add ENTER_GL/LEAVE_GL in surface_allocate_surface. 2008-04-03 11:30:47 +02:00