Commit graph

828 commits

Author SHA1 Message Date
H. Verbeet
3d2ae69102 wined3d: Allow async occlusion queries. 2006-08-07 19:59:49 +02:00
H. Verbeet
008c23d06a wined3d: Improve a few query traces.
The query type is useful to have in query TRACEs.
IWineD3DQueryImpl_GetDataSize isn't really a stub.
2006-08-07 19:42:54 +02:00
H. Verbeet
44c1747f71 wined3d: Check Occlusion query GL calls. 2006-08-07 19:42:39 +02:00
H. Verbeet
02a8f74490 wined3d: Add a couple of traces to the vertexdeclaration creation code. 2006-08-07 19:42:31 +02:00
Francois Gouget
ce9b4baad8 Assorted spelling fixes. 2006-08-07 13:52:55 +02:00
Roderick Colenbrander
930a9a1d02 wined3d: texture caps fixes. 2006-08-07 13:52:38 +02:00
Roderick Colenbrander
bd6f0b23d6 wined3d: General constant caps fix. 2006-08-07 13:52:03 +02:00
H. Verbeet
219ca7c2a0 wined3d: Fix D3DCOLOR swizzling in shaders. 2006-08-07 13:12:21 +02:00
H. Verbeet
ef87a40c72 wined3d: Delay vertex shader compilation until the shader is first used. 2006-08-07 13:12:10 +02:00
Roderick Colenbrander
3d9e96f3bc wined3d: Volume textures fix. 2006-08-05 11:26:25 +02:00
Roderick Colenbrander
6ded5542b2 wined3d: Raster caps fix. 2006-08-05 11:26:06 +02:00
Roderick Colenbrander
6fedd6c041 wined3d: Primitive misc caps fix. 2006-08-05 11:25:51 +02:00
Roderick Colenbrander
9925b0561e wined3d: Basetexture anisotropic fix. 2006-08-04 20:48:08 +02:00
Roderick Colenbrander
95b047c2fe wined3d: Fix a number of badly reported caps. 2006-08-04 20:47:50 +02:00
Roderick Colenbrander
a7c2ab3e90 wined3d: Surface pitch fix. 2006-08-04 11:59:00 +02:00
H. Verbeet
ea905eab09 wined3d: Disable vertex arrays after we're done drawing from them.
After drawing from a vertex array we should disable them, to prevent
the next draw calls from potentially reading past their ends. This
also moves the disabling of vertex attrib arrays (for shaders) into
its own function.
2006-08-04 11:58:43 +02:00
Roderick Colenbrander
c0c525d458 wined3d: Paletted texture support. 2006-08-03 18:20:37 +02:00
Chris Robinson
13557abb7f wined3d: Fix potential NULL dereference in IWineD3DSurfaceImpl_LockRect. 2006-07-31 17:20:15 +02:00
Chris Robinson
92bc96a96b wined3d: Avoid NULL dereference. 2006-07-31 17:20:05 +02:00
H. Verbeet
d5238cfb38 wined3d: Split the GLSL check in a check for GLSL vertex shaders and one for GLSL fragment shaders. 2006-07-31 10:53:05 +02:00
H. Verbeet
c6c6cf1f51 wined3d: Improve IWineD3DDeviceImpl_CreateTexture trace. 2006-07-31 10:53:00 +02:00
H. Verbeet
56395ca5f3 wined3d: Use GL_LIMITS(samplers) instead of GL_LIMITS(sampler_stages) in IWineD3DSurfaceImpl_UnlockRect. 2006-07-31 10:52:55 +02:00
Jason Green
e5fc18a505 wined3d: Skip processing of D3DSIO_PHASE instruction. 2006-07-29 11:50:10 +02:00
Jason Green
2e52b36bb3 wined3d: Declare a 1D sampler for TEXDP3TEX (GLSL). 2006-07-29 11:50:02 +02:00
Jason Green
d353ab7879 wined3d: Start checking for D3DUSAGE_QUERY_* items, improve traces. 2006-07-29 11:49:51 +02:00
Roderick Colenbrander
dc743d82ff wined3d: Optimize d3dfmt_convert_surface. 2006-07-29 11:49:03 +02:00
Jason Green
72bfe131d1 wined3d: More shader fixes / new instructions.
- Replace gl_FragColor with gl_FragData[0] for GLSL pixel shader output.
- Subtract 1 more constant from total GLSL allowed float constants to
  accommodate the PROJECTION matrix row that we reference.
2006-07-28 14:01:16 +02:00
Roderick Colenbrander
6d16eff9a6 wined3d: Render target texturing. 2006-07-28 14:01:07 +02:00
Stefan Dösinger
65e5ed60ae wined3d: Do not use the IWineD3DSurface for the cursor. 2006-07-28 12:31:57 +02:00
Stefan Dösinger
0fbc1fc0df wined3d: Avoid a false ERR. 2006-07-28 12:28:19 +02:00
Jason Green
0312a30676 wined3d: Fix minor typo from shader patch. 2006-07-27 14:40:01 +02:00
Jason Green
46c4b88ba5 wined3d: Fix some upside-down rendering issues for shaders. 2006-07-27 12:03:25 +02:00
Roderick Colenbrander
3127d6401a wined3d: BltFast/BltOverride color keying. 2006-07-27 12:02:16 +02:00
Stefan Dösinger
3588067b90 wined3d: Blacklist WINED3DFMT_R8G8B8. 2006-07-27 11:57:45 +02:00
Kovács András
de051649c3 wined3d: Fix CopyRects if pDestPointsArray is NULL. 2006-07-26 15:40:39 +02:00
Stefan Dösinger
3b10a021db wined3d: More efficient color keying dirtifying.
Instead of blindly dirtifying the surface LoadTexture keeps track of
the color key that was used when creating the opengl texture and
reloads the surface if the color key has changed.
2006-07-26 15:21:00 +02:00
Stefan Dösinger
06106e2810 ddraw: Support using an application-provided surface pointer. 2006-07-26 15:17:59 +02:00
Stefan Dösinger
a5142837c6 wined3d: Enable all bump mapping formats. 2006-07-26 10:24:37 +02:00
Jason Green
f6b88b93ad wined3d: Fix crash caused by bad TRACE. 2006-07-26 10:24:27 +02:00
Michael Stefaniuc
5ca9f82661 wined3d: Remove superfluous breaks. 2006-07-26 10:24:15 +02:00
Jason Green
7e90aba97b wined3d: Implement more GLSL instructions.
Implement D3DSIO_TEXREG2AR, TEXREG2GB, TEXREG2RGB, TEXM3X3TEX, TEXM3X3SPEC.
2006-07-25 11:22:55 +02:00
H. Verbeet
536638918d wined3d: Add real occlusion query support. 2006-07-25 11:22:00 +02:00
H. Verbeet
8c981140a2 wined3d: Add traces to IWineD3DVertexShaderImpl_SetFunction & IWineD3DPixelShaderImpl_SetFunction. 2006-07-25 11:21:51 +02:00
H. Verbeet
2d6e661fbe wined3d: D3d8 shaders can have a NULL pFunction, but a valid vertex declaration. 2006-07-25 11:21:46 +02:00
Jason Green
ac8f2c033c wined3d: Improve traces for D3DTRANSFORMSTATETYPE.
Added debug function for WINED3DTRANSFORMSTATETYPE and changed all
references from D3DTS_* to WINED3DTS_*.
2006-07-24 19:55:27 +02:00
Stefan Dösinger
a98ccb543d wined3d: Draw the cursor. 2006-07-24 13:27:15 +02:00
Stefan Dösinger
14c2aa0ed6 wined3d: Use the ddraw blitting code for IWineD3DDevice::ColorFill. 2006-07-24 13:27:15 +02:00
Jason Green
75950b5bf8 wined3d: Replace memset/memcpy routines on stateblock (fixes dynamic shader constants regression). 2006-07-24 12:57:34 +02:00
Stefan Dösinger
127613bc6f wined3d: Whitelist pixelformats instead of blacklisting. 2006-07-24 12:57:34 +02:00
Stefan Dösinger
a64febd3d1 wined3d: Reactivate the X bits fixup. 2006-07-24 12:57:33 +02:00
Jason Green
3c03ae2f84 wined3d: Minor trace corrections in Set___ShaderConstants(). 2006-07-21 20:22:19 +02:00
Stefan Dösinger
9423fd2d9f wined3d: Do not try to create a vbo more than once. 2006-07-21 20:21:00 +02:00
Stefan Dösinger
d637aa3581 wined3d: Move vertex fixups into their own function. 2006-07-21 20:20:54 +02:00
Ivan Gyurdiev
99f67c676b wined3d: Respect EnableAutoDepthStencil parameter. 2006-07-21 10:54:43 +02:00
Ivan Gyurdiev
99272f0dee wined3d: Correct initial render states. 2006-07-21 10:54:12 +02:00
Ivan Gyurdiev
65109002ae wined3d: Do not return WINED3DERR_INVALIDCALL for Phong shading. 2006-07-21 10:53:54 +02:00
Ivan Gyurdiev
0c6c9f04a7 wined3d: Restore recording mode later in ActiveRender(). 2006-07-21 10:53:34 +02:00
Ivan Gyurdiev
b77b72c91b wined3d: Read shader constants from correct stateblock. 2006-07-21 10:53:01 +02:00
H. Verbeet
a8f2c1075a wined3d: Compilation fixes. 2006-07-20 12:11:06 +02:00
Jason Green
718716b77a wined3d: Make the number of floating point shader constants dynamic. 2006-07-19 09:54:30 +02:00
Stefan Dösinger
bffe5a6922 ddraw/wined3d: Remove texture format enumeration functions. 2006-07-18 11:25:22 +02:00
Stefan Dösinger
9740555d83 wined3d: Duplicate flips in software if the local copy is up to date. 2006-07-18 11:24:51 +02:00
Stefan Dösinger
9a9a14d4f5 wined3d: Disable the fog before writing the back buffer data. 2006-07-18 11:24:08 +02:00
Stefan Dösinger
739d565c59 wined3d: Add a setting for the render target locking method. 2006-07-18 11:22:51 +02:00
Stefan Dösinger
f8ca32b3fb wined3d: Break the glDrawPixels call out of UnlockRect. 2006-07-18 11:22:09 +02:00
Christian Costa
2dc451e181 wined3d: Readd missing copyright to shaders files. 2006-07-18 11:10:34 +02:00
Christian Costa
95ac88cc0b wined3d: Fix typo in ARB pixel shader. 2006-07-18 11:10:23 +02:00
H. Verbeet
593541a50c wined3d: Increment texture_idx when continuing as well. 2006-07-18 11:09:46 +02:00
Jason Green
6a97f2202e wined3d: Fix for vertex shaders. 2006-07-17 15:05:38 +02:00
Stefan Dösinger
ecbb53a723 wined3d: Break out the frame buffer readback of LockRect, implement palettized readback. 2006-07-17 15:05:38 +02:00
Stefan Dösinger
5702a310e9 wined3d: Allocate 4 extra bytes in the dib section. 2006-07-17 13:51:12 +02:00
Christian Costa
494841d3e5 wined3d: Only copy memory corresponding to the dib section instead of the power of 2 surface. 2006-07-14 13:32:40 +02:00
Ivan Gyurdiev
436d700c2e wined3d: Fix cmp instruction for GLSL.
The current GLSL cmp instruction is incorrect, because:
- it ignores destination write mask
- it ignores source swizzle
- it ignores other source modifiers.
- it works incorrectly for src0 = 0
2006-07-14 13:32:38 +02:00
Ivan Gyurdiev
07eb6531a3 wined3d: Fix light state bugs. 2006-07-14 12:39:13 +02:00
H. Verbeet
0924f969d1 wined3d: Texture stages that reference NULL textures should just pass
through the result of the previous stage.
2006-07-12 13:21:04 +02:00
H. Verbeet
7090259545 wined3d: Fix specular color handling for register combiners.
By default the FinalCombiner is setup to add the specular color to the
final result of the combiner operations. However, it should only do
this when the WINED3DRS_SPECULARENABLE renderstate is enabled.
2006-07-12 13:20:41 +02:00
Stefan Dösinger
0dd13f2cb7 wined3d: Check the color data type too when deciding whether to convert data. 2006-07-12 13:20:25 +02:00
Ivan Gyurdiev
ed9848930b wined3d: Improve GetAdapterMonitor stub. 2006-07-11 17:14:46 +02:00
Ivan Gyurdiev
33293df143 wined3d: More flow control instructions.
- Implement call, callnz, label, and ret
- Implement support for NOT modifier
2006-07-11 17:14:24 +02:00
Ivan Gyurdiev
6ede56495a wined3d: More flow control instructions
- Implement if, else, endif, rep, endrep, break
- Implement ifc, breakc, using undocumented comparison bits in the instruction token
- Fix bug in main loop processing of codes with no dst token
- Fix bug in GLSL output modifier processing of codes with no dst token
- Fix bug in loop implementation (src1 contains the integer data, src0 is aL)
- Add versioning for all the instructions above, and remove
  GLSL_REQUIRED thing, which is useless and should be removed from all
  opcodes in general.
2006-07-11 17:13:05 +02:00
Ivan Gyurdiev
345dd49eda wined3d: Fix off-by-one constants bug. 2006-07-11 17:12:24 +02:00
Ivan Gyurdiev
8068fc3b9c wined3d: Clamp texcoord output between 0 and 1. 2006-07-11 17:12:04 +02:00
Ivan Gyurdiev
e9de563e41 wined3d: Place immediate constants in the same array as global constants.
- move DEF, DEFI, DEFB handling into the register counting pass
- keep track of defined constants as a linked list (because there's a
  few of them)
- apply immediate constants after global constants in the constant
  loading function
- both types of constants now get loaded with array notation in the
  shader (into the same array)
2006-07-11 17:11:30 +02:00
Louis. Lenders
2ce792fd33 wined3d: Add an "\n" to a fixme to fix another overflow (in IWineD3DImpl_CheckDeviceFormatConversion). 2006-07-11 12:41:29 +02:00
Alexandre Julliard
5258e061dc make_dlls: Ignore generated import libraries from the top-level .gitignore. 2006-07-10 20:55:58 +02:00
Alexandre Julliard
cc2b3b48e6 Take advantage of the recursive nature of .gitignore for Makefile entries.
Prefix other entries with '/' to make them non-recursive.
2006-07-10 20:47:54 +02:00
Ivan Gyurdiev
c58e06548e wined3d: Fix typo breaking 3.0 pshaders color input. 2006-07-10 11:48:11 +02:00
Stefan Dösinger
eb527c82e2 Add a common fps counter channel to ddraw, opengl and d3d. 2006-07-07 17:52:46 +02:00
Ivan Gyurdiev
5638fac685 wined3d: Trace ABS/ABSNEG modifiers. 2006-07-07 17:40:03 +02:00
Ivan Gyurdiev
899c8cdb64 wined3d: Create fake input semantics for d3d8 shaders.
Use them to remove the need for loading arrays in two different places.
2006-07-07 17:39:52 +02:00
Ivan Gyurdiev
5b3c500efe wined3d: Reverse semantics maps for shaders. 2006-07-07 17:39:26 +02:00
Ivan Gyurdiev
c611012df5 wined3d: Make WINED3D_ATR macros more flexible.
Make them operate on a type, as opposed to a semantic name.
2006-07-07 17:37:25 +02:00
Ivan Gyurdiev
c202bfe40d wined3d: Simplify primitiveDeclartationConvertToStrided.
Assign fixed indices to declaration inputs.
Then use a common path to load the strided data.
2006-07-07 17:36:24 +02:00
Ivan Gyurdiev
85aa8ab855 wined3d: Add position_transformed flag to Strided data format. 2006-07-07 17:35:36 +02:00
Ivan Gyurdiev
fc2611d4a8 wined3d: Only link and use GLSL program if at least one GLSL shader is available. 2006-07-07 17:28:21 +02:00
Jason Green
c562c4c771 wined3d: Fix D3DSIO_TEXKILL for GLSL. 2006-07-07 16:57:51 +02:00
Michael Stefaniuc
00e779370f janitorial: Put "inline static" at the beginning of a declaration. 2006-07-07 14:30:35 +02:00
Michael Stefaniuc
32b1a24501 janitorial: Move the storage specifier to the beginning of the declaration. 2006-07-07 14:30:35 +02:00
Jason Green
3529e0ceeb wined3d: Fix D3DSIO_M#X# instruction for both ARB and GLSL shaders.
This instruction was being handled incorrectly in the case where the
2nd src argument contained a relatively addressed constant.
2006-07-06 16:31:24 +02:00
Ivan Gyurdiev
0472e9cd49 wined3d: Clean up drawPrimitive/drawPrimitiveDrawStrided. 2006-07-06 16:07:38 +02:00
Ivan Gyurdiev
1309844913 wined3d: Implement FVF to DECL9 conversion (with tests). 2006-07-06 16:07:38 +02:00
Ivan Gyurdiev
276609e1e5 wined3d: Move register count pass to SetFunction.
Move semantics pointers out of the reg_maps, make them persistent data
in the shader (again, for future software shaders).
2006-07-06 16:07:38 +02:00
Ivan Gyurdiev
bbe7b40a71 wined3d: Fix STREAM flag override. 2006-07-06 16:07:38 +02:00
Ivan Gyurdiev
e260e9fd98 wined3d: Add missing PSIZE register for decl8->9 conversion. 2006-07-06 16:07:38 +02:00
Ivan Gyurdiev
b324fc0fdb wined3d: Allow mix of SW vertex and GLSL pixel shader.
Do not attach non-GLSL shaders to the GLSL program, that will cause a
crash. Mix with ARB shaders is never going to happen, because the
selection code will always choose GLSL for both or ARB for both.
2006-07-06 16:07:37 +02:00
Ivan Gyurdiev
771623692e wined3d: Rework shader mode selection.
- currently half the shader selection code (GLSL vs ARB) is in
fillGLcaps. The parts that check for software shaders are in
GetDeviceCaps. That placement, will work, but is definitely not optimal.
FillGLcaps should detect support - it should not make decision as to
what's used, because that's not what the purpose of the function is.
GetDeviceCaps should report support as it has already been selected.
Instead, select shader mode in its own function, called in the
appropriate places.

- unifying pixel and vertex shaders into a single selection is a
mistake. A software vertex shader can be coupled with a hardware arb or
glsl pixel shader, or no shader at all. Split them back into two and add
a SHADER_NONE variant.

- drawprim is doing support checks for ARB_PROGRAM, and making shader
decisions based on that - that's wrong, support has already been
checked, and decided upon, and shaders can be implemented via software,
ARB_PROGRAm or GLSL, so that support check isn't valid.

- Store the shader selected mode into the shader itself. Different types
of shaders can be combined, so this is an improvement. In fact, storing
the mode into the settings globally is a mistake as well - it should be
done per device, since different cards have different capabilities.
2006-07-06 16:07:37 +02:00
Stefan Dösinger
1a82976908 wined3d: Flip WINED3DFMT_R8G8B8 to GL_RGB. 2006-07-06 12:45:27 +02:00
Ivan Gyurdiev
7e9fd0b4c1 wined3d: Add a function to print out D3DDECLUSAGE9 values. 2006-07-03 12:04:37 +02:00
Ivan Gyurdiev
0111e15e1f wined3d: Fix faulty DCL trace. 2006-07-03 12:04:23 +02:00
Ivan Gyurdiev
1bfec25031 wined3d: Resync ARB mnxn function with GLSL mnxn function. 2006-07-03 12:04:09 +02:00
Ivan Gyurdiev
fd896d8652 wined3d: Use shader_get_regtype() in register counting pass. 2006-07-03 12:03:58 +02:00
Ivan Gyurdiev
d06e13db99 wined3d: Move SHADER_ARB code into arb_program_shader.c. 2006-07-03 12:03:31 +02:00
Ivan Gyurdiev
fce0c625f0 wined3d: Cleanup: print constants in device code. 2006-07-03 12:02:04 +02:00
Stefan Dösinger
77448f588b wined3d: Perform sanity checks on the rectangle in LockRect. 2006-06-30 20:44:27 +02:00
Jason Green
4fbe97e5e7 wined3d: Fix a few GLSL shader instruction translations.
This fixes the translations for a few instructions in GLSL and allows
Cubemap sampling in pixel shaders < 2.0.  It makes some of the
lighting on textures in Half Life 2 look better, including some of the
water effects.  It's not perfect yet, but much closer now.
2006-06-29 14:41:01 +02:00
H. Verbeet
7f9e61f7d2 wined3d: Use register combiners for texture stage operations.
Make wined3d use register combiners for texture stage operations. In
order to do that the texture unit index needs to be separated from the
texture stage index. For cards that don't support the
NV_register_combiners extension nothing should change.
2006-06-28 16:34:36 +02:00
H. Verbeet
f3a2a9f30a wined3d: Add code for using register combiners for texture stage operations.
On nVidia cards the value of GL_MAX_TEXTURE_UNITS is generally not
larger than 4. In Direct3D that would correspond to
MaxSimultaneousTextures in the caps, rather than MaxTextureBlendStages
(which can be much larger) to which it currently corresponds in
wined3d. Using register combiners we can get around that limitation
and get up to GL_MAX_GENERAL_COMBINERS_NV (typically 8) texture
stages. This patch adds code for doing the texture operations with
register combiners instead of ARB_texture_env_combine or
NV_texture_env_combine4, but doesn't make use of that code yet. That's
what the next patch will do.
2006-06-28 16:08:36 +02:00
H. Verbeet
ac98d566ac wined3d: Fix uploading of textures for shaders.
The code for uploading / binding textures for use with pixel shaders
is slightly different from the one for uploading / binding textures
for use with the fixed function pipeline. It would be possible to keep
the code in a single function with a couple of conditionals, but in
combination with the changes needed for register combiners that would
become quite messy.
2006-06-28 16:08:17 +02:00
H. Verbeet
a54e36adfe wined3d: Texture limits fixes.
GL_LIMITS(textures) is currently used for both the number of texture
stages and the maximum number of simultaneous textures. In the current
code that's the same, but in a later patch that will be separated,
since a texture stage doesn't have to reference an actual
texture. Also, shaders can access a larger number of samplers than the
number of texture units the fixed function pipeline can access.
2006-06-28 16:06:25 +02:00
H. Verbeet
085e20c0da wined3d: Add & use D3DTEXTUREOP dumping code. 2006-06-28 15:43:53 +02:00
Stefan Dösinger
cea41b0a0f wined3d: Vertex buffer can be locked multiple times. 2006-06-27 21:14:02 +02:00
Jason Green
baf38b3007 wined3d: Implement more GLSL instructions and a little cleanup.
- Implement D3DSIO_DP2ADD, D3DSIO_TEXKILL, D3DSIO_TEXM3X3PAD
- Partially implement D3DSIO_TEXBEM, D3DSIO_TEXM3X3VSPEC (as much as
  they are implemented in ARB_fragment_program at least).
- Stop copying the SHADER_PARSE_STATE struct in each ARB shader
  routine - use a pointer instead.
2006-06-27 11:16:10 +02:00
H. Verbeet
3489f1b9b1 wined3d: Remove some redundant code. 2006-06-27 11:15:54 +02:00
H. Verbeet
f460b38612 wined3d: Fix compilation (VBO constants). 2006-06-27 11:15:47 +02:00
Francois Gouget
9bfbfcbeb4 Assorted spelling, case and grammar fixes. 2006-06-26 13:06:11 +02:00
Stefan Dösinger
e18b89aca7 wined3d: Fix single buffering.
Tell gl to draw to the back buffer when a back buffer is used, do not
use the value from gl.
2006-06-26 13:03:56 +02:00
Stefan Dösinger
2a40642804 wined3d: Fix a bad trace. 2006-06-26 13:03:43 +02:00
Stefan Dösinger
2122026713 wined3d: Create vertex buffer objects for D3D vertex buffers. 2006-06-26 13:03:08 +02:00
Stefan Dösinger
232dfc9b3a wined3d: Vertex fixups. 2006-06-26 13:02:36 +02:00
Stefan Dösinger
7d31ab95e4 wined3d: Add support for VBOs to the drawing code. 2006-06-26 13:02:19 +02:00
Stefan Dösinger
495e46197a ddraw/wined3d: IDirectDrawSurface7::SetSurfaceDesc corrections. 2006-06-26 12:38:55 +02:00
Stefan Dösinger
3518747165 wined3d: Pixel format cleanup. 2006-06-21 12:15:50 +02:00
Louis. Lenders
6601e8eefe wined3d: Add an "\n" to a fixme to fix an overflow. 2006-06-21 11:16:15 +02:00
Jason Green
e0ccbeb282 wined3d: Bind correct number of samplers for GLSL shaders.
We are only checking against GL_MAX_TEXTURES when binding samplers,
when we should be checking against the maximum number of samplers that
the card supports.  Spotted by H. Verbeet.
2006-06-21 11:16:07 +02:00
Jason Green
0b09ecb291 wined3d: Move D3DSIO_DEF instruction for ARB shaders into arb_program_shader.c. 2006-06-20 11:28:15 +02:00
Jason Green
99c855e6ae wined3d: Fix DEF instructions in GLSL for non-Nvidia platforms.
- NVidia allows "const vec4 = {1.0, 2.0, 3.0, 4.0};", even though
  that's not part of the spec.
- It should be  "const vec4 = vecr4(1.0, 2.0, 3.0, 4.0);"
- This patch fixes this for D3DSIO_DEF and D3DSIO_DEFI.
2006-06-20 11:28:05 +02:00
Jason Green
c13f097de3 wined3d: Correct implementation of D3DSIO_LOOP.
I initially misread the specification.  src0.x is the iteration count,
not the max amount for the loop register.  This fixes that.
2006-06-19 11:11:45 +02:00
Jason Green
fd83de7129 wined3d: Fix lookup for LOOP register. 2006-06-19 11:11:24 +02:00
Jason Green
9afa540eb5 wined3d: Added correct cast support for gl_FogFragCoord and gl_PointSize output registers. 2006-06-19 11:11:05 +02:00
Jason Green
406ec20459 wined3d: Load boolean and integer constants into the GLSL shader program. 2006-06-19 10:59:58 +02:00
Jason Green
f444009bfb wined3d: Implement locally defined boolean and integer constants in GLSL. 2006-06-19 10:59:13 +02:00
Jason Green
34d271bab6 wined3d: Add preliminary support for constant boolean and integer registers in GLSL.
- Separate the declaration phase of the shader string generator into
  the arb and glsl specific files.
- Add declarations and recognition for application-sent constant
  integers and booleans (locally defined ones will follow).
- Standardize capitilization of pixel/vertex specific variable names.
2006-06-19 10:50:14 +02:00
Jason Green
2d8e05f8a1 wined3d: Move constant loading into target-specific files.
- Moves GLSL constant loading code into glsl_shader.c and out of the
  over-populated drawprim.c.
- Creates a new file named arb_program_shader.c which will hold code
  specific to ARB_vertex_program & ARB_fragment_program.
- Remove the constant loading calls from drawprim.c
2006-06-19 10:49:52 +02:00
Jason Green
7f18b4e5fa wined3d: Remove dead vertex shader code. 2006-06-19 10:39:36 +02:00
Paul Vriens
edaac6f696 wined3d: GetScissorRect should use zero-based scissorBox (Coverity). 2006-06-16 14:42:36 +02:00
Francois Gouget
9eb81363ad Add trailing '\n's to ok() calls.
Remove spaces before '\n'.
2006-06-16 11:32:42 +02:00
Francois Gouget
11ae0f6386 Assorted spelling fixes. 2006-06-16 11:32:29 +02:00
H. Verbeet
701ce97d65 wined3d: Add and use GL_EXT_fog_coord defines. 2006-06-16 11:29:31 +02:00
Stefan Dösinger
3862f8e3d7 wined3d: Support more than one back buffer. 2006-06-15 16:51:41 +02:00
Stefan Dösinger
5c3c5903a5 wined3d: Correct vertex fog for transformed vertices and correctly
handle non-vertex, non-table fog.
2006-06-15 12:24:09 +02:00
Jason Green
cc06ed3d53 wined3d: Implement more GLSL instructions.
- Implemented: D3DSIO_SGN, LOOP, ENDLOOP, LOGP, LIT, DST, SINCOS
- Process instruction-based modifiers (function existed, it just
  wasn't being called)
- Add loop checking to register maps.
- Renamed "sng" to "sgn" for D3DSIO_SGN - it's not handled anywhere
  except for GLSL, so won't matter.
2006-06-15 12:20:20 +02:00
Alexandre Julliard
836b5c7e93 wined3d: Use unsigned int instead of size_t to avoid printf format warnings. 2006-06-13 14:14:20 +02:00
Ivan Gyurdiev
45dbb78d73 wined3d: Fix params for DP2ADD/TEXLDD.
DP2ADD is valid on pshaders 2.0 and above, has 4 parameters.
TEXLDD is valid on pshaders 2.x and above, has 5 parameters.
2006-06-13 11:40:23 +02:00
Ivan Gyurdiev
8c6ee8df0d wined3d: Mark instructions without a destination token.
There are a total of 17 instructions without a destination token. Of
those 9 have num_params != 0, which means that we will not process any
of them correctly, because we assume the first token (if present) is a
destination token.

Those are basically all the flow control instructions, which we plan to
support very soon. They have source tokens, and no destination. Add a
flag that marks them up to the ins table. Use this flag in the trace
pass, and generation pass.
2006-06-13 11:40:22 +02:00
Ivan Gyurdiev
14a52e5c09 wined3d: Keep pshader and vshader constants in GLSL separate.
GLSL uniforms have as scope the entire program.
To prevent conflicts, name pshader and vshader constants differently.
Based on a patch by Jason Green.
2006-06-13 11:40:22 +02:00
Ivan Gyurdiev
0d08316523 wined3d: Improve Sampler support on 2.0 and 3.0 shaders.
- track sampler declarations and store the sampler usage in reg_maps structure
- store a fake sampler usage for 1.X shaders (defined as 2D sampler)
- re-sync glsl TEX implementation with the ARB one (no idea why they diverged..)
- use sampler type in new TEX implementation to support 2D, 3D, and Cube sampling
- change drawprim to bind pixel shader samplers

Additional improvements:
- rename texture limit to texcoord to prevent confusion
- add sampler limit, and use that for samplers - *not* the same as texcoord above
2006-06-13 11:40:22 +02:00
Ivan Gyurdiev
e99926ee06 wined3d: Cast more things.
Anything with a swizzle has to be casted to vec4, or it won't work properly.
There's multiple ways to do this, for the moment pick the easiest one.
2006-06-13 11:40:22 +02:00
Ivan Gyurdiev
a1f4dfe4e3 wined3d: Add support for shader model 3.0 I/O registers.
SM 3.0 can pack multiple "semantics" into 12 generic input/output registers.

To support that, define temporaries called IN and OUT, and use those as
the output registers. At the end of the vshader, unpack the OUT temps
into the proper GL variables. At the beginning of the pshader, pack the
GL variables back into 12 IN registers.
2006-06-13 11:40:22 +02:00
Ivan Gyurdiev
1a3003338f wined3d: Trivial cleanups
- compiler warnings and errors should be FIXME
- remove obsolete comment, and change variable type.
2006-06-13 11:40:22 +02:00
Ivan Gyurdiev
a42925ee09 wined3d: Register map cleanups.
Various cleanups:
- do not use DWORD as a bitmask, that places artificial limit of 32 on
  registers
- track attributes that are used and declare only those
- move declarations function call in pshader/vshader to allow us to
  insert pixel or vertex specific code between the declarations and
  the rest of the code
- remove redundant 0 intializers
- remove useless continue statement
2006-06-13 11:40:22 +02:00
Ivan Gyurdiev
17b0d26c1e wined3d: Share trace pass
Now that the declaration function is out of the way, the tracing pass,
which is very long and 100% the same can be shared between pixel and
vertex shaders.

The new function is called shader_trace_init(), and is responsible for:
- tracing the shader
- initializing the function length
- setting the shader version [needed very early]
2006-06-13 11:40:22 +02:00
Ivan Gyurdiev
9bae7755ab wined3d: Rework dcl processing.
The new function is called in pass 2 (getister counting/maps), and
it's now in baseshader. It operates on all INPUT and OUTPUT registers,
which, in addition to the old vertex shader input declarations covers
Shader Model 3.0 vshader output and pshader input declarations. The
result is stored into the reg_map structure.
2006-06-13 11:40:21 +02:00
Ivan Gyurdiev
f144d58ac2 wined3d: The namedArrays code path is dead (always FALSE).
Delete the entire namedArrays code path and all its dependencies (one
of which is quite long - storeOrder in drawprim is always FALSE, for
example). Delete declaredArrays, and make its code path the default.
2006-06-13 11:40:21 +02:00
Jan Zerebecki
c6449b5a91 wined3d: Move a checkGLcall to it's gl call inside an "if". 2006-06-13 10:51:07 +02:00
Jan Zerebecki
7528fc0de1 wined3d: Fix stencil related render states. 2006-06-13 10:50:55 +02:00
Jan Zerebecki
cf8833c467 wined3d: Enable two sided stencil in the caps. 2006-06-13 10:46:29 +02:00
Jan Zerebecki
df3e078b20 wined3d: Also print the format like a fourcc if unknown in debug_d3dformat. 2006-06-13 10:35:14 +02:00
H. Verbeet
405e11ea62 wined3d: Cleanup GetSrcAndOpFromValue().
- Cleanup GetSrcAndOpFromValue().
- Use naming more consistent with the rest of the file.
2006-06-12 16:07:58 +02:00
Jason Green
d822496dee wined3d: Map D3DSIO_DEF to it's GLSL generating function for vertex shaders. 2006-06-12 13:21:46 +02:00
Alexandre Julliard
dbfb3739aa wined3d: Make all the local shader functions static. 2006-06-10 13:22:27 +02:00
Alexandre Julliard
e9cbc66e93 wined3d: Make the virtual table functions static where possible. 2006-06-10 13:15:32 +02:00
Jason Green
42dd4653e3 wined3d: Change fog output variable name for GLSL shaders. 2006-06-10 12:43:10 +02:00
Jason Green
e8c97e9421 wined3d: Fix regression from register maps switch for ARB shaders.
I missed a register mask in the move to share the shader_hw_def()
function between pixel and vertex shaders for ARB shaders.  Fixed
that, and made the GLSL version use the same mask for consistency.
2006-06-10 12:43:02 +02:00
Ivan Gyurdiev
a09c941677 wined3d: Enable CND/CMP for SHADER_ARB. 2006-06-10 12:42:09 +02:00
Ivan Gyurdiev
621f075fb9 wined3d: Print out sampler state names. 2006-06-10 12:41:54 +02:00
Ivan Gyurdiev
d44d0b5edb wined3d: Downgrade Get*Shader FIXME to TRACE. 2006-06-10 12:41:44 +02:00
Jason Green
08295f4cfc wined3d: GLSL shader cleanup patch.
- Based on comments from H. Verbeet
- Changed the distinction from .rgba & .xyzw masks to only use .xyzw
  in GLSL shaders.  They are interchangeable, and only served to make
  the trace look more intuitive, but they don't always apply as-is, so
  we'll just leave everything to .xyzw.
- Got rid of the "UseProgramObjectARB(0)" call in drawprim.  If there
  is no shader set on the next primitive, then that primitive will
  call UseProgramObjectARB(0) when it begins to draw.
2006-06-09 21:09:03 +02:00
Jason Green
d5d4568450 wined3d: Allow drawPrim to create and use the GLSL program. 2006-06-09 15:20:06 +02:00
Jason Green
b67cda248d wined3d: Add GLSL helper functions to Device.
- Add functions to attach & detach shader objects, create and delete programs, and maintain the list of programs.
- Add a list of GLSL shader programs to the device which is initialized on Init3D(), and deleted on Release().
2006-06-09 15:19:52 +02:00
Jason Green
ca7976c34f wined3d: Map vertex shader instructions to GLSL generating functions. 2006-06-09 15:19:09 +02:00
Jason Green
5798356d21 wined3d: Map pixel shader instructions to GLSL generating functions. 2006-06-09 15:19:02 +02:00
Jason Green
d59714b78c wined3d: Prototype the GLSL functions for use with pixel and vertex shaders. 2006-06-09 15:14:34 +02:00
Jason Green
806aaa1287 wined3d: Added more declarations to GLSL.
- Declare more variable names for GLSL programs.
- Some of these won't need to be declared eventually, but it doesn't hurt to do it for now.
- Correct output name for pixel shaders (gl_FragColor instead of glFragColor).
2006-06-09 15:14:22 +02:00
Jason Green
ca70d13af4 wined3d: Unified float constant register mapping between ARB pixel and vertex shaders.
- Got rid of the separate constant maps.
- Side effect of this is that the map is a bit larger for pixel shaders than it needs to be
2006-06-09 14:36:50 +02:00
Jason Green
0c59ca6448 wined3d: Add the bulk of the GLSL string generation functions.
- Add a new file glsl_shader.c which contains almost every GLSL specific function we'll need
- Move print_glsl_info() into glsl_shader.c
- Move the shader_reg_maps struct info into the private header, and make it part of SHADER_OPCODE_ARG.
- Create a new shared ps/vs register map for float constants (future patch will make ARB programs use this, too)
2006-06-09 13:47:55 +02:00
Jason Green
1f1057fc9b wined3d: Move constant loading out of DrawPrimDrawStrided() and enable
loading float constants for GLSL.

- DrawPrim is just too big of a function.  This separates the passing
  of constants to the shader into new functions.
- Fixes an off-by-one error when loading vertex declaration constants
  (should be <, not <=)
- Adds a function for GLSL loading of constants (aka Uniforms)
- Adds a GLSL program variable to the stateblock and sets it to 0 (a
  future patch will actually create this program)
2006-06-09 13:26:51 +02:00
Ivan Gyurdiev
ac46320f57 wined3d: TEXREG2GB is valid on pshaders 1.1. 2006-06-07 15:23:23 +02:00
Ivan Gyurdiev
83a9666f9c wined3d: Fix NULL dereference in generator function. 2006-06-07 15:23:17 +02:00
Ivan Gyurdiev
4d66615bbb wined3d: Fix missing light recording.
Write a light with the default parameters in disabled state if
capturing a missing light.
2006-06-07 15:20:00 +02:00
H. Verbeet
26978a4d2d wined3d: Return the result of QueryInterface in GetContainer. 2006-06-07 11:48:00 +02:00
H. Verbeet
7b8bf46f3f wined3d: Remove a redundant break. 2006-06-07 11:47:54 +02:00
H. Verbeet
85ec834f7a wined3d: Don't hardcode type sizes for shader constants. 2006-06-07 11:47:46 +02:00
Ivan Gyurdiev
5f5969b3c5 wined3d: Remove constant type field in stateblock.
It is wrong to maintain a mapping from a constant index to a type
field, because different constant types do not share an index -
boolean constant 0 is supposed to co-exist with floating point
constant 0, not replace it. Drawprim and other code using the type
array to decide whether to look up a constant in bools, floats, or
ints is wrong - you can't make that decision based on the index.
2006-06-06 11:58:54 +02:00
Ivan Gyurdiev
0909df6711 wined3d: Rename vertex shader constants.
From const%lu to C%lu for consistency (to match pshaders).
2006-06-06 11:50:36 +02:00
Ivan Gyurdiev
79029c1099 wined3d: Add limits for ps_2_x. 2006-06-06 11:50:20 +02:00
Ivan Gyurdiev
aec2e3e46d wined3d: Trace improvements. 2006-06-06 11:49:03 +02:00
Ivan Gyurdiev
2c232990ee wined3d: pshader defi has 5 parameters. 2006-06-06 11:48:48 +02:00
Stefan Dösinger
2c3adec595 wined3d: Render target locking fixes. 2006-06-05 20:59:41 +02:00
Stefan Dösinger
5de8cd3bd6 wined3d: Adjust the video mem when dropping the pow2 size in GDISurface. 2006-06-01 11:44:38 +02:00
Vitaliy Margolen
93fd4c12f8 wined3d: Properly destroy texture object if we failed to create its surfaces. 2006-05-30 12:34:26 +02:00