H. Verbeet
48f82d3f5e
wined3d: Fix pshader_glsl_tex() and pshader_glsl_texcoord().
2007-01-16 16:13:10 +01:00
H. Verbeet
c3bfef8d7e
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_callnz().
2007-01-16 16:12:46 +01:00
H. Verbeet
50e0deafca
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_breakc().
2007-01-16 16:12:37 +01:00
H. Verbeet
f593cd0de8
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_ifc().
2007-01-16 16:12:26 +01:00
H. Verbeet
a89edf1be9
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_if().
2007-01-16 16:12:18 +01:00
H. Verbeet
9f22df26ef
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_rep().
2007-01-16 16:12:11 +01:00
H. Verbeet
2cb49c67db
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_loop().
...
Fix the comment.
2007-01-16 16:12:02 +01:00
H. Verbeet
cf1a3cc81a
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texm3x3vspec().
...
Use shader_glsl_get_sample_function().
Use the GLSL builtin reflect() function.
2007-01-16 16:11:45 +01:00
H. Verbeet
f0fb61daed
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texm3x3spec().
...
Use shader_glsl_get_sample_function().
2007-01-16 16:11:26 +01:00
H. Verbeet
ba1740909e
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texm3x3().
2007-01-16 16:11:13 +01:00
H. Verbeet
b26fae9a25
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texm3x3tex().
...
Use shader_glsl_get_sample_function().
2007-01-16 16:11:02 +01:00
H. Verbeet
950783d4fd
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texm3x2tex().
2007-01-16 16:10:43 +01:00
H. Verbeet
92ab90eee8
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texm3x3pad().
2007-01-16 16:10:34 +01:00
H. Verbeet
459e0bf633
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texm3x2pad().
2007-01-16 16:10:23 +01:00
H. Verbeet
04144983eb
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texm3x2depth().
2007-01-16 16:10:17 +01:00
H. Verbeet
1947b27380
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texdp3().
2007-01-16 16:10:07 +01:00
H. Verbeet
3cd84d9ab6
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texdp3tex().
2007-01-16 16:10:01 +01:00
H. Verbeet
0fcb682af6
wined3d: Rewrite pshader_glsl_texreg2rgb to properly take the write mask into account.
...
Use shader_glsl_get_sample_function() rather than having the instruction handler figure it out itself.
Get rid of shader_glsl_add_dst_old().
2007-01-16 16:09:50 +01:00
H. Verbeet
67e203215f
wined3d: Split out getting the sample function and coordinate mask from shader_glsl_sample().
2007-01-16 16:09:23 +01:00
H. Verbeet
54137bacfa
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texreg2gb().
2007-01-16 16:09:09 +01:00
H. Verbeet
8325937ded
wined3d: Pass the correct mask to shader_glsl_add_src_param() in pshader_glsl_texreg2ar.
...
Use the correct source swizzle.
2007-01-16 16:08:58 +01:00
H. Verbeet
7d07f31045
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_dst().
2007-01-16 16:08:35 +01:00
H. Verbeet
146093af33
wined3d: Rewrite shader_glsl_rcp() to properly take the write mask into account.
2007-01-16 16:08:19 +01:00
H. Verbeet
9857158a99
wined3d: Rewrite shader_glsl_expp() to properly take the write mask into account.
2007-01-16 16:08:08 +01:00
H. Verbeet
2c60906ec4
wined3d: Rewrite shader_glsl_cnd() to properly take the write mask into account.
...
Take the difference between ps 1.4 and earlier versions into account.
2007-01-16 16:07:56 +01:00
H. Verbeet
693b6ef876
wined3d: Rewrite shader_glsl_cmp() to properly take the write mask into account.
2007-01-16 16:07:44 +01:00
H. Verbeet
1414d75a3f
wined3d: Rewrite shader_glsl_lrp() to properly take the write mask into account, use the GLSL mix instruction.
2007-01-16 16:07:35 +01:00
H. Verbeet
e0588e7475
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_lit().
2007-01-16 16:07:15 +01:00
H. Verbeet
cb5c47f8fe
wined3d: Rewrite shader_glsl_mov() to properly take the write mask into account.
...
In case of writing to an address register round the source.
2007-01-16 16:07:05 +01:00
H. Verbeet
9425aef623
wined3d: Rewrite pshader_glsl_dp2add() to properly take the write mask into account.
2007-01-16 16:06:37 +01:00
H. Verbeet
f3a4d35dee
wined3d: Rewrite shader_glsl_dot() to properly take the write mask into account.
2007-01-16 16:06:25 +01:00
H. Verbeet
b3ff0c3703
wined3d: Rewrite shader_glsl_map2gl() to properly take the write mask into account.
2007-01-16 16:06:11 +01:00
H. Verbeet
7252b4d340
wined3d: Give WINED3DSIO_CRS its own function, properly take the write mask into account.
2007-01-16 16:05:49 +01:00
H. Verbeet
b557a8021a
wined3d: Move WINED3DSIO_SGE & WINED3DSIO_SLT from shader_glsl_map2gl() to shader_glsl_compare() where they belong.
...
Properly take the write mask into account
2007-01-16 16:04:18 +01:00
H. Verbeet
e0f0bf1d08
wined3d: Rewrite shader_glsl_mad() to properly take the write mask into account.
2007-01-16 16:03:59 +01:00
H. Verbeet
b0fd23e844
wined3d: Rewrite shader_glsl_arith() to properly take the write mask into account.
2007-01-16 16:03:50 +01:00
H. Verbeet
4452120007
wined3d: Rewrite shader_glsl_sincos() to properly take the write mask into account.
...
The write mask can only be one of .x, .y, .xy
2007-01-16 16:03:38 +01:00
H. Verbeet
dc0d2a27f1
wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_get_register_name().
2007-01-16 16:03:25 +01:00
H. Verbeet
b8bc92dc7b
wined3d: Pass a mask to shader_glsl_add_src_param().
2007-01-16 16:03:15 +01:00
H. Verbeet
1bfc08e081
wined3d: Rename shader_glsl_add_dst() to shader_glsl_add_dst_old(), add shader_glsl_append_dst().
2007-01-16 16:02:41 +01:00
H. Verbeet
b28bd67fd9
wined3d: Fixup the write mask for gl_FogFragCoord and gl_PointSize.
...
gl_FogFragCoord and gl_PointSize are floats rather than vec4s in GLSL,
so they shouldn't have a destination swizzle, and the write mask we
return should consist of only the first component.
2007-01-16 16:02:21 +01:00
H. Verbeet
16cf41413b
wined3d: Return the (binary) write mask from shader_glsl_add_dst_param().
2007-01-16 16:02:13 +01:00
H. Verbeet
9f4f02b5fb
wined3d: Split shader_glsl_add_param() in shader_glsl_add_src_param() and shader_glsl_add_dst_param().
2007-01-16 16:02:06 +01:00
H. Verbeet
aa4d88d6f8
wined3d: Add a comment about D3D write masks and GLSL destination swizzles.
2007-01-16 16:01:55 +01:00
Christoph Bumiller
d905795503
wined3d: Sampler variables wrongly named 'shader'.
2007-01-03 11:01:26 +01:00
Alexandre Julliard
d46d7d13ab
Revert "wined3d: Simplify the get_write_mask and get_swizzle functions."
...
This reverts commit a9f658f6a6
.
2007-01-02 13:21:47 +01:00
H. Verbeet
a9f658f6a6
wined3d: Simplify the get_write_mask and get_swizzle functions.
2006-12-29 20:56:16 +01:00
H. Verbeet
0fae42da50
wined3d: Cleanup shader_glsl_get_input_register_swizzle().
2006-12-29 20:55:51 +01:00
H. Verbeet
2b9a63b5d1
wined3d: Cleanup shader_glsl_get_output_register_swizzle().
2006-12-29 20:55:25 +01:00
H. Verbeet
a22933e08e
wined3d: The default debug channel for arb_program_shader.c & glsl_shader.c already is d3d_shader.
2006-12-28 12:18:09 +01:00
H. Verbeet
c972351051
wined3d: Move set_glsl_shader_program() to glsl_shader.c.
2006-12-28 12:17:49 +01:00
H. Verbeet
e4fc45e0fe
wined3d: Allow wined3d to handle multiple render targets.
2006-12-20 12:32:30 +01:00
Dmitry Timoshkov
47ffd7ae95
wined3d: Make some data const.
2006-12-14 20:11:41 +01:00
H. Verbeet
533dcbf170
wined3d: Use the texture sampling function in a few more instructions (GLSL).
2006-11-28 12:22:32 +01:00
H. Verbeet
ac651a7058
wined3d: Fix the texm3x3tex instruction to sample properly.
2006-11-28 12:19:48 +01:00
H. Verbeet
e7122e9a79
wined3d: Create a separate function for sampling a texture.
2006-11-28 12:19:39 +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
Kovács András
eb7b1f4bce
wined3d: Fix introduced regression in shader_glsl_mnxn and vshader_hw_mnxn.
2006-10-30 20:37:34 +01:00
Ivan Gyurdiev
ce2e980d1b
wined3d: Add shader version/end masks to the WINED3D namespace.
2006-10-13 11:15:45 +02:00
Ivan Gyurdiev
9846602412
wined3d: Add D3DTEXTURETRANSFORMTYPE to the WINED3D namespace.
2006-10-13 11:15:31 +02:00
Ivan Gyurdiev
b7edf5b008
wined3d: Add D3DSHADER_ADDRMODE masks to the WINED3D namespace.
2006-10-13 11:15:00 +02:00
Ivan Gyurdiev
837027fcb7
wined3d: D3DTEXTURESTAGESTATETYPE: Consistently use in WINED3D namespace.
2006-10-11 12:18:53 +02:00
Ivan Gyurdiev
82379f22a7
wined3d: Move D3DSP dest modifier related items into the WINED3D namespace.
2006-10-10 13:38:45 +02:00
Ivan Gyurdiev
76b571cb48
wined3d: Move D3DSP source modifier-related items into the WINED3D namespace.
2006-10-10 13:38:36 +02:00
Ivan Gyurdiev
17c9d9588a
wined3d: Move D3DSP_REG structures into the WINED3D namespace.
2006-10-10 13:37:49 +02:00
Ivan Gyurdiev
e8137632c7
wined3d: Move D3DSP DCL-related structures into WINED3D namespace.
2006-10-10 13:37:35 +02:00
Ivan Gyurdiev
7259b9d8b6
wined3d: Move D3DSPR structure into the WINED3D namespace.
2006-10-10 13:37:12 +02:00
Ivan Gyurdiev
062541c026
wined3d: Move D3DSIO structure into WINED3D namespace.
2006-10-10 13:37:03 +02:00
Ivan Gyurdiev
3dcd3681f3
wined3d: Win64 printf fixes.
2006-10-02 14:38:04 +02:00
Ivan Gyurdiev
42a9262acf
wined3d: Read GL info and load constants into the same device.
2006-09-27 19:53:43 +02:00
Ivan Gyurdiev
d0032a1a2a
wined3d: Move device pointer into the BaseShader class.
2006-09-27 19:44:09 +02:00
Stefan Dösinger
581c24ef4e
wined3d: Use GL_EXTCALL.
...
That fixes compilation with gl headers that do not know about glUniform4fvARB.
2006-09-26 11:41:53 +02:00
Stefan Dösinger
96bce8d6d4
wined3d: Avoid wasting a uniform.
2006-09-25 18:24:19 +02:00
Stefan Dösinger
d4a88724dd
wined3d: Load projected textures in fragment shaders.
2006-08-25 11:19:15 +02:00
H. Verbeet
09eb0c40a6
wined3d: Improve float constant loading a bit.
...
- Use a list to keep track of what constants are set.
- Move TRACEs and checkGLcall calls out of the main constant loading loop.
2006-08-21 12:17:42 +02:00
H. Verbeet
49f4c68e29
wined3d: Lookup GLSL float uniform locations only once per program.
2006-08-21 12:16:27 +02:00
H. Verbeet
2358fbbb03
wined3d: Fix indices for the float constant map.
...
Indices for the float constant map should be multiplied by 4 because
we're loading 4 component float vectors, not because the size of a
float is 4.
2006-08-21 12:15:12 +02:00
Phil Costin
ef1c8fd118
wined3d: Fix vertex shader corruption issue.
2006-08-14 11:45:33 +02:00
Roderick Colenbrander
31abc2febd
wined3d: Draw buffers support.
2006-08-10 10:54:50 +02:00
Jason Green
2e52b36bb3
wined3d: Declare a 1D sampler for TEXDP3TEX (GLSL).
2006-07-29 11:50:02 +02:00
Jason Green
72bfe131d1
wined3d: More shader fixes / new instructions.
...
- Replace gl_FragColor with gl_FragData[0] for GLSL pixel shader output.
- Subtract 1 more constant from total GLSL allowed float constants to
accommodate the PROJECTION matrix row that we reference.
2006-07-28 14:01:16 +02:00
Michael Stefaniuc
5ca9f82661
wined3d: Remove superfluous breaks.
2006-07-26 10:24:15 +02:00
Jason Green
7e90aba97b
wined3d: Implement more GLSL instructions.
...
Implement D3DSIO_TEXREG2AR, TEXREG2GB, TEXREG2RGB, TEXM3X3TEX, TEXM3X3SPEC.
2006-07-25 11:22:55 +02:00
Jason Green
718716b77a
wined3d: Make the number of floating point shader constants dynamic.
2006-07-19 09:54:30 +02:00
Ivan Gyurdiev
436d700c2e
wined3d: Fix cmp instruction for GLSL.
...
The current GLSL cmp instruction is incorrect, because:
- it ignores destination write mask
- it ignores source swizzle
- it ignores other source modifiers.
- it works incorrectly for src0 = 0
2006-07-14 13:32:38 +02:00
Ivan Gyurdiev
33293df143
wined3d: More flow control instructions.
...
- Implement call, callnz, label, and ret
- Implement support for NOT modifier
2006-07-11 17:14:24 +02:00
Ivan Gyurdiev
6ede56495a
wined3d: More flow control instructions
...
- Implement if, else, endif, rep, endrep, break
- Implement ifc, breakc, using undocumented comparison bits in the instruction token
- Fix bug in main loop processing of codes with no dst token
- Fix bug in GLSL output modifier processing of codes with no dst token
- Fix bug in loop implementation (src1 contains the integer data, src0 is aL)
- Add versioning for all the instructions above, and remove
GLSL_REQUIRED thing, which is useless and should be removed from all
opcodes in general.
2006-07-11 17:13:05 +02:00
Ivan Gyurdiev
8068fc3b9c
wined3d: Clamp texcoord output between 0 and 1.
2006-07-11 17:12:04 +02:00
Ivan Gyurdiev
e9de563e41
wined3d: Place immediate constants in the same array as global constants.
...
- move DEF, DEFI, DEFB handling into the register counting pass
- keep track of defined constants as a linked list (because there's a
few of them)
- apply immediate constants after global constants in the constant
loading function
- both types of constants now get loaded with array notation in the
shader (into the same array)
2006-07-11 17:11:30 +02:00
Ivan Gyurdiev
c58e06548e
wined3d: Fix typo breaking 3.0 pshaders color input.
2006-07-10 11:48:11 +02:00
Ivan Gyurdiev
5b3c500efe
wined3d: Reverse semantics maps for shaders.
2006-07-07 17:39:26 +02:00
Jason Green
c562c4c771
wined3d: Fix D3DSIO_TEXKILL for GLSL.
2006-07-07 16:57:51 +02:00
Jason Green
3529e0ceeb
wined3d: Fix D3DSIO_M#X# instruction for both ARB and GLSL shaders.
...
This instruction was being handled incorrectly in the case where the
2nd src argument contained a relatively addressed constant.
2006-07-06 16:31:24 +02:00
Ivan Gyurdiev
276609e1e5
wined3d: Move register count pass to SetFunction.
...
Move semantics pointers out of the reg_maps, make them persistent data
in the shader (again, for future software shaders).
2006-07-06 16:07:38 +02:00
Jason Green
4fbe97e5e7
wined3d: Fix a few GLSL shader instruction translations.
...
This fixes the translations for a few instructions in GLSL and allows
Cubemap sampling in pixel shaders < 2.0. It makes some of the
lighting on textures in Half Life 2 look better, including some of the
water effects. It's not perfect yet, but much closer now.
2006-06-29 14:41:01 +02:00
Jason Green
baf38b3007
wined3d: Implement more GLSL instructions and a little cleanup.
...
- Implement D3DSIO_DP2ADD, D3DSIO_TEXKILL, D3DSIO_TEXM3X3PAD
- Partially implement D3DSIO_TEXBEM, D3DSIO_TEXM3X3VSPEC (as much as
they are implemented in ARB_fragment_program at least).
- Stop copying the SHADER_PARSE_STATE struct in each ARB shader
routine - use a pointer instead.
2006-06-27 11:16:10 +02:00
Jason Green
e0ccbeb282
wined3d: Bind correct number of samplers for GLSL shaders.
...
We are only checking against GL_MAX_TEXTURES when binding samplers,
when we should be checking against the maximum number of samplers that
the card supports. Spotted by H. Verbeet.
2006-06-21 11:16:07 +02:00
Jason Green
99c855e6ae
wined3d: Fix DEF instructions in GLSL for non-Nvidia platforms.
...
- NVidia allows "const vec4 = {1.0, 2.0, 3.0, 4.0};", even though
that's not part of the spec.
- It should be "const vec4 = vecr4(1.0, 2.0, 3.0, 4.0);"
- This patch fixes this for D3DSIO_DEF and D3DSIO_DEFI.
2006-06-20 11:28:05 +02:00
Jason Green
c13f097de3
wined3d: Correct implementation of D3DSIO_LOOP.
...
I initially misread the specification. src0.x is the iteration count,
not the max amount for the loop register. This fixes that.
2006-06-19 11:11:45 +02:00
Jason Green
9afa540eb5
wined3d: Added correct cast support for gl_FogFragCoord and gl_PointSize output registers.
2006-06-19 11:11:05 +02:00