Commit Graph

396 Commits

Author SHA1 Message Date
Stefan Dösinger 760456dc7f wined3d: Find the correct sampler type for < 2.0 pshaders. 2006-08-28 11:37:24 +02:00
Jan Zerebecki fd15b8d064 wined3d: Use a common function for all D3DCMPFUNC -> GLenum conversions. 2006-08-25 20:04:56 +02:00
Stefan Dösinger d7f94bf7c9 wined3d: Correctly draw transformed and untransformed vertices in the same scene. 2006-08-22 12:53:53 +02:00
Roderick Colenbrander de97fa7a3b wined3d: Better GPU detection. 2006-08-21 12:21:19 +02:00
H. Verbeet 09eb0c40a6 wined3d: Improve float constant loading a bit.
- Use a list to keep track of what constants are set.
- Move TRACEs and checkGLcall calls out of the main constant loading loop.
2006-08-21 12:17:42 +02:00
H. Verbeet 49f4c68e29 wined3d: Lookup GLSL float uniform locations only once per program. 2006-08-21 12:16:27 +02:00
Jan Zerebecki 4d6cfb6351 wined3d: Registry setting for the amount of simulated texture memory.
Set VideoMemorySize under HKCU\Software\Wine\Direct3D to amount in MB
as string.
2006-08-08 11:20:05 +02:00
H. Verbeet 02a8f74490 wined3d: Add a couple of traces to the vertexdeclaration creation code. 2006-08-07 19:42:31 +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 d353ab7879 wined3d: Start checking for D3DUSAGE_QUERY_* items, improve traces. 2006-07-29 11:49:51 +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
Stefan Dösinger 65e5ed60ae wined3d: Do not use the IWineD3DSurface for the cursor. 2006-07-28 12:31:57 +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
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
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
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 9423fd2d9f wined3d: Do not try to create a vbo more than once. 2006-07-21 20:21:00 +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 739d565c59 wined3d: Add a setting for the render target locking method. 2006-07-18 11:22:51 +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 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 85aa8ab855 wined3d: Add position_transformed flag to Strided data format. 2006-07-07 17:35:36 +02:00
Michael Stefaniuc 32b1a24501 janitorial: Move the storage specifier to the beginning of the declaration. 2006-07-07 14:30:35 +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 7e9fd0b4c1 wined3d: Add a function to print out D3DDECLUSAGE9 values. 2006-07-03 12:04:37 +02:00
Ivan Gyurdiev d06e13db99 wined3d: Move SHADER_ARB code into arb_program_shader.c. 2006-07-03 12:03:31 +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 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
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
Stefan Dösinger 7d31ab95e4 wined3d: Add support for VBOs to the drawing code. 2006-06-26 13:02:19 +02:00
Stefan Dösinger 3518747165 wined3d: Pixel format cleanup. 2006-06-21 12:15:50 +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
Stefan Dösinger 3862f8e3d7 wined3d: Support more than one back buffer. 2006-06-15 16:51:41 +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 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
Jan Zerebecki 7528fc0de1 wined3d: Fix stencil related render states. 2006-06-13 10:50:55 +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
Ivan Gyurdiev 621f075fb9 wined3d: Print out sampler state names. 2006-06-10 12:41:54 +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 d59714b78c wined3d: Prototype the GLSL functions for use with pixel and vertex shaders. 2006-06-09 15:14:34 +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 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
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 aec2e3e46d wined3d: Trace improvements. 2006-06-06 11:49:03 +02:00
Jason Green 473ce80fa2 wined3d: Add ability to generate GLSL shader objects for vertex and pixel shaders. 2006-05-27 11:01:05 +02:00
Roderick Colenbrander 54e5f9c465 wined3d: Dynamicly load GL_ARB_multitexture functions. 2006-05-25 20:17:32 +02:00
Stefan Dösinger 5b8b776431 wined3d: Small rhw vertex fix.
Fix the one pixel displacement and move the glOrtho code in a common
function.
2006-05-25 20:09:57 +02:00
Stefan Dösinger e902cd119f wined3d: Swapchain and back buffer corrections + tests. 2006-05-24 13:56:55 +02:00
Jason Green d204540d1f wined3d: Replaced USING_GLSL define with a new wined3d_settings option based on the registry. 2006-05-24 10:40:35 +02:00
Jason Green a67488a26e wined3d: Add function to print the infolog of a GLSL shader on errors.
With assistance from H. Verbeet.
2006-05-24 10:37:33 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Stefan Dösinger 158691ea3b wined3d: OpengGL accelerated blits.
Implement some basic opengl accelerated blts from and to render
targets. It's not perfect yet, but enought to make some D3D apps
happy. For now the only supported operations are:

- Full screen back -> Front buffer: Just call present
- Offscreen surface -> render target
- Render target -> offscreen surface(slow)
- render target colorfill
2006-05-23 12:41:31 +02:00
Ivan Gyurdiev cb973648ab wined3d: Clean up register use maps. 2006-05-22 11:40:38 +02:00
Stefan Dösinger cfcdb6515b wined3d: Sort of oversized surface support. 2006-05-20 14:06:09 +02:00
Stefan Dösinger 566cdcf55c wined3d: Implement IWineD3DDevice::SetDisplayMode. 2006-05-20 14:05:06 +02:00
Phil Costin 1b320431b8 wined3d: Check registry for UseGLSL enabled. 2006-05-18 16:40:32 +02:00
Ivan Gyurdiev 42b89791ff wined3d: Take predication tokens into account.
Each instruction can have a predication token. Account for it in the
trace pass, register count pass, and store it in the SHADER_OPCODE_ARG
structure for generation. MSDN claims the token is at the end of the
instruction, but that's not true - testing a demo, which lets me
manipulate the shader shows the predication token is the first source
token immediately following the destination token.
2006-05-18 10:32:54 +02:00
Ivan Gyurdiev 746d1b1cd3 wined3d: Modify shader_dump_param() to take into account address token.
Currently we hardcode a0.x, which I think is correct for shaders 1.0.
However, for shaders 2.0, we must look into the address token, and
print the register there. Handle both cases to correct the trace.
2006-05-17 10:55:11 +02:00
Ivan Gyurdiev 03b67e3030 wined3d: Use shader_get_param() in trace pass, reg. count pass, generation pass.
Change the trace pass, the register counting pass, and the hw
generator pass to take into account the new get_params() function. For
hw generation, store the address tokens into the SHADER_OPCODE_ARG
structure, so they're available to generator functions.
2006-05-17 10:54:23 +02:00
Ivan Gyurdiev 404eff792f wined3d: Add shader_get_param() fn, which processes address tokens.
Add a new function to process parameters.
On shaders 1.0, processing parameters amounts to *pToken++.
On shaders 2.0+, we have a relative addressing token to account for.
This function should be used, instead of relying on num_params everywhere.
2006-05-17 10:53:18 +02:00
Ivan Gyurdiev 8b7401c39a wined3d: Shaders: share dump_param function, version functions. 2006-05-15 16:07:31 +02:00
Stefan Dösinger 2f724834f8 wined3d: Implement IWineGDISurface. 2006-05-15 14:02:03 +02:00
Stefan Dösinger 9abdac6aaa wined3d: Implement IWineD3DDevice::ProcessVertices. 2006-05-15 13:57:17 +02:00
Ivan Gyurdiev 257692e087 wined3d: Initialize volume format. 2006-05-11 12:11:42 +02:00
Ivan Gyurdiev c61af3af8d wined3d: Share shader_dump_ins_modifiers().
Share shader_dump_ins_modifiers(), and make vertex shaders use it.
The saturate modifer (_sat) is valid on vs_3_0+, and it isn't being
shown in the trace.
2006-05-11 12:10:59 +02:00
Jason Green e9927d6ffd wined3d: Further split GLSL & ARB_v/f_program generation and allow GLSL functions to be called. 2006-05-10 12:20:39 +02:00
Jason Green 246677ae46 wined3d: Modified the opcode tables (and struct) to include a pointer to a GLSL generator function. 2006-05-10 12:20:08 +02:00
Jason Green 36b0b9cc1c wined3d: Added new GenerateShader function for Vertex Shaders & declare generate_base_shader(). 2006-05-10 12:18:08 +02:00
Jason Green cc2ea9e08c wined3d: Place # of textures, addresses, & temps used inside the baseShader struct to prepare for GenerateShader merge. 2006-05-10 12:16:22 +02:00
Jason Green 653e71d774 wined3d: Further split up GenerateProgramArbHW for pixelshaders. 2006-05-10 12:16:02 +02:00
Jason Green 5308e026d1 wined3d: Move program_dump_decl_usage into baseshader. 2006-05-10 12:14:39 +02:00
Ivan Gyurdiev cdfe848b6d wined3d: Break out arithmetic instruction processing. 2006-05-10 11:28:11 +02:00
Ivan Gyurdiev 320e33dcb3 wined3d: Merge register counting pass. 2006-05-10 11:26:01 +02:00
Stefan Dösinger 9b29fb6860 wined3d: Implement IWineD3DSurface::SetColorKey. 2006-05-09 20:46:59 +02:00
Stefan Dösinger 08dc9e003d wined3d: Implement IWineD3DSurface::IsLost and Restore. 2006-05-09 20:45:39 +02:00
Stefan Dösinger 10ff0d8184 wined3d: rhw vertex fixup.
Change the rhw=0 range to ]1e-8,1e-8[ and move the value to a constant
in wined3d_types.h
2006-05-09 20:45:27 +02:00
Ivan Gyurdiev 1d0c672393 wined3d: Share get_opcode. 2006-05-09 20:45:10 +02:00
Ivan Gyurdiev c93239d36d wined3d: Clean up per version shader limits code. 2006-05-09 11:58:14 +02:00
Ivan Gyurdiev 5f10560762 wined3d: Addline cleanup. 2006-05-09 11:55:45 +02:00
Stefan Dösinger af462957c3 wined3d: Implement IWineD3DSurface::GetDC and IWineD3DSurface::ReleaseDC. 2006-05-08 20:58:27 +02:00
Ivan Gyurdiev 4b3079438b wined3d: Share get_register_code(). 2006-05-08 15:15:30 +02:00
Stefan Dösinger a173c8e35a wined3d: Add IWineD3DDevice::DrawPrimitiveStrided. 2006-05-08 14:51:13 +02:00
Stefan Dösinger 1cfbc903d5 wined3d: Add some surface flags. 2006-05-08 14:50:58 +02:00
Stefan Dösinger a6f71af021 wined3d: Implement IWineD3DPalette. 2006-04-21 11:28:11 +02:00
Stefan Dösinger 04da3ce2d1 wined3d: Implement GetHWND and SetHWND. 2006-04-19 12:55:03 +02:00
Stefan Dösinger a6206836e6 wined3d: Implement IWineD3DDevice::EnumDisplayModes. 2006-04-19 12:53:30 +02:00
Stefan Dösinger d04f0507cf wined3d: Implement Init3D and Uninit3D. 2006-04-19 12:43:22 +02:00
Stefan Dösinger cff4e1ea4b wined3d: Add IWineD3DPalette. 2006-04-18 11:11:49 +02:00
Stefan Dösinger ffc8e46e76 wined3d: Add IWineD3DSurface::Blt. 2006-04-17 11:19:30 +02:00
Stefan Dösinger e0c8773199 wined3d: Add a resource dumper. 2006-04-12 12:54:28 +02:00
Ivan Gyurdiev 634698cb19 wined3d: Print all errors in checkGLcall. 2006-04-10 12:24:23 +02:00
Stefan Dösinger cf4b91f074 wined3d: Add WINED3DBOX to wined3d_types.h. 2006-04-07 14:55:50 +02:00
Stefan Dösinger 63fd9a7a98 wined3d: Add WINED3DTEXTUREFILTERTYPE to wined3d_types.h. 2006-04-06 22:22:35 +02:00
Stefan Dösinger f6ed704f96 wined3d: Make use of WINED3DDEVICE_CREATION_PARAMETERS. 2006-04-03 21:35:44 +02:00
H. Verbeet 59af5c4a62 wined3d: Move fields common to vertex shaders and pixel shaders to IWineD3DBaseShader. 2006-03-30 21:55:15 +02:00
H. Verbeet d4132cf7d7 wined3d: Move the vshader_ins and pshader_ins arrays into their respective objects. 2006-03-29 13:40:16 +02:00
H. Verbeet 3ee642bb09 wined3d: Move the SHADER_OPCODE definition to wined3d_private.h. 2006-03-29 13:39:33 +02:00
Stefan Dösinger d75fd75d48 wined3d: Add WINED3DPOOL to wined3d_types.h. 2006-03-28 17:34:42 +02:00
Stefan Dösinger b4b295c2a5 wined3d: Add WINED3DMULTISAMPLE_TYPE to wined3d_types.h. 2006-03-27 11:30:49 +02:00
H. Verbeet 46b13aaa58 wined3d: glTypeLookup cleanup.
Use a struct instead of an UINT array as entries in the glTypeLookup
table.
2006-03-22 21:39:04 +01:00
Stefan Dösinger 913df5b143 wined3d: Consistently use WINED3DRESOURCETYPE. 2006-03-10 21:43:00 +01:00
Stefan Dösinger 46e8d67787 wined3d: Update the glOrtho between 2 rhw draws if the viewport was changed. 2006-02-13 13:25:21 +01:00
H. Verbeet e43cfb1a68 wined3d: Fix SetContainer.
Add/Release references to the container.
Change the type of the container from IUnknown to IWineD3DBase.
2006-02-06 11:30:48 +01:00
Oliver Stieber 7c482cb9a1 wined3d: Vertex shader 8 support.
Start to add support for DirectX 8 vertex shaders, constants and
registers are now correctly assigned and loaded allowing support for
most basic d3d8 shaders.
2005-12-09 11:23:52 +01:00
Oliver Stieber aa9ce3577a Added support for vertex and pixel shader constants that have no type
i.e. they haven't been set yet or are clear.
2005-11-29 17:05:54 +01:00
Francois Gouget 6d442aeb34 Assorted spelling fixes. 2005-11-23 20:14:43 +01:00
Oliver Stieber 932815d6f0 Implement a pixel shader parser and cross compiler. All version of
shaders up to 3 should be parsed correctly, but only shaders 1-1.4
will be cross compiled.
2005-11-21 16:27:55 +00:00
Raphael Junqueira 705aec5a6f - defined D3DCOLOR_B macros to access byte values of D3DCOLOR
- use D3DCOLOR macros instead of using shift + masks
- fix a bug where diffuse.lpData checked instead of specular.lpData
- implement color fixup on ARB VShader compilation code:
 -> on input parameters using swizzle
 -> add is_color parameter on vshader_program_add_param
2005-11-15 12:03:13 +00:00
Oliver Stieber 1f2a9e2c31 Move the softwareVertexProcessing flag from the stateblock to the
device because its state shouldn't be recorded in a stateblock.
2005-10-29 10:30:36 +00:00
Oliver Stieber b3563daca2 Implement state tracking for pixel shader constants. 2005-09-28 10:13:00 +00:00
Francois Gouget a8c7284f92 Assorted spelling fixes. 2005-09-26 10:58:41 +00:00
Oliver Stieber 9e6957bbdc Optionally repack nonpower 2 textures to the expected span length when
a textures is locked. This is necessary for buggy games like Warhammer
40k that don't work with the odd span sizes produce by default
nonpower 2 support.
2005-09-23 11:08:03 +00:00
Oliver Stieber 329d017db3 Start to implement TestCooperativeLevel. 2005-09-21 10:55:03 +00:00
Oliver Stieber 0c2fcf2efe Added support for state management of vertex shader constants via
stateblocks.
2005-09-21 10:19:29 +00:00
Oliver Stieber 5ea96a851f Implemented occlusion queries using either GL_ARB_occlusion_query or
GL_NV_occlusion_query.
2005-09-21 09:43:13 +00:00
Mike McCormack 93ab695a5c Fix gcc 4.0 warnings. 2005-08-26 08:53:31 +00:00
Oliver Stieber 2af36c646e Implemented stubbed out pixel shaders and their states in wined3d. 2005-08-25 19:24:21 +00:00
Oliver Stieber 3f24b9164d Fix quite a few texturing problems and cases where text isn't being
correctly displated.
2005-08-22 10:07:10 +00:00
Oliver Stieber 1be54d8b79 Integrate hardware vertex shaders into the drawing pipeline. 2005-08-19 10:05:00 +00:00
Oliver Stieber 2c0e97e641 Copy the parser and cross compiler from d3d8 and update everything to
vertex shaders 3.0.
The Parser will now display the input shader in DirectX style, and the
cross compiler now generates valid ARB_VERTEX_PROGRAM programs and
outputs the result in ARB_VERTEX_PROGRAM style.
Support for a number of extended attributes has been added, but this
may not be complete, and dereferencing from loop counters isn't
properly parsed yet.
2005-08-17 11:34:03 +00:00
Oliver Stieber 9b0b803b47 Add support for vertex shader constants to the stateblock. 2005-08-17 10:27:01 +00:00
Oliver Stieber 80cbb93163 Tidy up vertex shaders and bring the current code inline with the rest
of wined3d.
2005-08-17 09:54:54 +00:00
Oliver Stieber 313b01073c Track the state of softwareVertexProcessing. 2005-08-11 10:31:40 +00:00
Oliver Stieber e31bc6cea4 Moved support for non power 2 texture to hardware.
Fix for the texture state separation patches, ApplyTextureStates is
now called instead of being commented out.
2005-08-03 19:49:05 +00:00
Oliver Stieber bb6f9b022b Move the setting of states from device to basetexture, states that
relate to the opengl texture object will only be updated when they are
out of sync, this reduces the number of texture object state changes
during game play in Axis and allies from several hundreds to 0 or 1.
2005-08-03 11:00:28 +00:00
Oliver Stieber d344162f41 Separate the setting of the DirectX texture and sampler states from
the setting of OpenGL states (now in applyTextureStateState and
applySamplerState).
2005-08-01 10:58:31 +00:00
Oliver Stieber 386470bedc Tidy up some of the formatting in drawprim and add missing strided
data.
2005-07-30 19:06:14 +00:00
Mike McCormack 8955ac43a3 gcc 4.0 -Wpointer-sign fixes. 2005-07-28 10:16:21 +00:00
Oliver Stieber c93da09265 Changed swapchains held by the device from an array to a linked
list. Also provide a notification function that that the swapchain can
be removed when it is released.
2005-07-27 15:33:17 +00:00
Oliver Stieber 052d108bf5 DirectX uses a R/Z transform to translate a texture but under OpenGL a
Q transform must be used instead.
2005-07-26 20:01:29 +00:00
Oliver Stieber 7cb748fed2 Makes sure any internal reference counting is passed onto the parent,
any objects referenced by the internal stateblock are released when
the stateblock is released (we don't reference count while a
stateblock is recording, so recorded stateblocks have no references to
clean up).
2005-07-26 18:49:30 +00:00
Oliver Stieber ea6189e04b Implement resource tracking, require for reset and evict managed
resources and provides extra sanity checks.
2005-07-26 10:34:15 +00:00
Raphael Junqueira cc8762a91e - add a new settings for vbo support
- use a struct to handle wined3d settings
- prepare VBO using some abstraction APIs
2005-07-24 17:11:33 +00:00
Francois Gouget bd19d67ad1 Assorted spelling fixes. 2005-07-22 09:06:03 +00:00
Oliver Stieber 948563267e Implement the use of PBuffers for offscreen textures. 2005-07-19 11:39:24 +00:00
Oliver Stieber fe80b4ea48 Implemented Get/Set/Free private data in resource. 2005-07-15 09:54:57 +00:00
Oliver Stieber b220ce1343 Correct a few formats that were incorrect. 2005-07-13 19:38:39 +00:00
Oliver Stieber 6a032491d3 Added basic memory management and tracking to wined3d. 2005-07-13 11:34:55 +00:00
Oliver Stieber 13621056db Move parameters relating to opengl on the surface structure on to a
glDesciption member.
Removed Level and Target from LoadTexture, and reduced the dependency
on surface->device.
Fixed a couple of compiler warnings in d3d9.
2005-07-11 20:38:27 +00:00
Oliver Stieber 520c2f0870 Implemented basic non-power 2 texture in wined3d.
Also fixed a typo in drawprim that was causing vertex declarations to
crash.
2005-07-11 14:25:54 +00:00
Oliver Stieber 8a6799d47d Implement render targets using either textures, swapchains or
standalone surfaces.
2005-07-07 20:35:05 +00:00
Oliver Stieber abb11f30cd Implemented stateblocks in wined3d. 2005-07-05 14:05:18 +00:00
Francois Gouget 02c25a8981 Assorted spelling fixes. 2005-06-30 18:19:33 +00:00
Oliver Stieber 18857f1170 Add support for samplers.
Switch from using d3d9 constants to wined3d constants so that there's
no recursive dependencies.
2005-06-24 11:53:07 +00:00
Oliver Stieber 46e7c30a71 Implement swapchains. 2005-06-23 11:05:24 +00:00
Marcus Meissner 9c01e4274f Fixed definition/declaration mismatches of newly static vtables. 2005-06-09 09:47:10 +00:00
Dmitry Timoshkov eba47f1dfe Make remaining OLE interface vtables const. 2005-06-06 19:50:35 +00:00
Oliver Stieber 67f2ad4563 - Volume now inherits Resource. This isn't the way Microsoft implements
the interface but it is more correct way (Microsoft even have a
  resource type of volume).
- Moved usage, format, allocatedMemory and size onto the resource
  class structure.
- Refactored Preload for classes that inherit BaseTexture, preload now
  binds the texture instead of bind texture calling preload, bindTexture
  allocated a glTexture if there isn't one.
- Added two new class static members BaseTexture_CleanUp and
  Resource_CleanUp that should be called by classes that implement
  BaseTexture or Resource.
2005-03-29 19:01:00 +00:00
Oliver Stieber ba5eb14768 Encapsulate texture, surface encapsulated.
Added BindTexture, GetTextureDimensions, UnBindTexture.
Proper GetContainer support for surface.
SetContainer added to surface and volume.
SetInPbufferState added to surface (until gl context management is
implemented).
Minor changes:
- BaseTexture no longer 'holds' a reference to IWineD3DDevice to
  prevent circular referencing.
- Better managment of referinging for texture.
- Some TODO's for implementing a context manager.
- Better preload implementation.
- Fix compile warning in device.c Set/GetSamplerState.
- Add QueryInterface support for surface.
- Format X8R8G8B8 added to locking.
2005-03-14 10:12:52 +00:00
Oliver Stieber 7b261656fd Added a stubbed out version of query to d3d9 and wined3d.
Update the d3d9 headers and creates wined3d types where d3d9 and d3d8
are incompatible.
2005-03-03 13:57:15 +00:00
Oliver Stieber 2121f7831e Put all the stubs in wined3d in place, with some functionality copied
across from d3d9.
Make sure all d3d9 device function call their wined3d counterpart (or
perform a function).
2005-03-02 12:16:10 +00:00
Raphael Junqueira 4c385f981d - VertexDeclaration device APIs
- D3D9 declarations parsing
- a little better APIs (trying to avoid compile problems)
2005-01-26 20:54:00 +00:00
Raphael Junqueira 4f02b52c6b Begin support of VertexDeclaration on wined3d using d3d8 code base
(handling d3d8 and d3d9 specs).
2005-01-19 19:34:49 +00:00
Jason Edmeades 33025b203c - Handle failures to allocate storage more gracefully.
- Only prototype the interfaces which are subclassed (I overdid it
  last time!).
- Implement Get/Set Texture and GetBackBuffer, plus device's
  GetDisplayMode / GetDeviceCaps.
- Make some of the d3d9 skeleton code issue fixme's to highlight code
  which hasn't been migrated yet.
- Correct the d3d9 headers for D3DSURFACE_DESC which caused stack
  corruption in demos.
2005-01-18 11:42:29 +00:00
Jason Edmeades bcecddc084 - Add texture support for all the texture types for d3d9->wined3d.
- Add prototypes for the COM interfaces.
- Fix some incorrect types from the last patch.
2005-01-17 13:44:57 +00:00
Jason Edmeades 41427857b1 Add render target support, and ensure there is a front and back buffer
created during device creation.
2005-01-09 17:37:02 +00:00
Raphael Junqueira 66cae0d2a8 Fixed build problem with GL_VERSION_1_2. 2004-12-17 19:07:44 +00:00
Jason Edmeades c4de952eb5 Add Clear, Present and EndScene support and fix a bug in the drawing
code.
2004-12-14 11:54:27 +00:00
Jason Edmeades 2003c7ab11 Add {G,S}etRenderState and {G,S}etTextureStageState support, and
ensure the stateblock is fully populated at device startup.
2004-12-13 13:35:38 +00:00
Jason Edmeades f738c146e2 Add {G,S}etIndices, {G,S}Viewport and enable the basic drawing
functionality into wined3d and call from d3d9.
2004-12-09 11:42:34 +00:00
Jason Edmeades 819b0e1190 Add BaseTexture class support, call from d3d9. 2004-12-07 14:29:12 +00:00
Jason Edmeades 0a944ae319 Implement Material, Clip plane and Light support plus
MultiplyTransform.
2004-11-29 17:53:42 +00:00
Jason Edmeades eba27af4f1 Add Get/Set Transform support, plus BeginScene (does nothing). 2004-11-28 15:04:41 +00:00
Jason Edmeades 73e8baffd2 Add indexbuffer support into wined3d. 2004-11-24 18:13:41 +00:00
Jason Edmeades 289562eeb5 - Implement SetStreamSource
- Ensure wined3d objects maintain a reference count of at least that
  of the d3dx version.
2004-11-23 13:52:46 +00:00
Jason Edmeades 447d5ed048 Implement the beginnings of the stateblock class, and a first method
to use it.
2004-10-21 20:59:12 +00:00
Jason Edmeades db7a50582c - Add support (as far as was previously) for the VertexBuffer and
Resource classes in wined3d and use when called from d3d9.
- Reduce the header includes in all the d3d9 interface to one common
  set in the private header.
2004-10-14 00:32:04 +00:00
Jason Edmeades b9e2bedac1 Copy and tidy up the code from dx8 create device into wined3d. Call
from wined3d and d3d8, but short term only use the code for real from
d3d9.
2004-10-08 20:52:33 +00:00
Jason Edmeades ac490fabac Add a IWineD3DDevice object type (empty for now), and create one when
an IDirect3DDevice object is created.
2004-10-07 04:22:21 +00:00
Jason Edmeades b519893e41 Move the GetDeviceCaps into the wined3d library and call from d3d9. 2004-10-06 00:05:29 +00:00
Jason Edmeades c579fa6213 Move the Check* type functions into wined3d and copy from d3d9, and
flag that they are mostly stubs.
2004-10-05 02:14:06 +00:00
Jason Edmeades c3421ea434 Move into wined3d and call from d3d9 the GetAdapterId function and
copy all the gl declarations into the more global wined3d_gl header
file.
2004-09-29 21:26:47 +00:00
Jason Edmeades ae5a436873 - Make d3d8 know about the wined3d device and start using it.
- Move some of the screen mode related functions into wined3d and add
  untested support for the new d3d9 options of providing the format to
  some of the calls.
- Move other functions from the directx interface into the common
  library and implement the calls from d3d9 as well.
- Copy across the first of the functions used to make traces more readable,
  creating utils.c to store them in. Eventually the ones in d3d8 will be
  removed but for now just duplicate the code.
2004-09-28 02:12:12 +00:00
Jason Edmeades 24ab49e250 Create a wined3d interface, and generate a wined3d object in the d3d9
create method. Make the first (simple) call implementation into the
new wined3d interface.
2004-09-23 04:34:27 +00:00
Raphael Junqueira 0196861349 Add the wined3d dll for beginning a cleaner d3d architecture that will
contain the shared openGL code needed for all wine direct3d
implementations.
2003-11-14 03:50:35 +00:00