Commit Graph

194 Commits

Author SHA1 Message Date
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 4aa00e8a21 wined3d: Rename texture_stage_op.color_correction to texture_stage_op.color_fixup.
This is consistent with other uses of struct color_fixup_desc.
2008-12-10 10:50:24 +01:00
Henri Verbeet ce4d03318b wined3d: Fix some spelling errors. 2008-12-09 11:27:51 +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 b451048eb7 wined3d: Move GlPixelFormatDesc to wined3d_private.h where it belongs.
Also remove the silly typedef.
2008-12-04 11:59:06 +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 33482a732e wined3d: Enable blue = 1.0 fixup for D3DFMT_V8U8.
The dx7 sdk demos need this.
2008-11-25 13:07: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
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 5c79a9f437 wined3d: Rename the fragment ffp desc structures.
This reflects the fact that they describe the fragment pipeline.
The vertex pipeline will use its own structures.
2008-11-20 12:17:45 +01:00
Stefan Dösinger 234e995bdc wined3d: Make sure the arbfp pipeline replacement constants are loaded.
The code here skipped constant loading when a pixel shader was in use,
and only reloaded them on ffp use if the shader implementation used
ARB too. This way a e.g. texfactor change could get lost if GLSL
shaders are used, and the texfactor changed while a pixel shader was
in use.
2008-11-20 12:16:57 +01:00
Henri Verbeet 495fcc72a6 wined3d: Avoid using a stack buffer in a few places in shader_hw_map2gl(). 2008-11-19 14:22:49 +01:00
Henri Verbeet 9b118cc345 wined3d: Give mov & mova their own handler. 2008-11-19 14:22:41 +01:00
Henri Verbeet bd427f58a0 wined3d: Make it more obvious the pshader path in shader_hw_map2gl() doesn't handle opcodes without parameters. 2008-11-19 14:22:34 +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
Stefan Dösinger 8b38533f69 wined3d: Restore the fragment replacement prog after depth_blt.
The current code properly enabled/disabled GL_ARB_fragment_program
after a depth blit, but it did not restore the bound fragment program
properly. This leads to problems if a depth blit was done between two
draws without any change of the fragment processing settings.
2008-11-03 13:34:13 +01:00
Henri Verbeet 373a43442d wined3d: Remove a FIXME that doesn't apply anymore. 2008-11-03 11:49:20 +01:00
Henri Verbeet c090471a49 wined3d: Properly break in get_argreg() (LLVM/Clang). 2008-10-31 12:58:37 +01:00
Henri Verbeet 17ab7f6b83 wined3d: Support some more depth blt texture types for arb programs. 2008-10-29 11:51:54 +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
Roderick Colenbrander 3a1aeef7c7 wined3d: Add ENTER_GL/LEAVE_GL to gen_yuv_shader. 2008-10-20 11:37:54 +02:00
Roderick Colenbrander 5163a360e0 wined3d: arbfp_blit_unset should call ENTER_GL/LEAVE_GL instead of the caller. 2008-10-20 11:37:46 +02:00
Roderick Colenbrander 8a002b09c1 wined3d: arbfp_set_shader_blit should handle ENTER_GL/LEAVE_GL instead of the caller. 2008-10-20 11:37:38 +02:00
Alexandre Julliard 6cfef95ce7 wined3d: Convert source files to utf-8. 2008-10-18 19:21:20 +02:00
Henri Verbeet 9aaccfe77f wined3d: Correct some swizzles and write masks in arb_program_shader. 2008-10-09 12:14:21 +02:00
Henri Verbeet a0940051eb wined3d: Make some more ARB program functions private to the backend. 2008-09-24 12:53:16 +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 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
Henri Verbeet ee49230cd2 Make some ARB program structs and functions private to the backend. 2008-09-16 22:33:42 +02:00
Roderick Colenbrander e3e113383e wined3d: Degrade an ERR to a TRACE. 2008-09-15 11:29:20 +02:00
Stefan Dösinger ae7572217d wined3d: Some ARB code fixes. 2008-09-11 11:43:34 +02:00
Stefan Dösinger 035729ab97 wined3d: Don't disable arbfp if the pipeline replacement is in. 2008-09-11 11:43:30 +02:00
Jeff Zaroyko 6a14bcc824 wined3d: Add missing HeapFree. 2008-09-08 12:31:43 +02:00
Stefan Dösinger 271f56c9f1 wined3d: Close a pshader on-off switching loophole. 2008-09-05 11:23:19 +02:00
Stefan Dösinger ab74030ec5 wined3d: Optimize the projected bump map handling. 2008-09-02 14:56:57 +02:00
Stefan Dösinger d60ece20b5 wined3d: Implement secondary color in the arbfp ffp pipeline. 2008-09-02 14:56:15 +02:00
Stefan Dösinger 422eebd2c3 wined3d: BLENDTEXTUREALPHAPM reads the texture. 2008-09-02 14:55:57 +02:00
Stefan Dösinger 3b48660f43 wined3d: Implement YV12 support for emulated overlays.
This is the prefered format of many codecs, and for some codecs this
is the only supported output format. As usual I try to handle all the
conversion in the GPU and keep the CPU involvement minimal to gain the
full performance of PBO transfers.
2008-09-02 14:55:50 +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 005e5e868e wined3d: Replace an #if 0 with if(0). 2008-08-28 11:24:49 +02:00
Stefan Dösinger dda59e361c wined3d: Update the arbfp shader on a texturetransformflags change. 2008-08-27 13:21:24 +02:00
Stefan Dösinger 9b94c0abb9 wined3d: Make the alphaop == colorop matching a bit smarter. 2008-08-26 12:07:41 +02:00