Commit Graph

989 Commits

Author SHA1 Message Date
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
Allan Tong 29dd286d79 wined3d: Add code to cleanup device multistate_funcs. 2009-01-10 17:43:11 +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 d9e58e6591 wined3d: Failing HeapAlloc() should be an ERR. 2009-01-09 14:06:13 +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 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
Henri Verbeet 9a889f6b0b wined3d: Convert textures to a bitmap in struct SAVEDSTATES. 2009-01-03 14:55:31 +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
Henri Verbeet 457037f4de wined3d: Fix the value of HIGHEST_TRANSFORMSTATE.
The highest transform state should be 511.
2009-01-02 11:52:02 +01:00
Henri Verbeet 0657e8d87a wined3d: Use slightly nicer loops in device_map_fixed_function_samplers(). 2009-01-02 11:51:46 +01:00
Henri Verbeet 29a0d06518 wined3d: Convert some BOOLs to bitfields in struct IWineD3DDeviceImpl.
Also fills a 3 byte hole.
2008-12-31 12:26:33 +01:00
Henri Verbeet 2b926db50d wined3d: Make use_vs() and use_ps() work on a stateblock instead of a device.
Most callers work on a stateblock rather than a device, and the main fields
we check (vertexShader and pixelShader) are part of the stateblock as well.
2008-12-31 12:25:56 +01:00
Henri Verbeet f197e8b1ca wined3d: Handle D3DFVF_XYZW in ConvertFvfToDeclaration().
This is similar to 0bdab5f80c.
2008-12-30 11:36:57 +01:00
Henri Verbeet 007c648c20 d3d: Correct some debug levels. 2008-12-30 11:36:50 +01:00
Henri Verbeet 684017c071 wined3d: Properly reset the stateblock. 2008-12-20 11:11:39 +01:00
Henri Verbeet ef7365a4cd wined3d: Set the initial viewport in InitStartupStateBlock().
>From 8aa3fb7ceb6fb93abf71520c852403284a9f8c76 Mon Sep 17 00:00:00 2001
From: Henri Verbeet <hverbeet@codeweavers.com>
Date: Fri, 19 Dec 2008 19:21:55 +0100
Subject: wined3d: Set the initial viewport in InitStartupStateBlock().
2008-12-20 11:11:34 +01:00
Henri Verbeet a52edd7810 wined3d: Don't call allocate_shader_constants() from Init3D().
CreateStateBlock() should take care of that.
2008-12-19 18:05:02 +01:00
Henri Verbeet d099dde7a9 wined3d: Track shader constants in the shader backend. 2008-12-18 13:17:02 +01:00
Henri Verbeet a14dab4937 wined3d: Don't mark shader constants dirty when we're recording a stateblock. 2008-12-18 13:16:52 +01:00
Henri Verbeet 0968cb9b6c wined3d: Fix constant setting for the ARB backend. 2008-12-18 13:16:46 +01:00
Henri Verbeet 78ad5de8da wined3d: Record floating point pixel shader constants in EndStateBlock() as well. 2008-12-17 14:02:09 +01:00
Henri Verbeet 4adb342327 wined3d: Remove GetFVF() and SetFVF() from IWineD3DDevice. 2008-12-17 14:02:03 +01:00
Stefan Dösinger 199a3468bf wined3d: Fake GL_ARB_multitexture. 2008-12-16 14:31:25 +01:00
Henri Verbeet 46572f682c wined3d: Refuse to create shaders with a NULL function. 2008-12-16 12:51:49 +01:00
Henri Verbeet 7d29aecd6f wined3d: Use a simpler way to calculate the number of texture levels.
It's probably slightly faster too.
2008-12-12 11:40:39 +01:00
Henri Verbeet 70ed814b95 wined3d: Get rid of the textureDimensions field in the state block. 2008-12-12 11:40:32 +01:00
Henri Verbeet f36c377d0e wined3d: We only care is a sampler is sampled at all in device_map_vsamplers(), not the specific type. 2008-12-12 11:40:26 +01:00
Henri Verbeet fb475c7c29 wined3d: Don't reparse the entire shader just to update the sampler types. 2008-12-12 11:40:20 +01:00
Henri Verbeet 89139b7589 wined3d: Make shader texture format fixups more generic.
Based on a patch by Stefan Dösinger. This is more flexible, and allows
the shader backend implementation to be simpler, since it doesn't have
to know about specific formats. The next patch makes use of this.
2008-12-04 11:59:58 +01:00
Henri Verbeet b451048eb7 wined3d: Move GlPixelFormatDesc to wined3d_private.h where it belongs.
Also remove the silly typedef.
2008-12-04 11:59:06 +01:00
Chris Robinson 7806e4d85a wined3d: Make sure a context is set for query object generation. 2008-12-03 10:59:49 +01:00
Henri Verbeet 70968e69ac wined3d: Use a bitmask to store which bool and int constants are set.
Note that constants_set was never actually NULL for
shader_glsl_load_constantsB() and shader_glsl_load_constantsI().
2008-12-03 09:49:10 +01:00
Henri Verbeet 92b93172df wined3d: Remove some unused code. 2008-12-02 14:04:40 +01:00
Henri Verbeet 5532c990b6 wined3d: Const correctness fixes. 2008-12-02 14:04:15 +01:00
Henri Verbeet fec9820e56 wined3d: Handle a few "silent" FIXMEs more consistent with the rest of the code.
Also avoids needlessly initializing static variables.
2008-12-02 14:04:00 +01:00
Henri Verbeet c7880e8916 wined3d: Make minMipLookup_noFilter and magLookup_noFilter const.
Note that minMipLookup and magLookup aren't particularly safe to use,
they're global arrays initialized from IWineD3DImpl_FillGLCaps(). The same
goes for the other global dynamic lookup tables.
2008-11-28 12:53:57 +01:00
Henri Verbeet 449c219eb0 wined3d: Const correctness fixes for device.c. 2008-11-28 12:53:41 +01:00
Henri Verbeet f2b34c97cc wined3d: Remove some unnecessary casts in process_vertices_strided().
lpData is already a pointer to BYTE. Note that the cast for the normal
data was actually wrong.
2008-11-28 12:53:33 +01:00
Henri Verbeet b4f0b5bdd0 wined3d: Const correctness fixes. 2008-11-25 13:37:39 +01:00
Stefan Dösinger ff767f4984 wined3d: Make the shader backend call CompileShader.
A number of considerations contribute to this:

1) The shader backend knows best which shader(s) it needs. GLSL needs
both, arb only one
2) The shader backend may pass some parameters to the compilation
code(e.g. which pixel format fixup to use)
3) The structures used in (2) are different in vs and ps, so a
baseshader::Compile won't work
4) The structures in (2) are wined3d-private structures, so
having a public method in the vtable won't work(its a bad idea
anyway).
2008-11-25 13:06:23 +01:00
Francois Gouget c0e271c4de wined3d: Remove WINAPI on static functions where not needed. 2008-11-25 11:49:57 +01:00
Andrew Talbot fdba8b8593 wined3d: Sign-compare warnings fix. 2008-11-21 11:29:12 +01:00
Stefan Dösinger a8497a5545 wined3d: Fix the num blend values -> type match. 2008-11-04 11:40:37 +01:00
Henri Verbeet c52a55d724 wined3d: Fix some indentation. 2008-10-28 12:46:51 +01:00
Henri Verbeet 092b51e82a wined3d: Rename CreateAdditionalSwapChain to CreateSwapChain. 2008-10-28 12:46:46 +01:00
Roderick Colenbrander 47372928b8 wined3d: Fix recursive ENTER_GL in UpdateSurface. 2008-10-20 11:38:43 +02:00
Roderick Colenbrander d4b4810ebe wined3d: Prevent a recursive ENTER_GL before calling blitter->free_private. 2008-10-20 11:38:02 +02:00
Alexandre Julliard 6cfef95ce7 wined3d: Convert source files to utf-8. 2008-10-18 19:21:20 +02:00
Henri Verbeet 231e2c60b5 wined3d: The container is always non-NULL if GetContainer() succeeds. 2008-10-16 12:35:34 +02:00
Henri Verbeet 2889b42a3f wined3d: Cleanup properly if creating the context array fails in CreateAdditionalSwapChain(). 2008-10-15 15:21:41 +02:00
Henri Verbeet 2bb7aa7252 wined3d: Don't crash in CreateAdditionalSwapChain() if the context array wasn't allocated yet. 2008-10-15 15:21:35 +02:00
Henri Verbeet 3b2ac77e12 wined3d: Set the correct pow2Matrix for cube textures when NPOT textures are supported. 2008-10-09 12:14:08 +02:00
Henri Verbeet 8985b7a755 wined3d: Get rid of some redundant assignments (LLVM/Clang). 2008-10-09 12:14:01 +02:00
Henri Verbeet e9daf92ae6 wined3d: Assign the correct "levels" variable (LLVM/Clang). 2008-10-09 12:13:43 +02:00
Kjell Rune Skaaraas ed96dd72e3 wined3d: Implement IWineD3DResourceImpl_GetPriority and IWineD3DResourceImpl_SetPriority for resource management. 2008-10-08 14:17:03 +02:00
Henri Verbeet 31d6dbfd74 wined3d: Cleanup CreateAdditionalSwapChain error handling a bit (LLVM/Clang). 2008-10-08 12:16:54 +02:00
Henri Verbeet c5fbf98ed2 wined3d: Enable lights on the correct swapchain. 2008-10-06 13:06:44 +02:00
Henri Verbeet c6cd7a7717 wined3d: Properly handle the offset for compressed surfaces in IWineD3DDeviceImpl_UpdateSurface(). 2008-09-25 11:52:56 +02:00
Henri Verbeet 0ee57cf142 wined3d: Set the texture name at surface creation.
This prevents the target from changing during the first PreLoad() call
on a surface, which would be inconvenient when attaching a surface to
a FBO for example.
2008-09-25 11:52:50 +02:00
Henri Verbeet 9d192c6251 wined3d: Skip copying the depth stencil if it's discarded.
This gives a small performance improvement for applications that are
smart enough to set the D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL flag, or
to create depth stencils with Discard set to TRUE.
2008-09-23 12:25:18 +02:00
Henri Verbeet d95ae08ad4 wined3d: Get rid of the wantsDepthStencilBuffer in IWineD3DSwapChainImpl. 2008-09-23 12:25:04 +02:00
Roderick Colenbrander 0362ee3d16 wined3d: UpdateSurface should take into account the offset from the source rectangle. 2008-09-22 13:19:57 +02:00
Henri Verbeet 3862347bce wined3d: Fix a memory leak. 2008-09-22 12:20:28 +02:00
Henri Verbeet 76de76e508 wined3d: Destroy FBO entries in the context. 2008-09-22 12:20:24 +02:00
Henri Verbeet 45820046e8 wined3d: Create a FBO for each combination of render targets and depth stencil.
The main reason for this change is crappy performance for reconfiguring FBOs.
2008-09-19 11:30:00 +02:00
Henri Verbeet a269236649 wined3d: Move FBO handling functions to context.c. 2008-09-19 11:29:13 +02:00
Henri Verbeet 99981f2604 wined3d: Remove some assumptions that PreLoad() will always bind the texture. 2008-09-17 20:49:38 +02:00
Henri Verbeet d51ea01159 wined3d: Reset the auto depth stencil. 2008-09-10 12:05:31 +02:00
Francois Gouget e1797b530d wined3d: Remove spaces before '\n' in Wine traces. 2008-09-05 13:39:08 +02:00
Stefan Dösinger da1030f36c wined3d: Compressed surface sizes are multiples of 4.
Since those surfaces are stored in blocks, the 4 pixel step doesn't only apply to surfaces < 4, but
also to surfaces bigger than that, with a non-multiple-of-4 size.
2008-09-04 12:44:00 +02:00
Alexander Dorofeyev 78312704d9 wined3d: Remove obsolete code & ModifyLocation TODO.
This fbo logic appears to have already been implemented in ModifyLocation.
2008-09-04 12:29:57 +02:00
Henri Verbeet 615f75faec wined3d: IWineD3DSurface_PreLoad() doesn't do an implicit glBindTexture() anymore.
This was exposed by moving texture id generation from Preload() to BindTexture().
2008-09-04 11:15:33 +02:00
Henri Verbeet 4b6887b8e3 wined3d: Be more careful when deleting FBOs.
Clear all attachments before deleting FBOs. It should be valid to
delete FBOs that still have attachments, but for some reason the
nvidia drivers don't like it. The resulting memory corruption can be
pretty nasty, and this workaround seems clean enough.
2008-09-04 11:14:53 +02:00
Alexander Dorofeyev 379f400990 wined3d: Add glFlush when clearing the front buffer in ClearSurface. 2008-09-03 13:14:52 +02:00
Stefan Dösinger 8b1727ae62 wined3d: Report incorrect filtering settings in ValidateDevice. 2008-09-02 14:56:06 +02:00
Stefan Dösinger 3b48660f43 wined3d: Implement YV12 support for emulated overlays.
This is the prefered format of many codecs, and for some codecs this
is the only supported output format. As usual I try to handle all the
conversion in the GPU and keep the CPU involvement minimal to gain the
full performance of PBO transfers.
2008-09-02 14:55:50 +02:00
Stefan Dösinger a580325a47 wined3d: Remove some more junk code. 2008-08-28 11:24:49 +02:00
Stefan Dösinger 462ddaa254 wined3d: Make the texture stage mapping nvrc independent. 2008-08-27 13:21:24 +02:00
Stefan Dösinger a674ae71ae wined3d: Remove dead code. 2008-08-27 13:21:24 +02:00
Stefan Dösinger 9a6bc683e1 wined3d: Use the correct texture limit.
We have to use the texture limit of the fragment pipeline in use here,
not the fixed function GL texture limit.
2008-08-26 12:07:41 +02:00
Stefan Dösinger e8b9f167d6 wined3d: Fix the texcoord size mask.
There is room for 8 texture coordinates, not just 4.
2008-08-26 12:07:41 +02:00
David Adam bb67a925d6 ddraw: Only ddraw checks wether one can give a null pointer to SetMaterial. 2008-08-22 11:32:09 +02:00
Roderick Colenbrander fd0e60180a wined3d: Fix window rewrite regression. 2008-08-22 10:39:23 +02:00
H. Verbeet 05931f4a5a wined3d: Track FBOs per-context.
Although sharing FBOs across contexts is allowed by EXT_framebuffer_object
(issue 76), it causes issues with nVidia drivers. Considering the GL 3 spec
explicitly disallows sharing of FBOs accross contexts (Appendix D), this
patch is probably the right thing to do.
2008-08-22 10:38:59 +02:00
H. Verbeet 040c33de5a wined3d: Don't allocate This->draw_buffers in the error path for Init3D(). 2008-08-21 11:36:29 +02:00
H. Verbeet c33e03cca3 wined3d: Don't free backends if they're not created yet.
This would crash if CreateAdditionalSwapChain() failed.
2008-08-21 11:36:18 +02:00
Stefan Dösinger fc6b977486 wined3d: Start a framework for color conversion shaders in blits. 2008-08-20 12:25:26 +02:00
Stefan Dösinger 25c07dc86c wined3d: Remove the ddraw_window device member. 2008-08-19 12:25:05 +02:00