Commit Graph

107 Commits

Author SHA1 Message Date
Henri Verbeet a269236649 wined3d: Move FBO handling functions to context.c. 2008-09-19 11:29:13 +02:00
Stefan Dösinger c36e033856 wined3d: Fix the pixelformat selection logic. 2008-09-05 11:23:09 +02:00
Henri Verbeet 4b6887b8e3 wined3d: Be more careful when deleting FBOs.
Clear all attachments before deleting FBOs. It should be valid to
delete FBOs that still have attachments, but for some reason the
nvidia drivers don't like it. The resulting memory corruption can be
pretty nasty, and this workaround seems clean enough.
2008-09-04 11:14:53 +02:00
Stefan Dösinger 0e2713a1e1 wined3d: Remove unneeded code.
The fixed function backend disables the extension. Also messing
with the final combiner shouldn't be needed if nvrc is disabled.
2008-08-27 13:21:24 +02:00
Stefan Dösinger e110f2c680 wined3d: Don't retry less strict formats if a match was found. 2008-08-25 12:26:26 +02:00
Henri Verbeet e3507a725f wined3d: glDeleteFramebuffersEXT() needs a context. 2008-08-25 11:39:10 +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
Alexander Dorofeyev 1da8a032af wined3d: Disable TEXTURE_RECTANGLE in SetupForBlit. 2008-08-21 13:35:23 +02:00
Stefan Dösinger 77204574d1 wined3d: Prefer aux buffer matches over alpha matches.
Half Life 2 uses D3DFMT_X8R8G8B8 for the back buffer, but macos
supports aux buffers only on D3DFMT_A8R8G8B8. I think having aux
buffers is more important right now than having a precise alpha
match.
2008-08-21 13:33:09 +02:00
Stefan Dösinger 5d75939b09 wined3d: Keep track of the last used device. 2008-08-20 12:33:25 +02:00
H. Verbeet 2d6d879562 wined3d: Handle CTXUSAGE_BLIT with offscreen targets and FBO ORM.
This is mostly for correctness, in practice we should always be able
to avoid using CTXUSAGE_BLIT for offscreen targets when FBO ORM is
used.
2008-08-05 14:09:34 +02:00
H. Verbeet b685b84e66 wined3d: Apply FBO state in ActivateContext().
Fixes some GL errors due to calling glDrawBuffer(GL_BACK) when an FBO
is still active.
2008-08-05 14:09:34 +02:00
H. Verbeet f037eb8696 wined3d: Move setting the draw buffer to a separate function. 2008-08-04 13:52:09 +02:00
Stefan Dösinger 40cfec2582 wined3d: Do not enable GL_TEXTURE_SHADER_NV unconditionally. 2008-07-28 11:36:04 +02:00
Stefan Dösinger 1219e3d4a7 wined3d: Use less strict pixel format matching if the match fails.
Some drivers(the open source ones most notably) cannot satisfy all
possible D3D formats. This doesn't mean we should fall back to the
emergency fallback instantly. Instead, try to loosen the requirements
step by step.
2008-07-22 13:00:47 +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
Stefan Dösinger c48195e417 wined3d: Move shader_fragment_enable to the fragment pipeline implementation.
It isn't related to the shader backend any longer. The nvts_enable in
the ffp code isn't quite right as well, it should be moved away once
there is a dedicated nvts fragment pipeline replacement
2008-07-11 14:32:37 +02:00
Stefan Dösinger 98faed8ff5 wined3d: Start the state splitup.
The idea of this patchset is to split the monolithic state set into 3
parts, vertex processing, fragment processing and other states(depth,
stencil, scissor, ...). The states will be provided in templates which
can be (mostly) independently combined, and are merged into a single
state table at device creation time. This way we retain the advantages
of the single state table and having the advantage of separated
pipeline implementations which can be combined without any manually
written glue code.
2008-07-08 10:45:56 +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 74c5684f90 wined3d: Update the blit ortho on size changes.
SetupForBlit sets up the GL viewport and projection matrix for
screen-cordinate access to the framebuffer. These settings were not
updated if the other gl states were already set up for blitting. Guild
Wars reads back an offscreen rendered texture from the framebuffer,
which currently sets up CTXUSAGE_BLIT, then changes the render target,
and draws to the texture, which has to be reloaded from system memory
before it can be rendered to(since GW loaded some data into it). If the
two render targets had different size this failed.
2008-07-02 12:24:35 +02:00
Stefan Dösinger 535e61892c wined3d: Only read back offscreen targets on a target change.
This avoids calling PreLoad needlessly on a thread change during offscreen
rendering and breaks up the endless recursion due to lastTID != newTID.
2008-06-13 10:15:48 +02:00
Stefan Dösinger 78d963039b wined3d: Do not PreLoad the new render target.
There is no reason to do that, now that the SetGLTextureDesc bug is
fixed. This avoids an infinite recursion because PreLoad calls
ActivateContext at some point.
2008-06-13 10:15:26 +02:00
Roderick Colenbrander 0ca7d443ac wined3d: Add a WineD3D_ChoosePixelFormat line. 2008-06-03 11:17:27 +02:00
Roderick Colenbrander bd5c02e245 wined3d: Request a WGL depth stencil capable pixel format by default until we have proper SetDepthStencilSurface support. 2008-05-19 20:20:35 +02:00
Roderick Colenbrander 7b5561cbb8 wined3d: Allow stencil support when it wasn't requested on broken drivers. 2008-05-05 21:03:39 +02:00
Roderick Colenbrander e3b662bb20 wined3d: At the start of RemoveContextFromArray numContexts is decreased by 1, the loop which loops through the whole array doesn't take this into account.
Discovered by Peter Oberndorfer.
2008-05-05 12:53:52 +02:00
Roderick Colenbrander cb0f0af131 wined3d: We don't want double buffering in pbuffer mode. 2008-05-01 18:11:26 +02:00
Roderick Colenbrander 96c770d9bf wined3d: In window mode (!pbuffer) we want both a window drawable format and double buffering. 2008-05-01 18:11:26 +02:00
Roderick Colenbrander 628e4eece3 wined3d: Add multisampling support. 2008-04-30 10:23:25 +02:00
Roderick Colenbrander 4428cc32de wined3d: Fix a few small bugs in WineD3D_ChoosePixelFormat. 2008-04-29 12:47:07 +02:00
Roderick Colenbrander 34d06a5e96 wined3d: Also use WineD3D_ChoosePixelFormat for pbuffers. 2008-04-28 13:27:51 +02:00
Roderick Colenbrander a38e5a95ef wined3d: Let WineD3D_ChoosePixelFormat operate on the pixel format database we store at WineD3D startup. 2008-04-28 13:27:51 +02:00
Roderick Colenbrander ec5400b4f8 wined3d: Split WGL pixel format selection code off from CreateContext. 2008-04-28 13:27:51 +02:00
Roderick Colenbrander f0307d9366 wgl: Add a wine specific WGL extension which allows you to change the pixel format multiple times. 2008-04-24 12:32:38 +02:00
Stefan Dösinger e3bd5b6dcd wined3d: Use the shader backend to enable / disable atifs and nvts.
The previous logic assumed that if NVTS or ATIFS are available they
will be used. This happens to be true for NVTS, but ATIFS is only used
if neither ARBFP nor GLSL are supported. This breaks fixed function
fragment processing on ATI r300 and newer cards
2008-04-24 11:37:17 +02:00
Austin English 6e59cd2c34 Spelling fixes. 2008-04-22 12:20:12 +02:00
Stefan Dösinger fb8fde81d1 wined3d: Disable blending when clearing. 2008-04-09 11:53:44 +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 ddf52dda15 wined3d: Deactivate GL_FRAGMENT_SHADER_ATI before deactivating a context.
Mesa has a bug that causes a crash due to a NULL pointer dereference
with the R200 driver when making a context current that has
GL_FRAGMENT_SHADER_ATI enabled. This patch works around this bug by
making sure that GL_FRAGMENT_SHADER_ATI is disabled before deactivating
a context, and reactivates it afterwards. The context manager keeps
GL_ATI_FRAGMENT_SHADER generally enabled, except if the context is in 2D
blit mode.
2008-04-03 12:02:24 +02:00
Stefan Dösinger b1d8af7926 wined3d: Update copyright lines. 2008-04-02 20:22:42 +02:00
Roderick Colenbrander 4120188f99 wined3d: Request a pixel format with alpha support in case of P8 render targets. 2008-03-31 13:01:24 +02:00
Roderick Colenbrander 4eaa424c79 wined3d: Initial post pixelshader blending support. [attempt 2].
For each pixel format we store a flag in the table whether it supports
post pixelshader blending. Before applying blending or during a
context switch we verify that blending is turned off for the
format. In case of R32F this gave a 5-6x performance boost (without
filtering and software conversion).
2008-03-28 15:50:24 +01:00
Stefan Dösinger 4640be8dc8 wined3d: Fragment processing using GL_ATI_fragment_shader.
This adds code for handling fixed function fragment processing with the
GL_ATI_fragment_shader extension. This is a sort-of programmable
interface for fragment processing at the level of shader model 1.4 in
d3d. This code is of use on r200, r250 and r280 cards(radeon 8500 to
9200) which do not support GL_ARB_fragment_program, but support pixel
shader 1.4 on Windows. This code is somewhat a counterpart to the
existing fragment processing code using GL_NV_register_combiners and
GL_NV_texture_shader.
2008-03-25 19:50:32 +01:00
Stefan Dösinger 84258723f9 wined3d: Make the state table a property of the shader backend. 2008-03-25 19:35:32 +01:00
Roderick Colenbrander 690f496bd4 wined3d: We want to compare the old and the new format and not the old with the old. 2008-03-24 13:27:14 +01:00
Stefan Dösinger 6ea0880e43 wined3d: Fix a small bug in a patch from yesterday. 2008-03-05 11:21:51 +01:00
Stefan Dösinger 107e80a79c wined3d: Implement a different constant dirtification algorithm.
Add a new property of the shader backend which indicates whether the
shader backend is able to dirtify single constants rather than
dirtifying vshader and pshader constants as a whole. Depending on this
a different Set*ConstantF implementation is used which marks constants
dirty. The ARB shader backend uses this and marks constants clean
after uploading.
2008-03-04 12:15:16 +01:00
Roderick Colenbrander e5bef99fbe wined3d: Request aux buffers when using backbuffer rendering. 2008-02-25 12:17:36 +01:00
Roderick Colenbrander 68467cf344 wined3d: Request alpha in backbuffer mode, to work correctly with multiple opengl pixel formats. 2008-02-25 12:14:36 +01:00
Francois Gouget d0794c4aeb Assorted spelling fixes. 2008-01-23 21:16:22 +01:00