Henri Verbeet
560d63548d
wined3d: Remove trailing spaces.
2009-08-27 11:45:37 +02:00
Henri Verbeet
afc06ce748
wined3d: Get rid of a redundant memset() in device_stream_info_from_declaration().
2009-08-27 11:45:37 +02:00
Stefan Dösinger
52731a80c8
wined3d: Make it clear that glFlush and glFinish are WGL functions.
2009-08-26 14:35:41 +02:00
Henri Verbeet
458afd64bd
wined3d: Properly check if an attribute is used in IWineD3DDeviceImpl_ProcessVertices().
2009-08-21 11:10:26 +02:00
Henri Verbeet
4ec2b09d8f
wined3d: Don't check for a "representative" in the MarkStateDirty() functions.
...
States without representative should never be called. Arguably they shouldn't
exist in the first place, but allowing them simplifies the state table.
2009-08-21 11:10:21 +02:00
Henri Verbeet
8d0ad2cf36
wined3d: Remove a redundant IWineD3DDeviceImpl_MarkStateDirty() call.
...
We should now correctly track the relevant state per-context. The
IWineD3DDeviceImpl_SetViewport() call isn't quite correct for d3d8 and d3d9,
Stefan still has a patch for that.
2009-08-17 13:57:50 +02:00
Henri Verbeet
b8078fc747
wined3d: Use WINED3D_UNMAPPED_STAGE in some more places.
2009-08-17 13:57:50 +02:00
Henri Verbeet
7a0670392c
wined3d: Check the correct vertex sampler in device_unit_free_for_vs().
2009-08-17 13:57:50 +02:00
Henri Verbeet
8cf7aa2bdd
wined3d: Don't use a start index higher than MAX_COMBINED_SAMPLERS - 1 in device_map_vsamplers().
2009-08-17 13:57:50 +02:00
Henri Verbeet
a7251f0f4e
wined3d: Track render_offscreen in the context.
...
This makes sure the relevant states in FindContext() are actually marked dirty
when needed.
2009-08-06 17:26:30 +02:00
Henri Verbeet
7165bd19c1
wined3d: WINED3DTEXF_NONE only makes sense as a mip filter.
2009-08-05 11:20:43 +02:00
Henri Verbeet
da1e5573da
wined3d: Rename WineD3DContext to struct wined3d_context.
2009-08-03 15:01:48 +02:00
Henri Verbeet
be536ebe2f
wined3d: Get rid of activeContext.
2009-07-24 13:10:57 +02:00
Henri Verbeet
c8fe24d29e
wined3d: Explicitly pass the context to surface_load_ds_location().
2009-07-24 13:10:47 +02:00
Henri Verbeet
2c71b85334
wined3d: Explicitly pass the context to get_drawable_size().
2009-07-24 13:10:37 +02:00
Henri Verbeet
fb77678e9f
wined3d: Manage event queries in the context.
2009-07-24 13:10:28 +02:00
Henri Verbeet
4ab7af6575
wined3d: Manage occlusion queries in the context.
2009-07-24 13:10:19 +02:00
Henri Verbeet
357ea123d9
wined3d: get_drawable_size() needs a context.
2009-07-23 11:22:25 +02:00
Henri Verbeet
c114b04016
wined3d: Remove the useless lastThread field from IWineD3DDeviceImpl.
2009-07-21 14:23:06 +02:00
Henri Verbeet
2d7500600b
wined3d: Get rid of lastActiveRenderTarget.
2009-07-21 14:23:02 +02:00
Henri Verbeet
8402519c7a
wined3d: Call ModifyLocation on "target" in IWineD3DDeviceImpl_ClearSurface().
...
This is the same pointer, but lastActiveRenderTarget will go away.
2009-07-21 14:22:53 +02:00
Henri Verbeet
ee4d18cc83
wined3d: Pass NULL to ActivateContext() when we don't need a specific target.
...
Once we keep track of the wined3d context for each thread,
lastActiveRenderTarget won't do what we want here.
2009-07-21 14:22:44 +02:00
Henri Verbeet
3a63552fd1
wined3d: Skip some unnecessary FBO binds.
2009-07-20 13:35:11 +02:00
Henri Verbeet
710f6f8456
wined3d: Always use context_bind_fbo() to change the framebuffer binding.
2009-07-17 11:22:07 +02:00
Henri Verbeet
7485173849
wined3d: Pass the context instead of the device to the various context functions.
2009-07-17 11:22:07 +02:00
Henri Verbeet
69b7612265
wined3d: Get rid of struct glDescriptor.
...
In general it might not be a bad idea to group GL specific data into a
separate struct, but IWineD3DSurfaceImpl is currently the only thing that
bothers. It doesn't get it quite right either, since e.g. the PBO isn't in
glDescriptor either.
2009-07-10 12:13:24 +02:00
Henri Verbeet
038d939941
wined3d: Remove GetGlDesc() from the public IWineD3DSurface interface.
2009-07-10 12:13:09 +02:00
Henri Verbeet
2ac34bf231
wined3d: Add some missing float suffixes.
...
The compiler should be smart enough to fix most of these, but it looks sloppy.
2009-07-07 11:50:05 +02:00
Henri Verbeet
4075e45d81
wined3d: Add a WARN to IWineD3DDeviceImpl_SetFrontBackBuffers() about potentially being called without a GL context.
2009-06-29 12:30:37 +02:00
Henri Verbeet
7363b6e2e3
wined3d: Document GL context dependencies.
2009-06-26 12:05:07 +02:00
Henri Verbeet
4a137815db
wined3d: Make sure we have an active GL context in IWineD3DDeviceImpl_SetCursorProperties().
2009-06-25 11:47:34 +02:00
Henri Verbeet
94cd8656ea
wined3d: Make context_resource_released() responsible for activating a different GL context.
...
In case lastActiveRenderTarget is destroyed.
2009-06-25 11:47:24 +02:00
Henri Verbeet
11fd358cc6
wined3d: Make sure we have an active GL context in delete_opengl_contexts().
2009-06-25 11:47:09 +02:00
Stefan Doesinger
0188f96dd2
wined3d: Implement EvictManagedResources.
2009-06-19 14:54:04 +02:00
Henri Verbeet
9f252cd815
wined3d: Remove some useless code in IWineD3DDeviceImpl_SetLightEnable().
2009-06-18 15:17:27 +02:00
Henri Verbeet
41d93e1dd1
wined3d: Make sure we have a context in stretch_rect_fbo().
...
Specifically, in case the source surface was offscreen, we would sometimes to
GL calls without active context.
2009-06-18 15:17:27 +02:00
Henri Verbeet
88162fabb8
wined3d: Get rid of the pointers in WINED3DSURFACE_DESC.
2009-06-15 13:42:29 +02:00
Henri Verbeet
5f581975dc
wined3d: Introduce surface_init() to handle most of the surface initialization.
2009-06-15 13:42:28 +02:00
Henri Verbeet
4bc6b376e0
wined3d: Remove the useless "resource_type" parameter from IWineD3DDevice::CreateSurface().
2009-06-12 17:33:15 +02:00
Henri Verbeet
8f67918f1d
wined3d: Use WINED3DFMT_FLAG_COMPRESSED instead of checking for specific formats.
2009-06-12 17:33:15 +02:00
Henri Verbeet
e255f971e4
wined3d: Use the format info to calculate compressed surface size in IWineD3DDeviceImpl_CreateSurface().
2009-06-11 11:53:55 +02:00
Henri Verbeet
b052c6e8aa
wined3d: Remove some redundant s3tc extension checks.
...
If the extension isn't available to surface shouldn't have been created. We
don't do extension checks for all the other formats either.
2009-06-11 11:53:54 +02:00
Gerald Pfeifer
7856ac3c19
wined3d: Use & instead of && for bit test in IWineD3DDeviceImpl_CreateSurface().
2009-06-08 14:28:54 +02:00
Henri Verbeet
a2244051ef
wined3d: Use context_attach_depth_stencil_fbo() to clear FBO depth attachments.
2009-06-08 12:44:22 +02:00
Henri Verbeet
97f320a77b
wined3d: Introduce volumetexture_init() to handle most of the volume texture initialization.
2009-06-03 11:39:16 +02:00
Henri Verbeet
b0ba731bd5
wined3d: Introduce cubetexture_init() to handle most of the cube texture initialization.
2009-06-03 11:39:04 +02:00
Henri Verbeet
5171a65d81
wined3d: Introduce texture_init() to handle most of the 2D texture initialization.
2009-06-03 11:38:50 +02:00
Henri Verbeet
451a416fcf
wined3d: Call resource_init() from basetexture_init().
2009-06-02 11:57:22 +02:00
Henri Verbeet
5654544725
wined3d: Add device resources from resource_init().
...
This is consistent with removing them from resource_cleanup().
2009-05-29 11:26:44 +02:00
Henri Verbeet
5e0f541621
wined3d: Remove ResourceReleased() from the public device interface.
2009-05-29 11:26:38 +02:00
Henri Verbeet
13a05caa97
wined3d: Remove the "declaration" parameter to IWineD3DDeviceImpl_CreateVertexShader().
...
Once upon a time this was used for creating fake vertex shader
attribute semantics for d3d8 shaders. We don't need this anymore since
device_stream_info_from_declaration() will use the vertex
declaration's output slot to load the data, if present. That also
avoids the potentially expensive matching of attribute semantics
between vertex shader and declaration for d3d8.
2009-05-28 12:42:18 +02:00
Henri Verbeet
f0e303b0f2
wined3d: Add the output signature to IWineD3DDevice_CreateVertexShader().
2009-05-26 13:49:55 +02:00
Henri Verbeet
1d7845dd33
wined3d: Pass a proper format desc to resource_init() in IWineD3DDeviceImpl_CreateBuffer().
2009-05-26 13:49:37 +02:00
Henri Verbeet
639b258200
wined3d: Add missing GL locking to IWineD3DDeviceImpl_Uninit3D().
2009-05-14 11:12:52 +02:00
Henri Verbeet
9a579a43b1
wined3d: Use the output signature to map SM4 pixel shader outputs to the appropriate register.
2009-05-11 12:43:00 +02:00
Henri Verbeet
2a5a6a3439
wined3d: Store the SM 1-3 opcode information tables in the SM 1-3 frontend.
2009-05-05 11:34:28 +02:00
Henri Verbeet
8d4c90496f
wined3d: Store the sampler type in struct shader_reg_maps.
...
Instead of the usage token.
2009-04-29 13:08:01 +02:00
Stefan Dösinger
3dc55010ea
wined3d: Fix a few more direct buffer accesses.
2009-04-28 13:10:02 +02:00
David Adam
33eb939390
wined3d: SetDepthStencilSurface is always called when AutoDepthStencil is enabled.
2009-04-24 11:51:27 +02:00
Henri Verbeet
6f33b97c94
wined3d: Get rid of the shared_handle parameter.
...
I don't expect us to support this in the near future, and right now it's just
dead code.
2009-04-23 14:22:06 +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
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
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
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
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
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
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
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
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
a7d6128547
wined3d: Simplify IWineD3DDeviceImpl_ProcessVertices().
2009-03-26 14:48:04 +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
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
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
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
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
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
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
4ff5736edf
wined3d: Don't compare texUnitMap entries to -1.
2009-03-09 14:39:34 +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
702eeb6b0c
wined3d: Add separate methods for setting the primitive type.
2009-03-05 16:16:25 +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
7facc6906d
wined3d: Implement IWineD3DDeviceImpl_ClearRendertargetView().
2009-02-25 12:37:06 +01:00
Henri Verbeet
c796f76483
wined3d: Add IWineD3DRendertargetView.
2009-02-24 16:57:29 +01:00
Henri Verbeet
399d992a07
wined3d: Add IWineD3DBuffer, use it in d3d10core.
2009-02-23 12:20:45 +01:00