Commit Graph

198 Commits

Author SHA1 Message Date
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
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
Stefan Dösinger dd8905543b wined3d: Pass some stateblock values around directly.
This was suggested by Ivan quite a while ago, and we need it to better
handle conflicting texture format corrections and similar stateblock
value changes which until now required a recompilation of the entire
shader
2008-11-25 13:06:35 +01:00
Stefan Dösinger ff767f4984 wined3d: Make the shader backend call CompileShader.
A number of considerations contribute to this:

1) The shader backend knows best which shader(s) it needs. GLSL needs
both, arb only one
2) The shader backend may pass some parameters to the compilation
code(e.g. which pixel format fixup to use)
3) The structures used in (2) are different in vs and ps, so a
baseshader::Compile won't work
4) The structures in (2) are wined3d-private structures, so
having a public method in the vtable won't work(its a bad idea
anyway).
2008-11-25 13:06:23 +01:00
Alexandre Julliard 6cfef95ce7 wined3d: Convert source files to utf-8. 2008-10-18 19:21:20 +02:00
Henri Verbeet 2e76954097 wined3d: Move part of the shader instruction table to the backend. 2008-09-24 12:53:05 +02:00
Henri Verbeet e2bc8dfe3b wined3d: Use shader_glsl_log() in some more places. 2008-09-23 12:25:32 +02:00
Henri Verbeet ca28930113 wined3d: Merge pshader_hw_map2gl() and vshader_hw_map2gl().
This isn't the prettiest way to merge those functions, but it's a start.
2008-09-23 12:25:27 +02:00
Stefan Dösinger a580325a47 wined3d: Remove some more junk code. 2008-08-28 11:24:49 +02:00
H. Verbeet a6fa6a4a31 wined3d: Use gl_Color and gl_SecondaryColor to support more varyings in SM3.0 shaders.
SM3.0 requires 10 4 component float varyings for passing stuff between
vertex and pixel shaders. GF7 and earlier report 8 generic varyings +
gl_Color and gl_SecondaryColor in GLSL. This patch allows us to use
gl_Color and gl_SecondaryColor to get 2 extra varyings, which some
games, like C&C3 with highest gfx settings, require.
2008-06-19 11:47:52 +02:00
Stefan Dösinger b1d8af7926 wined3d: Update copyright lines. 2008-04-02 20:22:42 +02:00
Stefan Dösinger a66fb40d83 wined3d: Move shader generation into the shader backend.
Generating the shader ID and parts of the shader prolog and epilog was
done by the common vertexshader.c / pixelshader.c, which is ugly.

This patch doesn't get rid of all the uglyness, somewhen we'll still
have to sort out the relationship of [arb|glsl]_generate_shader and
[arb|glsl]_generate_declarations.
2008-03-25 19:35:58 +01:00
Stefan Dösinger 167a271434 wined3d: Support more than one texbem instruction per shader. 2008-03-05 19:22:44 +01:00
Austin English 3471f841a1 wined3d: Spelling fixes. 2008-01-18 12:53:33 +01:00
Stefan Dösinger 29a0b3622c wined3d: Fix a pixelshader recompilation check. 2008-01-08 17:04:49 +01:00
Stefan Dösinger 3fd0916654 wined3d: Make the code aware of GL_ARB_texture_rectangle. 2007-11-29 13:36:37 +01:00
Stefan Dösinger ba5c61ba20 wined3d: Fog is applied after sRGB correction. 2007-11-27 16:01:44 +01:00
Stefan Dösinger d2ac521cd3 wined3d: Make SRGB write correction working with 1.x shaders in arb. 2007-11-27 15:18:36 +01:00
Stefan Dösinger cfc5725760 wined3d: Move glsl shader destruction to the glsl shader backend. 2007-11-21 12:06:27 +01:00
Stefan Dösinger bd97580683 wined3d: Move IUnknown functions to IWineD3DBaseShader. 2007-11-20 12:53:07 +01:00
Stefan Dösinger edb78187a9 wined3d: Hardcode local constants into the shader if possible. 2007-11-14 11:51:26 +01:00
Stefan Dösinger 335bd99262 wined3d: Actually store the PS's vertex processing flag. 2007-11-09 12:41:12 +01:00
Stefan Dösinger 36330f0542 wined3d: Fix the varying number comparison. 2007-11-08 11:54:13 +01:00
Stefan Dösinger 1b23dd1ba1 wined3d: Implement the varying map. 2007-11-07 12:08:32 +01:00
Stefan Dösinger 409103f801 wined3d: Install a varying map. 2007-11-07 12:08:24 +01:00
Stefan Dösinger 3febe738ab wined3d: Handle ps 3.0 varyings in a different way. 2007-11-06 13:34:57 +01:00
Stefan Dösinger 8f3accc718 wined3d: Care for the inverted y coords in dsy. 2007-10-22 15:59:04 +02:00
Francois Gouget fda899a778 Assorted spelling fixes. 2007-10-11 19:52:49 +02:00
Stefan Dösinger 3d3369a77c wined3d: d3d ignores the sign of the input value in the log instruction. 2007-10-03 11:03:12 +02:00