Commit Graph

226 Commits

Author SHA1 Message Date
Henri Verbeet
f88c6e5ce5 wined3d: Move common shader fields to IWineD3DBaseShaderClass. 2009-09-25 15:14:35 +02:00
Henri Verbeet
77086e8e84 wined3d: Remove SetFunction() from the public shader interface. 2009-09-25 15:14:26 +02:00
Henri Verbeet
d76c7a8521 wined3d: Move some common shader functions to the IWineD3DBaseShader interface. 2009-09-25 15:14:17 +02:00
Henri Verbeet
789372afa8 wined3d: Don't free D3D pixel shaders until the wined3d pixel shader is destroyed. 2009-09-24 13:24:53 +02:00
Henri Verbeet
8aea1b1302 wined3d: Add a separate function for pixel shader initialization. 2009-09-24 13:24:27 +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
Henri Verbeet
2ee0d47a49 wined3d: Use strings for shader input/output semantics. 2009-05-27 11:12:12 +02:00
Henri Verbeet
19cb4594e3 wined3d: Use a separate structure for vertex shader attributes.
In D3D10 shaders input/output semantics are strings rather than predefined
types. Unfortunately, the code in vshader_get_input() can be performance
critical, depending on application behaviour. Since vshader_get_input() is
only relevant for d3d9 shaders anyway, just store the usage and usage_idx for
these shaders.
2009-05-27 11:12:07 +02:00
Henri Verbeet
1ccfab171f wined3d: Use SM3 shader limits for SM4.
This isn't completely right, since as far as I'm aware SM4 doesn't have shader
limits in the same sense as previous shader models, but this should do for now.
2009-05-26 13:50:08 +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
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
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
f9276a6429 wined3d: Keep track of used float constants. 2009-05-08 12:15:15 +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
2576bf3ddd wined3d: Fix some more indentation. 2009-05-06 12:20:50 +02:00
Henri Verbeet
46b4c15a31 wined3d: Remove some redundant code. 2009-05-06 12:20:39 +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
dddd1f0211 wined3d: Select the frontend based on the version token. 2009-05-04 12:53:16 +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
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
2b07565d6e wined3d: Store D3D shader opcode names in a separate table. 2009-04-27 13:25:09 +02:00
Tobias Jakobi
0c2514bd8f wined3d: Rename some NP2 fixup variables and update comments. 2009-04-13 17:32:11 -05:00
Tobias Jakobi
1b335dfaaa wined3d: Add texrect_fixup bitfield to ps_compile_args struct.
Initialization of the bitfield done in find_ps_compile_args
based on the previously introduced pow2Matrix_identity flag.
2009-03-31 12:40:10 +02:00
Henri Verbeet
42e31a4242 wined3d: Fix a few sign compare warnings. 2009-03-25 11:12:30 +01:00
Henri Verbeet
8ce2506aa8 wined3d: Try to make Coverity shut up (CID 863, 905).
Comparing gl_shaders against NULL after potentially dereferencing it a few
lines earlier probably confuses Coverity. Checking num_gl_shaders instead
should avoid this.
2009-03-24 12:56:19 +01:00
Henri Verbeet
e3bcc7544c wined3d: Remove the shader_color_fixup field from IWineD3DBaseTextureClass.
This is redundant now.
2009-03-12 13:09:55 +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
Michael Stefaniuc
cc6b283d3a wined3d: Remove some unused defines. 2009-02-03 12:40:12 +01:00
Stefan Dösinger
3d97055be7 wined3d: Get rid of is_compiled in the pixel shader. 2009-01-20 12:55:17 +01:00
Stefan Dösinger
3c3272dc41 wined3d: Don't single-allocate new gl shaders. 2009-01-20 12:45:09 +01:00
Henri Verbeet
cc447eac55 wined3d: Move position_transformed out of u.s in struct WineDirect3DVertexStridedData. 2009-01-08 13:21:31 +01:00
Henri Verbeet
2b926db50d wined3d: Make use_vs() and use_ps() work on a stateblock instead of a device.
Most callers work on a stateblock rather than a device, and the main fields
we check (vertexShader and pixelShader) are part of the stateblock as well.
2008-12-31 12:25:56 +01:00
Henri Verbeet
6f5af4047f wined3d: Get rid of the glname field in struct SHADER_OPCODE.
It's only used for shader_hw_map2gl() and vshader_hw_rsq_rcp(), and we
can handle those the same way we handle the GLSL equivalents.
2008-12-30 11:36:35 +01:00
Stefan Dösinger
690cbe76ac wined3d: Make pixelshaders disable fog properly.
This is a first step towards cleaning up the fog mess. The fog
parameter is added to the pixelshader compile args structure. That way
multiple pshaders are compiled for different fog settings, and the
pixel shader can remove the fog line if fog is not enabled. That way
we don't need special fog start and end settings, and this allows us
to implement EXP and EXP2 fog in the future too.
2008-12-19 17:17:16 +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
Stefan Dösinger
704f9ea5d1 wined3d: Get rid of IWineD3DPixelShaderImpl_GenerateShader. 2008-12-16 14:36:25 +01:00
Henri Verbeet
f3743fb402 wined3d: Shaders will never have a NULL function. 2008-12-16 12:52:04 +01:00
Henri Verbeet
8553665cb1 wined3d: Move the shader version to reg_maps. 2008-12-15 14:00:26 +01:00
Henri Verbeet
f36c377d0e wined3d: We only care is a sampler is sampled at all in device_map_vsamplers(), not the specific type. 2008-12-12 11:40:26 +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
Henri Verbeet
441f515d08 wined3d: Don't trace the shader if nobody's looking. 2008-12-11 12:14:55 +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
9541c346b3 wined3d: Remove some more unused code. 2008-12-11 12:14:40 +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
acbdd807b6 wined3d: Don't leak memory in IWineD3DPixelShaderImpl_GenerateShader().
This fixes a regression introduced by commit
0bf32b12f5.
2008-12-09 11:27:02 +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
5532c990b6 wined3d: Const correctness fixes. 2008-12-02 14:04:15 +01:00