Commit Graph

427 Commits

Author SHA1 Message Date
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