532 Commits

Author SHA1 Message Date
Stefan Dösinger
da7176be2a wined3d: Use DP2A or X2D for dp2add if available. 2009-05-29 11:27:29 +02:00
Stefan Dösinger
e2be741bc0 wined3d: Remove a MESA hack. 2009-05-29 11:27:23 +02:00
Stefan Dösinger
5f723bc44a wined3d: Allocate the proper size for the lconst map. 2009-05-29 11:27:14 +02:00
Henri Verbeet
d37472f27b wined3d: Add missing ActivateContext calls to shader_destroy() implementations. 2009-05-29 11:26:32 +02:00
Stefan Dösinger
e70c80add9 wined3d: Emulate if(bool) in ARB shaders. 2009-05-28 12:46:01 +02:00
Stefan Dösinger
e492dd858e wined3d: Add a function around the handler table.
This reduces the number of methods in the shader backend(the instr
modifiers can be handled in that wrapper) and it will help flow
control emulation in the ARB backend.
2009-05-28 12:45:45 +02:00
Stefan Dösinger
aad92c0780 wined3d: Manage vs_compile_args in the backends. 2009-05-28 12:45:32 +02:00
Stefan Dösinger
814dd42f25 wined3d: Manage ps_compiled_shader in the backends. 2009-05-28 12:45:21 +02:00
Stefan Dösinger
8763f6eac5 wined3d: Make find_gl_vshader backend specific. 2009-05-28 12:45:10 +02:00
Stefan Dösinger
732a9a15d5 wined3d: Remove the forward declaration added in the last patch. 2009-05-28 12:44:59 +02:00
Stefan Dösinger
d0d681c81e wined3d: Make find_gl_pshader backend private. 2009-05-28 12:44:43 +02:00
Stefan Dösinger
5865d9c01b wined3d: Store the compile args in the compile context, not the shader. 2009-05-28 12:44:22 +02:00
Stefan Dösinger
6492622350 wined3d: sincos for vertex shaders.
SCS is unfortunately a fragment program only instruction. If we have the NV
extensions we can use SIN and COS. Otherwise we have to approximate sine and
cosine with a taylor series. Luckily we're provided with the necessary
constants by the application.
2009-05-27 11:56:53 +02:00
Stefan Dösinger
2f3faf4526 wined3d: Put some ARB declarations in the right place.
TMP_POS is only used in vertex shaders, declare it in the vshader
specific code. The sRGB constants are only used by pixel shaders, so
move them to the ps specific code, and avoid reading the stateblock.
2009-05-27 11:56:29 +02:00
Stefan Dösinger
f484cbbf91 wined3d: Get rid of Tx hardcoding in texbem. 2009-05-27 11:56:07 +02:00
Stefan Dösinger
da1b8d0c8e wined3d: Replace a few hardcoded Tx registers with proper name getters. 2009-05-27 11:56:01 +02:00
Stefan Dösinger
7fc4279cb8 wined3d: Implement DSX in ARB.
DSY is not that easy because we have to deal with the inverted coordinate
system in onscreen(!) rendering - see GLSL dsy.
2009-05-27 11:55:52 +02:00
Stefan Dösinger
122af07a30 wined3d: Implement SGN in ARB. 2009-05-21 16:17:52 +02:00
Stefan Dösinger
8e45e48b0c wined3d: Support vec4 A0 with NV_vertex_program2_option. 2009-05-21 16:17:52 +02:00
Stefan Dösinger
d0756ee537 wined3d: Support ABS and ABSNEG with NV extensions if available. 2009-05-21 16:17:52 +02:00
Stefan Dösinger
01ec5068e2 wined3d: Add NV asm extension support to the ARB backend. 2009-05-21 16:17:51 +02:00
Stefan Dösinger
60f20a2f39 wined3d: Support ABS and ABSNEG in ARB. 2009-05-21 16:17:51 +02:00
Stefan Dösinger
7b1d48721d wined3d: Emulate the 4 component address register in ARB. 2009-05-20 10:55:17 +02:00
Stefan Dösinger
72e9e80f6e wined3d: Prepare for vec4 address registers in ARB. 2009-05-20 10:55:09 +02:00
Stefan Dösinger
c7ca3793cc wined3d: Implement mova rounding in arb. 2009-05-20 10:55:03 +02:00
Stefan Dösinger
bffb89101f wined3d: Fix srgb correction. 2009-05-20 10:54:56 +02:00
Stefan Dösinger
e6cc81d287 wined3d: Get rid of the TMP register in fragment shaders.
To be able keep the temporary register in the type independent NRM
instruction, the vertex temporary register is renamed to TA to match
the name of a pixel shader register.
2009-05-20 10:54:50 +02:00
Stefan Dösinger
ba35760f9f wined3d: Use CMP instead of SLT and SGE in sRGB correction.
This shortens the code and reduces the amount of temp regs used by 1.
2009-05-19 15:24:48 +02:00
Stefan Dösinger
ad217029b0 wined3d: Get rid of TMP accesses in texm3x3* instructions. 2009-05-19 15:24:39 +02:00
Stefan Dösinger
ced325f816 wined3d: Get rid of TMP access in texm3x2*.
texm3x2pad knows which register the following texm3x2depth or tex instruction
will use, and it knows that this register is uninitialized. So use it for
temporary storage instead of TMP.
2009-05-19 15:24:31 +02:00
Stefan Dösinger
17b001788f wined3d: Get rid of TMP2 and some easy TMP register uses.
We have 5 temporary registers declared for private use. We can get rid of two
of them.
2009-05-19 15:24:21 +02:00
Stefan Dösinger
4bf980962a wined3d: Only declare TMP_OUT in vertex shaders. 2009-05-19 15:24:13 +02:00
Stefan Dösinger
d7f282f241 WineD3D: Support more constants in ARB shaders.
GL_LIMIT - 1 for vertex programs and the GL limit in fragment programs. The
indirect addressing limitation in GLSL applies here as well.
2009-05-18 13:59:31 +02:00
Stefan Dösinger
c7839112c9 wined3d: Avoid declaring helper_const in vertex programs if possible. 2009-05-18 13:59:24 +02:00
Stefan Dösinger
2cb8f42168 wined3d: Support clipplanes with GLSL.
This is the Nth attemt to make clipping work with GLSL shaders. The patch now
uses the GLSL quirk table to handle cards that need a custom varying for
gl_ClipPos, and the code is adapted to the changed state table and shader
backend system.
2009-05-18 13:59:16 +02:00
Stefan Dösinger
45563979bd wined3d: Update the bump constants after a shader change.
Since we're using local constants now, we have to update the constants after a
shader change.
2009-05-18 13:58:57 +02:00
Stefan Dösinger
3372846aa6 wined3d: Use local constants for bump parameters.
This simplifies the loading code a bit. The constants were never
designed to be at the same location in all shaders, so there's no
point in using program.env. This way we don't collide with the d3d
shader constants and its easier to work together with NP2 fixups and
other shaders.
2009-05-18 13:58:47 +02:00
Stefan Dösinger
6fe1a5daa5 wined3d: Don't use TMP_COLOR unless srgb is enabled.
This was needed unconditionally in the past to apply fog, but since we're
using the ARBfp fog defines it is only needed if an sRGB correction is done
at the end of the shader.
2009-05-15 11:45:18 +02:00
Henri Verbeet
b35e469d9d wined3d: Document functions that depend on the caller to do GL locking. 2009-05-15 10:25:41 +02:00
Stefan Dösinger
0123f81ce5 wined3d: Centralize WINED3DSPDM_SATURATE handling.
Besides the cleanup this patch will help to implement D3DSPDM_PARTIALPRECISION 
with GL_NV_vertex_program2_option / GL_NV_fragment_program_option.
2009-05-14 14:27:33 +02:00
Stefan Dösinger
aeddd2da63 wined3d: Fix remaining incorrect dst register getters. 2009-05-14 14:27:25 +02:00
Stefan Dösinger
bcb20ae96c wined3d: Fix a few more hardcoded pixel shader registers. 2009-05-14 14:27:19 +02:00
Stefan Dösinger
2327e316a2 wined3d: Tidy up pshader_hw_texreg2rgb and friends. 2009-05-14 14:27:14 +02:00
Stefan Dösinger
05cc344e7d wined3d: Tidy up pshader_hw_dp2add. 2009-05-14 14:27:07 +02:00
Stefan Dösinger
ca1a979c69 wined3d: Tidy up pshader_hw_cmp. 2009-05-13 13:22:16 +02:00
Stefan Dösinger
c06aa361e0 wined3d: Tidy up pshader_hw_cnd. 2009-05-13 13:22:11 +02:00
Stefan Dösinger
90526ce761 wined3d: Separate Tx tempregs from Tx varyings in ARB.
ps_1_3 uses Tx to pass in texture coordinates, but also as temporary
registers. ps_1_4 and ps_2_0 only use them for texture coordinates. This patch
gets rid of the Tx = fragment.texcoord[x] assign in all shader versions, and
doesn't even declare Tx in ps_1_4 and ps_2_0.

The <=ps_1_3 instructions know which kind of input they expect from the Tx
register, so the instruction handlers now know if they have to read the
tempreg Tx or the varying fragment.texcoord[x].
2009-05-13 13:22:04 +02:00
Stefan Dösinger
fc5e511dda wined3d: Fix 1.4 pshader projection in ARB.
shader_arb_add_src_param handled DW and TXP undid it again. Remove DZ DW from
the modifiers and handle it in the instruction. DZ cannot be handled by TXP as
is, so move the .z component to .w and make it DW-like. Using SZW+TXP is
likely more efficient than the RCP, MUL, TEX we'd get if we let
shader_arb_add_src_param do the job.
2009-05-13 13:21:43 +02:00
Stefan Dösinger
45799fdc4e wined3d: Tidy up pshader_hw_tex.
Fix the indentation and replace the get_register_name with
shader_arb_get_dst_param.
2009-05-13 13:21:29 +02:00
Henri Verbeet
59689262e7 wined3d: Add missing GL locking to shader_backend_t.shader_free_private() implementations. 2009-05-13 12:01:48 +02:00