Commit Graph

281 Commits

Author SHA1 Message Date
Henri Verbeet 868f5bfc7c wined3d: Handle reading the shader header in the frontend.
In SM 1-3 this is just the version, in SM4 this also includes the token count.
2009-05-05 11:34:15 +02:00
Henri Verbeet ef074cdde1 wined3d: Introduce a stubbed SM4 shader frontend. 2009-05-05 11:34:07 +02:00
Henri Verbeet dddd1f0211 wined3d: Select the frontend based on the version token. 2009-05-04 12:53:16 +02:00
Henri Verbeet 5f96c0083a wined3d: Add a frontend function to determine if there are any tokens left. 2009-05-04 12:53:12 +02:00
Henri Verbeet 2378108eb9 wined3d: Create a frontend for parsing shaders. 2009-05-04 12:53:08 +02:00
Henri Verbeet 5a7afd9b2a wined3d: Move SM 1-3 parsing functions to their own file. 2009-05-04 12:53:04 +02:00
Henri Verbeet 6eb43e35c9 wined3d: Get rid of the remaining WINED3DSP_REGNUM_MASK usage. 2009-05-04 12:52:59 +02:00
Henri Verbeet 5e072395b4 wined3d: Avoid using WINED3DSP_REGNUM_MASK in the def/defi/defb handlers. 2009-05-01 13:12:08 +02:00
Henri Verbeet a605fcd2fd wined3d: Introduce shader_sm1_read_comment() to read shader comments. 2009-05-01 13:12:04 +02:00
Henri Verbeet 59705b9c20 wined3d: Use the shader_sm1_read_*() functions in shader_trace_init(). 2009-05-01 13:11:42 +02:00
Henri Verbeet 752d80400d wined3d: Merge shader_dump_arr_entry() into shader_dump_register(). 2009-05-01 13:11:37 +02:00
Henri Verbeet bf4f7bf34a wined3d: Split shader_dump_param() in shader_dump_src_param() and shader_dump_dst_param(). 2009-04-30 12:47:59 +02:00
Henri Verbeet 54a3054e5a wined3d: Pass a struct wined3d_shader_semantic to shader_dump_decl_usage(). 2009-04-30 12:47:56 +02:00
Henri Verbeet 032b8d4c02 wined3d: Explicitly pass register type, index, etc. to shader_dump_param(). 2009-04-30 12:47:52 +02:00
Henri Verbeet 18df05eb34 wined3d: Explicitly pass the register type and index to shader_get_float_offset(). 2009-04-30 12:47:44 +02:00
Henri Verbeet 88b6d5eb0b wined3d: Relative addressing tokens are always source parameters.
So the "is_src" argument to shader_dump_arr_entry() is redundant (and wrong).
2009-04-29 13:08:29 +02:00
Henri Verbeet 52644ab053 wined3d: The "input" parameter to shader_dump_param() should be a BOOL.
It's used to determine if the token is a source or destination parameter. A
subsequent patch will split shader_dump_param() in two different functions.
2009-04-29 13:08:22 +02:00
Henri Verbeet 42a8041cb8 wined3d: Handle the sampler type shift in the frontend. 2009-04-29 13:08:14 +02:00
Henri Verbeet 65321dd1ce wined3d: Introduce shader_sm1_read_semantic(). 2009-04-29 13:08: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
Henri Verbeet 9db67a5971 wined3d: Clear reg_maps in shader_get_registers_used() instead of the callers. 2009-04-28 13:10:02 +02:00
Henri Verbeet 0df4514894 wined3d: Use shader_sm1_read_dst_param() and shader_sm1_read_src_param() in shader_get_registers_used(). 2009-04-28 13:10:02 +02:00
Henri Verbeet e001876163 wined3d: Create a separate function to record register usage. 2009-04-28 13:10:02 +02:00
Henri Verbeet abc253f52f wined3d: Add a function to read a destination parameter from SM1-3 bytecode. 2009-04-27 13:25:26 +02:00
Henri Verbeet 4e97e430d9 wined3d: Add a function to read a source parameter from SM1-3 bytecode. 2009-04-27 13:25:21 +02:00
Henri Verbeet 15953b94b6 wined3d: Use shader_sm1_read_opcode() in shader_trace_init(). 2009-04-27 13:25:16 +02:00
Henri Verbeet 2b07565d6e wined3d: Store D3D shader opcode names in a separate table. 2009-04-27 13:25:09 +02:00
Stefan Dösinger 7ab6c22f5a wined3d: Support the full amount of constants in GLSL.
This patch advertises all GL reported float uniforms to the D3D app to
reach the 256 constants required by Shader Model 3.0 on dx9 cards. If
the shader does not use indirect addressing, all 256 constants are
declared. The compiler can then figure out which constants are
actually used. This makes shaders work that use high constant indices,
but don't use all 256 constants.
2009-04-27 13:24:00 +02:00
Henri Verbeet 19b84ffda1 wined3d: Use shader_sm1_read_opcode() in shader_get_registers_used(). 2009-04-24 11:53:18 +02:00
Henri Verbeet 521fcf11db wined3d: Add a function to read an opcode from SM1-3 bytecode. 2009-04-24 11:53:12 +02:00
Henri Verbeet e63bd2ce21 wined3d: The first shader token should be the version token. 2009-04-24 11:53:00 +02:00
Henri Verbeet 35499d0c3c wined3d: Handle the opcode specific control shift in the frontend rather than the backend. 2009-04-24 11:52:28 +02:00
Henri Verbeet fba6f871cf wined3d: Move frontend specfic constants to baseshader.c. 2009-04-23 14:22:06 +02:00
Henri Verbeet d6494ad00c wined3d: Move some frontend specfic code to baseshader.c. 2009-04-23 14:22:06 +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 cf1bfc8c68 wined3d: Handle the source modifier shift in the frontend rather than the backend. 2009-04-22 13:14:26 +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 baf2f94b76 wined3d: Get rid of the WINED3DVS_* swizzle constants.
They're redundant.
2009-04-22 13:14:09 +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 db5ab97125 wined3d: Store the source swizzle in struct wined3d_shader_src_param. 2009-04-21 14:00:02 +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 0663eb9323 wined3d: Store the source relative addressing token as a struct wined3d_shader_src_param. 2009-04-20 14:13:00 +02:00
Henri Verbeet d6ee7d59a8 wined3d: Create a relative addressing token for 1.x shaders in the frontend.
Rather than handling this in the backends. Note that the ARB backend always
assumes 1.x shaders.
2009-04-20 14:12:52 +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 4de1dba2c5 wined3d: Store the register type in struct wined3d_shader_src_param. 2009-04-15 15:57:25 -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
Tobias Jakobi 9b067a6ca5 wined3d: Add load_np2fixup_constants function to shader backend. 2009-04-10 14:00:50 +02:00
Henri Verbeet 62d9dc2177 wined3d: Store the relative addressing mode in struct wined3d_shader_dst_param. 2009-04-10 10:23:20 +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 9ec0b09d35 wined3d: Store usage and usage_idx in struct wined3d_shader_semantic.
Instead of the usage token.
2009-04-08 11:42:19 +02:00
Henri Verbeet d12e489272 wined3d: Store a struct wined3d_shader_dst_param in struct wined3d_shader_semantic. 2009-04-08 11:41:59 +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 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
Henri Verbeet 04b2e0b19b wined3d: Remove the opcode field from struct wined3d_shader_instruction. 2009-04-03 13:01:30 +02:00
Henri Verbeet 7bde2792c2 wined3d: Store the source and destination parameter count in struct wined3d_shader_instruction. 2009-04-02 16:28:29 +02:00
Henri Verbeet 44648b2b91 wined3d: Store the instruction handler index in struct wined3d_shader_instruction.
This allows us to avoid comparing against WINED3DSIO_*, which is specific to
the bytecode.
2009-04-02 16:28:29 +02:00
Henri Verbeet c3a01b315e wined3d: Use a more reasonable name for "SHADER_OPCODE_ARG". 2009-04-01 14:24:19 +02:00
Henri Verbeet e44335585e wined3d: Don't use the opcode_token field in the ARB backend. 2009-04-01 14:24:02 +02:00
Henri Verbeet ec43489e10 wined3d: Don't use the opcode_token field in the GLSL backend.
The idea is that we want to prevent backends from parsing the tokens
themselves, which is pretty much a requirement for adding SM4 support.
2009-04-01 14:23:56 +02:00
Henri Verbeet 67da604eca wined3d: Get rid of a few stack buffers. 2009-03-10 12:07:02 +01:00
Stefan Dösinger 5cf764aec2 wined3d: Put the color_correction calls into the instruction handlers.
The color correction cannot be done behind the back of the individual
instruction handlers because it might conflict with the instruction's
color modifications and the D3D provided writemask.
2009-02-27 13:14:23 +01:00
Stefan Dösinger 8dcd51286d WineD3D: Put vertex shader duplication infrastructure in place. 2009-02-11 12:21:25 +01:00
Michael Stefaniuc cc6b283d3a wined3d: Remove some unused defines. 2009-02-03 12:40:12 +01:00
Henri Verbeet 894edc49cc wined3d: Get rid of D3DCREATESHADEROBJECTINSTANCE. 2009-01-12 13:22:02 +01:00
Henri Verbeet 02e4c33611 wined3d: Consistently use .xyzw for vector components. 2008-12-20 11:11:55 +01:00
Stefan Dösinger 61e581abb4 wined3d: Pass the ps_compile_args structures to the shader generation code. 2008-12-19 17:16:39 +01:00
Henri Verbeet d099dde7a9 wined3d: Track shader constants in the shader backend. 2008-12-18 13:17:02 +01:00
Henri Verbeet 73823ef5f6 wined3d: Remove the shader_cleanup() method from the shader backend. 2008-12-17 14:02:24 +01:00
Henri Verbeet f3743fb402 wined3d: Shaders will never have a NULL function. 2008-12-16 12:52:04 +01:00
Henri Verbeet 9011452243 wined3d: Simplify shader_generate_main() a bit. 2008-12-15 14:00:29 +01:00
Henri Verbeet 8553665cb1 wined3d: Move the shader version to reg_maps. 2008-12-15 14:00:26 +01:00
Henri Verbeet dd094fe69d wined3d: Explicitly pass the shader version to some more functions. 2008-12-15 14:00:21 +01:00
Henri Verbeet fb475c7c29 wined3d: Don't reparse the entire shader just to update the sampler types. 2008-12-12 11:40:20 +01:00
Stefan Dösinger 4916cd5478 wined3d: Don't load INT and BOOL constants needlessly. 2008-12-11 14:06:04 +01:00
Henri Verbeet 8124f5e14a wined3d: shader_trace_init() shouldn't have side effects.
This moves setting baseShader.hex_version and baseShader.functionLength to
shader_get_registers_used(), where it's more appropriate.
2008-12-11 12:14:50 +01:00
Henri Verbeet 15d497cb26 wined3d: baseShader.functionLength should be 0 when a NULL pFunction is passed. 2008-12-11 12:14:36 +01:00
Henri Verbeet a2f259afff wined3d: Get rid of the "len" variable in shader_trace_init(). 2008-12-11 12:14:30 +01:00
Henri Verbeet 50a87e23e7 wined3d: Fix the IWineD3DVertexShader and IWineD3DPixelShader IUnknown methods.
IWineD3DVertexShader isn't supposed to implement IWineD3DPixelShader.
2008-12-09 11:27:32 +01:00
Henri Verbeet 4997bee1bf wined3d: Add functions to initialize and free shader buffers. 2008-12-09 11:27:13 +01:00
Henri Verbeet 9887d66dad wined3d: Return early from shader_trace_init() when a NULL pFunction is passed.
This is mainly to reduce the size and indentation level of the if-block.
2008-12-08 12:28:27 +01:00
Henri Verbeet e18629bedd wined3d: Explicitly pass the shader version to shader_skip_unrecognized(). 2008-12-08 12:28:20 +01:00
Henri Verbeet 6e677775ce wined3d: Explicitly pass the shader version to shader_get_param(). 2008-12-08 12:28:17 +01:00
Henri Verbeet 0c954ef743 wined3d: Explicitly pass the shader version to shader_dump_param() and shader_dump_arr_entry(). 2008-12-05 11:59:09 +01:00
Henri Verbeet 71a8a77cf9 wined3d: Explicitly pass the shader version to shader_dump_decl_usage(). 2008-12-05 11:59:06 +01:00
Henri Verbeet a13df0e4ef wined3d: Explicitly pass the version and instruction table to shader_get_opcode(). 2008-12-05 11:59:02 +01:00
Henri Verbeet af1bc3d9ed wined3d: Remove a redundant condition in shader_get_opcode(). 2008-12-05 11:58:58 +01:00
Henri Verbeet 89139b7589 wined3d: Make shader texture format fixups more generic.
Based on a patch by Stefan Dösinger. This is more flexible, and allows
the shader backend implementation to be simpler, since it doesn't have
to know about specific formats. The next patch makes use of this.
2008-12-04 11:59:58 +01:00
Henri Verbeet 0ae60765de wined3d: Make functions static where possible. 2008-12-03 09:47:35 +01:00
Henri Verbeet d8f6e63541 wined3d: Const correctness fixes for arb_program_shader.c. 2008-11-26 12:05:14 +01:00
Stefan Dösinger 0bf32b12f5 wined3d: Add the ability to duplicate GL pixel shaders.
Some stateblock parameters have to be compiled into the GL pixel
shader code, like lines for pixelformat fixups. This leads to problems
when applications switch those settings, requiring a recompilation of
the shader. This patch enables wined3d to have multiple GL shaders for
a D3D shader(pixel shaders only so far) to handle this more
efficiently.
2008-11-25 13:07:03 +01:00
Tobias Jakobi f4e0dec42e wined3d: Fix typo in baseshader.c. 2008-10-28 13:26:01 +01:00
Henri Verbeet 57401fcab2 wined3d: Pass the texture type to the shader depth blt function. 2008-10-28 12:33:18 +01:00
Alexandre Julliard 6cfef95ce7 wined3d: Convert source files to utf-8. 2008-10-18 19:21:20 +02:00
Henri Verbeet 5ba40c3d58 wined3d: Make some more GLSL functions private to the backend. 2008-09-24 12:53:23 +02:00