Commit Graph

136 Commits

Author SHA1 Message Date
Andrew Talbot 92dc74016a wined3d: Cast-qual warnings fix. 2006-11-27 13:43:10 +01:00
Kovács András eb7b1f4bce wined3d: Fix introduced regression in shader_glsl_mnxn and vshader_hw_mnxn. 2006-10-30 20:37:34 +01:00
Kovács András da6c01bea0 wined3d: Implement D3DSIO_MOVA in ARB backend. 2006-10-27 14:12:58 +02:00
Ivan Gyurdiev 93b3106be2 wined3d: Add D3DVS_RASTOUT_OFFSETS to the WINED3D namespace. 2006-10-24 20:06:21 +02:00
Francois Gouget 8e1e62616a wined3d: Remove '\0's in traces. 2006-10-16 11:30:53 +02:00
Ivan Gyurdiev ce2e980d1b wined3d: Add shader version/end masks to the WINED3D namespace. 2006-10-13 11:15:45 +02:00
Ivan Gyurdiev b7edf5b008 wined3d: Add D3DSHADER_ADDRMODE masks to the WINED3D namespace. 2006-10-13 11:15:00 +02:00
Ivan Gyurdiev 29aa316d67 wined3d: Add D3DSI and other opcode masks to the WINED3D namespace. 2006-10-13 11:14:47 +02:00
Ivan Gyurdiev 82379f22a7 wined3d: Move D3DSP dest modifier related items into the WINED3D namespace. 2006-10-10 13:38:45 +02:00
Ivan Gyurdiev 76b571cb48 wined3d: Move D3DSP source modifier-related items into the WINED3D namespace. 2006-10-10 13:38:36 +02:00
Ivan Gyurdiev 17c9d9588a wined3d: Move D3DSP_REG structures into the WINED3D namespace. 2006-10-10 13:37:49 +02:00
Ivan Gyurdiev e8137632c7 wined3d: Move D3DSP DCL-related structures into WINED3D namespace. 2006-10-10 13:37:35 +02:00
Ivan Gyurdiev 7259b9d8b6 wined3d: Move D3DSPR structure into the WINED3D namespace. 2006-10-10 13:37:12 +02:00
Ivan Gyurdiev 062541c026 wined3d: Move D3DSIO structure into WINED3D namespace. 2006-10-10 13:37:03 +02:00
Ivan Gyurdiev e020eceddf wined3d: Make the shader mode selections per device. 2006-10-09 20:27:55 +02:00
Ivan Gyurdiev 3dcd3681f3 wined3d: Win64 printf fixes. 2006-10-02 14:38:04 +02:00
Ivan Gyurdiev d0032a1a2a wined3d: Move device pointer into the BaseShader class. 2006-09-27 19:44:09 +02:00
H. Verbeet 5bc0e91ddf wined3d: Don't overwrite the position y offset in ARB vertex programs. 2006-09-27 09:46:08 +02:00
Stefan Dösinger 96bce8d6d4 wined3d: Avoid wasting a uniform. 2006-09-25 18:24:19 +02:00
Stefan Dösinger bc449ca31f wined3d: Apply the half pixel correction for shaders too. 2006-08-29 12:26:15 +02:00
Stefan Dösinger 760456dc7f wined3d: Find the correct sampler type for < 2.0 pshaders. 2006-08-28 11:37:24 +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
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
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
H. Verbeet 8c981140a2 wined3d: Add traces to IWineD3DVertexShaderImpl_SetFunction & IWineD3DPixelShaderImpl_SetFunction. 2006-07-25 11:21:51 +02:00
Jason Green 718716b77a wined3d: Make the number of floating point shader constants dynamic. 2006-07-19 09:54:30 +02:00
Christian Costa 2dc451e181 wined3d: Readd missing copyright to shaders files. 2006-07-18 11:10:34 +02:00
Jason Green 6a97f2202e wined3d: Fix for vertex shaders. 2006-07-17 15:05:38 +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 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
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 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 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
Ivan Gyurdiev d06e13db99 wined3d: Move SHADER_ARB code into arb_program_shader.c. 2006-07-03 12:03:31 +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 7f18b4e5fa wined3d: Remove dead vertex shader code. 2006-06-19 10:39:36 +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
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 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 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 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
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