Commit Graph

283 Commits

Author SHA1 Message Date
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 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
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 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
Henri Verbeet 5e473cb17f wined3d: Group register information into struct wined3d_shader_register. 2009-05-08 12:13:17 +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
Stefan Dösinger 4c29105cb2 wined3d: Pack hardcoded local constants in ARB.
This makes the location of used program.local parameters more
predictable and eases sharing this space with other private constants.
2009-05-06 13:12:45 +02:00
Stefan Dösinger df5d82dd5b wined3d: Pack ARB srgb constants better.
There's no need to waste constants for repeatedly loading the same value.
2009-05-05 14:13:20 +02:00
Henri Verbeet 2a5a6a3439 wined3d: Store the SM 1-3 opcode information tables in the SM 1-3 frontend. 2009-05-05 11:34:28 +02:00
Henri Verbeet 2378108eb9 wined3d: Create a frontend for parsing shaders. 2009-05-04 12:53:08 +02:00
Henri Verbeet 8d4c90496f wined3d: Store the sampler type in struct shader_reg_maps.
Instead of the usage token.
2009-04-29 13:08:01 +02:00
Francois Gouget 6376941266 wined3d: Avoid using an implicit value to set fogcoord to 0.0. 2009-04-23 18:14:27 +02:00
Henri Verbeet fc60083ed2 wined3d: Handle the destination modifier shift in the frontend rather than the backend. 2009-04-23 14:22:06 +02:00
Henri Verbeet fec1fa93cf wined3d: Handle the swizzle shift in the frontend rather than the backend. 2009-04-22 13:14:14 +02:00
Henri Verbeet 629801bccb wined3d: Get rid of the token field from struct wined3d_shader_src_param. 2009-04-22 13:14:03 +02:00
Henri Verbeet 7a3d4ce76f wined3d: Pass a struct wined3d_shader_src_param to shader_arb_get_swizzle(). 2009-04-22 13:13:57 +02:00
Henri Verbeet db5ab97125 wined3d: Store the source swizzle in struct wined3d_shader_src_param. 2009-04-21 14:00:02 +02:00
Henri Verbeet 644439ff0d wined3d: Pass a struct wined3d_shader_src_param to pshader_gen_input_modifier_line(). 2009-04-21 13:56:58 +02:00
Henri Verbeet ea0b3b42eb wined3d: Pass a struct wined3d_shader_src_param to shader_arb_add_src_param(). 2009-04-20 14:13:33 +02:00
Henri Verbeet 1ae060be4a wined3d: Simplify replicating the .x swizzle in shader_hw_mov().
It becomes even simpler once the swizzle shift and token field are eliminated.
2009-04-20 14:13:28 +02:00
Henri Verbeet 915b91757f wined3d: Store the destination relative addressing token as a struct wined3d_shader_src_param. 2009-04-20 14:13:08 +02:00
Henri Verbeet 8ac4c98be2 wined3d: Store the source modifiers in struct wined3d_shader_src_param. 2009-04-15 15:57:35 -05:00
Henri Verbeet b6668b0296 wined3d: Store the register index in struct wined3d_shader_src_param. 2009-04-15 15:57:30 -05:00
Henri Verbeet ff62cab537 wined3d: Introduce struct wined3d_shader_src_param. 2009-04-15 15:57:19 -05:00
Henri Verbeet 463de24e7b wined3d: Group instruction context information together in struct wined3d_shader_context. 2009-04-15 15:57:13 -05:00
Henri Verbeet d3fc7dca99 wined3d: Get rid of the "token" field from struct wined3d_shader_dst_param. 2009-04-14 15:25:07 -05:00
Henri Verbeet 18cdcc0b7e wined3d: Pass a struct wined3d_shader_dst_param to shader_arb_get_write_mask(). 2009-04-14 15:25:01 -05:00
Tobias Jakobi 0c2514bd8f wined3d: Rename some NP2 fixup variables and update comments. 2009-04-13 17:32:11 -05:00
Tobias Jakobi 9657e81429 wined3d: Add newline to fixme. 2009-04-13 17:32:03 -05:00
Tobias Jakobi 6e970c5d95 wined3d: glsl: Enable load_np2fixup_constants. 2009-04-10 14:00:58 +02:00
Tobias Jakobi 9b067a6ca5 wined3d: Add load_np2fixup_constants function to shader backend. 2009-04-10 14:00:50 +02:00
Stefan Dösinger 754b5cf2ad wined3d: Deal with reserved shader constants in the backend.
This moves the GLSL and ARB specific reserved constants out of directx.c into
the get_caps methods of the shader backends. That way the number of reserved
constants remains in the backend.

GL_LIMITS({v/p}shader_constantsF) now contains the real number of constants as
advertised by GL instead of some mixture of GL info and backend implementation
specifics. This makes it easier for backends to decide how many constants to
use.
2009-04-10 11:22:55 +02:00
Henri Verbeet 3a5bbe6a0c wined3d: Split vshader_program_add_param() in shader_arb_add_src_param() and shader_arb_add_dst_param(). 2009-04-10 10:23:38 +02:00
Henri Verbeet e6031afdfa wined3d: Merge pshader_get_register_name() and part of vshader_program_add_param(). 2009-04-10 10:23:33 +02:00
Henri Verbeet 9a28d273bc wined3d: Explicitly pass the register type and index to pshader_get_register_name(). 2009-04-10 10:23:24 +02:00
Henri Verbeet 22e57d025c wined3d: Store the destination shift in struct wined3d_shader_dst_param. 2009-04-10 10:23:15 +02:00
Henri Verbeet 0f92bbc6bc wined3d: Store the register type in struct wined3d_shader_dst_param. 2009-04-07 14:21:49 +02:00
Henri Verbeet 6f66c1ddbd wined3d: Store the write mask in struct wined3d_shader_dst_param. 2009-04-07 14:21:37 +02:00
Henri Verbeet f0de1622d0 wined3d: Store the destination modifiers in struct wined3d_shader_dst_param. 2009-04-06 12:57:52 +02:00
Henri Verbeet 6660978b44 wined3d: Use register_idx in the ARB shader backend. 2009-04-03 13:01:50 +02:00
Henri Verbeet 7b62165546 wined3d: Store the register index in struct wined3d_shader_dst_param. 2009-04-03 13:01:44 +02:00
Henri Verbeet 7245cd2b81 wined3d: Add a struct wined3d_shader_dst_param for storing destination parameter information. 2009-04-03 13:01:38 +02:00