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
Henri Verbeet
318fb7036b
wined3d: Add missing GL locking to test_pbo_functionality().
2009-05-14 11:12:57 +02:00
Henri Verbeet
639b258200
wined3d: Add missing GL locking to IWineD3DDeviceImpl_Uninit3D().
2009-05-14 11:12:52 +02:00
Henri Verbeet
e260132701
wined3d: Add missing GL locking to set_blit_dimension() calls.
2009-05-14 11:12:46 +02:00
Henri Verbeet
1070e075e4
wined3d: Add missing GL locking to calls to FBO functions.
2009-05-14 11:12:38 +02:00
Henri Verbeet
12c4af8dd8
wined3d: Add missing GL locking to delete_glsl_program_entry() calls.
2009-05-14 11:12:30 +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
Francois Gouget
514c5f2648
wined3d: Make surface_force_reload() static.
2009-05-13 12:45:36 +02:00
Henri Verbeet
b7ac22004f
wined3d: Add missing GL locking to shader_backend_t.shader_select() calls.
2009-05-13 12:01:57 +02:00
Henri Verbeet
7f14ea01c6
wined3d: Add missing GL locking to state table calls.
2009-05-13 12:01:52 +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
Henri Verbeet
b5aee04023
wined3d: Add missing GL locking to fragment_pipeline.enable_extension() implementations.
2009-05-13 12:01:43 +02:00
Henri Verbeet
91c3a5eac1
wined3d: Directly call basetexture_apply_state_changes().
...
All the implementations of IWineD3DBaseTexture::ApplyStateChanges() forward to
basetexture_apply_state_changes().
2009-05-13 11:55:01 +02:00
Rico Schüller
2ef751883d
wined3d: Add UnregisterClass() on DLL_PROCESS_DETACH.
2009-05-12 12:33:57 +02:00
Henri Verbeet
0d446053da
wined3d: Don't create more than WINED3D_MAX_FBO_ENTRIES FBO entries.
...
This essentially turns the FBO entry list into an LRU cache.
2009-05-12 11:18:15 +02:00
Henri Verbeet
cad271f13d
wined3d: Print the correct limit in a WARN().
2009-05-12 11:18:08 +02:00
Henri Verbeet
adc9bfe3fd
wined3d: Pass a struct wined3d_shader_register to shader_record_register_usage().
2009-05-12 11:18:02 +02:00
Henri Verbeet
2039702035
wined3d: Pass a struct wined3d_shader_register to shader_dump_register().
2009-05-12 11:17:56 +02:00
Henri Verbeet
fef4253171
wined3d: Pass a struct wined3d_shader_register to shader_arb_get_register_name().
2009-05-12 11:17:45 +02:00
Stefan Dösinger
601030cfa9
wined3d: Standardize pshader_hw_texkill.
...
Use shader_arb_get_dst_param instead of get_register_name to find the register
name. Even though this adds support for modifiers(which aren't allowed by
native), this shouldn't hurt. If an app passes in an incorrect shader it
should be caught in the frontend.
2009-05-11 12:50:37 +02:00
Stefan Dösinger
5cfbfbc8b3
wined3d: Tidy up shader_hw_rsq_rcp.
2009-05-11 12:50:22 +02:00
Stefan Dösinger
da47f68522
wined3d: Simplify shader_hw_map2gl.
...
Most of the extra work done in the pixel shader code was not needed or
redundant. This patch unifies the two paths.
2009-05-11 12:50:01 +02:00
Stefan Dösinger
7a1f9c84f1
wined3d: Get rid of the strcat in shader_arb_add_dst_param and make it shader_arb_get_dst_param.
2009-05-11 12:49:54 +02:00
Stefan Dösinger
48c2b0d669
wined3d: Merge shader_arb_add_src_param and pshader_gen_input_modifier_line.
...
Mostly based on the code of pshader_gen_input_modifier_line. The space-adding
behavior of shader_arb_add_src_param was removed because the plurality of
instruction handlers passes an uninitialized buffer in and expects a register
name written to its start, and only map2gl and rcp_rsq use the space-adding
stuff. I'll change rcp_rsq in a later patch anyway. I changed the name to
shader_arb_get_src_param to reflect this behavior.
2009-05-11 12:48:35 +02:00
Henri Verbeet
9a579a43b1
wined3d: Use the output signature to map SM4 pixel shader outputs to the appropriate register.
2009-05-11 12:43:00 +02:00
Henri Verbeet
d2409581e0
wined3d: Record register usage only once.
2009-05-08 18:16:48 +02:00
Stefan Dösinger
7a1f305d42
wined3d: Get rid of pshader_gen_output_modifier_line.
...
Use shader_arb_add_instruction_modifiers instead. This avoids calling the
fixup function from each single instruction handler to handle shifts. It does
not yet get rid of the modifier handler in each instruction because we don't
want a separate line if we can just append _SAT to the instruction name.
2009-05-08 12:20:37 +02:00
Stefan Dösinger
f025829449
wined3d: Pass the instr to pshader_gen_output_modifier_line.
2009-05-08 12:20:25 +02:00
Stefan Dösinger
2fd485ae31
winedd: Move shader_*_add_instruction_modifiers into the shader backend.
2009-05-08 12:20:18 +02:00
Stefan Dösinger
668328a697
wined3d: Work around a bad crash in fglrx.
2009-05-08 12:16:50 +02:00
Stefan Dösinger
4daa3e5320
wined3d: Always declare single constants in ARB if rel addr is not used.
...
This is needed to raise the number of advertised constants to the GL
limit. The ARB assembler ususally does not optimize away unused
constants, so we have to do this.
2009-05-08 12:15:26 +02:00
Stefan Dösinger
f9276a6429
wined3d: Keep track of used float constants.
2009-05-08 12:15:15 +02:00
Henri Verbeet
69cbb57bfd
wined3d: Add support for immediate constants to the GLSL backend.
2009-05-08 12:13:49 +02:00
Henri Verbeet
96005c0fca
wined3d: Pass a struct wined3d_shader_register to shader_is_scalar().
2009-05-08 12:13:46 +02:00
Henri Verbeet
4a18697246
wined3d: Pass a struct wined3d_shader_register to shader_glsl_get_register_name().
2009-05-08 12:13:40 +02:00
Henri Verbeet
448dc84b6e
wined3d: Fix shader_glsl_get_register_name() indentation.
2009-05-08 12:13:33 +02:00
Henri Verbeet
5e473cb17f
wined3d: Group register information into struct wined3d_shader_register.
2009-05-08 12:13:17 +02:00
Henri Verbeet
69861b8fed
wined3d: Increase the size of glsl_src_param_t.param_str.
...
It constains the register name plus potential modifiers, so it should be
larger than reg_name instead of smaller.
2009-05-07 14:44:22 +02:00
Henri Verbeet
690d666de5
wined3d: Add support for immediate constants to shader_dump_register().
2009-05-07 14:44:22 +02:00
Henri Verbeet
65622a052c
wined3d: Create a struct wined3d_shader_version to store version information.
...
The version tokens in SM1-3 and SM4 are similar, but not the same.
2009-05-07 14:44:21 +02:00
Henri Verbeet
5c63d93e18
wined3d: Store the shader version in the frontend's private data.
2009-05-07 14:44:21 +02:00
Henri Verbeet
94cf618658
wined3d: Improve shader_sm4_read_opcode() to handle some simple opcodes.
2009-05-07 14:44:21 +02:00