Commit Graph

399 Commits

Author SHA1 Message Date
Henri Verbeet 4ff5736edf wined3d: Don't compare texUnitMap entries to -1. 2009-03-09 14:39:34 +01:00
Henri Verbeet a3df476706 wined3d: Buffer object ID's are supposed to be unsigned. 2009-03-09 14:39:18 +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
Stefan Dösinger 6012475e59 wined3d: Properly update last_was_pshader. 2009-02-24 16:57:30 +01:00
Henri Verbeet 828f42cb1f wined3d: Add some traces to state handlers.
Should make it a bit clearer what's happening in some cases.
2009-02-19 12:53:44 +01:00
Stefan Dösinger 4386a827e9 wined3d: Pass the requested srgb flag to PreLoad.
Add a new wined3d-internal PreLoad function to textures and surfaces
that takes a parameter specifying wether the rgb or srgb texture
should be loaded.
2009-02-17 12:51:36 +01:00
Stefan Dösinger c585b4de99 wined3d: Duplicate GL textures for srgb switching.
This reduces the number of srgb switching reloads quite a lot. The only
situation in which a reload is needed is if the rgb copy is modified on the GL
side and the srgb copy is needed.
2009-02-17 12:48:05 +01:00
Henri Verbeet bae1ec98ca wined3d: Don't use drawStridedFast() for drawing pretransformed vertices.
This was exposed by adding EXT_vertex_array_bgra support, previously we would
almost never hit this because color data being present would already prevent
us from using drawStridedFast(). Thanks to Stefan for spotting this.
2009-01-23 13:12:58 +01:00
Henri Verbeet 0cc5f0d3eb wined3d: Don't use drawStridedFast() when pointsize data is present. 2009-01-23 13:12:52 +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
Stefan Dösinger 50109aa969 wined3d: Get rid of last_was_foggy_shader & friends.
The fog settings do not depend on wether the shader writes to oFog or not,
instead they depend on the FOGVERTEXMODE and FOGTABLEMODE settings, and if a
vertex shader is bound at all.

It works the same way as with the fixed function, and having a vertex shader
is the same as using pretransformed vertices, just that the fog coord comes
from the shader instead of the specular color:

FOGTABLEMODE != NONE: The Z coord is used, oFog is ignored
FOGTABLEMODE == NONE, with VS: oFog is used
FOGTABLEMODE == NONE, no VS, XYZ: Z is used
FOGTABLEMODE == NONE, no VS, XYZRHW: diffuse color is used
2009-01-20 12:45:40 +01:00
Henri Verbeet 44240eff27 wined3d: Remove some comments. 2009-01-15 12:43:32 +01:00
Stefan Dösinger 365e1f3b07 wined3d: Avoid hooking non-fog glEnable/glDisable calls.
This prevents fallout from the GL_EXT_fog_coord emulation. glEnable
and glDisable calls other than those that change GL_FOG are not
hooked. The glEnableWINE and glDisableWINE functions can be used to
add other hooks too if ever needed.
2009-01-12 13:03:47 +01:00
Stefan Dösinger 1deafcb5a7 wined3d: Split the remains of state_fog. 2009-01-12 13:02:49 +01:00
Stefan Dösinger 061087811f wined3d: Remove the apply_pshader_fog state handler.
The fog doesn't depend on pixel shaders any longer(but still vice
versa), so we don't need this state any more.
2009-01-12 13:02:39 +01:00
Stefan Dösinger 2dd18635c9 wined3d: Move fogdensity and fogcolor to the fragment pipeline. 2009-01-12 13:02:29 +01:00
Stefan Dösinger 7c21147dcd wined3d: Remove the pixelshader fogstart/fogend optimization. 2009-01-12 13:01:49 +01:00
Allan Tong 29dd286d79 wined3d: Add code to cleanup device multistate_funcs. 2009-01-10 17:43:11 +01:00
Henri Verbeet 92488ca7c1 wined3d: Simplify checking if an attribute is used in loadNumberedArrays(). 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 cc447eac55 wined3d: Move position_transformed out of u.s in struct WineDirect3DVertexStridedData. 2009-01-08 13:21:31 +01:00
Henri Verbeet a8697d90e4 wined3d: Renumber WINED3DTEXTURESTAGESTATETYPE enum elements.
Saves some space by not having unused entries is the arrays tracking these
states.
2009-01-06 12:45:43 +01:00
Henri Verbeet 29a0d06518 wined3d: Convert some BOOLs to bitfields in struct IWineD3DDeviceImpl.
Also fills a 3 byte hole.
2008-12-31 12:26:33 +01:00
Henri Verbeet 3f12f59aa4 wined3d: Convert some BOOLs to bitfields in struct WineD3DContext.
Also happens to fill two 3 byte holes.
2008-12-31 12:26:23 +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 690cbe76ac wined3d: Make pixelshaders disable fog properly.
This is a first step towards cleaning up the fog mess. The fog
parameter is added to the pixelshader compile args structure. That way
multiple pshaders are compiled for different fog settings, and the
pixel shader can remove the fog line if fog is not enabled. That way
we don't need special fog start and end settings, and this allows us
to implement EXP and EXP2 fog in the future too.
2008-12-19 17:17:16 +01:00
Stefan Dösinger 31da3c0578 wined3d: Emulate GL_EXT_fog_coord. 2008-12-16 14:34:11 +01:00
Stefan Dösinger 199a3468bf wined3d: Fake GL_ARB_multitexture. 2008-12-16 14:31:25 +01:00
Henri Verbeet 143fb431e0 wined3d: Fix use_vs() usage in vertexdeclaration(). 2008-12-16 12:52:10 +01:00
Henri Verbeet f3743fb402 wined3d: Shaders will never have a NULL function. 2008-12-16 12:52:04 +01:00
Henri Verbeet 8553665cb1 wined3d: Move the shader version to reg_maps. 2008-12-15 14:00:26 +01:00
Stefan Dösinger c0a715977d wined3d: Remove a blank line in state.c. 2008-12-15 12:24:52 +01:00
Henri Verbeet 70ed814b95 wined3d: Get rid of the textureDimensions field in the state block. 2008-12-12 11:40:32 +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 5ad3bbabda wined3d: Avoid disabling numbered arrays if we're going to enable them afterwards anyway. 2008-12-08 12:28:31 +01:00
Henri Verbeet 74acbf9c16 wined3d: Get rid of vcheckGLcall.
Everywhere it's used a regular checkGLcall will do just as well.
2008-12-04 12:00:29 +01:00
Henri Verbeet 89139b7589 wined3d: Make shader texture format fixups more generic.
Based on a patch by Stefan Dösinger. This is more flexible, and allows
the shader backend implementation to be simpler, since it doesn't have
to know about specific formats. The next patch makes use of this.
2008-12-04 11:59:58 +01:00
Henri Verbeet b451048eb7 wined3d: Move GlPixelFormatDesc to wined3d_private.h where it belongs.
Also remove the silly typedef.
2008-12-04 11:59:06 +01:00
Alexandre Julliard 6800d3dbb7 wined3d: Fix some macros definitions to make them proper C statements. 2008-12-03 10:03:45 +01:00
Alexandre Julliard 9c306e9871 wined3d: Make some functions and variables static. 2008-12-02 15:31:17 +01:00
Henri Verbeet 7c0cb8c0c3 wined3d: Const correctness fixes for state.c. 2008-12-02 14:04:08 +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 21b8535902 wined3d: Make the lpData member of WineDirect3DStridedData const. 2008-12-01 12:45:23 +01:00
Henri Verbeet d8f6e63541 wined3d: Const correctness fixes for arb_program_shader.c. 2008-11-26 12:05:14 +01:00
Stefan Dösinger ff767f4984 wined3d: Make the shader backend call CompileShader.
A number of considerations contribute to this:

1) The shader backend knows best which shader(s) it needs. GLSL needs
both, arb only one
2) The shader backend may pass some parameters to the compilation
code(e.g. which pixel format fixup to use)
3) The structures used in (2) are different in vs and ps, so a
baseshader::Compile won't work
4) The structures in (2) are wined3d-private structures, so
having a public method in the vtable won't work(its a bad idea
anyway).
2008-11-25 13:06:23 +01:00
Stefan Dösinger cd011661e6 d3d9: Test psize_min vs psize_max vs psize behavior.
Add a test that checks what happens if D3DRS_POINTSIZE, D3DRS_POINTSIZE_MIN
and POINTSIZE_MAX have conflicting values. D3DRS_POINTSIZE_MAX trumps
D3DRS_POINTSIZE_MIN, and both MIN and MAX clamp the D3DRS_POINTSIZE value if it is
outside of their range.
2008-11-20 12:17:18 +01:00
Stefan Dösinger 620a423b22 wined3d: Kill the GL_ATI_envmap_bumpmap code.
GL_ATI_envmap_bumpmap provides two things: Signed V8U8 pixel formats,
and bump mapping. The extension is only supported on fglrx, and this
driver also supports GL_ARB_fragment_program.  Thus the bump mapping
code is never used on any driver out there.  Furthermore, if it is
used, it tends to crash the driver

The signed pixel format is used, as it can be used by pixel shaders or
the ARBfp replacement. However, the format is broken in fglrx, and
negative values are clamped to 0.0. This results in test
failures. WineD3D has an alternative codepath using scale+bias to
enable V8U8 using a standard signed RGB which works correctly on
fglrx.
2008-11-04 11:41:14 +01:00
Tobias Jakobi e79d89ff40 wined3d: Fix some typos. 2008-10-21 11:53:40 +02:00
Alexandre Julliard 6cfef95ce7 wined3d: Convert source files to utf-8. 2008-10-18 19:21:20 +02:00
Henri Verbeet 9e3b9f8b41 wined3d: Add a checkGLcall() at the end of loadTexCoords().
To prevent GL errors in loadTexCoords from showing up in different state handlers
2008-09-17 20:50:04 +02:00