Commit Graph

489 Commits

Author SHA1 Message Date
Roderick Colenbrander 98a0786096 wined3d: Don't flush in D3D RealizePalette without a palette. 2008-02-22 11:53:45 +01:00
Roderick Colenbrander 8f18eeea35 wined3d: Let flush_to_framebuffer_drawpixels use a valid rect. 2008-02-20 12:06:46 +01:00
Roderick Colenbrander 28464f9689 wined3d: Fix lack of indent in PreLoad. 2008-02-19 13:39:25 +01:00
Roderick Colenbrander 48275308ee wined3d: Add a GL specific RealizePalette which also updates the drawable. 2008-02-19 13:39:25 +01:00
Alexander Dorofeyev 5346039d5a wined3d: Take alpha from device palette entry for d3d 8 and later.
Adds support for D3D >= 8 style palettes that contain alpha. This fixes
rendering problems in games like Commandos 3 and Madden NFL 2004.
2008-02-19 13:39:24 +01:00
Roderick Colenbrander a29584b34f wined3d: Add SURFACE_BUSY support to *_BltFast. 2008-02-18 14:19:44 +01:00
Roderick Colenbrander 5437cb01f1 wined3d: Add SURFACE_BUSY support to *_Blt. 2008-02-18 14:19:37 +01:00
Stefan Dösinger d49c9bbcbe wined3d: Do not change the texture unit when binding surfaces.
Changing the texture unit when binding a surface for loading can break
the state manager in the way that it changes the currently active
texture unit while it is setting up a texture that has to be loaded.
Instead find out the current unit to dirtify the correct sampler.
2008-02-18 13:34:13 +01:00
Roderick Colenbrander ba90a740be wined3d: Add read_from_framebuffer_texture which combines code from read_from_framebuffer (drawpixels) and LoadLocation.
This makes the code easier to read and the pieces borrowed from
read_from_framebuffer are more correct than the code in LoadLocation.
2008-02-11 19:58:58 +01:00
Roderick Colenbrander 059778446f wined3d: Upload p8 palette using GL_ALPHA instead of GL_RED. 2008-02-08 11:04:36 +01:00
Roderick Colenbrander 424e9c3e08 wined3d: Allow read back of P8 surfaces. This fixes some of the redrawing issues in Red Alert. 2008-02-06 11:36:35 +01:00
Roderick Colenbrander f84589ea1f wined3d: Reload the palette on a color key change. This fixes the ddex4/ddex5 samples from the dx7 sdk. 2008-02-06 11:36:23 +01:00
Roderick Colenbrander 1b78457bc6 wined3d: Make sure to set the color key when it is needed including for index_in_alpha. 2008-02-06 11:36:15 +01:00
Stefan Dösinger 33d012efcb wined3d: Unload implicit depth stencil buffers correctly.
We have to destroy potential fbo renderbuffers, and make sure the
texture is gone
2008-02-05 12:32:42 +01:00
Andrew Talbot 18047e77e5 wined3d: Remove unneeded casts. 2008-01-24 11:41:42 +01:00
Roderick Colenbrander a1364d11c0 wined3d: Don't use texture_rectangle for paletted textures. 2008-01-23 11:31:42 +01:00
Alexander Dorofeyev d9567b7627 wined3d: Fix not released swapchain in some codepaths. 2008-01-22 11:19:43 +01:00
Marcus Meissner d757432c7d wined3d: Removed deadcode. 2008-01-21 12:41:31 +01:00
Pablo Spallanzani 91afa09ac0 wined3d: Fix texture coordinate calculation in surface_blt_to_drawable. 2008-01-15 11:36:44 +01:00
Stefan Dösinger c372654b26 wined3d: Implement IWineD3DSurface::UnLoad. 2008-01-14 15:10:30 +01:00
Stefan Dösinger e59ddb0ab1 wined3d: Add a new IWineD3DResource::UnLoad method. 2008-01-14 15:10:17 +01:00
Roderick Colenbrander a74ecc5f2f wined3d: Unify color conversion code. 2008-01-07 22:57:05 +01:00
Roderick Colenbrander f2e32f7c45 wined3d: Use software palette conversion for non-texturing operations. 2008-01-07 18:20:07 +01:00
H. Verbeet bf50e07f34 wined3d: SFLAG_INTEXTURE is the same as SFLAG_INDRAWABLE for offscreen render targets when ORM_FBO is used. 2008-01-03 11:40:31 +01:00
H. Verbeet 4863daf06a wined3d: Bind the surface texture in LoadLocation(). 2008-01-03 11:40:31 +01:00
H. Verbeet 6cab4c8005 wined3d: Move binding the texture and dirtifying the sampler to its own function from surface_download_data(). 2008-01-03 11:40:31 +01:00
H. Verbeet c46c53a12c wined3d: Call ActivateContext regardless of WINED3DCREATE_MULTITHREADED. 2008-01-03 11:40:31 +01:00
Alexander Dorofeyev 7165d7268b wined3d: Fix regression of colorfill and texture to swapchain codepaths in BltOverride. 2007-12-31 17:49:00 +01:00
Roderick Colenbrander f3df6cf42b wined3d: Only store the palette index in the alpha component when the primary render target uses P8.
This was already done in other places but I missed this spot.
2007-12-28 11:45:03 +01:00
Roderick Colenbrander 756cb66e78 wined3d: In case of GL_EXT_paletted_textures we use GL_COLOR_INDEX and don't need a GL_RED fixup. 2007-12-28 11:44:49 +01:00
Stefan Dösinger 2bec23fd7c wined3d: Fix a problem in BltOverride. 2007-12-27 13:44:05 +01:00
Alexander Dorofeyev f5aaabd1f2 wined3d: Rewrite IWineD3DSurfaceImpl_BltOverride colorfill codepath. 2007-12-21 13:58:13 +01:00
Stefan Dösinger b95f30134b wined3d: Implement texture -> swapchain blits with stretch_rect_fbo. 2007-12-19 12:19:43 +01:00
Stefan Dösinger 37e872e901 wined3d: Some improvements for SFLAG_CONVERTED checking.
We can check this flag before setting up the gl lock, and add the
surface format to the FIXME.
2007-12-19 12:19:39 +01:00
Stefan Dösinger 7e9af243d1 wined3d: Implement blits from the active render target to swapchains. 2007-12-19 12:19:12 +01:00
Stefan Dösinger 83c0b13c5b wined3d: Split up the render target -> render target blit. 2007-12-18 14:08:28 +01:00
Stefan Dösinger df77e28854 wined3d: Implement D3DFMT_G16R16. 2007-12-18 14:08:18 +01:00
Alexander Dorofeyev 1dbc9d50c9 wined3d: Improve thread safety in IWineD3DSurfaceImpl_BltOverride. 2007-12-10 12:36:06 +01:00
Francois Gouget 5f7a9cea38 Assorted spelling fixes. 2007-12-07 16:35:32 +01:00
Stefan Dösinger 9bc6200ece wined3d: Add a method for querying the gl drawable size of rendertarget. 2007-12-04 14:32:39 +01:00
Stefan Dösinger 94cd8c276a wined3d: Remove the X channel fixup in render target unlocking. 2007-11-30 14:01:34 +01:00
Stefan Dösinger d09cbcec91 wined3d: Activate GL_ARB_texture_rectangle. 2007-11-29 13:36:55 +01:00
Stefan Dösinger 3fd0916654 wined3d: Make the code aware of GL_ARB_texture_rectangle. 2007-11-29 13:36:37 +01:00
Stefan Dösinger 7925ef35cd wined3d: Avoid hardcoding GL_TEXTURE_2D. 2007-11-29 13:36:05 +01:00
Stefan Dösinger 4dbee07ff5 wined3d: Disable GL_TEXTURE_2D in the standard blit setup. 2007-11-29 13:35:53 +01:00
Stefan Dösinger a0127f2e1f wined3d: Allow using a different internal format for fbos.
OpenGL drivers do not support some low precision internal formats
like GL_RGB5 for fbo color targets. Direct3D application depend on them,
so provide a fallback format for render targets if the requested format
itself is not supported.
2007-11-28 13:40:29 +01:00
Stefan Dösinger b91c19af87 wined3d: Inform the texture about filtering changes.
The surface_blt_to_drawable function changes the filtering settings of
the texture object, but without informing the container about this
change. This patch makes sure that the basetexture knows about this and
reapplies the changed states to the settings chosen by the app.
2007-11-28 13:40:28 +01:00
Stefan Dösinger f13bb40671 wined3d: Do not call PreLoad in surface_download_data. 2007-11-16 13:23:02 +01:00
Roderick Colenbrander 9b0d661e43 wined3d: Flush GL calls after drawing to the drawable. This fixes apps that use multiple GL contexts. 2007-11-12 14:13:14 +01:00
Roderick Colenbrander b238e39ec8 wined3d: Make sure SFLAG_LOCKED is set at the start of LockRect as various functions called from LockRect depend on it (e.g. LoadTexture if called from LoadLocation). 2007-11-09 12:40:26 +01:00
Stefan Dösinger 24ee003bfe wined3d: Pass surface dirtification to the container. 2007-11-08 12:18:30 +01:00
Stefan Dösinger ed937c6ad4 wined3d: Take care for client storage and pbos. 2007-11-08 12:07:30 +01:00
Roderick Colenbrander b3f7a5565a wined3d: Make sure the format of the render target is P8 too. 2007-11-06 13:57:03 +01:00
Roderick Colenbrander 9f808670ac wined3d: UnlockRect regression fix. 2007-11-05 14:11:52 +01:00
Roderick Colenbrander d39abb7667 wined3d: Only use p8 conversion on render targets. 2007-11-05 14:11:44 +01:00
Roderick Colenbrander 1f34016401 wined3d: Fix LockedRect regression. 2007-11-05 13:24:37 +01:00
Stefan Dösinger d97e3fd086 wined3d: Move texture->sysmem specific code into its special function. 2007-11-05 13:24:36 +01:00
Stefan Dösinger 4678cd75be wined3d: Move drawable->sysmem specific code to its special function. 2007-11-05 13:24:36 +01:00
Stefan Dösinger 2d11b509b4 wined3d: Move sysmem->drawable specific blit code out of LoadLocation. 2007-11-05 13:24:36 +01:00
Stefan Dösinger 1367e00750 wined3d: Remove a wrong return. 2007-11-05 13:24:36 +01:00
Stefan Dösinger 7c97b80193 wined3d: Remove an unneeded check. 2007-11-05 13:24:36 +01:00
Stefan Dösinger 393ed4a070 wined3d: Make resource memory 32 byte aligned. 2007-11-01 12:38:45 +01:00
Stefan Dösinger 4d4fce7e33 wined3d: Disconnect allocatedMemory and Heap allocation. 2007-11-01 12:38:37 +01:00
Stefan Dösinger f1f84a3615 wined3d: Allocate memory for default pool resources too. 2007-11-01 12:38:25 +01:00
Stefan Dösinger a175e7b68e wined3d: Move a part of LockRect to the base class. 2007-11-01 12:38:17 +01:00
Stefan Dösinger 2a09716c75 wined3d: Reenable render target unlocking via textures. 2007-11-01 12:38:02 +01:00
Stefan Dösinger 64929cfb33 wined3d: Move memory allocation into a separate function. 2007-11-01 12:37:51 +01:00
Stefan Dösinger 948292dbc3 wined3d: Move texture -> drawable blits to LoadLocation. 2007-11-01 12:37:43 +01:00
Stefan Dösinger 58ed14eb52 wined3d: Honor pbos when downloading a compressed texture. 2007-10-29 12:04:18 +01:00
Stefan Dösinger f6637cae98 wined3d: Move texture loading to LoadLocation. 2007-10-29 12:04:11 +01:00
Stefan Dösinger 2a85970631 wined3d: Move sysmem->drawable copying to LoadLocation. 2007-10-29 12:04:01 +01:00
Stefan Dösinger dc1848bd22 wined3d: Add a comment explaining what LoadLocation does. 2007-10-29 12:03:51 +01:00
Stefan Dösinger 34d6b38397 wined3d: Move drawable->sysmem reading to UpdateLocation. 2007-10-29 12:03:44 +01:00
Stefan Dösinger 20f1f50b2a wined3d: Move regular surface / texture downloading to LoadLocation. 2007-10-26 15:18:15 +02:00
Stefan Dösinger 123744910f wined3d: Add a method for surface location updates. 2007-10-26 15:17:30 +02:00
Stefan Dösinger dcff7dc213 wined3d: Begin centralizing surface location management. 2007-10-26 15:17:19 +02:00
Roderick Colenbrander e1a3e9a6ef wined3d: Rebind the 2D texture corresponding to the p8 surface. In some programs this caused nothing to show up. 2007-10-22 12:37:44 +02:00
Francois Gouget 7785c93b02 wined3d: Fix the d3dfmt_p8_init_palette() prototype. 2007-10-15 14:04:54 +02:00
Roderick Colenbrander b4678b7b10 wined3d: Optimize P8 fragment shader. 2007-10-15 11:10:26 +02:00
Roderick Colenbrander 134aa67ec9 wined3d: Use a fragment shader to do P8 palette conversion in hardware. 2007-10-12 11:07:23 +02:00
Roderick Colenbrander 5749dd4051 wined3d: Fix inverse palette lookup for P8 surfaces.
The previous method didn't take into account duplicate entries for the same color.
2007-10-12 11:07:07 +02:00
Roderick Colenbrander 8e64d870b1 wined3d: Merge p8 palette initialization code. 2007-10-10 11:59:51 +02:00
Francois Gouget b2bc712323 Assorted spelling fixes. 2007-09-27 20:12:53 +02:00
Stefan Dösinger 10f25e0104 wined3d: Add signed format conversion for glsl. 2007-09-24 13:29:54 +02:00
Stefan Dösinger e94a21b270 wined3d: Fix a typo in the surface code. 2007-09-20 15:53:28 +02:00
Stefan Dösinger 46e2d79508 wined3d: Move the software blitting to the base surface class. 2007-09-18 09:54:49 +02:00
Stefan Dösinger 3f0ea3d082 wined3d: Move lastActiveRenderTarget cleanup to the device. 2007-09-18 09:54:23 +02:00
Stefan Dösinger 5a7756447b wined3d: Move DIB section creation to the base surface implementation. 2007-09-18 09:54:05 +02:00
Stefan Dösinger e324da1494 wined3d: Remove a pbo check. 2007-09-18 09:53:50 +02:00
Stefan Dösinger 511f9dfb2d wined3d: Clean up SetMem. 2007-09-18 09:34:08 +02:00
Stefan Dösinger e56c6610c6 wined3d: Clean up SetFormatDesc. 2007-09-18 09:34:08 +02:00
Stefan Dösinger e2944175e5 wined3d: Base surface move, part 2. 2007-09-18 09:34:08 +02:00
Stefan Dösinger d99143c251 wined3d: Move non-rendering surface specific code to the base class. 2007-09-18 09:34:08 +02:00
Stefan Dösinger 0c91610433 wined3d: Move resource methods to the base surface class. 2007-09-18 09:34:08 +02:00
Stefan Dösinger 8434060b7e wined3d: Start of some surface cleanup.
This patch and the following intend to make the surface code more
manageable and are a preparation to add gl3 support. The code adds a
new IWineD3DBaseSurface surface type, which will contain the
non-rendering management code. IWineD3DSurface and IWineGDISurface
will be derived from IWineD3DBaseSurface, and IWineGL3Surface can be
added later.
2007-09-18 09:34:08 +02:00
Michael Stefaniuc a5fdea0e6a janitorial: Remove two fresh redundant NULL checks before HeapFree(). Found by Smatch. 2007-09-17 13:47:49 +02:00
Roderick Colenbrander 2374c456bc wined3d: Add pbo support for compressed textures. 2007-09-17 12:10:40 +02:00
Roderick Colenbrander f9002c2628 wined3d: Don't create a pbo for system memory surfaces. 2007-09-17 12:10:21 +02:00
Stefan Dösinger 3961491d15 wined3d: Do not invalidate the sysmem copy if a pbo exists. 2007-09-17 12:08:54 +02:00
Stefan Dösinger f42f228621 wined3d: Do not allocate memory if there's a pbo. 2007-09-17 12:08:47 +02:00
Roderick Colenbrander ad692f2a83 wined3d: Add PBO support for dynamically locked surfaces. 2007-09-13 11:00:47 +02:00
Stefan Dösinger 0ed81b20af wined3d: Emulate D3DFMT_L6V5U5. 2007-09-12 12:09:56 +02:00
Roderick Colenbrander 12e942b135 wined3d: Move the memory code of LockRect to the end of the function.
This is needed for PBOs because for those memory allocation works differently.
2007-09-12 11:20:35 +02:00
Stefan Dösinger 41bf0d48db wined3d: Fix WINED3DFMT_X8L8V8U8. 2007-09-11 13:48:15 +02:00
Roderick Colenbrander 63c06b4b38 wined3d: Fix ddraw-opengl surface free bug. 2007-09-10 16:47:49 +02:00
Stefan Dösinger bb213f67a3 wined3d: Take the format into account when finding the clear value. 2007-08-31 11:25:46 +02:00
Francois Gouget a116879507 Assorted spelling fixes. 2007-08-30 12:26:02 +02:00
Stefan Dösinger a489aa488b wined3d: Accept rendering to sublevels with backbuffer orm. 2007-08-30 11:57:18 +02:00
Stefan Dösinger 3b822b80fe wined3d: Reject opengl accelerated blits with system memory surfaces. 2007-08-30 11:57:18 +02:00
Stefan Dösinger 0d749e8e26 wined3d: Clear unused channels on R32F and R16F textures on readback. 2007-08-30 11:57:18 +02:00
Stefan Dösinger 50c101135c wined3d: Refuse to ReleaseDC the wrong DC. 2007-08-23 13:34:00 +02:00
Stefan Dösinger ea283d3cba wined3d: Refuse to lock locked surfaces. 2007-08-23 13:33:40 +02:00
Roderick Colenbrander 3c08b23024 wined3d: Fix a null pointer dereference. 2007-08-21 21:38:57 +02:00
Stefan Dösinger 86b991c851 wined3d: Fix R32F and R16F. 2007-08-17 12:01:38 +02:00
Stefan Dösinger 028729d102 wined3d: Fix WINED3DFMT_A4L4. 2007-08-16 11:35:06 +02:00
Roderick Colenbrander e77da5ef8a wined3d: Don't call ActivateContext between ENTER_GL/LEAVE_GL. 2007-08-07 12:36:32 +02:00
H. Verbeet cfb07e7114 wined3d: Set SFLAG_INSYSMEM when WINED3DLOCK_DISCARD is passed to IWineD3DSurfaceImpl_LockRect. 2007-08-02 12:18:41 +02:00
Alexandre Julliard af4b9bb85c wined3d: Fix compiler warning. 2007-07-30 14:14:01 +02:00
Stefan Dösinger d2016ff892 wined3d: Store the gl format table in the gl info structure. 2007-07-30 12:49:50 +02:00
Stefan Dösinger a0131a3272 wined3d: Split up the format table. 2007-07-30 12:49:39 +02:00
Stefan Dösinger 59efd5c7ec wined3d: Set the pow2 sizes in gl surface private setup. 2007-07-26 11:48:36 +02:00
Michael Stefaniuc 25707d4c5d wined3d: Remove a return after a return. Found by Smatch. 2007-07-25 13:02:39 +02:00
Stefan Dösinger 9ba3f389f6 wined3d: Initialize surfaces at creation. 2007-07-10 13:30:31 +02:00
Michael Stefaniuc 0326da9dd5 wined3d: Remove superfluous casts of void pointers to other pointer types. 2007-06-27 12:53:37 +02:00
Stefan Dösinger fb269f9210 wined3d: Depthfill blits are allowed between BeginScene and Endscene. 2007-06-22 13:42:51 +02:00
Stefan Dösinger 6e5a5d2736 wined3d: DDraw surfaces are QWORD aligned. 2007-06-14 13:22:52 +02:00
Stefan Dösinger c9b8a79e0b wined3d: Implement vertical refresh sync. 2007-06-14 13:21:54 +02:00
Stefan Dösinger ef65b233c0 wined3d: Some render target->texture blit context handling. 2007-06-11 13:56:47 +02:00
Stefan Dösinger a460a2df43 wined3d: Store the gl information in a per adapter structure and initialize it only once. 2007-06-11 13:51:06 +02:00
Francois Gouget 96c337f0a1 Assorted spelling fixes. 2007-06-07 19:24:32 +02:00
Phil Costin e7578dca36 wined3d: Add support for loading gamma corrected textures. 2007-06-07 13:01:49 +02:00
Lei Zhang f00670df61 wined3d: Various spelling fixes. 2007-06-06 13:40:01 +02:00
Chris Robinson 1e64bb93a4 wined3d: Add a few missing checkGLcall calls. 2007-06-05 12:19:10 +02:00
Kolbjoern Fredheim cb8a8182d1 wined3d: Implemented converting X1R5G5B5 format to R5G5B5A1 to emulate color-keying. 2007-05-22 12:26:49 +02:00
Stefan Dösinger 093261b729 wined3d: Only addref clippers if one exists. 2007-05-11 11:26:40 +02:00
Stefan Dösinger a90f650fd2 wined3d: Implement DDBLT_DEPTHFILL on the active depth stencil target. 2007-05-11 11:25:41 +02:00
Stefan Dösinger e7b68eec34 ddraw: Use point filter for blit operations.
D3DTEXF_NONE is a special value for mipmapping which disabled
mipmapping, but it is not a valid mag / min filter parameter.
D3DTEXF_POINT is what we want
2007-05-11 11:21:29 +02:00
Francois Gouget f999a9e433 wined3d: Add a missing '\n' to a trace. 2007-05-11 11:20:34 +02:00
Stefan Dösinger c9bc4ee760 wined3d: Handle DDPCAPS_ALPHA. 2007-05-08 18:28:38 +02:00
Stefan Dösinger 0fb41a8845 wined3d: Make the blit -> flip work for windowed rendering. 2007-05-08 18:28:08 +02:00
Stefan Dösinger d93e161b1f d3d: Move clippers from DDraw to wined3d. 2007-05-08 18:27:44 +02:00
H. Verbeet 7b48db196f d3d: Fix the surface locking rectangle validation. 2007-05-04 13:41:13 +02:00
Stefan Dösinger 61d1abb1c1 wined3d: Do not allocate surfaces unless needed. 2007-04-26 14:51:56 +02:00
H. Verbeet 5fddfd5bbc wined3d: Use surface_get_gl_buffer where appropriate. 2007-04-17 11:12:43 +02:00
H. Verbeet 1b9a5ba682 wined3d: Add a function to determine if a surface is the front or the backbuffer for a swapchain, and return the corresponding GLenum. 2007-04-17 11:12:34 +02:00
Stefan Dösinger 725057da47 d3d: Remove dependency on ddraw.h header. 2007-04-16 13:20:15 +02:00
H. Verbeet 2423c9f003 wined3d: Dirtify the sampler used by IWineD3DSurface_PreLoad in IWineD3DSurfaceImpl_BltOverride. 2007-04-10 21:39:43 +02:00
H. Verbeet 75e91fa409 wined3d: Use the framebuffer blit extension to implement StretchRect. 2007-04-09 12:40:52 +02:00
H. Verbeet c9b178b594 wined3d: Fixup FBO depth attachments when the depth attachment is larger than the render target. 2007-04-09 12:39:23 +02:00
Felix Nawothnig e600f7d082 wined3d: Issue an error when the render target is read back without SFLAG_INDRAWABLE being set. 2007-04-09 12:17:17 +02:00
Felix Nawothnig c0782603d0 wined3d: Allow np2 textures to be loaded for SFLAG_INDRAWABLE. 2007-04-09 12:15:56 +02:00
Stefan Dösinger 290f2eb146 wined3d: Add Filtering to IWineD3DSurface::Blt and handle it.
This is to allow StretchRect to pass the texture filter to WineD3D.
DirectDraw sets the texture filter to WINED3DTEXF_NONE, simmilar to all
other functions which do not need filtering.
2007-04-07 10:58:10 +02:00
Stefan Dösinger 4f5d33311b wined3d: Use GL_APPLE_client_storage if available. 2007-04-02 11:34:12 +02:00
Stefan Dösinger e25a16fda5 wined3d: General signed format correction without native signed formats.
Implement signed d3d formats for D3DFMT_V8U8 and D3DFMT_Q8W8V8U8 if no
suitable opengl signed format is supported.
2007-03-21 22:51:19 +01:00
Stefan Dösinger ede01abee2 wined3d: Support GL_ATI_envmap_bumpmap for D3DFMT_V8U8. 2007-03-21 22:50:41 +01:00
Stefan Dösinger fcb83e7111 wined3d: Activate a context before doing opengl calls. 2007-03-19 12:22:57 +01:00
Erich Hoover 01199072dd wined3d: Fix LockRect memory location calculation for WINED3DFMT_DXT*. 2007-03-17 19:51:34 +01:00
Stefan Dösinger 0b46254b57 wined3d: Blitting to offscreen target.
Fix the NULL deref that occured when blitting to offscreen targets and
select the proper gl drawing buffer instead.
2007-03-15 12:14:39 +01:00
Erich Hoover 9795e6839f wined3d: Allow SetCursorProperties on existing cursor. 2007-03-14 13:14:08 +01:00
Stefan Huehner 4d1d01f266 Mark several functions as static. 2007-03-13 13:35:12 +01:00
Fabian Bieler 8dae597f24 wined3d: Implemented signed texture formats via NV_TEXTURE_SHADER. 2007-03-13 11:51:56 +01:00
Stefan Dösinger c54a0fc2cf wined3d: Rework surface dirtification.
Previously the surfaces stored a flag if the system memory copy was
ahead of the gl copy(SFLAG_DIRTY) or the gl copy is
ahead(SFLAG_GLDIRTY). The pbuffer copy was 'managed' differently using
SFLAG_INPBUFFER and SFLAG_INTEXTURE.

This patch replaces them with 3 flags, INSYSMEM, INPBUFFER and
INTEXTURE which specify which copy contains the most up to date
copy. It is perfectly valid to have more than one of those flags
set. One must be set at least (except at init, when no content is in
the surface yet). When one copy is modified, the flags for the others
are removed.
2007-03-07 12:18:14 +01:00
Stefan Dösinger ebe274feed wined3d: Remove IWineD3DSurface::SetPBufferState.
The method is removed because it does not really help with
anything. It should not be exported from wined3d, there is no need for
the other libs to call it. It does not help abstraction and code
simplification in any way because it is very specific and the code
calling it has to know what is happening in the surface to use this
method.
2007-03-07 12:17:33 +01:00
Stefan Dösinger daeffc897b wined3d: Use an aux buffer as blitting helper if available.
This helps performance a bit because the function does not have to
wait for the 2nd read to finish before returning. Only do that if we
have an aux buffer to mess with for free though.
2007-03-06 22:16:44 +01:00
Stefan Dösinger ae57138eae wined3d: WINED3DFMT_U8V8 is signed.
Plain OpenGL does not provide any signed pixel formats, so the
unsigned GL_RGB is used for loading perturbation data into pixel
shaders that use texbem. For correct loading, the signedness has to be
considered.
2007-03-06 22:16:12 +01:00
Stefan Dösinger 424d34f84f wined3d: Use the source surface's texture for writing the backup.
The hwstretch blit code creates a new texture each time it is called
to back up the back buffer and releases it afterwards. It is more
efficient to keep the texture and release it with the surface.
2007-03-01 11:39:52 +01:00
Stefan Dösinger 8d9a553d89 wined3d: Support for using auxilliary buffers for offscreen rendering.
OpenGL AUX buffers provide a way for offscreen rendering which is very
similar to our back buffer "offscreen" rendering emulation. Not all
card support aux buffers, but if they are available they are a nice
present which is easy to use.
2007-02-28 21:04:47 +01:00
Francois Gouget 93494f2ac0 Assorted spelling fixes. 2007-02-20 20:30:51 +01:00
Stefan Dösinger 7676462a3d wined3d: Fix d3d8/9 style palettes. 2007-02-20 11:46:20 +01:00
Stefan Dösinger 5e37345b30 wined3d: Activate a different context if the active render target is destroyed. 2007-02-19 13:10:51 +01:00
Stefan Dösinger 1f32d6235e wined3d: Convert the full surface for now.
Until we have proper subrectangle handling for offscreen surfaces,
surface conversion has to use the real surface sizes, and not the size
of the opengl subrectangle that it is going to upload. Due to the
power of 2 limitations the gl height may be bigger than the real
surface height. If that is not the case, the uploading function will
pick the correct parts from the converted surface data.
2007-02-15 17:22:27 +01:00
Stefan Dösinger 20a07693b5 wined3d: Read offscreen render targets upside down when blitting them to a texture. 2007-02-15 17:22:06 +01:00
H. Verbeet 75ebf29e1b wined3d: Get rid of any remaining d3d9 stuff in surface.c and surface_gdi.c. 2007-02-15 14:21:11 +01:00
Stefan Dösinger 1282b43302 wined3d: Restore blitting environment after modifying it. 2007-02-15 11:41:05 +01:00
Stefan Dösinger 8b8e30b1e1 ddraw, wined3d: Color keying tests and fixes. 2007-02-15 11:37:00 +01:00
Stefan Dösinger ccd2772e28 wined3d: Accelerated blits from and to offscreen render targets. 2007-02-15 11:36:39 +01:00
Stefan Dösinger de036ff68e wined3d: Convert and load U8V8 surfaces as rgb.
GL_INDEX is definitly not the way to load U8V8 surfaces
2007-02-15 11:36:28 +01:00
Stefan Dösinger b90a665d20 wined3d: Do not allocate compressed surfaces with glTexImage2D. 2007-02-14 12:29:42 +01:00
Stefan Dösinger 403b5ecf60 wined3d: Partial render target locking. 2007-02-14 12:29:11 +01:00
Stefan Dösinger b48dfb3c54 wined3d: Always use np2 repacking if no native np2 support is available. 2007-02-14 12:29:01 +01:00
Stefan Dösinger 21172f1dec wined3d: Improve render target locking. 2007-02-14 12:28:39 +01:00
Stefan Dösinger c3f0eb489b wined3d: Remove pow2Size from the surfaces. 2007-02-14 12:28:19 +01:00
Stefan Dösinger 12252d0589 wined3d: Use the context manager to select the primary render target. 2007-02-13 12:05:35 +01:00
Stefan Dösinger e534340450 wined3d: Improve render target to texture blits. 2007-02-13 12:04:20 +01:00
Stefan Dösinger f22d37e4dd wined3d: Use the context manager to prepare for blitting. 2007-02-13 12:04:08 +01:00
Stefan Dösinger e6c9a073b0 wined3d: Store state optmization members in the context. 2007-02-13 11:50:38 +01:00
Stefan Dösinger c739c387b6 wined3d: Add a per context structure for context management. 2007-02-13 11:50:14 +01:00
Stefan Dösinger 67b1f4a7e9 wined3d: BeginScene and EndScene tests and fixes. 2007-02-12 12:08:34 +01:00
Stefan Dösinger 03389acc30 wined3d: Do not free regularily locked surfaces. 2007-01-15 12:43:29 +01:00
Stefan Dösinger 723b32b1c9 wined3d: Do not perform a NULL check on riid (Coverity). 2007-01-12 11:49:46 +01:00
Stefan Dösinger d0f1c23c93 wined3d: Select a proper texture unit in LockRect and dirtify the state. 2007-01-03 11:20:06 +01:00
Stefan Dösinger e26e3ee5f3 wined3d: Remove d3ddevice_set_ortho. 2007-01-03 11:19:55 +01:00
Stefan Dösinger 82bd0790ed wined3d: Move the projection matrix into its own state. 2007-01-03 11:19:45 +01:00
Stefan Dösinger 5fa0f7f775 wined3d: Move the world matrix to the state table. 2007-01-03 11:19:09 +01:00
Alexandre Julliard 656fc93815 Use GetDC instead of CreateDC where possible. 2007-01-02 17:16:36 +01:00
Stefan Dösinger 603038a07a wined3d: Do not setup states for unlocking if unlocking is disabled. 2006-12-29 12:49:41 +01:00
Stefan Dösinger 666b507766 wined3d: Move samplers to the state table. 2006-12-20 17:07:56 +01:00
H. Verbeet 8355b1a501 wined3d: Allow the device to store multiple render targets. 2006-12-20 12:31:40 +01:00
Markus Amsler 9b397ec2d5 wined3d: Remove IWineD3DSurface_GetContainerParent. 2006-12-18 12:02:17 +01:00
Vitaliy Margolen 81c7c00bb2 wined3d/d3d9: Pitch for DXTn textures can not be 0. With tests. 2006-12-04 12:38:16 +01:00