Stefan Dösinger
39877a2ad2
wined3d: Reserve additional GLSL constants on some drivers.
...
Some drivers apparently need private constants, or don't have an efficient
immval packing. For example, MacOS seems to need 1 float for each different
relative addressing offset. fglrx has the same issue, although it is more
efficient in general
Previously this worked on most drivers because the 16 + 4 reserved int and
bool constants kept the problem hidden. Now that we are more aggressive with
uniforms we have to keep free room for some drivers.
2009-04-20 16:38:39 +02:00
Stefan Dösinger
78d26a659d
wined3d: Move the remaining quirks into the quirk table.
2009-04-20 16:38:07 +02:00
Stefan Dösinger
50e91f8d84
wined3d: Move the generic mac glsl uniform fixup to the quirk table.
2009-04-20 16:37:46 +02:00
Stefan Dösinger
7b7f027221
wined3d: Add a more formal framework for driver quirks.
...
This allows better defining of driver desc fixups without adding extra if
lines for each card.
For starters, there's a fixup for the advertised GLSL constants in ATI cards.
fglrx advertises 512 GLSL uniforms instead of the supported 1024(means 128
instead of 256 vec4's). This bug was confirmed by ATI.
2009-04-20 16:37:31 +02:00
Francois Gouget
5ef481922f
Assorted spelling fixes.
2009-04-20 15:25:26 +02:00
Henri Verbeet
ea0b3b42eb
wined3d: Pass a struct wined3d_shader_src_param to shader_arb_add_src_param().
2009-04-20 14:13:33 +02:00
Henri Verbeet
1ae060be4a
wined3d: Simplify replicating the .x swizzle in shader_hw_mov().
...
It becomes even simpler once the swizzle shift and token field are eliminated.
2009-04-20 14:13:28 +02:00
Henri Verbeet
48a096a638
wined3d: Pass a struct wined3d_shader_src_param to shader_glsl_add_src_param().
2009-04-20 14:13:20 +02:00
Henri Verbeet
c7660c57a0
wined3d: Pass a struct wined3d_shader_src_param to shader_glsl_get_register_name() for the relative addressing token.
2009-04-20 14:13:12 +02:00
Henri Verbeet
915b91757f
wined3d: Store the destination relative addressing token as a struct wined3d_shader_src_param.
2009-04-20 14:13:08 +02:00
Henri Verbeet
0663eb9323
wined3d: Store the source relative addressing token as a struct wined3d_shader_src_param.
2009-04-20 14:13:00 +02:00
Henri Verbeet
d6ee7d59a8
wined3d: Create a relative addressing token for 1.x shaders in the frontend.
...
Rather than handling this in the backends. Note that the ARB backend always
assumes 1.x shaders.
2009-04-20 14:12:52 +02:00
Henri Verbeet
8ac4c98be2
wined3d: Store the source modifiers in struct wined3d_shader_src_param.
2009-04-15 15:57:35 -05:00
Henri Verbeet
b6668b0296
wined3d: Store the register index in struct wined3d_shader_src_param.
2009-04-15 15:57:30 -05:00
Henri Verbeet
4de1dba2c5
wined3d: Store the register type in struct wined3d_shader_src_param.
2009-04-15 15:57:25 -05:00
Henri Verbeet
ff62cab537
wined3d: Introduce struct wined3d_shader_src_param.
2009-04-15 15:57:19 -05:00
Henri Verbeet
463de24e7b
wined3d: Group instruction context information together in struct wined3d_shader_context.
2009-04-15 15:57:13 -05:00
Henri Verbeet
a7e2c2d70c
wined3d: Don't die if a vertex shader has samplers.
...
This fixes a regression introduced by 38239be58c
.
2009-04-15 15:57:00 -05:00
Henri Verbeet
d3fc7dca99
wined3d: Get rid of the "token" field from struct wined3d_shader_dst_param.
2009-04-14 15:25:07 -05:00
Henri Verbeet
18cdcc0b7e
wined3d: Pass a struct wined3d_shader_dst_param to shader_arb_get_write_mask().
2009-04-14 15:25:01 -05:00
Roderick Colenbrander
f2e2e3e499
wined3d: Report the driver description as reported by the Windows drivers when a device string is entered in our device table.
2009-04-13 17:35:44 -05:00
Roderick Colenbrander
c238541656
wined3d: Update Nvidia driver version information.
2009-04-13 17:35:25 -05:00
Tobias Jakobi
0c2514bd8f
wined3d: Rename some NP2 fixup variables and update comments.
2009-04-13 17:32:11 -05:00
Tobias Jakobi
9657e81429
wined3d: Add newline to fixme.
2009-04-13 17:32:03 -05:00
Tobias Jakobi
6e970c5d95
wined3d: glsl: Enable load_np2fixup_constants.
2009-04-10 14:00:58 +02:00
Tobias Jakobi
9b067a6ca5
wined3d: Add load_np2fixup_constants function to shader backend.
2009-04-10 14:00:50 +02:00
Stefan Dösinger
754b5cf2ad
wined3d: Deal with reserved shader constants in the backend.
...
This moves the GLSL and ARB specific reserved constants out of directx.c into
the get_caps methods of the shader backends. That way the number of reserved
constants remains in the backend.
GL_LIMITS({v/p}shader_constantsF) now contains the real number of constants as
advertised by GL instead of some mixture of GL info and backend implementation
specifics. This makes it easier for backends to decide how many constants to
use.
2009-04-10 11:22:55 +02:00
Stefan Dösinger
99d88c15ea
wined3d: Fix the drawRectPatch vertex count.
...
DrawPrimitive now accepts the number of vertices, not the number of
primitives. This code was forgotten in the patch that changed this.
We're drawing triangles, so we are drawing num_primitives * 3 vertices.
2009-04-10 11:14:45 +02:00
Stefan Dösinger
014c4bfc70
wined3d: Save some memory in vertex buffers.
...
In most cases we're fine with the vbo and glMapBuffer and never use the actual
heap memory copy. Try to stick to just the vbo copy and avoid allocating the
extra heap memory. In case it is needed(emulation or vertex conversion), fall
back to the old double buffering mode.
2009-04-10 11:14:32 +02:00
Henri Verbeet
3a5bbe6a0c
wined3d: Split vshader_program_add_param() in shader_arb_add_src_param() and shader_arb_add_dst_param().
2009-04-10 10:23:38 +02:00
Henri Verbeet
e6031afdfa
wined3d: Merge pshader_get_register_name() and part of vshader_program_add_param().
2009-04-10 10:23:33 +02:00
Henri Verbeet
9a28d273bc
wined3d: Explicitly pass the register type and index to pshader_get_register_name().
2009-04-10 10:23:24 +02:00
Henri Verbeet
62d9dc2177
wined3d: Store the relative addressing mode in struct wined3d_shader_dst_param.
2009-04-10 10:23:20 +02:00
Henri Verbeet
22e57d025c
wined3d: Store the destination shift in struct wined3d_shader_dst_param.
2009-04-10 10:23:15 +02:00
Stefan Dösinger
cb1c9dcda9
d3d: Remove the format from index buffers.
2009-04-09 16:28:25 +02:00
Stefan Dösinger
f0efa97413
wined3d: Remove the buffer fvf.
2009-04-09 16:28:10 +02:00
Henri Verbeet
3a0eb81cea
wined3d: Get rid of a redundant strcat in shader_glsl_get_register_name().
2009-04-09 11:27:29 +02:00
Henri Verbeet
ff58255f4e
wined3d: Explicitly pass parameter properties to shader_glsl_get_register_name().
2009-04-09 11:27:25 +02:00
Henri Verbeet
f3e5e92a18
wined3d: Pass a struct wined3d_shader_dst_param to shader_glsl_get_write_mask().
2009-04-09 11:27:21 +02:00
Henri Verbeet
d299f865f7
wined3d: Add a separate function for converting write masks to strings.
2009-04-09 11:27:17 +02:00
Henri Verbeet
877e252681
wined3d: Only update the swizzle and use map for streams that are actually used in device_stream_info_from_strided().
...
This fixes a regression introduced by d7c7c76850
and exposed by ef2d704183
. Unfortunately having
EXT_vertex_array_bgra support masks the problem, which is why the regression
tests didn't catch it.
2009-04-09 11:27:10 +02:00
Henri Verbeet
2df49ea8ef
wined3d: Eliminate a useless local variable.
2009-04-08 11:42:24 +02:00
Henri Verbeet
9ec0b09d35
wined3d: Store usage and usage_idx in struct wined3d_shader_semantic.
...
Instead of the usage token.
2009-04-08 11:42:19 +02:00
Henri Verbeet
a1dedbdf58
wined3d: Properly check if input/output varyings are used.
2009-04-08 11:42:12 +02:00
Henri Verbeet
375780a5a8
wined3d: Fix some more 3 space indentation.
2009-04-08 11:42:05 +02:00
Henri Verbeet
d12e489272
wined3d: Store a struct wined3d_shader_dst_param in struct wined3d_shader_semantic.
2009-04-08 11:41:59 +02:00
Stefan Dösinger
513a493f00
wined3d: Merge IWineD3DIndexBuffer and IWineD3DBuffer.
2009-04-08 11:37:29 +02:00
Stefan Dösinger
2a7a237170
wined3d: Merge indexbuffer and buffer implementations.
2009-04-08 11:37:24 +02:00
Stefan Dösinger
3ed94329a3
wined3d: Use Map and Unmap for index buffers.
...
Just a change in name to prepare for the next patch
2009-04-08 11:36:18 +02:00
Stefan Dösinger
dc80a3ede5
d3d: Unify WINED3DVERTEXBUFFER_DESC and WINED3DINDEXBUFFER_DESC.
2009-04-08 11:36:02 +02:00
Stefan Dösinger
bc07ad0579
d3d8, d3d9: Don't rely on the wined3d buffer type.
2009-04-08 11:35:29 +02:00
Henri Verbeet
a4c942f606
wined3d: Simplify shader_glsl_cmp() and shader_glsl_cnd().
2009-04-07 14:22:00 +02:00
Henri Verbeet
a374ba54e5
wined3d: Simplify shader_glsl_color_correction().
2009-04-07 14:21:54 +02:00
Henri Verbeet
0f92bbc6bc
wined3d: Store the register type in struct wined3d_shader_dst_param.
2009-04-07 14:21:49 +02:00
Henri Verbeet
f7f61a58f4
wined3d: Explicitly pass register type and index to shader_is_scalar().
2009-04-07 14:21:44 +02:00
Henri Verbeet
6f66c1ddbd
wined3d: Store the write mask in struct wined3d_shader_dst_param.
2009-04-07 14:21:37 +02:00
Henri Verbeet
f0de1622d0
wined3d: Store the destination modifiers in struct wined3d_shader_dst_param.
2009-04-06 12:57:52 +02:00
Henri Verbeet
decc1cec9d
wined3d: Pass a pointer to struct wined3d_shader_dst_param to shader_glsl_add_dst_param().
2009-04-06 12:57:44 +02:00
Henri Verbeet
72aff27e0e
wined3d: Pass a pointer to struct wined3d_shader_dst_param to shader_glsl_append_dst_ext().
2009-04-06 12:57:37 +02:00
Henri Verbeet
91305b1f49
wined3d: Use a more appropriate mask for masking out the write mask.
2009-04-06 12:57:32 +02:00
Henri Verbeet
1120f0f585
wined3d: Unset the current GLSL program when it's destroyed.
2009-04-06 12:57:27 +02:00
Roderick Colenbrander
a932fdcb2f
wined3d: Update NVidia pci ids.
2009-04-06 11:16:24 +02:00
Henri Verbeet
6660978b44
wined3d: Use register_idx in the ARB shader backend.
2009-04-03 13:01:50 +02:00
Henri Verbeet
7b62165546
wined3d: Store the register index in struct wined3d_shader_dst_param.
2009-04-03 13:01:44 +02:00
Henri Verbeet
7245cd2b81
wined3d: Add a struct wined3d_shader_dst_param for storing destination parameter information.
2009-04-03 13:01:38 +02:00
Henri Verbeet
04b2e0b19b
wined3d: Remove the opcode field from struct wined3d_shader_instruction.
2009-04-03 13:01:30 +02:00
Henri Verbeet
29c9dc989d
wined3d: Use the source and destination parameter count in the ARB shader backend.
2009-04-03 13:01:20 +02:00
Henri Verbeet
7bde2792c2
wined3d: Store the source and destination parameter count in struct wined3d_shader_instruction.
2009-04-02 16:28:29 +02:00
Henri Verbeet
d633b6d47e
wined3d: Avoid comparing against WINED3DSIO_* in the ARB shader backend.
2009-04-02 16:28:29 +02:00
Henri Verbeet
44648b2b91
wined3d: Store the instruction handler index in struct wined3d_shader_instruction.
...
This allows us to avoid comparing against WINED3DSIO_*, which is specific to
the bytecode.
2009-04-02 16:28:29 +02:00
Henri Verbeet
fb6547a3e1
wined3d: Compare num_params against 1 in shader_glsl_map2gl().
...
num_params includes the destination parameter, while we're only interested in
source parameters. This doesn't cause problems for any of the instrctions
currently handled by shader_glsl_map2gl() though, since they all happen to
have at least 1 source parameter.
2009-04-02 16:28:29 +02:00
Henri Verbeet
c697bdc3a1
wined3d: Remove some code that doesn't make a whole lot of sense.
...
The "instr" parameter to shader_glsl_gen_modifier() is actually a source
parameter, so comparing against WINED3DSIO_TEXKILL is just silly.
2009-04-02 16:28:29 +02:00
Henri Verbeet
c3a01b315e
wined3d: Use a more reasonable name for "SHADER_OPCODE_ARG".
2009-04-01 14:24:19 +02:00
Henri Verbeet
de4e8cf0f9
wined3d: Avoid a forward declaration.
2009-04-01 14:24:11 +02:00
Henri Verbeet
e44335585e
wined3d: Don't use the opcode_token field in the ARB backend.
2009-04-01 14:24:02 +02:00
Henri Verbeet
ec43489e10
wined3d: Don't use the opcode_token field in the GLSL backend.
...
The idea is that we want to prevent backends from parsing the tokens
themselves, which is pretty much a requirement for adding SM4 support.
2009-04-01 14:23:56 +02:00
Henri Verbeet
7f740f2a51
wined3d: Don't leak the swapchain in IWineD3DDeviceImpl_Reset() if the display mode is unsupported.
2009-03-31 12:42:20 +02:00
Henri Verbeet
4ccbc948a1
d3d10core: Set the initial buffer data, when present.
2009-03-31 12:42:07 +02:00
Henri Verbeet
0591442469
wined3d: Care for things like pitch and blocksize when copying DXT surfaces.
2009-03-31 12:42:00 +02:00
Tobias Jakobi
94a7cd42ed
wined3d: Simplify sampler_texmatrix using pow2Matrix_identity.
2009-03-31 12:40:30 +02:00
Tobias Jakobi
38239be58c
wined3d: GLSL: Implement texrect coord fixup.
2009-03-31 12:40:21 +02:00
Tobias Jakobi
1b335dfaaa
wined3d: Add texrect_fixup bitfield to ps_compile_args struct.
...
Initialization of the bitfield done in find_ps_compile_args
based on the previously introduced pow2Matrix_identity flag.
2009-03-31 12:40:10 +02:00
Tobias Jakobi
31f8cd9621
wined3d: Add pow2Matrix_identity flag to BaseTextureClass struct.
...
New flag helps to quickly find out whether the pow2Matrix is a
identity matrix (no texcoord fixup needed) or not.
2009-03-31 12:39:27 +02:00
Henri Verbeet
1205c33c90
wined3d: Use the output slot when we have one.
2009-03-30 15:11:29 +02:00
Henri Verbeet
ef2d704183
wined3d: Store the format_desc itself in struct wined3d_stream_info_element.
2009-03-30 15:11:24 +02:00
Roderick Colenbrander
5d08f3b705
wined3d: Check for the presence of wglGetExtensionsStringARB.
2009-03-30 15:10:00 +02:00
Stefan Dösinger
3e099d0147
wined3d: Advertise post pixelshader blending for a few more formats.
...
Windows advertises it on all these formats(Nvidia Geforce 7400), and
Trackmania Nations needs it on D3DFMT_Q8W8V8U8 to accept ps_3_0 support.
2009-03-30 14:22:06 +02:00
Stefan Dösinger
3fbdb64270
wined3d: Update a comment.
...
shader_select takes care of compiling the shader since we have the shader
duplication infrastructure. However, there's still a motivation to skip the
shader_select call if the vertex shader is dirty.
2009-03-30 14:21:52 +02:00
Stefan Dösinger
703dcca61b
wined3d: Fix some whitespace.
2009-03-30 14:21:44 +02:00
Stefan Dösinger
8d4ac8ac1b
wined3d: Remove a TODO.
...
init_materials() doesn't exist, and I don't know what the TODO means with
primitive type (the diffuse stuff is already handled properly).
2009-03-30 14:21:08 +02:00
Henri Verbeet
4434d00f84
wined3d: Unify vertex and texture formats.
...
Some fields should be redundant now, eg. gl_vtx_type and glType. I'll leave
that for a different patch to fix though.
2009-03-27 15:51:25 +01:00
Henri Verbeet
6f206c75ec
wined3d: Don't create an END element for wined3d vertex declarations.
...
Wined3d doesn't need it since it already has the element count.
2009-03-27 15:51:25 +01:00
Henri Verbeet
9f26fed28d
wined3d: Separate the internal representation of vertex declaration elements from the struct used to create it.
...
Internally we want to store some extra data, like ffp_valid. One of the later
patches also stores the format desc in the declaration elements, instead of
the current WINED3DDECLTYPE.
2009-03-27 15:51:25 +01:00
Henri Verbeet
4330d20d0d
wined3d: Remove IWineD3DVertexDeclaration_SetDeclaration() from the public interface.
2009-03-27 15:51:25 +01:00
Henri Verbeet
d8a4cc6648
wined3d: Remove IWineD3DVertexDeclarationImpl_GetDeclaration().
...
It's never used.
2009-03-27 15:51:25 +01:00
Henri Verbeet
d7c7c76850
wined3d: Use separate structures for ddraw style strided data and wined3d's internal stream info.
2009-03-27 15:51:25 +01:00
Henri Verbeet
5390628e6f
wined3d: Make sure the format actually exists in init_format_texture_info().
2009-03-27 15:51:24 +01:00
Henri Verbeet
837f163662
wined3d: Create a separate function for setting a format's GL texture info.
2009-03-27 15:50:24 +01:00
Henri Verbeet
b8f25ef6f2
wined3d: Create a separate function for setting format fixups.
2009-03-27 15:50:16 +01:00
Henri Verbeet
7874a6b74b
wined3d: Create a separate function for checking a format's FBO compatibility.
2009-03-27 15:50:08 +01:00
Henri Verbeet
1407bd6b1a
wined3d: Create a separate function for setting basic format info.
2009-03-27 11:23:41 +01:00
Henri Verbeet
c0c1c42288
wined3d: Pass the number of components to glVertexBlendARB().
2009-03-26 14:48:16 +01:00
Henri Verbeet
663e5a6a4c
wined3d: Simplify the "transformed" check in state_lighting().
...
It doesn't really matter if lighting is enabled or not if we don't have
position data.
2009-03-26 14:48:10 +01:00
Henri Verbeet
a7d6128547
wined3d: Simplify IWineD3DDeviceImpl_ProcessVertices().
2009-03-26 14:48:04 +01:00
Henri Verbeet
c1a42ff024
wined3d: Simplify remove_vbos().
2009-03-26 14:47:58 +01:00
Henri Verbeet
6afd97cc9f
wined3d: Remove unused attributes from WineDirect3DVertexStridedData.
...
These are essentially unused, and mostly just complicate the code.
2009-03-26 14:47:52 +01:00
Henri Verbeet
25b60e168a
wined3d: Do the ffp_valid check before even trying to use the element.
2009-03-25 11:12:55 +01:00
Henri Verbeet
4469fbd43d
wined3d: Don't use rtInternal for surfaces that are on a swapchain.
...
These surfaces won't be attached to an FBO anyway, so avoid the cost of a
potential format conversion when blitting from a non-RT surface. This is
mostly an issue for ddraw applications with 16 bit render targets.
2009-03-25 11:12:49 +01:00
Henri Verbeet
899df56ebe
wined3d: Add a more convenient way to check if a surface is on a swapchain.
...
This won't help if we actually need the swapchain, of course.
2009-03-25 11:12:40 +01:00
Henri Verbeet
42e31a4242
wined3d: Fix a few sign compare warnings.
2009-03-25 11:12:30 +01:00
Henri Verbeet
59c5962828
wined3d: Make the texunit field in struct stb_const_desc unsigned.
2009-03-25 11:12:13 +01:00
Henri Verbeet
771fe7fd8a
wined3d: Implement WINED3DTSS_TCI_SPHEREMAP.
2009-03-25 11:12:07 +01:00
Henri Verbeet
3234a4af2d
wined3d: Reduce the number of checkGLcall's in tex_coordindex() a bit.
2009-03-25 11:12:02 +01:00
Henri Verbeet
61cd872fa7
wined3d: Print a FIXME in tex_coordindex() when NV_TEXGEN_REFLECTION isn't supported.
2009-03-25 11:11:57 +01:00
Henri Verbeet
f63313fe3e
wined3d: Fix the indentation in tex_coordindex().
...
The indentation here is pretty horrible. Also removes a couple of fairly
useless comments.
2009-03-25 11:11:32 +01:00
Henri Verbeet
8255dde127
wined3d: Print a warning when the stage isn't mapped to a valid texture unit in tex_coordindex().
2009-03-25 11:11:24 +01:00
Henri Verbeet
afc5744e70
wined3d: Pass format_desc to set_shader().
...
This should be the last unnecessary getFormatDescEntry() call.
2009-03-24 12:57:45 +01:00
Henri Verbeet
dd1f0d9c48
wined3d: Pass format_desc to getColorBits() and getDepthStencilBits().
2009-03-24 12:57:38 +01:00
Henri Verbeet
a02d801888
wined3d: Pass format_desc to the Check*Capability() function.
...
Rather than looking it up all the time.
2009-03-24 12:57:31 +01:00
Henri Verbeet
b7744f8158
wined3d: Remove the bytesPerPixel field from IWineD3DSurfaceImpl and IWineD3DVolumeImpl.
...
We can use the information from format_desc instead.
2009-03-24 12:57:21 +01:00
Henri Verbeet
a56a143461
wined3d: Set the byte count for WINED3DFMT_UNKNOWN to 0.
...
As far as I can tell nothing depends on this being 1, and there's some code
that checks for WINED3DFMT_UNKNOWN and uses 0 for the byte count in that case.
2009-03-24 12:57:12 +01:00
Henri Verbeet
8ce2506aa8
wined3d: Try to make Coverity shut up (CID 863, 905).
...
Comparing gl_shaders against NULL after potentially dereferencing it a few
lines earlier probably confuses Coverity. Checking num_gl_shaders instead
should avoid this.
2009-03-24 12:56:19 +01:00
Henri Verbeet
1f4e7b27ed
wined3d: Set the currently active context to NULL when it's destroyed.
...
This should make us crash when trying to use the "currently active" context
after it has been destroyed, rather than messing around with freed memory.
2009-03-23 14:08:02 +01:00
Henri Verbeet
89721c2173
wined3d: Compare the actual formats.
2009-03-23 14:08:02 +01:00
Henri Verbeet
24a4503d61
wined3d: Unload resources on Uninit3D().
...
This should prevent destroying GL objects without a GL context. Eg. when a ddraw
surface has a GL texture and is released after a call to Uninit3D().
2009-03-23 14:07:48 +01:00
Roderick Colenbrander
4544efc972
wined3d: Add a classic WGL pixel format backend as not all OpenGL implementations support WGL_ARB_pixel_format.
...
This should help for instance VirtualBox.
2009-03-23 13:25:50 +01:00
Roderick Colenbrander
9181ddcd16
wined3d: Add WGL_ARB_pixel_format detection.
...
Right now we assume that the extension is there but this isn't always
the case. The next patch in this series will add a
non-WGL_ARB_pixel_format codepath to help VirtualBox and others.
2009-03-23 13:25:17 +01:00
Henri Verbeet
2dc7fc2916
wined3d: Remove the format field from IWineD3DResourceClass.
2009-03-13 11:29:19 +01:00
Henri Verbeet
a56e3a102b
wined3d: Only return a pointer to struct GlPixelFormatDesc from getFormatDescEntry().
2009-03-13 11:29:10 +01:00
Henri Verbeet
53bf5c2658
wined3d: Add fields from StaticPixelFormatDesc to struct GlPixelFormatDesc.
...
The idea here is that we should lookup format information in struct
GlPixelFormatDesc, while StaticPixelFormatDesc and GlPixelFormatDescTemplate
will only be used to build the table.
2009-03-13 11:29:01 +01:00
Henri Verbeet
fbfc7c9742
wined3d: Remove the width and height fields from IWineD3DTextureImpl.
2009-03-13 11:28:55 +01:00
Henri Verbeet
a3657c164d
wined3d: Remove some redundant fields from struct glDescriptor.
2009-03-13 11:28:50 +01:00
Henri Verbeet
a139683a60
wined3d: Eliminate the heightscale field from IWineD3DSurfaceImpl.
2009-03-13 11:28:45 +01:00
Henri Verbeet
e56a4cb799
wined3d: Also change the resource's format desc in IWineD3DBaseSurfaceImpl_SetFormat().
2009-03-13 11:28:40 +01:00
Henri Verbeet
e3bcc7544c
wined3d: Remove the shader_color_fixup field from IWineD3DBaseTextureClass.
...
This is redundant now.
2009-03-12 13:09:55 +01:00
Henri Verbeet
1dcf222ab2
wined3d: Get rid of some calls to getFormatDescEntry().
...
Use the format description stored in the resource instead.
2009-03-12 13:09:55 +01:00
Henri Verbeet
38178541b0
wined3d: Store a pointer to the format description in the resource.
...
The goal is to eventually use a pointer to the format description in most
places where we currently use WINED3DFORMAT. IWineD3DSurfaceImpl for example
has copies of several fields from the format description, but also needs to
lookup the format description itself in several places.
2009-03-12 13:09:55 +01:00
Henri Verbeet
81075d2db3
wined3d: Remove a redundant check.
...
This is redundant now, InitAdapters() will only be called once for each
IWineD3DImpl object, as pointed out by Allan Tong.
2009-03-12 13:09:55 +01:00
Henri Verbeet
e4ea7976a5
wined3d: Remove an unused field.
2009-03-12 13:09:55 +01:00
Henri Verbeet
2219749ae9
wined3d: Explicitly pass the texUnitMap to shader_glsl_load_vsamplers() and shader_glsl_load_psamplers().
...
The general idea here is to reduce dependencies on the entire stateblock, and
pass the real dependencies explicitly. This should make it clearer what
context a shader really needs.
2009-03-12 13:09:55 +01:00
Henri Verbeet
40d4f9b7ec
wined3d: Don't leak WineD3DAdapter.cfgs.
2009-03-11 13:03:32 +01:00
Henri Verbeet
ddae14169b
wined3d: Get rid of the PUSH1 macro.
2009-03-11 13:03:32 +01:00
Henri Verbeet
2cc43393f0
wined3d: The adapters array should be owned by IWineD3DImpl.
2009-03-11 13:03:32 +01:00
Henri Verbeet
3644a7f6d7
wined3d: Free the logo path when we're done with it.
2009-03-11 13:03:32 +01:00
Henri Verbeet
a75590343a
wined3d: Set the correct texture names on cube surfaces.
2009-03-11 13:03:32 +01:00
Henri Verbeet
67da604eca
wined3d: Get rid of a few stack buffers.
2009-03-10 12:07:02 +01:00
Henri Verbeet
1fa83c95de
wined3d: Don't call shader_glsl_append_dst() from shader_glsl_texldl().
...
shader_glsl_gen_sample_code() already takes care of adding the destination.
2009-03-10 12:06:47 +01:00
Henri Verbeet
4e2c87dd22
wined3d: Handle error conditions better in RemoveContextFromArray().
2009-03-09 14:44:02 +01:00
Henri Verbeet
695c69f6a0
wined3d: Use shader_glsl_get_write_mask_size() to calculate the write mask size.
2009-03-09 14:39:48 +01:00
Henri Verbeet
362bc0d694
wined3d: Don't compare const_num against -1.
2009-03-09 14:39:39 +01:00
Henri Verbeet
4ff5736edf
wined3d: Don't compare texUnitMap entries to -1.
2009-03-09 14:39:34 +01:00
Henri Verbeet
a3df476706
wined3d: Buffer object ID's are supposed to be unsigned.
2009-03-09 14:39:18 +01:00
Henri Verbeet
aa3027a604
wined3d: Merge IWineD3DVertexBuffer with IWineD3DBuffer.
...
That still leaves IWineD3DIndexBuffer, but that code is also mostly similar,
except for the conversion code (which will be unused there).
2009-03-06 15:35:58 +01:00
Henri Verbeet
6324ba66ca
wined3d: Simplify IWineD3DVertexBufferImpl_PreLoad() a bit.
2009-03-06 15:35:50 +01:00
Henri Verbeet
594cc7ebc1
wined3d: Also set VBFLAG_HASDESC if we can determine we don't need conversion.
2009-03-06 15:35:28 +01:00
Henri Verbeet
702eeb6b0c
wined3d: Add separate methods for setting the primitive type.
2009-03-05 16:16:25 +01:00
Henri Verbeet
3b07e7059e
wined3d: Add d3d10 primitive types.
2009-03-05 16:16:24 +01:00
Henri Verbeet
3f9e0d9320
wined3d: Add support for ARB_geometry_shader4.
2009-03-05 16:16:24 +01:00
Henri Verbeet
17e12611b8
wined3d: Fix some prototypes.
2009-03-05 16:16:24 +01:00
Henri Verbeet
602bb1f551
wined3d: Pass the vertex count rather than the primitive count to wined3d draw methods.
2009-03-05 16:16:24 +01:00
Henri Verbeet
703ef0de02
wined3d: Use flags for shader_glsl_get_sample_function().
...
Having three BOOL parameters looks a bit awkward.
2009-03-04 12:07:20 +01:00
Stefan Dösinger
8781174a98
wined3d: Create a common sampling function in GLSL.
...
This way the individual instruction handlers don't have to bother about the
color correction, and there's now a single place to implement fixup dependent
sampling writemask selection.
2009-02-27 13:14:46 +01:00
Stefan Dösinger
d7a6859960
wined3d: Make shader_glsl_get_sample_function aware of *Lod functions.
2009-02-27 13:14:33 +01:00
Stefan Dösinger
5cf764aec2
wined3d: Put the color_correction calls into the instruction handlers.
...
The color correction cannot be done behind the back of the individual
instruction handlers because it might conflict with the instruction's
color modifications and the D3D provided writemask.
2009-02-27 13:14:23 +01:00
Henri Verbeet
b4830feb34
wined3d: Accept WINED3DFMT_R8G8B8A8_UNORM in getColorBits().
2009-02-25 12:37:06 +01:00
Henri Verbeet
7facc6906d
wined3d: Implement IWineD3DDeviceImpl_ClearRendertargetView().
2009-02-25 12:37:06 +01:00
Stefan Dösinger
6012475e59
wined3d: Properly update last_was_pshader.
2009-02-24 16:57:30 +01:00
Henri Verbeet
c796f76483
wined3d: Add IWineD3DRendertargetView.
2009-02-24 16:57:29 +01:00
Henri Verbeet
33dd39c4d0
wined3d: Merge indexbuffer.c with buffer.c.
2009-02-23 12:21:10 +01:00
Henri Verbeet
392cfefbeb
wined3d: Merge vertexbuffer.c with buffer.c.
...
This just moves to code to the same file, but we want to merge the
implementations as well at some point.
2009-02-23 12:21:02 +01:00
Henri Verbeet
399d992a07
wined3d: Add IWineD3DBuffer, use it in d3d10core.
2009-02-23 12:20:45 +01:00
Henri Verbeet
0048a0373b
d3d10core: Keep a reference to the wined3d device in the d3d10 device.
2009-02-23 12:20:29 +01:00
Henri Verbeet
8cefc47d81
wined3d: Add DXGI formats to WINED3DFORMAT.
2009-02-20 11:10:37 +01:00
Henri Verbeet
828f42cb1f
wined3d: Add some traces to state handlers.
...
Should make it a bit clearer what's happening in some cases.
2009-02-19 12:53:44 +01:00
Henri Verbeet
c8a3f3f13f
wined3d: Allow floating point values for WINED3DDECLUSAGE_BLENDWEIGHT.
...
glWeightPointerARB() obviously accepts floating point data.
2009-02-19 12:53:38 +01:00
Francois Gouget
5b60258f0d
wined3d: Make debug{fixup_channel_source,yuv_fixup}() static.
2009-02-18 12:17:38 +01:00
Stefan Dösinger
4386a827e9
wined3d: Pass the requested srgb flag to PreLoad.
...
Add a new wined3d-internal PreLoad function to textures and surfaces
that takes a parameter specifying wether the rgb or srgb texture
should be loaded.
2009-02-17 12:51:36 +01:00
Stefan Dösinger
68c251f327
wined3d: Add a debug function for surface locations.
2009-02-17 12:51:17 +01:00
Stefan Dösinger
c585b4de99
wined3d: Duplicate GL textures for srgb switching.
...
This reduces the number of srgb switching reloads quite a lot. The only
situation in which a reload is needed is if the rgb copy is modified on the GL
side and the srgb copy is needed.
2009-02-17 12:48:05 +01:00
Francois Gouget
83d18602d8
wined3d: Add a trailing '\n' to shader_addline() calls.
2009-02-12 17:53:35 +01:00
Stefan Dösinger
66778ed9ec
wined3d: Implement EXP and EXP2 fog in GLSL.
2009-02-11 12:21:51 +01:00
Stefan Dösinger
693d9ded47
wined3d: Properly set the fog frag coord according to the FOGTABLEMODE.
...
This also fixes the test that an earlier patch broke, so the todo_wine can be
removed again.
2009-02-11 12:21:44 +01:00
Stefan Dösinger
8dcd51286d
WineD3D: Put vertex shader duplication infrastructure in place.
2009-02-11 12:21:25 +01:00
Michael Stefaniuc
118c75a8c7
wined3d: Remove superfluous pointer casts.
2009-02-03 12:40:14 +01:00
Michael Stefaniuc
cc6b283d3a
wined3d: Remove some unused defines.
2009-02-03 12:40:12 +01:00
Henri Verbeet
bae1ec98ca
wined3d: Don't use drawStridedFast() for drawing pretransformed vertices.
...
This was exposed by adding EXT_vertex_array_bgra support, previously we would
almost never hit this because color data being present would already prevent
us from using drawStridedFast(). Thanks to Stefan for spotting this.
2009-01-23 13:12:58 +01:00
Henri Verbeet
0cc5f0d3eb
wined3d: Don't use drawStridedFast() when pointsize data is present.
2009-01-23 13:12:52 +01:00
Henri Verbeet
e82eef28f9
wined3d: Take EXT_vertex_array_bgra into account in send_attribute() and loadNumberedArrays().
2009-01-23 13:12:47 +01:00
Paul Chitescu
540febecf9
wined3d: Detect Radeon Xpress Series, report PCI ID of Radeon Xpress 200M.
2009-01-21 10:24:44 +01:00
Stefan Dösinger
3d97055be7
wined3d: Get rid of is_compiled in the pixel shader.
2009-01-20 12:55:17 +01:00
Stefan Dösinger
50109aa969
wined3d: Get rid of last_was_foggy_shader & friends.
...
The fog settings do not depend on wether the shader writes to oFog or not,
instead they depend on the FOGVERTEXMODE and FOGTABLEMODE settings, and if a
vertex shader is bound at all.
It works the same way as with the fixed function, and having a vertex shader
is the same as using pretransformed vertices, just that the fog coord comes
from the shader instead of the specular color:
FOGTABLEMODE != NONE: The Z coord is used, oFog is ignored
FOGTABLEMODE == NONE, with VS: oFog is used
FOGTABLEMODE == NONE, no VS, XYZ: Z is used
FOGTABLEMODE == NONE, no VS, XYZRHW: diffuse color is used
2009-01-20 12:45:40 +01:00
Stefan Dösinger
3c3272dc41
wined3d: Don't single-allocate new gl shaders.
2009-01-20 12:45:09 +01:00
Henri Verbeet
5d875906c1
wined3d: Remove some superfluous pointer casts.
2009-01-20 12:34:05 +01:00
Henri Verbeet
a966293f59
wined3d: Add an IWineD3DDeviceParent interface.
...
Other than being a bit nicer than passing function pointers all over the
place, this helps dxgi/d3d10. While the swapchain itself is created in dxgi,
its surfaces are constructed in d3d10core, which makes it impractical for dxgi
to pass the appropriate function pointers.
2009-01-16 13:29:32 +01:00
Henri Verbeet
44240eff27
wined3d: Remove some comments.
2009-01-15 12:43:32 +01:00
Henri Verbeet
17b94f6034
wined3d: Implement a R5G6B5 to X8R8G8B8 surface format converter.
...
Based on a patch by Mike Ruprecht.
2009-01-15 12:43:28 +01:00
Henri Verbeet
4c7e72bb96
wined3d: Fix a memory leak in CreateSwapChain() error handling.
2009-01-14 13:51:00 +01:00
Henri Verbeet
c8c073fc9b
wined3d: Get rid of D3DCREATEOBJECTINSTANCE.
2009-01-14 13:51:00 +01:00
Henri Verbeet
9440dfedf4
wined3d: Remove AddDirtyRect() from the public interface.
2009-01-14 13:51:00 +01:00
Henri Verbeet
fd90021666
wined3d: Remove AddDirtyBox() from the public interface.
...
This is an internal wined3d function.
2009-01-14 13:51:00 +01:00
Henri Verbeet
881780276b
wined3d: Remove CleanDirtyBox().
...
It's never used.
2009-01-14 13:51:00 +01:00
Henri Verbeet
a37782595f
wined3d: Fix cube texture creation error handling.
2009-01-13 15:20:56 +01:00
Henri Verbeet
d030cbdad2
wined3d: Fix volume texture creation error handling.
2009-01-13 15:20:52 +01:00
Henri Verbeet
99d3c62163
wined3d: Fix surface creation error handling.
2009-01-13 15:20:44 +01:00
Henri Verbeet
2654a148de
wined3d: Fix texture creation error handling.
...
Doing the levels calculation before the object is created prevents leaking
resources and avoids changing baseTexture.levels after it's been initialized
by basetexture_init().
2009-01-13 15:20:38 +01:00
Henri Verbeet
e4cfbdd4f7
wined3d: Get rid of D3DCREATERESOURCEOBJECTINSTANCE.
2009-01-13 15:20:28 +01:00
Henri Verbeet
b069321650
wined3d: Fix and unify shader creation error handling.
2009-01-12 13:22:07 +01:00
Henri Verbeet
894edc49cc
wined3d: Get rid of D3DCREATESHADEROBJECTINSTANCE.
2009-01-12 13:22:02 +01:00
Henri Verbeet
87627c811e
wined3d: Get rid of D3DINITIALIZEBASETEXTURE.
2009-01-12 13:21:56 +01:00
Henri Verbeet
00a4b85fa9
wined3d: Update the pixelshader when the texture type changes.
2009-01-12 13:21:51 +01:00
Stefan Dösinger
365e1f3b07
wined3d: Avoid hooking non-fog glEnable/glDisable calls.
...
This prevents fallout from the GL_EXT_fog_coord emulation. glEnable
and glDisable calls other than those that change GL_FOG are not
hooked. The glEnableWINE and glDisableWINE functions can be used to
add other hooks too if ever needed.
2009-01-12 13:03:47 +01:00
Stefan Dösinger
1deafcb5a7
wined3d: Split the remains of state_fog.
2009-01-12 13:02:49 +01:00
Stefan Dösinger
061087811f
wined3d: Remove the apply_pshader_fog state handler.
...
The fog doesn't depend on pixel shaders any longer(but still vice
versa), so we don't need this state any more.
2009-01-12 13:02:39 +01:00
Stefan Dösinger
2dd18635c9
wined3d: Move fogdensity and fogcolor to the fragment pipeline.
2009-01-12 13:02:29 +01:00
Stefan Dösinger
e61aa24aa3
wined3d: Use the ARB fog option in ARB_fragment_program shaders.
...
This is the "replacement" for the fog coord optimization removed in
the previous patch.
2009-01-12 13:02:19 +01:00
Stefan Dösinger
7c21147dcd
wined3d: Remove the pixelshader fogstart/fogend optimization.
2009-01-12 13:01:49 +01:00
Rico Schüller
5e79b0608d
wined3d: Add a checkGLcall() after glReadBuffer.
2009-01-10 18:04:28 +01:00
Allan Tong
29dd286d79
wined3d: Add code to cleanup device multistate_funcs.
2009-01-10 17:43:11 +01:00
Stefan Dösinger
a69c86d3f5
ddrawex: Add a test for the permanent DC function.
2009-01-09 16:26:06 +01:00
Henri Verbeet
9d8c6326c0
wined3d: Remove stray tabs.
2009-01-09 14:06:14 +01:00
Henri Verbeet
ac914262ed
wined3d: Rewrite BeginStateBlock() to use CreateStateBlock() instead of duplicating the code.
2009-01-09 14:06:14 +01:00
Henri Verbeet
9d523ebd8f
wined3d: Remove a silly check in drawStridedInstanced().
2009-01-09 14:06:14 +01:00
Henri Verbeet
92488ca7c1
wined3d: Simplify checking if an attribute is used in loadNumberedArrays().
2009-01-09 14:06:14 +01:00
Henri Verbeet
d9e58e6591
wined3d: Failing HeapAlloc() should be an ERR.
2009-01-09 14:06:13 +01:00
Henri Verbeet
e028e3f7bd
wined3d: Use GL_ALIASED_POINT_SIZE_RANGE to retrieve the max point size.
2009-01-09 14:06:13 +01:00
Henri Verbeet
45a61d1ac4
wined3d: Enable GL_HALF_FLOAT_NV when NV_HALF_FLOAT is supported.
...
This makes more sense than the other way around.
2009-01-08 13:21:56 +01:00
Henri Verbeet
b1812c690c
wined3d: Add support for EXT_vertex_array_bgra.
...
This allows us to skip BGRA->RGBA color conversion for vertex attributes if
this extension is present.
2009-01-08 13:21:51 +01:00
Henri Verbeet
6791e6b752
wined3d: Simplify handling of swizzled attributes.
...
This should also be a little bit faster.
2009-01-08 13:21:43 +01:00
Henri Verbeet
cc447eac55
wined3d: Move position_transformed out of u.s in struct WineDirect3DVertexStridedData.
2009-01-08 13:21:31 +01:00
Henri Verbeet
1a1f5ec69d
wined3d: Cleanup drawStridedFast().
...
Remove some uncessary code and use more descriptive parameter names. Note that
max_vertex_idx isn't the same as "minIndex + calculatedNumberOfindices - 1"
but rather "minIndex + numberOfVertices - 1". calculatedNumberOfindices just
specifies the number of vertices that's drawn, while numberOfVertices
specifies the range of vertices that's drawn.
2009-01-08 13:21:23 +01:00
Henri Verbeet
5f8c62e45d
wined3d: Remove a redundant parameter to drawPrimitive().
...
startIdx should be the first index to draw, either from the vertex
array or the index array, depending on if the draw is indexed or
not. Having both at the same time wouldn't make sense.
2009-01-07 12:22:12 +01:00
Henri Verbeet
46eabd5b16
wined3d: Don't delete queries from the wrong context.
2009-01-07 12:22:02 +01:00
Henri Verbeet
0e8ed9bebb
wined3d: Simplify IWineD3DOcclusionQueryImpl_GetData().
2009-01-07 12:21:58 +01:00
Henri Verbeet
ab275ab487
wined3d: Make calling a query from the wrong context a FIXME.
...
We want to know if this happens a lot. If the query is always called
from a different context than the one that created it, occlusion
culling would effectively be disabled, which could have a significant
performance impact, depending on the type of objects being culled.
2009-01-07 12:21:49 +01:00
Henri Verbeet
691894d1ab
wined3d: Also apply the last sampler state.
...
In practice we don't implement WINED3DSAMP_DMAPOFFSET anyway, so this
is unlikely to make much of a difference.
2009-01-07 12:21:37 +01:00
Henri Verbeet
bddf5e76ea
wined3d: Convert textureState to a bitmap in struct SAVEDSTATES.
2009-01-06 12:45:52 +01:00
Henri Verbeet
a8697d90e4
wined3d: Renumber WINED3DTEXTURESTAGESTATETYPE enum elements.
...
Saves some space by not having unused entries is the arrays tracking these
states.
2009-01-06 12:45:43 +01:00
Henri Verbeet
e8ba733706
wined3d: Remove unused enum elements from WINED3DTEXTURESTAGESTATETYPE.
2009-01-05 12:41:31 +01:00
Henri Verbeet
fd33f0f97f
wined3d: Convert samplerState to a bitmap in struct SAVEDSTATES.
2009-01-05 12:41:17 +01:00
Henri Verbeet
c33b38117e
wined3d: Convert renderState to a bitmap in struct SAVEDSTATES.
2009-01-05 12:41:08 +01:00
Henri Verbeet
fc39831e4c
wined3d: Convert transform to a bitmap in struct SAVEDSTATES.
2009-01-05 12:40:57 +01:00
Stefan Dösinger
616ea53226
ddraw: Add a test for IDirectDrawSurface::GetDC.
2009-01-03 15:14:38 +01:00
Vincent Pelletier
23dcf61e61
wined3d: Make WARN about oversized texture output surface and texture sizes.
2009-01-03 14:55:31 +01:00
Henri Verbeet
9a889f6b0b
wined3d: Convert textures to a bitmap in struct SAVEDSTATES.
2009-01-03 14:55:31 +01:00
Henri Verbeet
39909f2a06
wined3d: Handle WINED3DFVF_XYZW in get_flexible_vertex_size().
...
Spotted by Chris Robinson.
2009-01-03 14:55:31 +01:00
Henri Verbeet
3c14b3936f
wined3d: Don't bother with the GLSL info log if nobody's looking.
2009-01-03 14:55:30 +01:00
Henri Verbeet
2e0212e998
wined3d: Fix the line number for some fglrx spam.
...
We added a #version line a while ago, so the line number for the
warning changed.
2009-01-03 14:55:30 +01:00
Allan Tong
fdd512deeb
wined3d: Add mapping for MOV instructions in shader_hw_map2gl.
2009-01-02 11:53:35 +01:00
Henri Verbeet
3b5c75d991
wined3d: Convert clipplane to a bitmap in struct SAVEDSTATES.
2009-01-02 11:53:04 +01:00
Henri Verbeet
52a900d4e8
wined3d: Convert streamSource and streamFreq to bitmaps in struct SAVEDSTATES.
2009-01-02 11:52:34 +01:00