Commit Graph

287 Commits

Author SHA1 Message Date
Henri Verbeet 8553665cb1 wined3d: Move the shader version to reg_maps. 2008-12-15 14:00:26 +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 b409061337 wined3d: Make some constant arrays also static.
As pointed out by Dan Kegel.
2008-12-10 10:50:37 +01:00
Henri Verbeet 4997bee1bf wined3d: Add functions to initialize and free shader buffers. 2008-12-09 11:27:13 +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 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 9f2fa8ba25 wined3d: Remove sampled_format from IWineD3DBaseShaderClass, it isn't used anywhere. 2008-12-04 11:59:14 +01:00
Henri Verbeet 70968e69ac wined3d: Use a bitmask to store which bool and int constants are set.
Note that constants_set was never actually NULL for
shader_glsl_load_constantsB() and shader_glsl_load_constantsI().
2008-12-03 09:49:10 +01:00
Andrew Talbot 89509eb628 wined3d: Sign-compare warnings fix. 2008-12-01 14:25:52 +01:00
Henri Verbeet fecfddfb3a wined3d: Const correctness fixes for glsl_shader.c. 2008-11-26 12:05:21 +01:00
Henri Verbeet d8f6e63541 wined3d: Const correctness fixes for arb_program_shader.c. 2008-11-26 12:05:14 +01:00
Henri Verbeet cfb3bea895 wined3d: Make the SHADER_OPCODE_ARG parameter to shader handlers const. 2008-11-26 12:05:06 +01:00
Henri Verbeet eb78c2a082 wined3d: Const correctness fixes for utils.c. 2008-11-26 12:04:56 +01:00
Stefan Dösinger 2f98fce9cf wined3d: Put the ps compile parameters into the glsl program hashmap.
This avoids the double search for a pixel shader. The pixel shader
compilation parameter structure is recorded in the GLSL program
hashmap, together with the WineD3D pixel shader.
2008-11-25 13:07:23 +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 aed9305c78 wined3d: Store shader IDs in the vs and ps impl structures. 2008-11-25 13:06:45 +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
Stefan Dösinger 620a423b22 wined3d: Kill the GL_ATI_envmap_bumpmap code.
GL_ATI_envmap_bumpmap provides two things: Signed V8U8 pixel formats,
and bump mapping. The extension is only supported on fglrx, and this
driver also supports GL_ARB_fragment_program.  Thus the bump mapping
code is never used on any driver out there.  Furthermore, if it is
used, it tends to crash the driver

The signed pixel format is used, as it can be used by pixel shaders or
the ARBfp replacement. However, the format is broken in fglrx, and
negative values are clamped to 0.0. This results in test
failures. WineD3D has an alternative codepath using scale+bias to
enable V8U8 using a standard signed RGB which works correctly on
fglrx.
2008-11-04 11:41:14 +01:00
Henri Verbeet dfde4c91e0 wined3d: vertexshader should never be NULL in generate_param_reorder_function() (LLVM/Clang). 2008-11-03 11:49:41 +01:00
Henri Verbeet 795c4a77aa wined3d: Handle projected cube textures. 2008-10-29 11:52:11 +01:00
Henri Verbeet b33ddbde6a wined3d: Support some more texture types for GLSL depth blts. 2008-10-28 12:33:36 +01:00
Henri Verbeet 437b342424 wined3d: Pass explicit texcoords to depth blt. 2008-10-28 12:33:27 +01:00
Henri Verbeet 57401fcab2 wined3d: Pass the texture type to the shader depth blt function. 2008-10-28 12:33:18 +01:00
Tobias Jakobi e79d89ff40 wined3d: Fix some typos. 2008-10-21 11:53:40 +02:00
Henri Verbeet bf187ed1e0 wined3d: Set the sampler only once in shader_glsl_select_depth_blt().
It (obviously) never changes.
2008-10-20 12:23:26 +02:00
Alexandre Julliard 6cfef95ce7 wined3d: Convert source files to utf-8. 2008-10-18 19:21:20 +02:00
Henri Verbeet 3643d59d5b wined3d: Make sure some variables are always initialized. 2008-10-09 12:14:26 +02:00
Henri Verbeet 5ba40c3d58 wined3d: Make some more GLSL functions private to the backend. 2008-09-24 12:53:23 +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 c2178eb64f wined3d: Make some GLSL structs and functions private to the backend. 2008-09-16 22:33:35 +02:00
Henri Verbeet 4987ffff1f wined3d: Correct a comment. 2008-09-10 12:03:48 +02:00
Stefan Dösinger af8d268a39 wined3d: Handle projected textures properly in arbfp and atifs.
GL_ARB_fragment_program and GL_ATI_fragment_shader can disable
projected textures properly, and they can also handle
D3DTTFF_PROJECTED | D3DTTFF_COUNT3 properly.
2008-08-28 11:24:49 +02:00
Stefan Dösinger c38b2fe09e wined3d: Filter out more spam. 2008-08-21 13:34:23 +02:00
Stefan Dösinger bfe7067973 wined3d: Ask the ffp/shader/blit implementation about format support.
If a format is not supported natively by opengl, a shader may be able
to convert it. Up to now, CheckDeviceFormat had magic knowldge which
GL extensions lead to which supported format. This patch adds
functions that allow CheckDeviceFormat to ask the actual
implementation for its capabilities.
2008-08-20 12:26:02 +02:00
Francois Gouget a793888a28 Assorted spelling fixes. 2008-08-04 13:04:48 +02:00
Stefan Dösinger bc4435e406 wined3d: Use a hashmap to store the ffp shaders. 2008-07-31 13:01:50 +02:00
Stefan Dösinger 726d9d47af wined3d: ATI2N support using GL_EXT_texture_compression_rgtc. 2008-07-24 11:56:42 +02:00
Stefan Dösinger dc25a86cc5 wined3d: Support ATI's D3DFMT_ATI2N format.
This is an ATI specific format designed for compressed normal maps,
and quite a few games check for its existence. While it is an
ATI-specific "extension" in d3d9, it is a core part of
D3D10(DXGI_FORMAT_BC5), and supported on Geforce 8 cards.
2008-07-24 11:56:24 +02:00
Stefan Dösinger e4078fb0ba wined3d: Set ffp caps in the ffp backend, not the shader backend. 2008-07-11 14:32:53 +02:00
Stefan Dösinger c48195e417 wined3d: Move shader_fragment_enable to the fragment pipeline implementation.
It isn't related to the shader backend any longer. The nvts_enable in
the ffp code isn't quite right as well, it should be moved away once
there is a dedicated nvts fragment pipeline replacement
2008-07-11 14:32:37 +02:00
H. Verbeet b37cc08721 wined3d: Don't call shader_select() in depth_blt().
Calling shader_select() from inside depth_blt() isn't necessarily
safe. shader_select() assumes CompileShader() has been called for the
current shaders, but that depends on STATE_VSHADER / STATE_PIXELSHADER
being applied. That isn't always true when depth_blt() gets called,
with the result that sometimes GLSL programs could be created with no
shader objects attached.
2008-07-10 20:33:29 +02:00
H. Verbeet 54ae3ebfd4 wined3d: Destroy depth_blt resources in the backend's destructor.
No need to expose this in the interface.
2008-07-10 12:17:06 +02:00
H. Verbeet a85a5ffb1b wined3d: Store the glsl program lookup table in the backend's private data. 2008-07-09 10:42:57 +02:00
Stefan Dösinger 3a2743f25d wined3d: Remove the state table from the shader backend. 2008-07-08 21:08:54 +02:00
Stefan Dösinger 2d7cdc3ec2 wined3d: Remove the DLL load init function. 2008-07-08 21:08:54 +02:00
H. Verbeet a637fda7bf wined3d: Store the current GLSL program in the backend's private data. 2008-07-08 10:47:30 +02:00
Andrew Talbot 6ced8a3f55 wined3d: Remove unneeded address-of operators from function names. 2008-07-07 12:32:39 +02:00
H. Verbeet d76de4eede wined3d: Specify the GLSL language version our shaders are written to.
This prevents some driver warnings when using language features from
1.20, like "first class arrays".
2008-07-01 12:26:05 +02:00