Commit graph

1331 commits

Author SHA1 Message Date
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
2cdbd9a53d wined3d: Store the pixel format in the texture. 2007-03-21 22:50:49 +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
e213d7eff5 wined3d: Add GL_ATI_envmap_bumpmap to our gl extension header. 2007-03-21 22:50:30 +01:00
Vitaly Budovski
f7b565e2ca wined3d: Check for float texture formats correctly.
Move the checks for float texture formats into the correct location.
This allows some Direct3D sample applications which check for any of
the float formats together with D3DUSAGE_RENDERTARGET to start.
2007-03-21 12:33:17 +01:00
Phil Costin
1f03896e00 wined3d: Ensure all states affected by a change in render_offscreen are marked dirty in ActivateContext. 2007-03-21 11:55:52 +01:00
Stefan Dösinger
90fe64cee0 wined3d: Store an array of contexts in the swapchain.
This is a preparation for using multiple contexts on one drawable to
handle multithreading.
2007-03-19 12:23:16 +01:00
Stefan Dösinger
fcb83e7111 wined3d: Activate a context before doing opengl calls. 2007-03-19 12:22:57 +01:00
Stefan Dösinger
9789f993ce wined3d: Remove some old stuff. 2007-03-19 12:18:20 +01:00
Stefan Dösinger
65c447082a wined3d: Fix client gl unit selection.
I forgot that when re-enabling register combiners during the state
management rewrite.
2007-03-19 12:18:07 +01:00
Stefan Dösinger
022e884342 wined3d/ddraw: Forward DDSCL_MULTITHREADED to wined3d. 2007-03-19 12:17:18 +01:00
Andrew Talbot
2f5f3825c6 wined3d: Replace inline static with static inline. 2007-03-17 20:04:46 +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
4b445124d3 direct3d: Add a fixed function fog test. 2007-03-15 12:14:50 +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
Francois Gouget
e11ca0a7fd wined3d: Remove space before '\n' in trace. 2007-03-14 12:10:47 +01:00
Stefan Huehner
4d1d01f266 Mark several functions as static. 2007-03-13 13:35:12 +01:00
András Kovács
dac10f0da8 wined3d: Set WINED3DCAPS2_DYNAMICTEXTURES flag. 2007-03-13 12:08:23 +01:00
H. Verbeet
62fff2eab8 wined3d: Remove some redundant code in IWineD3DVertexBufferImpl_FindDecl(). 2007-03-13 11:56:18 +01:00
H. Verbeet
6998d0d472 wined3d: Remove a redundant check in handleStreams(). 2007-03-13 11:56:10 +01:00
H. Verbeet
05d461aee9 wined3d: Remove some redundant checks in the vertexdeclaration() state handler. 2007-03-13 11:56:02 +01:00
H. Verbeet
30ee071eb9 wined3d: Disable vertex shaders when transformed vertices are used. 2007-03-13 11:55:55 +01:00
H. Verbeet
ee09e8bfd6 wined3d: Remove FVF related fields from IWineD3DVertexDeclaration. 2007-03-13 11:54:24 +01:00
H. Verbeet
b22ca33a85 wined3d: 11 space indent is ugly. 2007-03-13 11:54:08 +01:00
H. Verbeet
23cd4475f6 wined3d: Correct various texture limits checks. 2007-03-13 11:53:28 +01:00
Fabian Bieler
8dae597f24 wined3d: Implemented signed texture formats via NV_TEXTURE_SHADER. 2007-03-13 11:51:56 +01:00
Fabian Bieler
89843f2c27 wined3d: Set wrapmode for cubemags to clamp regardless of the sampler state. 2007-03-13 11:51:35 +01:00
Fabian Bieler
a2808903b1 wined3d: Height of rectangle is bottom - top, not vice versa. 2007-03-12 13:49:58 +01:00
Stefan Dösinger
eba060463d wined3d: Account for offscreen rendering when setting up the clearing scissor rectangle. 2007-03-12 12:02:20 +01:00
Stefan Dösinger
603e7933ea wined3d: Blit the offscreen texture into the drawable if needed.
When using pbuffer or back buffer offscreen rendering the content of
the drawable will have been overwritten. Thus the texture has to be
written into the drawable. An exception is the (pretty common) case
that the whole render target is cleared before rendering to it.
2007-03-12 12:02:05 +01:00
Stefan Dösinger
850bd7b414 wined3d: Restore the index buffer when switching from UP to buffer drawing.
The state handler binds index buffer 0 when a user pointer is used. Likewise the real index
buffer has to be restored when switching back to drawing from index buffers.
2007-03-12 12:01:45 +01:00
H. Verbeet
fc5f36f037 wined3d: Fix IWineD3DPixelShader_GetFunction / IWineD3DVertexShader_GetFunction. 2007-03-08 11:58:50 +01:00
Michael Stefaniuc
719a02856d janitorial: Remove two redundant checks for NULL. 2007-03-08 11:58:09 +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
H. Verbeet
2384bdde9d wined3d: Remove broken software shaders. 2007-03-07 11:52:17 +01:00
H. Verbeet
318fb2987c wined3d: Fix a typo. 2007-03-07 11:47:54 +01:00
Stefan Dösinger
81aeae3249 wined3d: Do not specify the viewport origin upside down when doing offscreen rendering.
The gl viewport origin is the lower left corner of the window, in d3d
it is the upper right corner. This is corrected when setting the
viewport. However, when we are doing offscreen rendering, this is
reversed. So do not flip the viewport origin when rendering offscreen.
2007-03-06 22:17:28 +01:00
Stefan Dösinger
6886b237ad wined3d: Disable depth stencil related states without a depth stencil buffer.
Except with fbos, it is not possible to remove the depth stencil
buffer from the opengl frame buffer, so when the d3d app sets a NULL
depth stencil disable all states that work with the depth stencil
buffer.
2007-03-06 22:17:15 +01:00
Stefan Dösinger
5f159452ef wined3d: Clearing the depth stencil buffer fails without a depth stencil buffer. 2007-03-06 22:17:03 +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
5f05906f3b wined3d: Store the number of aux buffers in the gl limits structure. 2007-03-06 22:16:25 +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
e0a271ee0c wined3d: Adjust the rhw transformation for offscreen rendering. 2007-03-06 22:15:57 +01:00
Stefan Dösinger
2cdced8193 wined3d: Adjust the rhw transformation for offscreen rendering.
When drawing processed vertices with the fixed function pipeline the
projection matrix is set up to map y values from 0 to height to 1.0;
-1.0(gl and d3d coord systems are flipped). This moves the y axis to
the bottom of the drawing area. When later on the y inversion matrix
is applied for offscreen rendering, the coordinate system will get
flipped out of the viewport.

This patch sets the Y range up upside down when using offscreen
rendering, so the invymat will flip it to the correct position. This
has to happen before the 0.375 pixel correction.
2007-03-05 15:31:36 +01:00
Stefan Dösinger
7126b63645 wined3d: Use the scissor test when clearing the full surface too.
It was incorrect to disable the scissor test for full surfaces in my
clear patch. With back buffer offscreen rendering the viewport does
not seem to restrict clearing, and with different sizes of depth
stencil and color buffer the final fantasy XI demo seems to expect the
clear to be restricted.
2007-03-05 15:31:21 +01:00
H. Verbeet
25cd1c4d28 wined3d: gl_FogFragCoord is a scalar. 2007-03-05 12:06:45 +01:00
H. Verbeet
71a0c6e482 wined3d: The texldl instruction takes 3 arguments. 2007-03-05 12:06:40 +01:00
H. Verbeet
3aaabf4e27 wined3d: Properly check the clipplane index against the limit. 2007-03-05 12:06:33 +01:00