558 Commits

Author SHA1 Message Date
Henri Verbeet
483d552e21 wined3d: Allow shader_buffer_init() to fail. 2009-07-09 11:38:02 +02:00
Henri Verbeet
40b411958b wined3d: Rename "SHADER_BUFFER" to something sane. 2009-07-09 11:37:58 +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
Tobias Jakobi
0caebe5f51 wined3d: Force NP2 constant reload in shader_arb_select. 2009-07-02 11:56:57 +02:00
Tobias Jakobi
ef280280c2 wined3d: Implement shader_arb_load_np2fixup_constants. 2009-07-02 11:56:51 +02:00
Tobias Jakobi
e29babbf6d wined3d: Add NP2 fixup code to shader_hw_sample (ARB). 2009-07-02 11:56:45 +02:00
Tobias Jakobi
034fa4268c wined3d: Add NP2 fixup code to shader_arb_generate_pshader. 2009-07-02 11:56:39 +02:00
Tobias Jakobi
ec30e9a85e wined3d: Add arb_ps_np2fixup_info structure and improve structure packing for arb_ps_compiled_shader. 2009-07-02 11:56:33 +02:00
Stefan Dösinger
c82da7d975 wined3d: Don't dirtify too many shader constants.
If we have start = 4, count = 3, the highest dirty constant is the one with index 6. start + count gives 7,
so it already includes the zero-based array correction. Don't add an additional 1.

Additionally to the inefficiency of looking at one extra constant, this causes problems if the driver
rejects loading 257 constants on the initial load. In this case no constant is loaded if
GL_EXT_gpu_program_parameters is used.
2009-07-01 13:14:34 +02:00
Henri Verbeet
40bc47901c wined3d: Use flags for driver quirks. 2009-07-01 11:41:44 +02:00
Stefan Dösinger
d4312ebb16 wined3d: Add the vertex shader footer in the main function. 2009-06-29 12:28:40 +02:00
Stefan Dösinger
5befed21f6 wined3d: Write the vshader footer in a separate function. 2009-06-29 12:28:31 +02:00
Stefan Dösinger
5859d87754 wined3d: Implement function calls with NV exts. 2009-06-29 12:28:21 +02:00
Stefan Dösinger
031401a070 wined3d: ARB*p is already on after a depth blit. 2009-06-29 12:28:13 +02:00
Stefan Dösinger
9d63585352 wined3d: Don't disable ARBfp if the replacement pipeline is used.
If the replacement pipeline is used, ARBfp is always on. Disabling it
can break shaders or the replacement pipeline, because the shader and
ffp code assumes the extension is on.
2009-06-29 12:28:06 +02:00
Henri Verbeet
7363b6e2e3 wined3d: Document GL context dependencies. 2009-06-26 12:05:07 +02:00
Stefan Dösinger
d1cd08b7b3 wined3d: Honor WINED3DSPSM_NOT in ARB. 2009-06-26 12:02:29 +02:00
Stefan Dösinger
8fb1e2acfb wined3d: Jump to the else branch if cond is false, not endif. 2009-06-26 12:02:18 +02:00
Stefan Dösinger
a07b50c94c wined3d: Support writemasks on texkill in ARB. 2009-06-26 12:02:12 +02:00
Stefan Dösinger
3a327908de wined3d: Initialize the used clip planes even if no clip emulation is used. 2009-06-26 12:02:07 +02:00
Stefan Dösinger
4d86eac60a wined3d: Unclamp vertex colors for 3.0 shaders in ARB if needed. 2009-06-26 12:02:01 +02:00
Stefan Dösinger
f69fb5c011 wined3d: POW and LOG operate on the absolute value. 2009-06-26 12:01:54 +02:00
Stefan Dösinger
bd14b6e2b4 wined3d: IFC requires GL_NV_fragment_program2. 2009-06-26 12:01:44 +02:00
Stefan Dösinger
d4854b636c wined3d: Beware of double negations. 2009-06-26 12:01:36 +02:00
Henri Verbeet
f98c6e3cff wined3d: Allow the existence of other shader types in get_loop_control_const(). 2009-06-24 11:28:50 +02:00
Henri Verbeet
943ed4e1e9 wined3d: Eliminate a redundant local variable in get_loop_control_const(). 2009-06-24 11:28:45 +02:00
Henri Verbeet
aec6d319fa wined3d: Avoid a redundant copy. 2009-06-24 11:28:38 +02:00
Henri Verbeet
fd8ebebe56 wined3d: Use a proper structure for "loop_control". 2009-06-24 11:28:33 +02:00
Henri Verbeet
4caf43ddb7 wined3d: Add some missing GL locking documentation to arb_program_shader.c. 2009-06-24 11:28:27 +02:00
Austin English
a4f2d3d18e wined3d: Fix a compiler warning. 2009-06-24 11:25:09 +02:00
Stefan Dösinger
e0ec956b3d wined3d: Fix pixelshader ifc.
The NVfp2 control flow uses the D3D syntax, and doesn't need the inversed
branch condition we're using in the vertex shader.
2009-06-23 15:53:00 +02:00
Stefan Dösinger
444b7ac7e5 wined3d: Use a local parameter for the position fixup.
I don't like that I have to do this because the posFixup is in all
vertex programs, so its at the same position and could be loaded
globally.  Unfortunately, there are only 256 env parameters usually,
which makes it impossible for any shader to use c256, even if it does
not use indirect addressing, and so we can't claim 256 constant
support.
2009-06-23 15:53:00 +02:00
Stefan Dösinger
7ffd10da28 wined3d: Find the clip texcoord before compiling.
The best is to put this together with the rest of the shader_arb_priv initialization.
2009-06-23 15:53:00 +02:00
Stefan Dösinger
e64d48371f wined3d: Add a function to control use of NV_vp2 clipplanes.
I find it helpful for debugging to have this controlled at a central place,
without having to disable the entire GL extension or manually find all the
places where GL_SUPPORT(NV_VERTEX_PROGRAM2_OPTION) controls clipplane use. It
is useful for debugging the emulation code on NV cards and for debugging mac
driver issues.
2009-06-23 15:53:00 +02:00
Stefan Dösinger
85af0b2943 wined3d: Don't emulate clipplanes with ffp vp and fix a wrong if condition.
b2f09fd20421d0a5e179b42332ca63bc5ac17d8a accidentally got the
device->vs_clipping check wrong. The FFP replacement should emulate
clipping if GL can't do this natively with vertex shaders, not the
other way. Also don't emulate clipping if we're using fixed function
vertex processing because (a) clipping is always supported by GL in
this case, and (b), fragment.texcoord[7] is undefined. (Or in the
worst case set to something bad by the app).
2009-06-23 15:53:00 +02:00
Henri Verbeet
114b5bdefb wined3d: Fix a comment.
This was actually broken by 122af07a3034ddd2e0e74d9166df442a0e263e9a.
2009-06-23 11:48:10 +02:00
Gerald Pfeifer
569b448e13 wined3d: Fix logical condition in find_clip_texcoord(). 2009-06-22 13:25:27 +02:00
Stefan Dösinger
3845b37a21 wined3d: Advertise SM 3.0 in ARB if the extensions are available. 2009-06-22 11:27:11 +02:00
Stefan Dösinger
e211a0b4a4 wined3d: Enable Shader Model 2.0 in ARB.
If the needed constants are available, we can support all vs_2_0 and ps_2_0
requirements with the plain ARB extensions. We cannot however, run SM 2.0a or
SM 2.0b.
2009-06-22 11:27:05 +02:00
Stefan Dösinger
e1c6b73e2d wined3d: Make the ARB index offset work with emulated MOVA. 2009-06-22 11:26:57 +02:00
Stefan Dösinger
77820d5ea5 wined3d: XXXC CC doesn't work even with NV_FP2 on. 2009-06-22 11:26:50 +02:00
Stefan Dösinger
26d17fe04c wined3d: Implement MRTs in ARB. 2009-06-22 11:26:43 +02:00
Stefan Dösinger
bb8bcf5878 wined3d: Reload the first 8 constants on a 1.x and != 1.x ps switch.
ps 1.x constants are clamped to [-1;1], constants in >= 2.0 pshaders
are not. This means we have to reload constants when switching between
those shader types in ARB. In GLSL this is not a concern because
constants are tied to program objects and are reloaded on a shader
change anyway.
2009-06-22 11:26:33 +02:00
Stefan Dösinger
2364ce08e5 d3d9: Add a SGN test. 2009-06-22 11:26:14 +02:00
Stefan Doesinger
b2f09fd204 wined3d: Emulate clipplanes in ARB if the NV extensions are not available.
This patch tries to find a free texture coordinate to load up to 4 clip
coordinates into the pixel shader, and uses KIL to throw away fragments
that are cut by a clipplane. If no free texture coordinate is found,
clipping is not done. If more than 4 clipplanes are used, only the first
4 are actually enabled. That should be pretty rare though.
2009-06-19 14:54:00 +02:00
Stefan Doesinger
7baf7c6518 wined3d: Implement vertex texture fetch in ARB. 2009-06-19 14:53:50 +02:00
Stefan Doesinger
f1e97cdfbc wined3d: Don't run out of varyings because of clipplanes. 2009-06-19 14:53:43 +02:00
Stefan Doesinger
b53b5909ff wined3d: Handle SM 3.0 varyings in ARB. 2009-06-19 14:53:20 +02:00
Stefan Doesinger
3aaa530ca9 wined3d: Properly load the y correction. 2009-06-18 15:17:26 +02:00