Commit Graph

660 Commits

Author SHA1 Message Date
Rico Schüller 5e79b0608d wined3d: Add a checkGLcall() after glReadBuffer. 2009-01-10 18:04:28 +01:00
Stefan Dösinger a69c86d3f5 ddrawex: Add a test for the permanent DC function. 2009-01-09 16:26:06 +01:00
Henri Verbeet 9d8c6326c0 wined3d: Remove stray tabs. 2009-01-09 14:06:14 +01:00
Stefan Dösinger 616ea53226 ddraw: Add a test for IDirectDrawSurface::GetDC. 2009-01-03 15:14:38 +01:00
Vincent Pelletier 23dcf61e61 wined3d: Make WARN about oversized texture output surface and texture sizes. 2009-01-03 14:55:31 +01:00
Nick Burns 9dea6f7de5 wined3d: Fix glReadPixels call from read_from_framebuffer. 2008-12-26 13:42:17 +01:00
Stefan Dösinger 0dc0444c14 wined3d: Reinstall the G16R16F format surface load fixup.
We cannot remove this because we still have to load the surface as
RGB. The shader may take care of setting the blue channel to 1.0 now,
but we still get the red and green channels loaded incorrectly if we
don't insert a blue channel before loading.
2008-12-16 14:32:11 +01:00
Stefan Dösinger 199a3468bf wined3d: Fake GL_ARB_multitexture. 2008-12-16 14:31:25 +01:00
Henri Verbeet 74acbf9c16 wined3d: Get rid of vcheckGLcall.
Everywhere it's used a regular checkGLcall will do just as well.
2008-12-04 12:00:29 +01:00
Stefan Dösinger e04556bb16 wined3d: Fix D3DFMT_R32F, R16F, G16R16F, ... in the pixel shader.
This allows us to drop the load time conversion and the clear
readback hack and replaces it with a color fixup in the fixed
function pipeline replacement.
2008-12-04 12:00:15 +01:00
Henri Verbeet 89139b7589 wined3d: Make shader texture format fixups more generic.
Based on a patch by Stefan Dösinger. This is more flexible, and allows
the shader backend implementation to be simpler, since it doesn't have
to know about specific formats. The next patch makes use of this.
2008-12-04 11:59:58 +01:00
Henri Verbeet b451048eb7 wined3d: Move GlPixelFormatDesc to wined3d_private.h where it belongs.
Also remove the silly typedef.
2008-12-04 11:59:06 +01:00
Henri Verbeet 2acf8d7947 wined3d: Rename resource functions to reflect that they're not COM functions. 2008-12-03 09:47:26 +01:00
Alexandre Julliard 9c306e9871 wined3d: Make some functions and variables static. 2008-12-02 15:31:17 +01:00
Andrew Talbot 33e0d1610a wined3d: Sign-compare warnings fix. 2008-12-02 14:12:39 +01:00
Henri Verbeet c7880e8916 wined3d: Make minMipLookup_noFilter and magLookup_noFilter const.
Note that minMipLookup and magLookup aren't particularly safe to use,
they're global arrays initialized from IWineD3DImpl_FillGLCaps(). The same
goes for the other global dynamic lookup tables.
2008-11-28 12:53:57 +01:00
Henri Verbeet 4cea13dec7 wined3d: Const correctness fixes for surface.c. 2008-11-26 12:05:27 +01:00
Henri Verbeet f552c90c30 wined3d: Make some functions static. 2008-11-25 13:37:55 +01:00
Henri Verbeet f0a816e8cb wined3d: Slightly reduce the scope of fragment_palette_conversion. 2008-11-25 13:37:50 +01:00
Henri Verbeet 49b55f677e wined3d: Don't call IWineD3DSurfaceImpl_GetData() from surface_gdi.c. 2008-11-25 13:37:45 +01:00
Henri Verbeet b4f0b5bdd0 wined3d: Const correctness fixes. 2008-11-25 13:37:39 +01:00
Francois Gouget c0e271c4de wined3d: Remove WINAPI on static functions where not needed. 2008-11-25 11:49:57 +01:00
Christian Costa 632d34651f wined3d: Implement CONVERT_CK_RGB24 in d3dfmt_convert_surface. 2008-11-24 14:18:41 +01:00
Henri Verbeet 29f2fefc2b wined3d: Fix the cube map coordinates in surface_blt_to_drawable().
I don't see how this can ever have worked properly.
2008-11-19 14:22:29 +01:00
Stefan Dösinger 620a423b22 wined3d: Kill the GL_ATI_envmap_bumpmap code.
GL_ATI_envmap_bumpmap provides two things: Signed V8U8 pixel formats,
and bump mapping. The extension is only supported on fglrx, and this
driver also supports GL_ARB_fragment_program.  Thus the bump mapping
code is never used on any driver out there.  Furthermore, if it is
used, it tends to crash the driver

The signed pixel format is used, as it can be used by pixel shaders or
the ARBfp replacement. However, the format is broken in fglrx, and
negative values are clamped to 0.0. This results in test
failures. WineD3D has an alternative codepath using scale+bias to
enable V8U8 using a standard signed RGB which works correctly on
fglrx.
2008-11-04 11:41:14 +01:00
Henri Verbeet d262752aea wined3d: Handle lack of NPOT support for depth blts. 2008-10-29 11:52:06 +01:00
Henri Verbeet 80818bfc8d wined3d: Support some more depth blt texture types in surface_depth_blt(). 2008-10-29 11:52:01 +01:00
Henri Verbeet 437b342424 wined3d: Pass explicit texcoords to depth blt. 2008-10-28 12:33:27 +01:00
Henri Verbeet 57401fcab2 wined3d: Pass the texture type to the shader depth blt function. 2008-10-28 12:33:18 +01:00
Henri Verbeet 4034a29f19 wined3d: Move depth_blt to surface.c. 2008-10-28 12:33:13 +01:00
Roderick Colenbrander b98a7b5082 wined3d: Fix recursive ENTER_GL in LoadLocation. 2008-10-20 11:38:19 +02:00
Roderick Colenbrander e5ed8edb89 wined3d: Fix a recursive ENTER_GL in read_from_framebuffer. 2008-10-20 11:38:11 +02:00
Roderick Colenbrander 5163a360e0 wined3d: arbfp_blit_unset should call ENTER_GL/LEAVE_GL instead of the caller. 2008-10-20 11:37:46 +02:00
Roderick Colenbrander 8a002b09c1 wined3d: arbfp_set_shader_blit should handle ENTER_GL/LEAVE_GL instead of the caller. 2008-10-20 11:37:38 +02:00
Alexandre Julliard 6cfef95ce7 wined3d: Convert source files to utf-8. 2008-10-18 19:21:20 +02:00
Henri Verbeet 231e2c60b5 wined3d: The container is always non-NULL if GetContainer() succeeds. 2008-10-16 12:35:34 +02:00
Henri Verbeet f5fbfe47d7 wined3d: Handle offscreen rendering a bit nicer in surface_blt_to_drawable(). 2008-10-16 12:35:09 +02:00
Henri Verbeet e22bda24c6 wined3d: Simplify texture target handling in surface_blt_to_drawable(). 2008-10-15 15:22:11 +02:00
Henri Verbeet c777f962a2 wined3d: We only need to enable texturing for a target if we're going to draw with it (without a shader).
Also, these enables cause problems if they're done while the context
is setup for blitting.
2008-10-15 15:22:06 +02:00
Henri Verbeet a98b19cef5 wined3d: Pass the correct RECT to LoadLocation() in LockRect(). 2008-10-10 12:27:21 +02:00
Henri Verbeet eaf2474003 wined3d: Split SetGlTextureDesc() up.
This creates a function for setting the texture name and one for
setting the texture target. The idea is that the texture target should
get set right after the surface is created, and won't change, while
generating a texture name can wait.
2008-09-25 11:52:42 +02:00
Henri Verbeet 254349fb4d wined3d: Remove the "Wine 1.0 safety path". 2008-09-24 12:53:29 +02:00
Roderick Colenbrander c13b3f6179 wined3d: Re-add a comment which got lost. 2008-09-22 12:20:42 +02:00
Stefan Dösinger 2e6717ab79 wined3d: Initialize standalone surface parameters. 2008-09-22 12:20:13 +02:00
Henri Verbeet 45820046e8 wined3d: Create a FBO for each combination of render targets and depth stencil.
The main reason for this change is crappy performance for reconfiguring FBOs.
2008-09-19 11:30:00 +02:00
Henri Verbeet a269236649 wined3d: Move FBO handling functions to context.c. 2008-09-19 11:29:13 +02:00
Henri Verbeet 99981f2604 wined3d: Remove some assumptions that PreLoad() will always bind the texture. 2008-09-17 20:49:38 +02:00
Henri Verbeet 53a7951230 wined3d: Clarify a comment. 2008-09-17 20:49:33 +02:00
Henri Verbeet 147ec1a1a4 wined3d: Use the internal format for renderbuffer storage.
Note that using GL_DEPTH_COMPONENT instead of eg. GL_DEPTH_COMPONENT24
will work, but will create a renderbuffer with the format of the
onscreen depth buffer.
2008-09-16 22:34:03 +02:00
Henri Verbeet 047e42da08 wined3d: Improve a TRACE. 2008-09-16 22:33:46 +02:00
Henri Verbeet 81effcf30d wined3d: Set the viewport to the texture size in depth_blt(). 2008-09-05 10:50:55 +02:00
Alexander Dorofeyev 78312704d9 wined3d: Remove obsolete code & ModifyLocation TODO.
This fbo logic appears to have already been implemented in ModifyLocation.
2008-09-04 12:29:57 +02:00
Alexander Dorofeyev 1bcd6e4508 wined3d: Get rid of gl buffer variable in BltOverride.
Uses This == dstSwapchain->frontBuffer instead as suggested by Henri Verbeet.
2008-09-04 12:29:50 +02:00
Alexander Dorofeyev 7c38816819 wined3d: Remove glDrawBuffer calls in BltOverride.
Handled in ActivateContext, must be remains of pre-context management code.
2008-09-04 12:29:42 +02:00
Alexander Dorofeyev 5c7f2906ee wined3d: Make the condition to enter p8 conversion shader path more strict.
This prevents shader path from being entered for an offscreen surface
when there is p8 render target and fixes failures in ddraw visual test
(with opengl rendering and RTL_READDRAW mode) and visual glitches in
Red Alert.
2008-09-04 12:29:35 +02:00
Alexander Dorofeyev e13d0efb01 wined3d: Remove glFlush in RealizePalette.
glFlush was added to surface_blt_to_drawable some time ago, which is a
more general fix and makes this one superfluous.
2008-09-03 13:14:52 +02:00
Stefan Dösinger 3b48660f43 wined3d: Implement YV12 support for emulated overlays.
This is the prefered format of many codecs, and for some codecs this
is the only supported output format. As usual I try to handle all the
conversion in the GPU and keep the CPU involvement minimal to gain the
full performance of PBO transfers.
2008-09-02 14:55:50 +02:00
Stefan Dösinger 6c87a66355 wined3d: Get a GL context before creating a PBO. 2008-08-25 12:24:43 +02:00
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
Alexander Dorofeyev d5b400307b wined3d: Add ENTER_GL/LEAVE_GL in surface_bind_and_dirtify. 2008-04-03 11:30:38 +02:00
Stefan Dösinger b1d8af7926 wined3d: Update copyright lines. 2008-04-02 20:22:42 +02:00
Alexander Dorofeyev 9b913b3b79 wined3d: Don't use device palettes in RealizePalette. 2008-03-25 11:53:47 +01:00
Alexander Dorofeyev 13ce219235 wined3d: Don't use device palettes in GetDC. 2008-03-25 11:53:39 +01:00
Alexander Dorofeyev 85fd313046 wined3d: Don't use device palettes in read_from_framebuffer. 2008-03-25 11:53:24 +01:00
Alexander Dorofeyev 16da594354 wined3d: Fix comment. 2008-03-25 11:53:01 +01:00
Roderick Colenbrander 3771341774 wined3d: Add a missing break to blt_to_drawable. 2008-03-24 12:08:12 +01:00
Alexander Dorofeyev fc064cb04b wined3d: Use primary_render_target_is_p8 in read_from_framebuffer. 2008-03-10 12:55:02 +01:00
Alexander Dorofeyev 8f8076c3f7 wined3d: Get rid of spurious err when locking with WINED3DLOCK_DISCARD. 2008-03-10 12:54:48 +01:00
Stefan Dösinger 825506d5ff wined3d: General cross format blitting infrastrucutre, R32F->R16F blits. 2008-02-26 11:31:19 +01:00
Roderick Colenbrander 0b3d880c8e wined3d: Use the color key in glAlphaFunc in case of index_in_alpha. 2008-02-22 11:54:51 +01:00
Roderick Colenbrander 0cdccfc8b5 wined3d: Unify p8 render target detection code. 2008-02-22 11:54:40 +01:00
Roderick Colenbrander a5444cb897 wined3d: In DirectDraw a palette is a property of a surface while in d3d8/9 it is a property of a device. 2008-02-22 11:54:31 +01:00
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