Commit Graph

2606 Commits

Author SHA1 Message Date
Henri Verbeet 6fbbcd19e7 wined3d: Move a TRACE up a few lines. 2008-08-25 11:39:16 +02:00
Henri Verbeet e3507a725f wined3d: glDeleteFramebuffersEXT() needs a context. 2008-08-25 11:39:10 +02:00
Chris Robinson eca8577d53 wined3d: Use 8 bits-per-component for the PBO test internal format.
GL_RGBA doesn't gaurantee an internal storage depth, which can cause the test 
to fail if it's stored with less than 8 bits of precision. Some nVidia 
drivers would actually store with 4 bits of precision.
2008-08-25 11:29:38 +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 b917bdaa52 wined3d: Remove useless hash_table_entry_t typedef.
It doesn't add much.
2008-08-22 10:39:08 +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 2f99bcdde2 wined3d: Move depth stencil location handling code up a couple of lines.
This is just for clarity, so that render targets and the depth stencil are
handled in the same place.
2008-08-22 10:38:30 +02:00
Alexander Dorofeyev 67631163ff wined3d: Fix copy paste error in IWineGDISurfaceImpl_RealizePalette.
It has to update the whole surface, so NULL must be passed to 
x11_copy_to_screen. Fixes a regression in Red Alert.
2008-08-21 13:35:35 +02:00
Alexander Dorofeyev 03ae71dad9 wined3d: Set D3DPTEXTURECAPS_TRANSPARENCY.
It indicates support of colorkey transparency on textures, so set it because 
wined3d supports it. Fixes transparency problems in Forsaken.
2008-08-21 13:35:30 +02:00
Alexander Dorofeyev 1da8a032af wined3d: Disable TEXTURE_RECTANGLE in SetupForBlit. 2008-08-21 13:35:23 +02:00
Stefan Dösinger c38b2fe09e wined3d: Filter out more spam. 2008-08-21 13:34:23 +02:00
Stefan Dösinger c425bbccab wined3d: Set the texture wrap default with the NP2 emulation properly. 2008-08-21 13:33:42 +02:00
Stefan Dösinger 46109da87d wined3d: Don't skip applying texdims with shaders.
There's no need to do that with the nvts and opengl ffp fixed function
fragment pipeline, it's perfectly well defined in GL which one takes
effect. This removes a few more troubles when switching between
shaders and arbfp.
2008-08-21 13:33:30 +02:00
Stefan Dösinger ec94c2ea99 wined3d: Don't enable texture dimensions with shaders.
ARB and GLSL don't need that. If a shader backend like atifs or nvts
need it in the future, the shader backend should deal with that rather
than the ffp pipeline.
2008-08-21 13:33:20 +02:00
Stefan Dösinger 77204574d1 wined3d: Prefer aux buffer matches over alpha matches.
Half Life 2 uses D3DFMT_X8R8G8B8 for the back buffer, but macos
supports aux buffers only on D3DFMT_A8R8G8B8. I think having aux
buffers is more important right now than having a precise alpha
match.
2008-08-21 13:33:09 +02:00
Stefan Dösinger bbf313e76a d3d9: Test for fixed function value clamping. 2008-08-21 13:27:58 +02:00
Stefan Dösinger bab367e1a0 wined3d: Update the overlay when the destination was drawn to. 2008-08-21 13:27:47 +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 8fe6bf0bad wined3d: Fix the unused arg marker. 2008-08-20 12:34:44 +02:00
Stefan Dösinger 5d75939b09 wined3d: Keep track of the last used device. 2008-08-20 12:33:25 +02:00
Stefan Dösinger 1f4cf3513d wined3d: Implement YUV emulation with GL_ARB_fragment_program. 2008-08-20 12:26:14 +02:00
Stefan Dösinger bfe7067973 wined3d: Ask the ffp/shader/blit implementation about format support.
If a format is not supported natively by opengl, a shader may be able
to convert it. Up to now, CheckDeviceFormat had magic knowldge which
GL extensions lead to which supported format. This patch adds
functions that allow CheckDeviceFormat to ask the actual
implementation for its capabilities.
2008-08-20 12:26:02 +02:00
Stefan Dösinger 438b6bd4c3 wined3d: Test formats for surface support. 2008-08-20 12:25:46 +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 6a24b28b75 wined3d: Support YUV formats with GL_APPLE_ycbcr_422. 2008-08-20 12:25:00 +02:00
Roderick Colenbrander 4421e3ebe5 wined3d: Fix BltOverride regression. 2008-08-20 11:45:41 +02:00
H. Verbeet f71fdecdc7 wined3d: Move creating a texture id from PreLoad to BindTexture.
This is consistent with BindTexture in basetexture/texture/etc. and has the
added benefit that it makes LoadLocation work properly.
2008-08-20 10:26:19 +02:00
Stefan Dösinger 3d49e8cd5e wined3d: Add a swapchain method to set the dest override.
DDraw can draw to the front buffer only, thus there's never a Present
call which could pass this window. Due to that a drawing-independent
method is needed.
2008-08-19 12:25:20 +02:00
Stefan Dösinger 25c07dc86c wined3d: Remove the ddraw_window device member. 2008-08-19 12:25:05 +02:00
Stefan Dösinger 376944ebe4 wined3d: Remove the device-global fullscreen flag. 2008-08-19 12:24:57 +02:00
Stefan Dösinger 34b37fe241 d3d: Remove IWineD3DDevice::SetHwnd. 2008-08-19 12:22:05 +02:00
Stefan Dösinger 7f2b8f9bba wined3d: Support redirecting the primary context. 2008-08-19 12:21:49 +02:00
Stefan Dösinger e178ddd9e1 wined3d: Use a swapchain for GDI surfaces.
This is a long-needed cleanup aimed at removing the ddraw_primary,
ddraw_window, ddraw_width and ddraw_height members from
IWineD3DDeviceImpl, which just do not belong there.  Destination
window and screen handling is supposed to be done by swapchains.
2008-08-19 12:21:32 +02:00
Stefan Dösinger e5de2fc82c wined3d: Move some swapchain code into a base class. 2008-08-19 12:20:47 +02:00
Stefan Dösinger dff3a42233 wined3d: Track overlay surfaces in the overlayed surface. 2008-08-05 14:09:37 +02:00
Stefan Dösinger b0c4673779 wined3d: Update the surface locations in Present. 2008-08-05 14:09:37 +02:00
Stefan Dösinger 851dd7339e wined3d: Implement overlay flipping. 2008-08-05 14:09:36 +02:00
Stefan Dösinger fad3f9ba98 wined3d: Basic overlay emulation with opengl. 2008-08-05 14:09:36 +02:00
Stefan Dösinger e795d842ec wined3d: Implement overlay position tracking. 2008-08-05 14:09:36 +02:00
Stefan Dösinger a7d5b1e9a5 wined3d: Move the pshader fog update to the vertex pipeline. 2008-08-05 14:09:36 +02:00
Stefan Dösinger eb0264e2b3 wined3d: Remove a glFlush. 2008-08-05 14:09:36 +02:00
Stefan Dösinger 44d419ad8e wined3d: Call glFlush outside the GL lock. 2008-08-05 14:09:36 +02:00
H. Verbeet 2d6d879562 wined3d: Handle CTXUSAGE_BLIT with offscreen targets and FBO ORM.
This is mostly for correctness, in practice we should always be able
to avoid using CTXUSAGE_BLIT for offscreen targets when FBO ORM is
used.
2008-08-05 14:09:34 +02:00
H. Verbeet b685b84e66 wined3d: Apply FBO state in ActivateContext().
Fixes some GL errors due to calling glDrawBuffer(GL_BACK) when an FBO
is still active.
2008-08-05 14:09:34 +02:00
H. Verbeet 9a9414dfe2 wined3d: Mark STATE_SCISSORRECT dirty in color_fill_fbo().
As pointed out by Alexander Dorofeyev.
2008-08-05 14:09:34 +02:00
Tobias Jakobi 2583975ec7 wined3d: Remove arb_tex_npot for NV FX series in fixup_extensions. 2008-08-04 14:05:01 +02:00
H. Verbeet d28a310f92 wined3d: Use CTXUSAGE_RESOURCELOAD for ActivateContext() in color_fill_fbo().
CTXUSAGE_CLEAR will apply the FBO state in a later patch.
2008-08-04 13:52:16 +02:00
H. Verbeet f037eb8696 wined3d: Move setting the draw buffer to a separate function. 2008-08-04 13:52:09 +02:00
Stefan Dösinger e9827cc916 wined3d: Always load glFinish and glFlush from opengl32.dll. 2008-08-04 13:12:10 +02:00
Stefan Dösinger 399825cd8e wined3d: Report the pitch alignment to ddraw. 2008-08-04 13:10:37 +02:00
Stefan Dösinger 8ee4159e4f wined3d: Only set D3D caps when GL was loaded successfully. 2008-08-04 13:10:20 +02:00
Stefan Dösinger a47e7badb9 ddraw: Set ddraw caps in wined3d.
Currently the ddraw capabilities were almost static, except of D3D
support. When overlay support is added, the caps depend on certain
settings in WineD3D or capabilities available from OpenGL and Xv. So
set those caps in wined3d as well.
2008-08-04 13:10:11 +02:00
Stefan Dösinger 474e7ed98c wined3d: Beware of the frontbuffer coordinate system difference. 2008-08-04 13:09:43 +02:00
Stefan Dösinger 016efe7d94 wined3d: Clamp results in the arbfp pipeline replacement.
Fixed function processing can only deal with values between 0 and 1
generally. Clamp the results of instructions that could produce bigger
or smaller values.
2008-08-04 13:07:53 +02:00
Stefan Dösinger 228f2cf3c2 wined3d: Initialize the texture op function properly. 2008-08-04 13:07:26 +02:00
Francois Gouget a793888a28 Assorted spelling fixes. 2008-08-04 13:04:48 +02:00
Aric Stewart eb4ee4f4ad wined3d: Rework surface Blt a bit to only lock the part of the destination surface being drawn to. 2008-07-31 13:41:14 +02:00
Aric Stewart c08e4927f9 wined3d: Check validity of rects before locking surface in Blt. 2008-07-31 13:41:07 +02:00
H. Verbeet daa59e00be wined3d: Call LoadLocation() on higher render targets as well, simplify some code in drawPrimitive.
It's probably rare for higher render targets to get locked or updated
from sysmem, but this should still be more correct. It also makes the
code simpler.
2008-07-31 13:04:08 +02:00
Stefan Dösinger 14b24058d6 wined3d: GL_ARB_fragment_program ffp implementation. 2008-07-31 13:02:04 +02:00
Stefan Dösinger bc4435e406 wined3d: Use a hashmap to store the ffp shaders. 2008-07-31 13:01:50 +02:00
Stefan Dösinger d4d133f032 wined3d: Use C bitfields to compact the ffp description. 2008-07-31 13:01:36 +02:00
Alexander Dorofeyev 76e02581a9 wined3d: Add ActivateContext in color_fill_fbo.
Also removes dirtifying of SCISSORTESTENABLE state that is made
redundant by ActivateContext(...,CTXUSAGE_CLEAR).
2008-07-30 13:54:40 +02:00
H. Verbeet c7da79ded3 wined3d: FBO texture == drawable handling is already handled in LoadLocation(). 2008-07-30 12:44:18 +02:00
H. Verbeet 9b47996b41 wined3d: Container dirtification is already handled in ModifyLocation(). 2008-07-30 12:44:12 +02:00
Stefan Dösinger 294f1b4aad wined3d: Add fog and tex types to the ffp fragment description. 2008-07-28 11:36:15 +02:00
Stefan Dösinger 40cfec2582 wined3d: Do not enable GL_TEXTURE_SHADER_NV unconditionally. 2008-07-28 11:36:04 +02:00
Stefan Dösinger 5a6b4e9f47 wined3d: Make the MAC ARBvp implementation happy about ARL. 2008-07-24 11:56:52 +02:00
Stefan Dösinger 726d9d47af wined3d: ATI2N support using GL_EXT_texture_compression_rgtc. 2008-07-24 11:56:42 +02:00
Stefan Dösinger dc25a86cc5 wined3d: Support ATI's D3DFMT_ATI2N format.
This is an ATI specific format designed for compressed normal maps,
and quite a few games check for its existence. While it is an
ATI-specific "extension" in d3d9, it is a core part of
D3D10(DXGI_FORMAT_BC5), and supported on Geforce 8 cards.
2008-07-24 11:56:24 +02:00
Stefan Dösinger 370b8299ab wined3d: Honor the texcoordindex when setting the texture matrix. 2008-07-24 11:56:02 +02:00
Stefan Dösinger b554cdbb5a d3d: D3DDECLTYPE_UNUSED is not valid in vertex declarations. 2008-07-24 11:55:42 +02:00
Stefan Dösinger eea2c95727 wined3d: Move set_tex_op(_nvrc) to their specific files. 2008-07-22 13:01:45 +02:00
Stefan Dösinger 212ff6ff57 wined3d: Remove some #ifdefs. 2008-07-22 13:01:22 +02:00
Stefan Dösinger bfd1ac26e2 wined3d: Set WINED3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET. 2008-07-22 13:01:15 +02:00
Stefan Dösinger 448fee2879 wined3d: Whitespace fix. 2008-07-22 13:01:07 +02:00
Stefan Dösinger d66c05ce1d wined3d: Fix a copy and paste bug.
This happened to work because most cards have the same amount of
pshader and vshader constants, but for some reason this doesn't hold
true on this macbook pro here, which lead to a crash due to heap
corruption
2008-07-22 13:00:58 +02:00
Stefan Dösinger 1219e3d4a7 wined3d: Use less strict pixel format matching if the match fails.
Some drivers(the open source ones most notably) cannot satisfy all
possible D3D formats. This doesn't mean we should fall back to the
emergency fallback instantly. Instead, try to loosen the requirements
step by step.
2008-07-22 13:00:47 +02:00
Stefan Dösinger cafec08516 wined3d: Use the nofilter mipmap lookup for np2 textures.
This is cleaner than the if statements in the code. Also np2 textures
should in theory support linear filtering, but fglrx doesn't seem to
like it. This needs further investigation. So far we've never used
linear filtering on np2 textures, so there should not be a
regression. Furthermore I think shader support is more important than
filtering, since NP2 textures are mostly used for 1:1 copying to the
screen.
2008-07-18 11:41:21 +02:00
Stefan Dösinger c088edeae7 wined3d: Use GL_ARB_texture_non_power_of_two emulation.
ATI cards prior to the radeon HD series did not have unconditional non
power of two support. So far we've used texture_rectangle for that, or
created a bigger power of two texture with padding. This had the
disadvantage that we had to correct the coordinates, which causes
extreme problems with shaders(doesn't work, pretty much).

Both the MacOS and the fglrx driver have support for
GL_ARB_texture_non_power_of_two, and run it on the hardware as long as
we stay within the texture_rectangle limitations. This allows us to
have conditional non power of two textures with normalized
coordinates. This patch adds an internal extension, and the code
creates a regular GL_TEXTURE_2D texture with NP2 size, but refuses
mipmapping, filtering and texture_rectangle incompatible
operations. This makes np2 textures work with shaders on fglrx and
macos.
2008-07-18 11:41:09 +02:00
Stefan Dösinger a0cc79f0bf wined3d: Correct the D3DTOP_LERP parameter order. 2008-07-18 11:40:40 +02:00
Stefan Dösinger 5b846adffd wined3d: Fix the MULTIPLYADD parameter orders in atifs. 2008-07-18 11:40:33 +02:00
Stefan Dösinger 55ab14a4ed wined3d: Move an VBO support check to the state template. 2008-07-18 11:40:19 +02:00
Stefan Dösinger dc203d36c9 wined3d: Remove more dead code.
The opengl extension mentioned in that code was never finished, and as
far as I know there is no way to make use of tangent data in the d3d
fixed function pipeline as well.
2008-07-18 11:40:12 +02:00
Stefan Dösinger e5f42f91b6 wined3d: Remove GL_EXT_vertex_weighting stubs. 2008-07-18 11:40:00 +02:00
Stefan Dösinger ebc77732c1 wined3d: Move the vertexblend support check to the template. 2008-07-18 11:39:44 +02:00
Stefan Dösinger f981afd7d3 wined3d: Check for ATI_ENVMAP_BUMPMAP in the template.
Note that GL_ATI_envmap_bumpmap is not the same as
GL_ATI_fragment_shader. envmap_bumpmap is used together with the
regular opengl ffp pipeline and is not used (other than for
pixelformats) if GL_ATI_fragment_shader is used.
2008-07-18 11:39:38 +02:00
Stefan Dösinger 8bb11dad76 wined3d: Only register the np2 texture fixup if needed. 2008-07-18 11:39:18 +02:00
Stefan Dösinger d247953687 wined3d: Test for multisampling in the template. 2008-07-17 11:45:00 +02:00
Stefan Dösinger 9c1b6581c6 wined3d: Move the point sprite support test into the template. 2008-07-17 11:44:54 +02:00
Stefan Dösinger 94e455343d wined3d: Split the psizemax state handler. 2008-07-17 11:44:48 +02:00
Stefan Dösinger 7740dda1da wined3d: Split the psizemin handler. 2008-07-17 11:44:42 +02:00
Stefan Dösinger 710b9a76b3 wined3d: Move the range fog support test to the template. 2008-07-17 11:44:34 +02:00
Stefan Dösinger df4dcc34aa wined3d: Move a few extension checks into the state template. 2008-07-17 11:44:28 +02:00
Stefan Dösinger 3ee9de462e wined3d: Move an extension check into the state template. 2008-07-17 11:44:21 +02:00
Stefan Dösinger ed49f9a848 wined3d: Coalesce the nvrc and nvts+nvrc state template. 2008-07-17 11:44:15 +02:00
Stefan Dösinger 35f33ef409 wined3d: Add extension information to the states.
This patch adds a new field to the state templates. If this extension
field is != 0, then the line is only applied to the final state table
if the extension is supported. Once a line is applied to the final
table, all further templates for this state from the same pipeline
part are ignored. This allows removing some extension checks from the
state handlers, which cleans them up and saves a few CPU cycles when
applying the states.
2008-07-17 11:44:08 +02:00
H. Verbeet c72c70d609 wined3d: Store the texture in a local variable in sampler_texmatrix().
Slightly improves readability.
2008-07-17 11:36:42 +02:00
Philip Nilsson 9528b1c63e wined3d: Enable filtering for D3DFMT_A4R4G4B4.
This patch enables texture filtering for textures using the A4R4G4B4
format, I can see no reason why it shouldn't be filtered (especially
considering X4R4G4B4 has it).
2008-07-16 19:56:24 +02:00
H. Verbeet 7f741f0414 wined3d: Use rev_tex_unit_map instead of assuming there's a 1:1 mapping between samplers and texture units. 2008-07-16 17:54:41 +02:00
H. Verbeet be405c71c0 wined3d: Improve some shader traces.
Make it clear the traced values are hexadecimal.
2008-07-16 17:54:23 +02:00
Andrew Talbot 0064976d54 wined3d: Remove unneeded address-of operators from array names. 2008-07-14 11:50:22 +02:00
Stefan Dösinger e27734779c wined3d: Remove some dead code. 2008-07-14 11:46:33 +02:00
Stefan Dösinger 197f472ea8 wined3d: Separate texture_activate_dimensions.
This creates an nvts version of this function, and removes the nvts
code from the original one. The nvts version is used by the nvts
pipeline implementation, the original one by the nvrc-only, atifs and
ffp one.
2008-07-14 11:46:25 +02:00
Stefan Dösinger 88ae2fe14a wined3d: Give nv* fixed function stuff its own state template. 2008-07-14 11:46:11 +02:00
Stefan Dösinger 38934fe70d wined3d: Move shader constant affecting states to the misc pipeline.
As long as we have the shader constants in misc, it is best to keep
all the code that affects shader constants, like bumpenvmat setting,
in there as well.
2008-07-14 11:44:48 +02:00
Stefan Dösinger 84d39a95e5 wined3d: WINED3DTSS_TEXCOORDINDEX belongs to the vertex pipeline. 2008-07-14 11:44:36 +02:00
Stefan Dösinger 86b033bbb9 wined3d: Give the nvts/nvrc code its own pipeline implementation.
This code creates the structures and the pipeline selection, as well
as the caps filling. It does not yet move the actual code around,
since this will be a bigger task.
2008-07-14 11:44:26 +02:00
Stefan Dösinger 7c216b8ab5 wined3d: Simplify the fragment pipeline selection.
This should do the same as the existing code, but it is more obvious.
2008-07-14 11:43:51 +02:00
Stefan Dösinger 51e64b3fe9 wined3d: Move fixed function texture dimension updates to the fragment pipeline.
This is a further separation of the sampler state, and a preparation
to move the nv texture shader stuff to its own pipeline implementation.
2008-07-14 11:43:41 +02:00
Stefan Dösinger d3c29b7063 wined3d: NP2 coordinate adjustment is a vertex operation.
When a sampler is changed and unconditional NP2 textures are not
supported, the texture matrix may need adjustment. The sampler state
function checks for that, and calls the texture transform setting
function in that case. However, samplers are a misc state, and the
texture transform flags a vertex state.  Thus split up the code and
move the matrix changes to the vertex side.
2008-07-14 11:43:30 +02:00
Stefan Dösinger e7733eacb7 wined3d: Remove the atifs shader backend.
Since atifs is only doing the fragment pipeline replacement right now
there is no need for the shader backend structure any longer. The ffp
private data is stored in new fragment pipeline private data(which
could potentially be set to equal the shader private data if needed).
2008-07-14 11:43:09 +02:00
Stefan Dösinger e4078fb0ba wined3d: Set ffp caps in the ffp backend, not the shader backend. 2008-07-11 14:32:53 +02:00
Stefan Dösinger c48195e417 wined3d: Move shader_fragment_enable to the fragment pipeline implementation.
It isn't related to the shader backend any longer. The nvts_enable in
the ffp code isn't quite right as well, it should be moved away once
there is a dedicated nvts fragment pipeline replacement
2008-07-11 14:32:37 +02:00
Stefan Dösinger f330815da5 wined3d: Samplers -> misc states. 2008-07-11 14:31:53 +02:00
Stefan Dösinger f8824996e9 Wined3d: Move the last states. 2008-07-11 14:31:44 +02:00
Stefan Dösinger 9b15e25411 wined3d: One more psize state. 2008-07-11 14:31:36 +02:00
Stefan Dösinger 721301fb3f wined3d: Point size vertex states. 2008-07-11 14:31:26 +02:00
H. Verbeet 6129e92e99 wined3d: Destroy the shader backend after the stateblock.
Destroying the stateblock potentially references the shader backend.
If the stateblock has active shaders when it is released, the shader's
destructor will tell the shader backend to destroy the corresponding
resources. This was exposed by my patch that moved the glsl program
lookup table into the backend's private data.
2008-07-11 13:58:13 +02:00
H. Verbeet b37cc08721 wined3d: Don't call shader_select() in depth_blt().
Calling shader_select() from inside depth_blt() isn't necessarily
safe. shader_select() assumes CompileShader() has been called for the
current shaders, but that depends on STATE_VSHADER / STATE_PIXELSHADER
being applied. That isn't always true when depth_blt() gets called,
with the result that sometimes GLSL programs could be created with no
shader objects attached.
2008-07-10 20:33:29 +02:00
Francois Gouget dbaec0a101 Assorted spelling fixes. 2008-07-10 13:40:15 +02:00
Stefan Dösinger 031ee3e695 wined3d: A few more junk misc states. 2008-07-10 12:30:56 +02:00
Stefan Dösinger c31dfc7d0d wined3d: A few more vertex states. 2008-07-10 12:30:56 +02:00
Stefan Dösinger 9086ed2d2e wined3d: WINED3DRS_SRGBWRITEENABLE->fragment. 2008-07-10 12:30:56 +02:00
Stefan Dösinger 0b67a84b44 wined3d: Wrapping states -> misc. 2008-07-10 12:30:56 +02:00
Stefan Dösinger dd95fce9fb wined3d: texturefactor-> fragment states. 2008-07-10 12:30:56 +02:00
Stefan Dösinger 6fa9f0e363 wined3d: Stencil states -> misc table. 2008-07-10 12:30:56 +02:00
Stefan Dösinger de1b0a5c04 wined3d: Move a few more odd states to the misc state table. 2008-07-10 12:30:56 +02:00
Stefan Dösinger e988c8bd60 wined3d: WINED3DRS_ZBIAS -> misc states. 2008-07-10 12:30:56 +02:00
Stefan Dösinger 1df66c3893 wined3d: Move the bordercolor to the fragment states. 2008-07-10 12:30:56 +02:00
Stefan Dösinger 340272bc26 wined3d: Move more fog stuff to the vertex states. 2008-07-10 12:30:55 +02:00
Francois Gouget 8320d214d4 wined3d: Move float_32_to_16() to surface_base.c which is the only place where it's used, and because it needs port.h for isinf(). 2008-07-10 12:18:43 +02:00
H. Verbeet 54ae3ebfd4 wined3d: Destroy depth_blt resources in the backend's destructor.
No need to expose this in the interface.
2008-07-10 12:17:06 +02:00
Stefan Dösinger ecc7b5fb18 wined3d: Move fog to the vertex states. 2008-07-09 10:49:17 +02:00
Stefan Dösinger cd9690d9d0 wined3d: Move a few more states to the misc states. 2008-07-09 10:48:59 +02:00
Stefan Dösinger a4c85d788a wined3d: WINED3DRS_LASTPIXEL -> misc states. 2008-07-09 10:48:50 +02:00
Stefan Dösinger 58ef02fa69 wined3d: Alpha states -> misc pipeline states. 2008-07-09 10:48:43 +02:00
Stefan Dösinger 5f3b11e9d6 wined3d: Move wrapu to the misc states. 2008-07-09 10:48:33 +02:00
Stefan Dösinger dd90d62356 wined3d: Move a few more states to the misc pipeline. 2008-07-09 10:48:26 +02:00
Stefan Dösinger b4445e8b98 wined3d: Textureperspective->misc states. 2008-07-09 10:48:17 +02:00
Stefan Dösinger cad055ae16 wined3d: Move WINED3DRS_ANTIALIAS to the misc states. 2008-07-09 10:48:08 +02:00
Stefan Dösinger f68ac7465f wined3d: Move pixelshader application to the fragment pipeline. 2008-07-09 10:47:59 +02:00
Stefan Dösinger b24c409cea wined3d: Initialize the state table before filling it. 2008-07-09 10:47:49 +02:00
H. Verbeet a85a5ffb1b wined3d: Store the glsl program lookup table in the backend's private data. 2008-07-09 10:42:57 +02:00
Stefan Dösinger a2628d0423 wined3d: Move Fixed function pipeline states to the new fragment structure. 2008-07-08 21:08:54 +02:00
Stefan Dösinger 3a2743f25d wined3d: Remove the state table from the shader backend. 2008-07-08 21:08:54 +02:00
Stefan Dösinger 2d7cdc3ec2 wined3d: Remove the DLL load init function. 2008-07-08 21:08:54 +02:00
Stefan Dösinger 94b723505f wined3d: Communicate the atifs functions via the fragment pipeline impl.
Move those things out of the state table.
2008-07-08 21:08:54 +02:00
Stefan Dösinger c15dfb87e9 wined3d: Create fragment processing state templates and select one.
For now the atifs selection sticks to the old rules, thus it is bound to
the available and selected shader capabilities. We may want to change that
in the future.
2008-07-08 21:08:54 +02:00
Stefan Dösinger bdfaab5a94 wined3d: Move texture transform flag stuff to the vertex pipeline states. 2008-07-08 21:08:54 +02:00
Stefan Dösinger 68948f0c71 wined3d: Move transforms to the vertex code.
Some fragment pipeline implementations may want to register their own
texture transform handlers.
2008-07-08 21:08:54 +02:00
Stefan Dösinger 1f5bce3454 wined3d: indexbuffer -> misc. 2008-07-08 21:08:54 +02:00
Stefan Dösinger b4bee02556 wined3d: Move the viewport to the vertex and misc pipeline states. 2008-07-08 21:08:54 +02:00
Stefan Dösinger 4b831a5d3e wined3d: Move shader constants to the misc states. 2008-07-08 21:08:54 +02:00
H. Verbeet a637fda7bf wined3d: Store the current GLSL program in the backend's private data. 2008-07-08 10:47:30 +02:00
Stefan Dösinger 95099404d5 wined3d: Move lights to the vertex pipeline states. 2008-07-08 10:47:20 +02:00
Stefan Dösinger 298c953b25 wined3d: Move the scissor rect to the misc states. 2008-07-08 10:47:12 +02:00
Stefan Dösinger 3668f7508f wined3d: Move clipplanes to vertex states. 2008-07-08 10:47:05 +02:00
Stefan Dösinger eb9d3d2a8f wined3d: Move the frontfacing state to the misc state table. 2008-07-08 10:46:57 +02:00
Stefan Dösinger 956bfca1e2 wined3d: Move material application to the vertex pipeline. 2008-07-08 10:46:50 +02:00
Stefan Dösinger 141f31f05d wined3d: Move stream source and vshader to misc and vertex pipeline tables. 2008-07-08 10:46:42 +02:00
Stefan Dösinger 6675374dda wined3d: Make the stream source application a regular state function. 2008-07-08 10:46:32 +02:00
Stefan Dösinger 68dec9d161 wined3d: Implement the state merger and start to use it. 2008-07-08 10:46:20 +02:00
Stefan Dösinger 98faed8ff5 wined3d: Start the state splitup.
The idea of this patchset is to split the monolithic state set into 3
parts, vertex processing, fragment processing and other states(depth,
stencil, scissor, ...). The states will be provided in templates which
can be (mostly) independently combined, and are merged into a single
state table at device creation time. This way we retain the advantages
of the single state table and having the advantage of separated
pipeline implementations which can be combined without any manually
written glue code.
2008-07-08 10:45:56 +02:00
Stefan Dösinger 155d3ac4cc wined3d: Remove an unneeded atifs hack.
The atifs fragment processing implementation doesn't borrow a pixel shader
implementation from anywhere. It was a hack during development, but never needed.
2008-07-08 10:45:05 +02:00
Stefan Dösinger 9be8f36c2e wined3d: Correct an off-by-one error in constant dirtification.
Constant numbers start at 0, and the loading loop has a for(i; i <
dirtyconsts; i++). This means that the highest dirty constant isn't
loaded correctly. Rather than replacing the < with <=, which would
make it impossible to have no dirty constant, add 1 to the dirty
constant counter.
2008-07-07 12:33:41 +02:00
Andrew Talbot 6ced8a3f55 wined3d: Remove unneeded address-of operators from function names. 2008-07-07 12:32:39 +02:00
Maarten Lankhorst 422d71f630 wined3d: Fix a deadlock that may occur during initialization. 2008-07-03 11:50:52 +02:00
H. Verbeet 4f77c29bcf wined3d: Track depth stencil location per-surface.
This gets rid of depth_copy_state in the device, and instead tracks
the most up to date location per-surface. This makes things a lot
easier to follow, and allows us to make a copy when switching depth
stencils in SetDepthStencilSurface().
2008-07-03 11:50:52 +02:00
H. Verbeet e7d0ef72ba wined3d: Use dst_fbo to do the depth blit.
This makes the depth copy independent of the currently attached render
targets. This is important for the next patch because it might do a
depth copy when the render targets aren't in a valid configuration
(SetDepthStencilSurface()).
2008-07-03 11:50:51 +02:00
H. Verbeet 22421b8476 wined3d: Make sure the FBO doesn't have any depth attachments in color_fill_fbo() and stretch_rect_fbo().
Currently this is already true, but the next patch will break that assumption.
2008-07-03 11:50:51 +02:00
Stefan Dösinger 8d930f6009 wined3d: Restore the gamma when destroying the swapchain. 2008-07-02 12:27:05 +02:00
Stefan Dösinger 2d4d18b59d wined3d: Delay render target activation.
The ActivateContext in SetRenderTarget was an old regression prevention,
but now it is time to remove it.
2008-07-02 12:25:12 +02:00
Stefan Dösinger 1c7f39ed1e wined3d: Use CTXUSAGE_RESOURCELOAD for fb->texture reads.
There is no need for _BLIT usage. RESOURCELOAD should be faster.
2008-07-02 12:24:54 +02:00
Stefan Dösinger 74c5684f90 wined3d: Update the blit ortho on size changes.
SetupForBlit sets up the GL viewport and projection matrix for
screen-cordinate access to the framebuffer. These settings were not
updated if the other gl states were already set up for blitting. Guild
Wars reads back an offscreen rendered texture from the framebuffer,
which currently sets up CTXUSAGE_BLIT, then changes the render target,
and draws to the texture, which has to be reloaded from system memory
before it can be rendered to(since GW loaded some data into it). If the
two render targets had different size this failed.
2008-07-02 12:24:35 +02:00
Stefan Dösinger c4eae160d7 wined3d: RENDERTARGET | AUTOGENMIPMAP are compatible.
The test used D3DPOOL_MANAGED which is mutually exclusive with
RENDERTARGET usage, thus the call failed.
2008-07-02 12:24:12 +02:00
H. Verbeet d5a8875b93 wined3d: Extract an attach_depth_stencil_fbo() function.
The idea is to make setting depth attachments a bit more consistent
with set_render_target_fbo()/attach_surface_fbo(). I've also got an
upcoming patch in my tree that needs this.
2008-07-02 11:37:31 +02:00
H. Verbeet a1a14fb2c3 wined3d: Get rid of a redundant local variable. 2008-07-02 11:37:25 +02:00
H. Verbeet d76de4eede wined3d: Specify the GLSL language version our shaders are written to.
This prevents some driver warnings when using language features from
1.20, like "first class arrays".
2008-07-01 12:26:05 +02:00
H. Verbeet d5cbb8375e wined3d: Use ModifyLocation() to force a reload on color key change.
Just unsetting SFLAG_INTEXTURE doesn't work for FBOs because the
drawable and texture are the same there (and ModifyLocation() is the
correct way to do this anyway). Fixes another ddraw test failure with
FBO ORM.
2008-07-01 12:25:54 +02:00
H. Verbeet 8d6dc9daa7 wined3d: Move setting a palette up a couple of lines in BltOverride().
This prevents a few failures in the ddraw tests when using FBOs due to
using P8 surfaces without a palette set.
2008-06-30 12:47:34 +02:00
H. Verbeet 469e791f00 wined3d: Invert "upsidedown" in fb_copy_to_texture_direct() and fb_copy_to_texture_hwstretch() rather than BltOverride().
This inversion is specific to the blit implementation being used,
stretch_rect_fbo() doesn't need it.
2008-06-30 12:47:25 +02:00
H. Verbeet 90b7efe2c4 wined3d: Delete depth_blt_texture on IWineD3DDeviceImpl_Uninit3D(). 2008-06-27 11:10:11 +02:00
H. Verbeet ad59eaf998 wined3d: Report WINED3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING.
As far as I can tell we support post ps blending in combination with
MRTs fine. Tabula Rasa needs this cap in order to enable some of the
higher graphics settings.
2008-06-27 11:10:04 +02:00
Francois Gouget 756b401f8d wined3d: Add a trailing '\n' to a couple of shader_addline() calls. 2008-06-26 21:08:35 +02:00
H. Verbeet c433562a68 wined3d: Explicitly enable depth buffer writing in depth_blt().
This prevents conflicts with WINED3DRS_ZWRITEENABLE.
2008-06-25 10:43:08 +02:00
H. Verbeet ebcb5f23a1 wined3d: Half float formats need ARB_TEXTURE_FLOAT as well.
Currently we only check if ARB_HALF_FLOAT_PIXEL is supported. This is
not enough, we need ARB_TEXTURE_FLOAT as well. This fixes some errors
when running the d3d9 visual test with Mesa swrast.
2008-06-23 12:55:08 +02:00
H. Verbeet 02a2ba9d2f wined3d: Report post pixelshader blending on WINED3DFMT_A16B16G16R16F. 2008-06-23 12:55:02 +02:00
Roderick Colenbrander ee3bbccf6e wined3d: Update the Nvidia driver version to 173.41 and also put it in the right format e.g. 7.15.11.7341 instead of 7.15.10.17341. 2008-06-23 12:53:45 +02:00
H. Verbeet e081d69bc1 wined3d: Report WINED3DFMT_FLAG_FILTERING on WINED3DFMT_D24X8.
We report this for WINED3DFMT_D24S8, so there should be no reason
WINED3DFMT_D24X8 can't do it. Fixes a regression in 3DMark06.
2008-06-20 11:20:05 +02:00
H. Verbeet c835b00a36 wined3d: Handle depth formats like any other format in CheckDeviceFormat.
Currently depth formats are handled separately from the other formats,
but depth formats can support things like filtering as well, so we
should check those caps as well.
2008-06-20 11:19:58 +02:00
H. Verbeet a6fa6a4a31 wined3d: Use gl_Color and gl_SecondaryColor to support more varyings in SM3.0 shaders.
SM3.0 requires 10 4 component float varyings for passing stuff between
vertex and pixel shaders. GF7 and earlier report 8 generic varyings +
gl_Color and gl_SecondaryColor in GLSL. This patch allows us to use
gl_Color and gl_SecondaryColor to get 2 extra varyings, which some
games, like C&C3 with highest gfx settings, require.
2008-06-19 11:47:52 +02:00
H. Verbeet 4a4ab5f2ae wined3d: Add support for ARB_color_buffer_float. 2008-06-19 11:47:34 +02:00
Roderick Colenbrander 88b4f29222 wined3d: Add a Geforce9 driver version (right now garbage is returned). 2008-06-18 15:21:56 +02:00
Stefan Dösinger 535e61892c wined3d: Only read back offscreen targets on a target change.
This avoids calling PreLoad needlessly on a thread change during offscreen
rendering and breaks up the endless recursion due to lastTID != newTID.
2008-06-13 10:15:48 +02:00
Stefan Dösinger 78d963039b wined3d: Do not PreLoad the new render target.
There is no reason to do that, now that the SetGLTextureDesc bug is
fixed. This avoids an infinite recursion because PreLoad calls
ActivateContext at some point.
2008-06-13 10:15:26 +02:00
Stefan Dösinger 6ab3d17104 wined3d: Remove a broken AddDirtyRect call. 2008-06-13 10:15:02 +02:00
Roderick Colenbrander b73b2eca47 wined3d: Update ATI GPUs. 2008-06-09 12:40:22 +02:00