Henri Verbeet
49e076eabd
wined3d: Separate context acquisition and state application.
2010-05-04 13:14:59 +02:00
Henri Verbeet
f09b8e454d
wined3d: Avoid some needless depth buffer copies.
...
If an application switches between render targets of a different size, but
with the same depth/stencil surface it'll typically clear the depth/stencil
surface before drawing. However, in case of the smaller render target that
wouldn't be a full clear, so we'd have to do a depth copy if we also switched
between onscreen and offscreen rendering. Keeping track of which part of the
depth/stencil surface is current for onscreen/offscreen allows us to avoid
most of these kinds of copies. The current scheme requires the current/dirty
rectangle to have an origin at (0,0). This could be extended to an arbitrary
rectangle, but the bookkeeping becomes somewhat more complex in that case, and
it's not clear that there would be much of a benefit at this point.
2010-04-29 10:19:39 -05:00
Henri Verbeet
6b34b8e6d1
wined3d: Simply pass an IWineD3DSurfaceImpl pointer to context_acquire().
2010-04-22 11:28:17 +02:00
Henri Verbeet
7b47dabd09
wined3d: Avoid some unnecessary invalidations of the the onscreen depth buffer.
...
This can happen for example when the application switches to a different
depth/stencil for offscreen rendering and back again.
2010-04-21 11:57:32 +02:00
Henri Verbeet
c5de1e1045
wined3d: Store the depth/stencil surface as an IWineD3DSurfaceImpl pointer in the device.
2010-04-20 11:14:42 +02:00
Henri Verbeet
c7a1848656
wined3d: Store render targets as IWineD3DSurfaceImpl pointers in the device.
2010-04-20 11:14:30 +02:00
Henri Verbeet
efb3993a3a
wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_modify_ds_location().
2010-04-19 14:55:24 +02:00
Henri Verbeet
ae46589f53
wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_load_ds_location().
2010-04-19 14:55:19 +02:00
Henri Verbeet
8eb2a2cf0c
wined3d: Disable strict draw ordering by default.
...
While some performance hit from the extra flushes was expected and would be
acceptable, the performance hit can be over 50% on some configurations, which
clearly isn't acceptable. This patch introduces a "StrictDrawOrdering"
registry key for applications affected by this, until we have a more
structural solution.
2010-04-13 21:13:36 +02:00
Stefan Dösinger
1181762f99
wined3d: Implement manual buffer fencing.
2010-03-23 12:31:15 +01:00
Henri Verbeet
7c930589bc
wined3d: Avoid some common invalid context accesses.
...
Unfortunately there are plenty of other places left. Perhaps we should
consider creating our own window when the context becomes invalid and making
the context current on that instead.
2010-03-18 10:25:09 +01:00
Henri Verbeet
135f364110
wined3d: Kill VTRACE.
2010-03-18 10:25:02 +01:00
Henri Verbeet
ce42470138
wined3d: Ensure draw ordering across contexts.
2010-01-28 11:07:59 +01:00
Henri Verbeet
98568f0ba1
wined3d: Add support for ARB_vertex_array_bgra.
2010-01-26 12:08:27 +01:00
Paul Vriens
c8681f885d
wined3d: Fix use of memset (Coccinelle).
2010-01-08 10:13:51 +01:00
Henri Verbeet
ea0af93c19
wined3d: Get rid of some redundant local variables.
...
E.g. "This" variables that are only used in traces.
2009-12-22 13:48:25 +01:00
Henri Verbeet
111307dfba
wined3d: Get rid of the GL_SUPPORT macro.
2009-10-29 13:09:33 +01:00
Henri Verbeet
48e03bc189
wined3d: Introduce a separate structure for various OpenGL implementation limits.
2009-10-29 13:09:27 +01:00
Henri Verbeet
eeb54b9922
wined3d: Keep better track of where we're using wined3d contexts.
...
The idea here is that we can restore the thread's current GL context on
context_release() if it doesn't correspond to the current wined3d context on
context_acquire().
2009-10-28 11:15:19 +01:00
Henri Verbeet
6be41fd59a
wined3d: Get rid of GL_LIMITS.
2009-10-22 10:46:05 +02:00
Henri Verbeet
47c84f4f7f
wined3d: Use the DXGI naming convention for all formats.
2009-09-25 15:15:44 +02:00
Henri Verbeet
2b2fc827ce
wined3d: Remove unused parameters to drawPrimitive().
2009-09-11 12:09:14 +02:00
Stefan Dösinger
65f3d54da5
wined3d: Silence a compiler warning.
2009-09-08 13:03:24 +02:00
Henri Verbeet
560d63548d
wined3d: Remove trailing spaces.
2009-08-27 11:45:37 +02:00
Henri Verbeet
c514323442
wined3d: Properly check if an attribute is used in drawStridedInstanced().
2009-08-27 11:45:37 +02:00
Henri Verbeet
d4e167dfbc
wined3d: Properly check if an attribute is used in remove_vbos().
2009-08-26 12:10:45 +02:00
Henri Verbeet
c9f270a5d9
wined3d: Properly check if an attribute is used in drawStridedSlow().
2009-08-25 11:09:34 +02:00
Henri Verbeet
c1c58f85ca
wined3d: Properly check if an attribute is used in drawStridedSlowVs().
2009-08-24 15:17:33 +02:00
Henri Verbeet
b8078fc747
wined3d: Use WINED3D_UNMAPPED_STAGE in some more places.
2009-08-17 13:57:50 +02:00
Henri Verbeet
0479fb13b5
wined3d: Explicitly pass the context to drawStridedSlow().
2009-08-07 12:11:10 +02:00
Henri Verbeet
a7251f0f4e
wined3d: Track render_offscreen in the context.
...
This makes sure the relevant states in FindContext() are actually marked dirty
when needed.
2009-08-06 17:26:30 +02:00
Henri Verbeet
da1e5573da
wined3d: Rename WineD3DContext to struct wined3d_context.
2009-08-03 15:01:48 +02:00
Henri Verbeet
be536ebe2f
wined3d: Get rid of activeContext.
2009-07-24 13:10:57 +02:00
Henri Verbeet
c8fe24d29e
wined3d: Explicitly pass the context to surface_load_ds_location().
2009-07-24 13:10:47 +02:00
Henri Verbeet
ee4d18cc83
wined3d: Pass NULL to ActivateContext() when we don't need a specific target.
...
Once we keep track of the wined3d context for each thread,
lastActiveRenderTarget won't do what we want here.
2009-07-21 14:22:44 +02:00
Henri Verbeet
32fd8f2130
wined3d: checkGLcall() doesn't need a \n.
2009-07-07 11:50:22 +02:00
Henri Verbeet
2ac34bf231
wined3d: Add some missing float suffixes.
...
The compiler should be smart enough to fix most of these, but it looks sloppy.
2009-07-07 11:50:05 +02:00
Henri Verbeet
964f4b0157
wined3d: Make sure we have an active GL context in buffer_PreLoad().
2009-06-25 11:47:16 +02:00
Henri Verbeet
9a58f37cd3
wined3d: Move the num_untracked_materials lookup out of the main drawing loop.
2009-06-22 12:58:59 +02:00
Henri Verbeet
dcc490e82f
wined3d: Don't load a rendertarget just because alpha test is enabled.
...
Unlike the depth test, the alpha test doesn't compare to the existing fragment
but against a reference value.
2009-06-19 13:52:47 +02:00
Henri Verbeet
60317d027a
wined3d: Avoid some unneeded rendertarget copies.
2009-06-17 12:13:07 +02:00
Henri Verbeet
8be020776b
wined3d: Avoid some unneeded depthstencil copies.
2009-06-17 12:13:07 +02:00
Henri Verbeet
f347374470
wined3d: Remove some apparently leftover debug code.
2009-05-25 11:23:39 +02:00
Henri Verbeet
b35e469d9d
wined3d: Document functions that depend on the caller to do GL locking.
2009-05-15 10:25:41 +02:00
Stefan Dösinger
d2e12a19ca
wined3d: Make use of GL_ARB_half_float_vertex.
...
This extension is a subset of GL_NV_half_float that defines support
for the stream format(same constant), but doesn't define texture
formats or immediate mode entrypoints.
2009-05-05 14:13:02 +02:00
Stefan Dösinger
014c4bfc70
wined3d: Save some memory in vertex buffers.
...
In most cases we're fine with the vbo and glMapBuffer and never use the actual
heap memory copy. Try to stick to just the vbo copy and avoid allocating the
extra heap memory. In case it is needed(emulation or vertex conversion), fall
back to the old double buffering mode.
2009-04-10 11:14:32 +02:00
Stefan Dösinger
2a7a237170
wined3d: Merge indexbuffer and buffer implementations.
2009-04-08 11:37:24 +02:00
Henri Verbeet
ef2d704183
wined3d: Store the format_desc itself in struct wined3d_stream_info_element.
2009-03-30 15:11:24 +02:00
Henri Verbeet
4434d00f84
wined3d: Unify vertex and texture formats.
...
Some fields should be redundant now, eg. gl_vtx_type and glType. I'll leave
that for a different patch to fix though.
2009-03-27 15:51:25 +01:00
Henri Verbeet
d7c7c76850
wined3d: Use separate structures for ddraw style strided data and wined3d's internal stream info.
2009-03-27 15:51:25 +01:00
Henri Verbeet
c1a42ff024
wined3d: Simplify remove_vbos().
2009-03-26 14:47:58 +01:00
Henri Verbeet
6afd97cc9f
wined3d: Remove unused attributes from WineDirect3DVertexStridedData.
...
These are essentially unused, and mostly just complicate the code.
2009-03-26 14:47:52 +01:00
Henri Verbeet
25b60e168a
wined3d: Do the ffp_valid check before even trying to use the element.
2009-03-25 11:12:55 +01:00
Henri Verbeet
aa3027a604
wined3d: Merge IWineD3DVertexBuffer with IWineD3DBuffer.
...
That still leaves IWineD3DIndexBuffer, but that code is also mostly similar,
except for the conversion code (which will be unused there).
2009-03-06 15:35:58 +01:00
Henri Verbeet
702eeb6b0c
wined3d: Add separate methods for setting the primitive type.
2009-03-05 16:16:25 +01:00
Henri Verbeet
3b07e7059e
wined3d: Add d3d10 primitive types.
2009-03-05 16:16:24 +01:00
Henri Verbeet
17e12611b8
wined3d: Fix some prototypes.
2009-03-05 16:16:24 +01:00
Henri Verbeet
602bb1f551
wined3d: Pass the vertex count rather than the primitive count to wined3d draw methods.
2009-03-05 16:16:24 +01:00
Michael Stefaniuc
118c75a8c7
wined3d: Remove superfluous pointer casts.
2009-02-03 12:40:14 +01:00
Henri Verbeet
e82eef28f9
wined3d: Take EXT_vertex_array_bgra into account in send_attribute() and loadNumberedArrays().
2009-01-23 13:12:47 +01:00
Henri Verbeet
5d875906c1
wined3d: Remove some superfluous pointer casts.
2009-01-20 12:34:05 +01:00
Henri Verbeet
9d8c6326c0
wined3d: Remove stray tabs.
2009-01-09 14:06:14 +01:00
Henri Verbeet
9d523ebd8f
wined3d: Remove a silly check in drawStridedInstanced().
2009-01-09 14:06:14 +01:00
Henri Verbeet
b1812c690c
wined3d: Add support for EXT_vertex_array_bgra.
...
This allows us to skip BGRA->RGBA color conversion for vertex attributes if
this extension is present.
2009-01-08 13:21:51 +01:00
Henri Verbeet
6791e6b752
wined3d: Simplify handling of swizzled attributes.
...
This should also be a little bit faster.
2009-01-08 13:21:43 +01:00
Henri Verbeet
cc447eac55
wined3d: Move position_transformed out of u.s in struct WineDirect3DVertexStridedData.
2009-01-08 13:21:31 +01:00
Henri Verbeet
1a1f5ec69d
wined3d: Cleanup drawStridedFast().
...
Remove some uncessary code and use more descriptive parameter names. Note that
max_vertex_idx isn't the same as "minIndex + calculatedNumberOfindices - 1"
but rather "minIndex + numberOfVertices - 1". calculatedNumberOfindices just
specifies the number of vertices that's drawn, while numberOfVertices
specifies the range of vertices that's drawn.
2009-01-08 13:21:23 +01:00
Henri Verbeet
5f8c62e45d
wined3d: Remove a redundant parameter to drawPrimitive().
...
startIdx should be the first index to draw, either from the vertex
array or the index array, depending on if the draw is indexed or
not. Having both at the same time wouldn't make sense.
2009-01-07 12:22:12 +01:00
Henri Verbeet
2b926db50d
wined3d: Make use_vs() and use_ps() work on a stateblock instead of a device.
...
Most callers work on a stateblock rather than a device, and the main fields
we check (vertexShader and pixelShader) are part of the stateblock as well.
2008-12-31 12:25:56 +01:00
Stefan Dösinger
199a3468bf
wined3d: Fake GL_ARB_multitexture.
2008-12-16 14:31:25 +01:00
Henri Verbeet
b409061337
wined3d: Make some constant arrays also static.
...
As pointed out by Dan Kegel.
2008-12-10 10:50:37 +01:00
Henri Verbeet
afd5a53bd0
wined3d: Load texture coordinates from the correct streams.
...
This fixes a regression introduced by commit
a2febdd200
.
2008-12-08 12:28:11 +01:00
Henri Verbeet
a2febdd200
wined3d: Slightly improve drawStridedSlow() performance.
...
This moves a couple of checks outside of the main drawing loop, since
they're not going to change anyway.
2008-12-05 11:58:53 +01:00
Henri Verbeet
fec9820e56
wined3d: Handle a few "silent" FIXMEs more consistent with the rest of the code.
...
Also avoids needlessly initializing static variables.
2008-12-02 14:04:00 +01:00
Henri Verbeet
6f98f19703
wined3d: Const correctness fixes for drawprim.c.
2008-12-01 12:45:29 +01:00
Henri Verbeet
21b8535902
wined3d: Make the lpData member of WineDirect3DStridedData const.
2008-12-01 12:45:23 +01:00
Andrew Talbot
f40afa87c6
wined3d: Sign-compare warnings fix.
2008-11-28 12:57:25 +01:00
Henri Verbeet
b4f0b5bdd0
wined3d: Const correctness fixes.
2008-11-25 13:37:39 +01:00
Henri Verbeet
6e1b7333e6
wined3d: Print an error when drawStridedSlowVs() is called with 0 idxSize and non-NULL idxData (LLVM/Clang).
2008-10-31 12:58:43 +01:00
Henri Verbeet
4034a29f19
wined3d: Move depth_blt to surface.c.
2008-10-28 12:33:13 +01:00
Alexandre Julliard
6cfef95ce7
wined3d: Convert source files to utf-8.
2008-10-18 19:21:20 +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
cb472a3be7
wined3d: Declare diffuseColor and specularColor inside their respective blocks (LLVM/Clang).
2008-10-10 12:27:17 +02:00
Henri Verbeet
d8c40f7641
wined3d: Print an error when drawStridedSlow() is called with 0 idxSize and non-NULL idxData (CID 509).
2008-10-08 12:16:35 +02:00
Henri Verbeet
3a7fcec4d7
wined3d: Handle texture coordinates the same way we handle other vertex attributes.
2008-09-25 11:53:10 +02:00
Henri Verbeet
2c1e4602a3
wined3d: If a stage isn't mapped to a texture unit, we can't set default coordinates either.
2008-09-25 11:53:03 +02:00
Henri Verbeet
f84680e66c
wined3d: Don't try to draw with unsupported attribute data types.
2008-09-22 12:20:34 +02:00
Tobias Jakobi
36cf25b598
wined3d: Fix long int warnings.
2008-09-12 13:33:00 +02:00
Tobias Jakobi
6e1194f06e
wined3d: Fix SHOW_FRAME_MAKEUP debug dump code.
2008-09-12 13:30:02 +02:00
Henri Verbeet
81effcf30d
wined3d: Set the viewport to the texture size in depth_blt().
2008-09-05 10:50:55 +02:00
Henri Verbeet
632102cd14
wined3d: Correct a TRACE and remove an incorrect comment.
2008-09-04 11:15:24 +02:00
Henri Verbeet
4b354e8e62
wined3d: Fix a variable name inside a VTRACE.
2008-09-04 11:15:17 +02:00
Henri Verbeet
d37c6fc0a9
wined3d: Depth stencil tracking depends on the value of This->render_offscreen.
2008-09-04 11:15:01 +02:00
Stefan Dösinger
43fe6b0bcf
wined3d: Remove some junk.
2008-08-27 13:21:24 +02:00
H. Verbeet
2f99bcdde2
wined3d: Move depth stencil location handling code up a couple of lines.
...
This is just for clarity, so that render targets and the depth stencil are
handled in the same place.
2008-08-22 10:38:30 +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
daa59e00be
wined3d: Call LoadLocation() on higher render targets as well, simplify some code in drawPrimitive.
...
It's probably rare for higher render targets to get locked or updated
from sysmem, but this should still be more correct. It also makes the
code simpler.
2008-07-31 13:04:08 +02:00
H. Verbeet
c7da79ded3
wined3d: FBO texture == drawable handling is already handled in LoadLocation().
2008-07-30 12:44:18 +02:00
H. Verbeet
9b47996b41
wined3d: Container dirtification is already handled in ModifyLocation().
2008-07-30 12:44:12 +02:00
H. Verbeet
b37cc08721
wined3d: Don't call shader_select() in depth_blt().
...
Calling shader_select() from inside depth_blt() isn't necessarily
safe. shader_select() assumes CompileShader() has been called for the
current shaders, but that depends on STATE_VSHADER / STATE_PIXELSHADER
being applied. That isn't always true when depth_blt() gets called,
with the result that sometimes GLSL programs could be created with no
shader objects attached.
2008-07-10 20:33:29 +02:00