Commit Graph

361 Commits

Author SHA1 Message Date
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
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
H. Verbeet e7d0ef72ba wined3d: Use dst_fbo to do the depth blit.
This makes the depth copy independent of the currently attached render
targets. This is important for the next patch because it might do a
depth copy when the render targets aren't in a valid configuration
(SetDepthStencilSurface()).
2008-07-03 11:50:51 +02:00
H. Verbeet c433562a68 wined3d: Explicitly enable depth buffer writing in depth_blt().
This prevents conflicts with WINED3DRS_ZWRITEENABLE.
2008-06-25 10:43:08 +02:00
Ben Mayhew a3f503f876 wined3d: Only display Missing vbo streams fixme once. 2008-05-12 11:41:59 +02:00
Andrew Talbot 0de14c37e5 wined3d: Remove unused variables. 2008-04-30 10:25:47 +02:00
Austin English 6e59cd2c34 Spelling fixes. 2008-04-22 12:20:12 +02:00
Alexander Dorofeyev 35979b920a wined3d: Prevent console spamming in drawPrimitive. 2008-04-21 14:22:42 +02:00
Alexander Dorofeyev 7c8b8e0a93 wined3d: Set isInDraw later in drawPrimitive.
This should fix the problem that in LoadLocation SFLAG_INTEXTURE path gl calls 
can be made without activating context, due to isInDraw checks.
2008-04-08 13:20:34 +02:00
Rico Schüller a44da70d63 wined3d: Improve drawStridedInstanced(). 2008-04-07 21:20:07 +02:00
Alexander Dorofeyev 5ccf91b705 wined3d: LEAVE_GL when exiting with error in tesselate_rectpatch. 2008-04-07 21:17:49 +02:00
Stefan Dösinger b1d8af7926 wined3d: Update copyright lines. 2008-04-02 20:22:42 +02:00
Alexander Dorofeyev 3d2bdf52cd wined3d: Handle zero primitive count. 2008-03-24 20:40:13 +01:00
Stefan Dösinger 1424e7fd09 wined3d: Make Clear aware of the depth stencil sharing. 2008-02-05 12:37:01 +01:00
Stefan Dösinger 3d2aa7afa0 wined3d: De-Statify depth blit opengl resources. 2008-02-05 12:33:15 +01:00
Andrew Talbot b3a58a2486 wined3d: Remove unneeded casts. 2008-01-24 11:41:36 +01:00
Austin English 3471f841a1 wined3d: Spelling fixes. 2008-01-18 12:53:33 +01:00
Stefan Dösinger b5f925cae0 wined3d: Implement half float vertex buffer conversion. 2007-12-21 13:13:56 +01:00
Stefan Dösinger aaa0e5090a wined3d: Add a test for 16 bit floats. 2007-12-20 12:10:16 +01:00
Stefan Dösinger 2d90449500 wined3d: Fixed function vertex attribute types are flexible. 2007-12-20 10:49:42 +01:00
Stefan Dösinger a3c2fb9e64 wined3d: Store if half float conversion is needed in the decl. 2007-12-20 10:48:16 +01:00
Stefan Dösinger 7a1d35e513 wined3d: Emulate half float vertices if GL_NV_half_float is not there. 2007-12-19 12:19:27 +01:00
Michael Stefaniuc a526ad6cbc wined3d: Fix a "ordered comparison of pointer with integer zero". 2007-12-11 14:59:54 +01:00
Gerald Pfeifer f4ec0a209b wined3d: Fix error handling in fixed_get_input(). 2007-12-05 13:47:10 +01:00
Stefan Dösinger e4f8a2da2b wined3d: Depth stencil fixes. 2007-11-14 11:58:36 +01:00
Stefan Dösinger 948292dbc3 wined3d: Move texture -> drawable blits to LoadLocation. 2007-11-01 12:37:43 +01:00
Stefan Dösinger dcff7dc213 wined3d: Begin centralizing surface location management. 2007-10-26 15:17:19 +02:00
Stefan Dösinger 4c51db896c wined3d: Check for NULL streams. 2007-09-20 15:53:19 +02:00
Stefan Dösinger 282696b4f6 wined3d: Supply texture coords even if no texture is bound and pshaders are used. 2007-08-31 19:32:46 +02:00
Stefan Dösinger 643d1e8847 wined3d: Tidy up the vbo removal from the strided data. 2007-08-30 11:57:18 +02:00
Stefan Dösinger 8c9c084004 wined3d: Use 0/0/0 as normal if no normal is supplied. 2007-08-30 11:57:18 +02:00
Stefan Dösinger 4779a27eed wined3d: Remove the D3DTTFF_PROJECTED handling from drawStridedSlow. 2007-08-28 11:55:33 +02:00
Stefan Dösinger fe0f0eb48a wined3d: Some texture transform fixes. 2007-08-27 18:28:43 +02:00
Stefan Dösinger 6ec6c941fa wined3d: BaseVertexIndex can be negative. 2007-08-27 12:00:42 +02:00
Stefan Dösinger 98bc83be7c wined3d: Fall back to drawStridedSlow if fog coords are used. 2007-08-23 13:33:22 +02:00
H. Verbeet 3c609c11e7 wined3d: UBYTE4 data shouldn't be normalized. 2007-08-20 22:24:48 +02:00
Hernan Rajchert 6aead911fb wined3d: Fixed error message when glDrawElement fails. 2007-08-13 11:32:07 +02:00
Stefan Dösinger b8dd5839ef wined3d: Store the position_transformed flag in the vdecl. 2007-08-08 15:32:00 +02:00
Stefan Dösinger 06e51c21e1 wined3d: Determine used streams at vdecl creation. 2007-08-08 15:32:00 +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 82245cb5d7 wined3d: Properly load FLOAT16_2 and FLOAT16_4 vertex data. 2007-08-02 12:18:41 +02:00
Francois Gouget 5266e57975 Assorted spelling fixes. 2007-07-31 21:37:50 +02:00
H. Verbeet e652128fdf wined3d: Pass the correct target to glMultiTexCoord. 2007-07-25 13:02:44 +02:00
H. Verbeet fc4c73902a wined3d: Trace the declaration element type in primitiveDeclarationConvertToStridedData(). 2007-07-24 11:25:52 +02:00
Stefan Dösinger 97cd8bab1b wined3d: Print the fixed and unfixed vertex warning only when needed. 2007-07-10 13:30:42 +02:00
Stefan Dösinger 26ebe396c3 wined3d: Implement high order patches. 2007-07-06 19:32:47 +02:00
H. Verbeet 5b7758f80c wined3d: Increase the sizes of texturing related arrays, in order to support vertex textures. 2007-06-26 11:57:17 +02:00
H. Verbeet 440ca84680 wined3d: Fix various incorrect uses of GL_LIMITS(texture_stages) and GL_LIMITS(sampler_stages). 2007-06-22 12:19:10 +02:00
H. Verbeet c60bdca5b0 wined3d: Make use of the texUnitMap in drawStridedSlow as well. 2007-06-21 13:10:40 +02:00
Stefan Dösinger b081cbaf40 wined3d: Emulate tracking of multiple material properties. 2007-06-21 13:09:30 +02:00
Stefan Dösinger 030b92a2f6 wined3d: Remove the FVF codepath from drawprim. 2007-06-21 13:09:08 +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
H. Verbeet 45b531fcea wined3d: Make sure the color buffer is not modified by depth_blt(). 2007-06-06 12:10:39 +02:00
Stefan Dösinger adb9b13b81 wined3d: Implement vertex blending using GL_ARB_vertex_blend. 2007-05-03 14:24:46 +02:00
Bernd Buschinski aff22d0472 wined3d: Fix drawStridedSlow typo. 2007-04-18 13:13:17 +02:00
H. Verbeet 8d3c078e6c wined3d: Disable the scissor test for depth blits. 2007-04-10 21:39:32 +02:00
H. Verbeet c9b178b594 wined3d: Fixup FBO depth attachments when the depth attachment is larger than the render target. 2007-04-09 12:39:23 +02:00
H. Verbeet 3d4e054b55 wined3d: Handle FBO attachments slightly more efficiently. 2007-04-09 12:38:53 +02:00
Stefan Dösinger a9e04dd87f wined3d: Index buffer data is unsigned. 2007-04-07 10:58:25 +02:00
Fabian Bieler 7cedd56d24 wined3d: Implement linear fog with pixel shader. 2007-03-23 12:30:23 +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
H. Verbeet 30ee071eb9 wined3d: Disable vertex shaders when transformed vertices are used. 2007-03-13 11:55:55 +01:00
H. Verbeet b22ca33a85 wined3d: 11 space indent is ugly. 2007-03-13 11:54:08 +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 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 2a90bc2c7a wined3d: Remove dead code from drawprim.c. 2007-02-21 10:57:50 +01:00
Stefan Dösinger fb1469c47d wined3d: Do not print the fixed / unfixed vertices warning with shaders. 2007-02-21 10:55:14 +01:00
Stefan Dösinger a9d681c3ad wined3d: With FVFs only one stream is used. 2007-02-20 11:50:26 +01:00
Stefan Dösinger 59ae2a56fb wined3d: Use VBOs for index buffers. 2007-02-20 11:50:10 +01:00
H. Verbeet 498f9c507a wined3d: Use WINED3DSTREAMSOURCE_INSTANCEDATA rather than D3DSTREAMSOURCE_INSTANCEDATA. 2007-02-15 11:15:25 +01:00
Stefan Dösinger 0feddccfe3 wined3d: Instancing emulation. 2007-02-14 20:46:25 +01:00
H. Verbeet 32e5cac2be wined3d: Get rid of the vertexDeclaration field in IWineD3DVertexShaderImpl. 2007-02-14 13:54:29 +01:00
H. Verbeet 8f0884066f wined3d: Add WINED3DDECLUSAGE, use it. 2007-02-14 13:50:22 +01:00
Stefan Dösinger 8cae0e4d07 wined3d: Dirtify the render targets, not the primary swapchain on draws. 2007-02-14 12:27:23 +01:00
Stefan Dösinger c1623d4e7b wined3d: Use the context manager to prepare for drawing. 2007-02-13 12:03:40 +01:00
Stefan Dösinger 380930dc54 wined3d: Store dirty states per context. 2007-02-13 11:55:07 +01:00
Stefan Dösinger c739c387b6 wined3d: Add a per context structure for context management. 2007-02-13 11:50:14 +01:00
Stefan Dösinger 354fdae524 wined3d: Implement per stream offsets. 2007-01-17 11:24:04 +01:00
Stefan Dösinger 1d3abdeeaa wined3d: Store the stream number in the strided structure. 2007-01-17 11:23:54 +01:00
Stefan Dösinger 71f923a6d2 wined3d: Improve drawStridedSlow a bit. 2007-01-17 11:23:41 +01:00
Stefan Dösinger 9b4920996e wined3d: Move material applying to the state table. 2007-01-10 22:00:34 +01:00
Stefan Dösinger dfeb40cbff wined3d: Remove the invymat from drawprim.c. 2007-01-10 22:00:25 +01:00
Stefan Dösinger 329670c7f1 wined3d: Do not reset the material. 2007-01-10 22:00:17 +01:00
Stefan Dösinger 9f2e0fa2e0 wined3d: Do not try to read the vertex decl when the stateblock isn't finalized. 2007-01-08 21:00:14 +01:00
Stefan Dösinger d47ec21280 wined3d: Vertex buffers can use the declaration from the device. 2007-01-08 20:59:57 +01:00
Stefan Dösinger b310e98693 wined3d: Clean up drawprim a bit. 2007-01-08 20:59:38 +01:00
Stefan Dösinger 09ab812e79 wined3d: Avoid negative draw start indices. 2007-01-08 20:58:11 +01:00
Stefan Dösinger 8e37fcd266 wined3d: Move applying shader constants to the state table. 2007-01-08 20:57:57 +01:00
Stefan Dösinger 799770b992 wined3d: Apply shaders in their state handlers. 2007-01-08 20:56:51 +01:00
Stefan Dösinger 7e314011fb wined3d: Move debugging fixmes from drawprim to the stream source handler. 2007-01-08 20:56:36 +01:00
Stefan Dösinger 27bac24acb wined3d: Re-add the fixed function stream source trace. 2007-01-08 20:56:06 +01:00
Stefan Dösinger d5f18e6a63 wined3d: Move applying the gl stream sources to the state table. 2007-01-08 20:55:51 +01:00
Stefan Dösinger e26e3ee5f3 wined3d: Remove d3ddevice_set_ortho. 2007-01-03 11:19:55 +01:00
Stefan Dösinger 82bd0790ed wined3d: Move the projection matrix into its own state. 2007-01-03 11:19:45 +01:00
Stefan Dösinger 20de200fa3 wined3d: Move the functionality of primitiveInitState to the state table. 2007-01-03 11:17:08 +01:00
Stefan Dösinger 438c172841 wined3d: Move decoding the vertex declaration to the vertexshader state handler. 2007-01-03 11:10:01 +01:00
Stefan Dösinger 04ce141940 wined3d: Pass the user pointer strided structure via the device implementation. 2007-01-03 11:03:03 +01:00
Stefan Dösinger 71631f7638 wined3d: Use the baseVertexIndex in the stateblock. 2007-01-03 11:02:51 +01:00
Stefan Dösinger 091f9c28e4 wined3d: Put the decoded strided data structure into the device. 2007-01-02 12:29:04 +01:00
H. Verbeet bf250285ff wined3d: Restore texture bindings in the FBO code. 2006-12-26 12:37:38 +01:00
H. Verbeet d6010edee0 wined3d: Copy the depth buffer after all dirty states are applied. 2006-12-26 12:37:29 +01:00
Stefan Dösinger 22e2a5aca5 wined3d: Add pixel shaders to the state table. 2006-12-20 17:09:21 +01:00
Stefan Dösinger 666b507766 wined3d: Move samplers to the state table. 2006-12-20 17:07:56 +01:00
Stefan Dösinger bd6a6ad2c0 wined3d: Move WINED3DTSS_ALPHAOP to the state table. 2006-12-20 17:06:10 +01:00
Stefan Dösinger 762af471e8 wined3d: Move WINED3DTSS_COLOROP to the state table. 2006-12-20 17:06:00 +01:00
Stefan Dösinger 1e264e5dd4 wined3d: Temporary disable nvrc junk texture skipping. 2006-12-20 17:05:11 +01:00
Stefan Dösinger 062b6ffc5c wined3d: Catch nop render state changes. 2006-12-19 16:53:18 +01:00
Stefan Dösinger 7532c759f1 wined3d: Add the state dirtification infrastructure. 2006-12-19 16:53:00 +01:00
Dmitry Timoshkov 47ffd7ae95 wined3d: Make some data const. 2006-12-14 20:11:41 +01:00
Markus Amsler c40501db50 Revert "d3d: Remove AddRef from IWineD3DDevice_GetSwapChain.".
This reverts commit f84f687e6d.
2006-11-30 16:03:59 +01:00
H. Verbeet 8a7f427948 wined3d: Select the right shader backend when creating the device. 2006-11-28 12:19:27 +01:00
H. Verbeet df6f482a69 wined3d: Move some code specific to the different shader backends into the respective source files. 2006-11-28 12:19:19 +01:00
Markus Amsler f84f687e6d d3d: Remove AddRef from IWineD3DDevice_GetSwapChain. 2006-11-22 11:40:50 +01:00
H. Verbeet 9d6f22002c wined3d: Only copy the depth buffer if there is one. 2006-11-20 11:50:14 +01:00
H. Verbeet 8afe27dacd wined3d: Fix GL_ARB_texture_cube_map extension support. 2006-11-20 11:50:14 +01:00
H. Verbeet ef2c062c09 wined3d: Allow the depth buffer to be shared between onscreen and offscreen rendering modes. 2006-11-17 18:14:25 +01:00
H. Verbeet 6d66085150 wined3d: Add FBO support for offscreen rendering. 2006-11-17 18:14:13 +01:00
H. Verbeet 9bf04ecd03 wined3d: Rename renderUpsideDown to render_offscreen. 2006-11-17 15:53:52 +01:00
Ivan Gyurdiev 875a1eb02d wined3d: Add D3DFVF codes to the WINED3D namespace. 2006-10-31 12:09:06 +01:00
Ivan Gyurdiev 4eced8ea24 wined3d: Add D3DFOGMODE to the WINED3D namespace. 2006-10-30 12:05:24 +01:00