Commit Graph

7043 Commits

Author SHA1 Message Date
Stefan Dösinger c4e4647ca5 d3d9: Validate swap effect and backbuffer count. 2015-08-27 21:43:46 +09:00
Henri Verbeet 2773b27bb1 wined3d: Use unsigned mask constants in shifts. 2015-08-26 23:53:22 +09:00
Henri Verbeet 9f530b579e wined3d: Get rid of some powf() calls. 2015-08-26 23:53:22 +09:00
Stefan Dösinger b471b217b2 wined3d: Handle multisample_quality if type == MULTISAMPLE_NON_MASKABLE. 2015-08-25 21:08:41 +09:00
Stefan Dösinger 40c5303b62 ddraw: Return the right error if range color keys are used. 2015-08-24 20:42:40 +09:00
Stefan Dösinger 1a965811f6 wined3d: Add a slop for color keying. 2015-08-24 20:42:20 +09:00
Stefan Dösinger 3bd0eb3eab wined3d: Use GL_RGB565 if available.
This offers better precision on r300g and r600g than GL_RGB5.
2015-08-20 20:16:15 +09:00
Stefan Dösinger 6626b1a51b wined3d: Use the correct color key in ARBfp color key blits. 2015-08-20 20:16:12 +09:00
Henri Verbeet 62a02a047f d3d10core: Implement d3d10_device_UpdateSubresource(). 2015-08-18 18:28:47 +09:00
Henri Verbeet ee9b1311cd wined3d: Separate loading shader resources and updating their binding points. 2015-08-18 18:28:41 +09:00
Henri Verbeet 8f6f9096d7 wined3d: Also invalidate STATE_SHADER_RESOURCE_BINDING in wined3d_texture_bind_and_dirtify(). 2015-08-18 18:28:39 +09:00
Andrey Gusev 5cdcd4493f Assorted spelling and typos fixes. 2015-08-18 15:00:13 +09:00
Henri Verbeet fca2d19423 dxgi: Implement dxgi_swapchain_ResizeBuffers(). 2015-08-07 23:44:19 +09:00
Henri Verbeet 2735947d76 wined3d: Introduce a separate function to resize swapchain buffers. 2015-08-07 23:44:14 +09:00
Henri Verbeet 7f29d994ad wined3d: Add base format info for WINED3DFMT_R8G8B8A8_UNORM_SRGB. 2015-08-06 23:36:01 +09:00
Henri Verbeet 7f416ff339 wined3d: Validate "data" in buffer_init(). 2015-07-31 12:08:53 +02:00
Henri Verbeet 62454ae71d wined3d: Validate "data" in wined3d_texture_upload_data(). 2015-07-31 12:08:49 +02:00
Stefan Dösinger 34d8b987c4 wined3d: Try to detect the polygon offset scale value.
FEAR draws the same geometry twice, the second time using zfunc=equal.
In both cases it sets a huge depth bias of -0.5, presumably to get
better precision for the fragile Z comparison. The GL polygon offset we
set ends up being so large that it pulls the geometry into the negative
Z range. It isn't clipped (or no longer, older NV drivers probably had a
separate bug there), but the Z value gets clamped to 0.0 in the first
draw and doesn't match the incoming Z in the second draw.
2015-07-30 23:50:57 +02:00
Matteo Bruni 1eb6e5dd80 wined3d: Update GLSL vertex pipe replacement TODO comment.
It turns out most of that has been implemented since the comment was
originally written.
2015-07-29 20:56:44 +02:00
Matteo Bruni a064797e0f wined3d: Don't unnecessarily fallback to immediate mode for FFP draws with the PSIZE attribute. 2015-07-29 20:56:41 +02:00
Michael Stefaniuc d700dbbae7 wined3d: Merge two adjacent ifs with identical condition (PVS-Studio). 2015-07-28 13:41:49 +02:00
Matteo Bruni f2989a2522 wined3d: Only install emulation wrappers when required. 2015-07-28 13:41:48 +02:00
Matteo Bruni 6244735f7a wined3d: Don't crash when emulating GL_EXT_fogcoord. 2015-07-28 13:41:48 +02:00
Matteo Bruni 930d3e6269 wined3d: Allow to apply extension emulation wrappers independently. 2015-07-28 13:41:47 +02:00
Matteo Bruni 12ef1756d2 wined3d: Don't run check_filter() on core contexts.
The code uses glBegin() / glEnd() and other APIs removed from core
profile.
2015-07-28 13:41:47 +02:00
Matteo Bruni 53d1527945 wined3d: Avoid glBegin() / glEnd() in check_fbo_compat() when possible. 2015-07-28 13:41:46 +02:00
Henri Verbeet e2c0c611d4 d3d10core: Implement d3d10_device_CopySubresourceRegion(). 2015-07-20 11:50:27 +02:00
Matteo Bruni a7315eb76a wined3d: Bind a VAO when using core profile contexts. 2015-07-13 22:06:38 +09:00
Matteo Bruni 3c49a012c0 wined3d: Add more entries to the core extensions table. 2015-07-13 22:06:38 +09:00
Matteo Bruni 6dc3ac2b04 wined3d: Make the core extensions enabling table-based. 2015-07-13 22:06:38 +09:00
Matteo Bruni 4c0b1a5038 wined3d: Use GLSL 1.50 on core contexts. 2015-07-09 17:18:22 +09:00
Matteo Bruni a1e718ccab wined3d: Add a setting for the maximum OpenGL version to use. 2015-07-09 17:18:22 +09:00
Matteo Bruni 6521fc78be wined3d: Use the correct texture coordinates in swapchain_blit() in the non-glBlitFramebuffer, NP2 case. 2015-07-09 17:18:22 +09:00
Matteo Bruni 04a195a980 wined3d: Use a core-compatible GL format for ATI2N. 2015-07-07 21:04:12 +09:00
Matteo Bruni 8839e7fb94 wined3d: Use a lookup table to select the sampler function name. 2015-07-07 21:04:05 +09:00
Józef Kucia 4a8e0ec3d6 wined3d: Implement normals transformation for vertex blending. 2015-07-03 16:51:37 +09:00
Józef Kucia 1f680c52fe wined3d: Implement vertex blending in glsl_vertex_pipe. 2015-07-03 16:51:34 +09:00
Józef Kucia 1fc4a17175 wined3d: Show fixme about unimplemented vertex processing once. 2015-07-03 16:51:29 +09:00
Matteo Bruni 13ceb3fddc wined3d: Don't hardcode WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL cap flag. 2015-07-03 16:51:27 +09:00
Matteo Bruni 4f57581310 wined3d: Improve NP2 fixups in GLSL PS texture sampling code. 2015-07-03 16:51:25 +09:00
Matteo Bruni a8fb1eee49 wined3d: Fix NP2 fixups in GLSL fragment FFP replacement. 2015-07-03 16:51:23 +09:00
Matteo Bruni 30031f6da4 wined3d: Replace an open-coded implementation of LIST_FOR_EACH_ENTRY_SAFE. 2015-07-03 16:51:21 +09:00
Matteo Bruni 93c88d34a8 wined3d: Fix GLSL backend with non-GLSL vertex and pixel pipeline combination.
That can only happen by manually modifying
select_vertex_implementation() and select_fragment_implementation(),
which may be useful for testing non-default vertex / fragment pipeline
implementations.
2015-07-03 16:51:17 +09:00
Matteo Bruni af55ae1379 wined3d: Don't flag WINED3D_SHADER_CONST_FFP_PROJ on transformed <-> untransformed vdecl change.
It's unnecessary since the vertex shader is going to change and
shader_glsl_select() flags all the constants used by the shader anyway.
2015-06-19 20:30:10 +09:00
Matteo Bruni 438f68cc38 wined3d: Drop unused gl_info parameter from shader_glsl_ffp_vertex_lighting(). 2015-06-19 20:30:07 +09:00
Matteo Bruni 498e55a182 wined3d: Make use of the EXT_BLEND_SUBTRACT flag.
MSDN mentions a fallback to D3DBLENDOP_ADD if the selected blendop
is not supported. In theory it would be nice to write a test for that but
I don't think this is particularly important and moreover hardware
without that cap seems hard to come by (i.e. I have none)...
2015-06-17 20:01:20 +09:00
Matteo Bruni 35a2406900 wined3d: Drop WINED3D_RS_TEXTUREPERSPECTIVE handling.
The hint is not supported on core profiles. It's not guaranteed to do
anything on compatibility profile either: "The interpretation of hints is
implementation dependent. An implementation may ignore them entirely."

This state was only available on D3D 7 and below (and not guaranteed to
do anything there either, according to older DX SDK docs).
If necessary we could implement it via the GLSL 1.50 "noperspective"
interpolation qualifier, which is what we need to use for the equivalent
D3D10 feature anyway.
2015-06-17 20:01:20 +09:00
Matteo Bruni f6e7e01744 wined3d: Cleanup and simplify texture sampling code generation.
Makes it easier to support the different names and syntax in GLSL 1.50
in the (hopefully) near future.
2015-06-17 20:01:19 +09:00
Matteo Bruni 170dca7741 wined3d: Handle per-vertex point size in the GLSL FFP replacement. 2015-06-17 20:01:19 +09:00
Henri Verbeet c9227bccc5 wined3d: Implement SM4 discard in the GLSL shader backend. 2015-06-15 22:10:35 +09:00
Henri Verbeet b4b2a29dec wined3d: Use surface_get_rect() in wined3d_surface_update_overlay(). 2015-06-15 22:10:35 +09:00
Matteo Bruni 4189d29776 wined3d: Avoid the builtin GLSL vertex attributes. 2015-06-12 21:23:12 +09:00
Stefan Dösinger 4e53faf77b wined3d: Disable the depth stencil on multisample mismatch. 2015-06-10 23:25:04 +09:00
Stefan Dösinger 985c061ad3 wined3d: Downgrade the framebuffer attachment FIXMEs to WARNs. 2015-06-09 22:09:58 +09:00
Stefan Dösinger 733d4b5ecc wined3d: Don't use depth textures without ARB_depth_texture. 2015-06-09 22:09:57 +09:00
Stefan Dösinger 28af7b407b wined3d: Require FBO attachability for render targets and depth stencils. 2015-06-09 22:09:57 +09:00
Stefan Dösinger 04c3c97072 wined3d: Set WINED3DFMT_FLAG_FBO_ATTACHABLE on depth stencil formats. 2015-06-09 22:09:57 +09:00
Stefan Dösinger e8ec01ad51 wined3d: Use renderbuffers if the resource type is RB. 2015-06-09 22:09:57 +09:00
Nikolay Sivov 68fcf9d7cf wined3d: dst_surface can't be NULL at this point (Coverity). 2015-06-08 18:51:54 +09:00
Stefan Dösinger dc7cb59c3a wined3d: Keep track of renderbuffer capabilities. 2015-06-08 18:51:30 +09:00
Stefan Dösinger c8d1a70804 wined3d: Set the gl resource type in resource_init. 2015-06-08 18:51:24 +09:00
Stefan Dösinger ec25ca7832 wined3d: Read format flags from the surface container. 2015-06-08 18:51:21 +09:00
Stefan Dösinger 4451bf477a wined3d: Read format flags from the volume container. 2015-06-08 18:51:13 +09:00
Matteo Bruni 614e52e897 wined3d: Don't use the builtin FFP uniforms for fog parameters. 2015-06-05 16:53:20 +09:00
Matteo Bruni b02a166cc8 wined3d: Introduce a get_fog_start_end() function. 2015-06-05 16:53:16 +09:00
Matteo Bruni 92fbe333d0 wined3d: Handle point sprites with PS 3.0. 2015-06-05 16:52:29 +09:00
Matteo Bruni c186939f32 wined3d: Clamp per-vertex point size in vertex shaders. 2015-06-03 19:52:22 +09:00
Matteo Bruni e8cb3bdba5 wined3d: Always enable GL_PROGRAM_POINT_SIZE in the GLSL backend.
Core contexts don't support clamping the point size to GL_POINT_SIZE_MIN
/ GL_POINT_SIZE_MAX.  Incidentally this mostly fixes per-vertex point
sizes for vertex shader version 1 and 2.
2015-06-03 19:52:14 +09:00
Nikolay Sivov 5daf08f2cb wined3d: Remove unnecessary test for 0 (Coverity). 2015-06-02 20:53:43 +09:00
Matteo Bruni 90af08c3b1 wined3d: Avoid the builtin uniforms for point size when using the fixed function vertex pipeline. 2015-05-29 16:44:24 +09:00
Matteo Bruni 953a45303c wined3d: Introduce a get_pointsize() function. 2015-05-29 16:44:18 +09:00
Matteo Bruni 36520c3e9d wined3d: Introduce a get_pointsize_minmax() function. 2015-05-29 16:44:13 +09:00
Matteo Bruni b551da8eef wined3d: Remove point size scaling hack.
Not sure how this was supposed to work, according to the GL spec the
clamping to POINT_SIZE_RANGE happens after the scaling is applied.
2015-05-29 16:44:05 +09:00
Stefan Dösinger 90d8896826 wined3d: Allow specifying a different depth stencil location.
This is for drivers that do not support depth stencil textures, but
happily support depth stencil renderbuffers.
2015-05-25 21:43:18 +09:00
Stefan Dösinger bd658a15b9 wined3d: Check resource types separately in check_fbo_compat. 2015-05-25 21:43:18 +09:00
Matteo Bruni 9586d3b256 wined3d: Make use of more specific device IDs with Nvidia binary drivers. 2015-05-21 20:52:04 +09:00
Matteo Bruni 83254963da wined3d: Add missing entries for Nvidia GPUs. 2015-05-21 20:52:01 +09:00
Matteo Bruni 5b911ed461 wined3d: Fix fragment shaders sampling directly into oC[n] in the ARB backend. 2015-05-20 17:29:09 +09:00
Matteo Bruni 409cda0ac2 wined3d: Dirtify vertex shader on transformed <-> untransformed transitions. 2015-05-20 17:29:05 +09:00
Stefan Dösinger d030c5ad06 wined3d: Don't allow 3D depth textures. 2015-05-19 22:56:14 +09:00
Stefan Dösinger 0356cbfab9 wined3d: Fix a copy / paste mistake. 2015-05-08 14:37:17 +09:00
Marcus Meissner d8a0f77c2b wined3d: Remove superflous check (Coverity). 2015-05-06 18:14:44 +09:00
Matteo Bruni 4b35cf730f wined3d: Fix the TIMESTAMP_DISJOINT query.
Spotted by Patrick Rudolph.
2015-05-05 18:51:10 +09:00
Matteo Bruni 2bab1f7250 wined3d: Check all the ffp_material fields.
The application can override each material parameter with one of the two
FFP vertex color attributes. The 'ambient' struct field in the GLSL shader
can thus happen to be unused and the GL driver may optimize it away.
2015-05-05 18:51:00 +09:00
Matteo Bruni 0c05f9f8fd wined3d: Rename *emission* as *emissive*.
Emission is the OpenGL name, emissive the D3D one. Prefer the latter.
2015-05-05 18:50:56 +09:00
Francois Gouget f129e2fbb1 wined3d: Add a trailing '\n' to a generated shader line. 2015-05-04 15:06:47 +09:00
Matteo Bruni 213f7d9f45 wined3d: Implement WINED3D_LIGHT_PARALLELPOINT support in the GLSL ffp. 2015-05-01 15:45:00 +09:00
Matteo Bruni 4388fb41e7 wined3d: Implement legacy light attenuation behavior in the GLSL vertex ffp. 2015-05-01 15:44:49 +09:00
Matteo Bruni f7e0927622 wined3d: Don't use the same va_list multiple times in shader_vaddline(). 2015-04-30 20:07:17 +09:00
Matteo Bruni 5af656ea85 wined3d: Allow texture updates in some cases even when mip levels don't match. 2015-04-30 20:07:08 +09:00
Matteo Bruni 15720f09de wined3d: Report ATI1N and ATI2N volume textures as not supported. 2015-04-30 19:58:01 +09:00
Matteo Bruni ca46914d07 wined3d: Use string_buffer_sprintf() in shader_glsl_generate_ffp_fragment_shader(). 2015-04-29 17:02:30 +09:00
Matteo Bruni 12e59c5278 wined3d: Use string_buffer_sprintf() in handle_ps3_input(). 2015-04-29 17:02:27 +09:00
Henri Verbeet da24b51139 wined3d: Don't try to apply format fixups for SM4+ shaders. 2015-04-29 12:24:36 +09:00
Matteo Bruni 28343db208 wined3d: Don't use the builtin FFP uniforms for the lights.
While at it, use D3D-like uniforms for the light parameters and
(consequently) implement range and proper D3D spotlights support.
2015-04-28 20:02:23 +09:00
Matteo Bruni e226e7593a wined3d: Use struct wined3d_vec4 to store the light position and direction. 2015-04-28 20:02:21 +09:00
Matteo Bruni 540130bfa9 wined3d: Store the directional light direction in the lightDirn field.
It's only an implementation detail that the direction needs to be passed
to the fixed function GL pipeline as GL_POSITION.
2015-04-28 20:02:18 +09:00
Matteo Bruni b5affa6d3c wined3d: Set spotlight direction .w component to 0.0f.
It's a direction so we don't want to get translations applied to it.
The variable is only used internally.
2015-04-28 20:02:12 +09:00
Henri Verbeet f09288cfc4 wined3d: Cleanup the sampler map in shader_cleanup() (Valgrind). 2015-04-28 15:34:12 +09:00
Henri Verbeet 4b86f13ade wined3d: Also free the input signature in shader_cleanup() (Valgrind). 2015-04-27 18:05:24 +09:00
Henri Verbeet 79f4ca9ec4 wined3d: Release the context before potentially destroying the swapchain in wined3d_device_uninit_3d() (Valgrind). 2015-04-27 18:05:22 +09:00
Stefan Dösinger 0152b0dad3 wined3d: Move the ARB_texture_rectangle check to init_format_texture_info. 2015-04-27 15:07:48 +09:00
Stefan Dösinger 0d6d64b358 wined3d: Move the ARB_texture_cube_map check to init_format_texture_info. 2015-04-27 15:07:46 +09:00
Stefan Dösinger 7109bebd02 wined3d: Move volume DXTn handling to apply_format_fixups. 2015-04-27 15:07:42 +09:00
Matteo Bruni 978fe23218 wined3d: Don't use the builtin FFP uniforms for the material. 2015-04-27 15:07:11 +09:00
Matteo Bruni 6984ca7f46 wined3d: Don't use the builtin FFP uniforms for texture transformation matrices. 2015-04-27 15:07:06 +09:00
Matteo Bruni 84ca0203bf wined3d: Introduce a scratch string buffers framework. 2015-04-27 15:07:03 +09:00
Matteo Bruni 54b4df6731 wined3d: Reduce initial wined3d_string_buffer buffer size to 32.
Also try to avoid unnecessary HeapReAlloc() + vsnprintf() loops when we
know the required size of the buffer.
2015-04-27 15:06:58 +09:00
Matteo Bruni 64463b81df wined3d: Rename struct wined3d_shader_buffer to wined3d_string_buffer.
Also rename the shader_buffer_(clear|init|free) functions.
2015-04-27 15:06:55 +09:00
Stefan Dösinger 072e1a3fb2 wined3d: Move the EXT_texture3D check to init_format_texture_info. 2015-04-24 19:08:45 +09:00
Stefan Dösinger 9def5ff409 wined3d: Query info for each resource type from ARB_internalformat_query2. 2015-04-24 19:08:41 +09:00
Stefan Dösinger e4e1e7d8d3 wined3d: Read flags of the right resource type in check_device_format. 2015-04-24 19:08:39 +09:00
Stefan Dösinger 3c0ed9ce0a wined3d: Introduce resource-type specific format flags. 2015-04-24 19:08:35 +09:00
Matteo Bruni 53ff2a9d22 wined3d: Drop the ARB_SHADER_OBJECTS extension flag.
The flag is currently unused and also unnecessary since both
ARB_vertex_shader and ARB_fragment_shader specs require
ARB_shader_objects support.
2015-04-24 19:08:15 +09:00
Matteo Bruni 7928ffaca5 wined3d: Drop glPrioritizeTextures() call.
It's not supported on core profiles and I doubt it matters anyway.
For the records, the default value is 1 so this was actually lowering
the priority for DEFAULT pool textures.
2015-04-24 19:08:10 +09:00
Matteo Bruni d6db6c7295 wined3d: Fix specular lighting for non-local viewer.
The viewer is in the (0.0, 0.0, -1.0) direction in the D3D coordinate
system.
2015-04-24 19:08:01 +09:00
Matteo Bruni b963c73abb wined3d: Introduce D3D7+ normal matrix computation. 2015-04-24 19:07:52 +09:00
Henri Verbeet cfd280fd66 wined3d: Get rid of the tracing code in shader_vaddline(). 2015-04-24 14:29:39 +09:00
Henri Verbeet dd2398297c wined3d: Simplify shader_arb_dump_program_source(). 2015-04-24 14:29:32 +09:00
Stefan Dösinger 4fbaab2020 wined3d: Shadow format flags in wined3d_rendertarget_view. 2015-04-23 20:43:20 +09:00
Francois Gouget 6f6dfe91d6 wined3d: Make glsl_vertex_pipe_view() static. 2015-04-23 20:43:19 +09:00
Stefan Dösinger 9076612e2d wined3d: Shadow format flags in the resource. 2015-04-22 23:24:41 +09:00
Henri Verbeet 6e4ad78ff4 wined3d: Slightly simplify get_info_log_line(). 2015-04-21 23:44:59 +09:00
Henri Verbeet de1450788b wined3d: Completely initialize "correction_params" in shader_glsl_load_constants() (Valgrind).
Leaving the last two elements uninitialized is mostly harmless since the
shader doesn't actually use them, but the driver might try to do some kind of
analysis on them.
2015-04-21 22:22:00 +09:00
Henri Verbeet c7780791ea wined3d: Introduce a function to compile ARB vertex/fragment programs. 2015-04-21 22:21:56 +09:00
Henri Verbeet 8063d4cfcc wined3d: Initialize "type.padding" in arbfp_blit_set() (Valgrind). 2015-04-21 22:21:52 +09:00
Henri Verbeet 8b6cddbe25 wined3d: Get rid of context_invalidate_active_texture().
Calling wined3d_texture_bind() + context_invalidate_active_texture() is
equivalent to just calling wined3d_texture_bind_and_dirtify().
2015-04-16 20:44:43 +09:00
Henri Verbeet dcaaf915f8 wined3d: Use wined3d_texture_bind_and_dirtify() in wined3d_texture_upload_data(). 2015-04-16 20:44:41 +09:00
Henri Verbeet 5c9da580a8 wined3d: Use wined3d_texture_bind_and_dirtify() in device_update_volume().
I missed this in 7c4d512fee. Generally speaking,
the only places where plain wined3d_texture_bind() calls are appropriate are
places where you're binding the texture to a specific stage for a subsequent
draw. I.e., places where context_active_texture() is called first.
2015-04-16 20:44:37 +09:00
Henri Verbeet 52478e3809 wined3d: Bind the texture before calling wined3d_volume_upload_data() in wined3d_volume_load_location(). 2015-04-16 20:44:31 +09:00
Henri Verbeet aad0ab8101 wined3d: Properly handle WINED3DSIH_DP2 in the GLSL shader backend. 2015-04-15 22:21:59 +09:00
Henri Verbeet a37099e132 wined3d: Bind sampler objects to the correct texture stage.
On current hardware this generally only makes a difference for vertex
textures. This fixes a regression introduced by commit
c6232e1d11.
2015-04-15 22:21:58 +09:00
Henri Verbeet dc53f6c2e6 wined3d: Use the display format if WINED3DFMT_UNKNOWN is passed as backbuffer format for windowed mode resets. 2015-04-15 22:21:58 +09:00
Stefan Dösinger 27209c69a9 wined3d: Call arbfp_blit_surface and ffp_blit_blit_surface through the blit interfaces. 2015-04-15 22:21:58 +09:00
Stefan Dösinger 6b455e74a0 wined3d: Move fixed function draw blits out of surface_blt_special. 2015-04-15 22:21:58 +09:00
Stefan Dösinger f84d741cb3 wined3d: Implement color keying in the ARB fixed function pipeline. 2015-04-15 22:21:58 +09:00
Stefan Dösinger 483d9550c4 wined3d: Use finer grained colorkey state invalidation. 2015-04-15 22:21:58 +09:00
Stefan Dösinger 382fa588a9 wined3d: Handle color key dirtification in wined3d_cs_exec_set_texture. 2015-04-15 22:21:57 +09:00
Joachim Priesner 8fff427bc0 wined3d: Load ModelView matrix for glLightfv calls.
Analogous to the light() function in state.c, the correct ModelView
matrix has to be loaded when glLightfv is called.
2015-04-13 16:41:48 +09:00
Stefan Dösinger c5c7137212 wined3d: Simplify alpha test and color keying in GLSL. 2015-04-10 21:44:13 +09:00
Stefan Dösinger 5c7707dc77 wined3d: Move alpha test states to the fragment pipeline.
This will allow some color keying cleanups. For Core Contexts we'll have
to emulate alpha testing in shaders anyway.
2015-04-10 21:44:01 +09:00
Stefan Dösinger f4b6874491 wined3d: Match blitter and fragment processing color keying capabilities.
This is necessary if e.g. the nvts or ffp fragment processing pipeline
is selected for debugging purposes on a GPU that otherwise supports the
ARB program blitter.
2015-04-10 21:43:51 +09:00
Stefan Dösinger 5d51c97d07 wined3d: Implement color keying in the glsl fragment pipeline. 2015-04-10 21:43:31 +09:00
Stefan Dösinger 2d56694445 wined3d: Implement color keying in arbfp_blit. 2015-04-10 21:43:12 +09:00
Stefan Dösinger 439076d591 wined3d: Allow ARB blits from converted surfaces. 2015-04-10 21:42:47 +09:00
Stefan Dösinger 82db5954c4 wined3d: Set color keys through the command stream. 2015-04-10 21:42:41 +09:00
Maxime Lombard 086d2af629 wined3d: Add support for Nvidia GTX 970M. 2015-04-10 21:42:27 +09:00
Sebastian Lackner 14219b0c3b wined3d: Fix a typo in vertexshader_init.
Should fix the graphical corruptions recently introduced by
002713de6d.
2015-04-08 23:14:24 +09:00
Sebastian Lackner 3a14df3b9a wined3d: Fix typo in init_output_registers. 2015-04-08 16:22:41 +09:00
Stefan Dösinger b413a4e202 wined3d: Add more formats to wined3d_format_convert_color_to_float. 2015-04-07 23:10:33 +09:00
Stefan Dösinger fa0a9232e0 wined3d: Move surface_convert_color_to_float to utils.c. 2015-04-07 23:10:30 +09:00
Stefan Dösinger 8a101bc1f5 wined3d: Add a function for wined3d_gl_resource_type to texture target conversion. 2015-04-07 23:10:20 +09:00
Stefan Dösinger f260c17b34 wined3d: Use a shader for unconverted blits. 2015-04-07 23:10:14 +09:00
Stefan Dösinger e8b9f8134d wined3d: Define a constant for the blit texture size parameter. 2015-04-03 00:33:29 +09:00
Stefan Dösinger ad50f872ae wined3d: Pass a struct arbfp_blit_type to the blit shader generation functions. 2015-04-03 00:33:28 +09:00
Stefan Dösinger 6cf421399b wined3d: Use bitfields in struct arbfp_blit_type. 2015-04-03 00:33:28 +09:00
Stefan Dösinger da7abd29b4 wined3d: Pass a wined3d_ffp_texture_type enum to blit shader functions. 2015-04-03 00:33:28 +09:00
Stefan Dösinger 844c4efb47 wined3d: Give tex_type and its values a better name. 2015-04-03 00:33:28 +09:00
Henri Verbeet 94b0e895db wined3d: Use GLSL 1.30 for SM4 shaders when available.
This is required for bitwise operators in particular if no other extension
provides them.
2015-03-31 18:49:28 +09:00
Henri Verbeet d0d8a7827b wined3d: Take WINED3D_PIXEL_CENTER_INTEGER into account when calculating vpos. 2015-03-31 18:49:28 +09:00
Henri Verbeet 94967c28b9 wined3d: Add support for half-integer pixel centers.
Like in OpenGL and Direct3D 10+.
2015-03-30 19:10:29 +09:00
Matteo Bruni 05757794a0 wined3d: Don't use the builtin FFP uniform for the projection matrix. 2015-03-27 20:40:38 +09:00
Matteo Bruni 7a8ac888de wined3d: Don't use the builtin FFP uniform for the normal matrix. 2015-03-27 20:40:38 +09:00
Stefan Dösinger be4c7a0a84 wined3d: Implement per stage constants in atifs. 2015-03-27 20:40:37 +09:00
Stefan Dösinger 3c2d0b983a wined3d: Avoid constant collision in atifs. 2015-03-24 20:06:18 +09:00
Stefan Dösinger 239e8cad7c wined3d: Add per-context private data for fragment pipelines. 2015-03-24 20:06:15 +09:00
Stefan Dösinger 1b0c063632 wined3d: Check for conversion changes in the atifs fragment pipeline.
Mapping colorop to pixelshader is necessary because misc_state_template
defines a pixel shader handler. We have to use the same representative
in all pipeline parts.

Wined3d_cs_exec_set_texture dirtifies the pixel shader state when the
fixup of a texture changes. Atifs no longer needs a pixel shader handler
on its own since vertex shader updates aren't delayed any more when the
pixel shader state is dirty.
2015-03-24 20:06:05 +09:00
Stefan Dösinger 92fee8c04f wined3d: Improve color fixups in atifs shaders.
The abilities of this hardware is too limited to support generic sign /
swizzle fixups. A generic handler would consume 4 of the 8 available
color instruction slots and 2 alpha instruction slots.

The bump mapping handler code has its own way of handling the color
fixups. It merges the fixup into the perturbation calculation without
requiring extra shader instructions. In theory this is possible for the
majority of d3d texture ops as well, but I don't think this is worth the
effort. I expect that this code will only be used for the ddraw signed
format test in practice.
2015-03-24 20:05:46 +09:00
Henri Verbeet 010ff106dd d3d10core: Implement d3d10_device_DrawInstanced(). 2015-03-24 17:41:17 +09:00
Henri Verbeet a33d3ad41b wined3d: Add support for SV_InstanceID. 2015-03-24 17:41:12 +09:00
Henri Verbeet f9fafb3686 wined3d: Use the "sysval_semantic" field instead of "semantic_name" to recognize SV_POSITION. 2015-03-24 17:41:09 +09:00
Henri Verbeet 1b08196c5a wined3d: Implement d3d10 style instance data step rates. 2015-03-24 17:41:06 +09:00
Matteo Bruni 74cda79ac3 wined3d: Introduce a get_texture_matrix() function. 2015-03-23 22:59:20 +09:00
Matteo Bruni 2d270f31c6 wined3d: Introduce a get_projection_matrix() function.
Notice that I'm using floats instead of doubles in the new function,
mostly to be able to use struct wined3d_matrix and multiply_matrix().
At a rough estimate the precision should still be good enough.
2015-03-23 22:59:19 +09:00
Matteo Bruni 65c8c40b18 wined3d: Use a separate STATE_VIEWPORT state handler in the GLSL pipeline. 2015-03-23 22:59:18 +09:00
Henri Verbeet 88f230b56e d3d10core: Also pass unused input layout elements to wined3d.
While these won't be used by the shader, they potentially affect the
calculated offset for WINED3D_APPEND_ALIGNED_ELEMENT elements.
2015-03-23 22:59:12 +09:00
Henri Verbeet cbe717b8f3 wined3d: Take the input slot into account when handling WINED3D_APPEND_ALIGNED_ELEMENT. 2015-03-23 22:59:11 +09:00
Henri Verbeet f3765e9f77 wined3d: Merge some common shader initialization code into shader_init(). 2015-03-23 22:59:10 +09:00
Henri Verbeet 002713de6d wined3d: Store shader input signatures as a wined3d_shader_signature structure. 2015-03-23 22:59:08 +09:00
Henri Verbeet 2e5ad1b6e3 wined3d: Store shader output signatures as a wined3d_shader_signature structure.
Instead of a fixed array of wined3d_shader_signature_element structures.
Shader model 4 shaders can have different semantics in a single
register, e.g.  v1.xy TEXCOORD0 and v1.zw TEXCOORD1, so having a single
wined3d_shader_signature_element structure per register isn't
necessarily sufficient.
2015-03-23 22:59:07 +09:00
Henri Verbeet ec78d50193 wined3d: Fix a TRACE in wined3d_device_draw_indexed_primitive_instanced(). 2015-03-20 21:32:50 +09:00
Henri Verbeet ba396e4212 wined3d: Simplify the wined3d_matrix structure. 2015-03-20 21:32:46 +09:00
Francois Gouget f505e6fb4a Assorted spelling fixes. 2015-03-19 21:54:14 +09:00
Matteo Bruni 9811d85141 wined3d: Don't use the builtin FFP uniform for the modelview matrix. 2015-03-19 20:56:59 +09:00
Matteo Bruni 425dc69fef wined3d: Use a separate STATE_TRANSFORM(WINED3D_TS_VIEW) state handler in the GLSL pipeline. 2015-03-19 20:56:56 +09:00
Matteo Bruni 99f3e835ac wined3d: Use a separate STATE_VDECL state handler in the GLSL pipeline.
It's mostly a copy of vertexdeclaration() from state.c, with a few
differences due to the new function being private to the GLSL backend
(e.g. d3d_info.vs_clipping is known to be TRUE) and the fragment fog
update part being split out.
2015-03-19 20:56:50 +09:00
Matteo Bruni 50861156e2 wined3d: Introduce a get_modelview_matrix() function. 2015-03-19 20:56:45 +09:00
Matteo Bruni fe4a226bfa wined3d: Introduce a get_identity_matrix() function. 2015-03-19 20:56:42 +09:00
Stefan Dösinger df829de88d ddraw: Handle DDBLT_ROP in ddraw. 2015-03-18 21:03:22 +09:00
Matteo Bruni 38e4cb29e7 wined3d: Depend on the vertex shader state instead of the vertex declaration state where appropriate. 2015-03-18 21:02:55 +09:00
Matteo Bruni d8c5e417c2 wined3d: Force stream info update on vertex shader change. 2015-03-18 21:02:41 +09:00
Stefan Dösinger 406cfefc2f wined3d: Initialize WINED3DTA_TEMP. 2015-03-11 22:09:42 +09:00
Matteo Bruni f298d30b39 wined3d: Fix a typo in a trace in context_create(). 2015-03-11 22:08:34 +09:00
Stefan Dösinger d4db09d0e9 wined3d: Support WINED3DFMT_R5G5_SNORM_L6_UNORM with EXT_texture_snorm.
From: Stefan Dösinger <stefandoesinger@gmx.at>
2015-03-10 21:43:34 +09:00
Stefan Dösinger 6df52ca7e6 wined3d: Add support for GL_EXT_texture_snorm. 2015-03-10 21:43:32 +09:00
Stefan Dösinger 6f2f73a456 wined3d: Improve the unsigned emulation of WINED3DFMT_R5G5_SNORM_L6_UNORM. 2015-03-10 21:43:11 +09:00
Stefan Dösinger ce836bf651 wined3d: Properly up-scale WINED3DFMT_R5G5_SNORM_L6_UNORM. 2015-03-10 21:43:07 +09:00
Bernhard Übelacker 44ddcac6c3 wined3d: Recognize Nvidia GeForce 8100 with Nouveau driver (bug). 2015-03-10 21:42:50 +09:00
Matteo Bruni db80aba5ad wined3d: Drop redundant check for instanced rendering from drawStridedFast.
We need GL_ARB_instanced_arrays to be able to take the fastest path and
that's already checked in draw_primitive.  Note that
GL_ARB_instanced_arrays provides glDrawElementsInstanced if
GL_ARB_draw_instanced is not supported so we don't need to explicitly
check for the latter.
2015-03-02 13:48:00 +09:00
Matteo Bruni 8ed9c2a11b wined3d: Add a couple checkGLcall() in surface_prepare_rb(). 2015-03-02 13:47:56 +09:00
Matteo Bruni 2f804307bd wined3d: Drop a few unnecessary &x[0]. 2015-03-02 13:47:52 +09:00
Matteo Bruni 7f618695c6 wined3d: Remove an obsolete comment.
Wined3d doesn't actually require the GLX extension for multisampling
at this point (while it does require FBOs).
2015-03-02 13:47:46 +09:00
Matteo Bruni 67d2b52c27 wined3d: Remove ARB_/EXT_TEXTURE_ENV_ADD. 2015-02-26 20:08:57 +09:00
Matteo Bruni aca8ab91eb wined3d: Use the core version of the INCR_WRAP and DECR_WRAP tokens. 2015-02-25 20:35:28 +09:00
Matteo Bruni 78ae4f66d7 wined3d: Set GL_UNPACK_ALIGNMENT to 1.
Alignment should be taken care by the surface pitch and
GL_UNPACK_ROW_LENGTH alone just fine, as long as the pitch is a
multiple of the pixel size. Client APIs respect that,
internally we need to do the same and the changes to
surface_load_texture and wined3d_volume_upload_data are there
for this reason (e.g. WINED3DFMT_R16G16_SNORM is emulated with
GL_RGB16 when NV_texture_shader isn't supported).
2015-02-20 22:53:09 +09:00
Matteo Bruni 7c4d512fee wined3d: Make sure the correct texture is bound in device_update_volume. 2015-02-19 17:52:03 +09:00
Matteo Bruni b47695bf3a wined3d: Reject unsupported pitches in wined3d_surface_update_desc(). 2015-02-19 17:51:47 +09:00
Matteo Bruni d56c168da1 wined3d: Set the surface pitch for user-memory surfaces. 2015-02-19 17:51:36 +09:00
Henri Verbeet 3fa8f4ece3 wined3d: Apply modifiers after floatBitsToInt()/floatBitsToUint() in shader_glsl_add_src_param(). 2015-02-18 23:21:49 +09:00
Stefan Dösinger 52ab9e382e wined3d: Read WINED3D_TEXTURE_COLOR_KEY and gl_color_key to find format conversions.
The idea is to make it clear that wined3d_texture_load is responsible
for checking the color key for changes. Once we can do color keying in
the shader we also have one place where we can disable the surface
conversion.
2015-02-18 22:02:39 +09:00
Stefan Dösinger e53d22b0c0 wined3d: Manage color key changes in the texture.
This fixes a regression with color keyed mipmaps that was introduced by
ee8a5b7dd1. surface_load for level n+1
would call texture_force_reload, thus removing level n from the GL
texture.
2015-02-18 22:02:33 +09:00
Henri Verbeet 849149d5d3 wined3d: Add support for appending vertex declaration elements. 2015-02-13 18:53:17 +09:00
Stefan Dösinger 9b3ab8a6f4 wined3d: Set z = 0.0 via the projection matrix instead of depth clamping.
This works on cards that don't implement ARB_depth_clamp like r500
cards. Note that texturing is influenced by position.w, not position.z.
2015-02-12 22:20:05 +09:00
Henri Verbeet 471e626052 wined3d: Fix the .spec. 2015-02-12 22:12:11 +09:00
Henri Verbeet e4cb3b5081 wined3d: Recognize the SM4 or opcode. 2015-02-11 23:05:17 +09:00
Henri Verbeet 3225fea30c wined3d: Recognize the SM4 ne opcode. 2015-02-11 23:05:13 +09:00
Henri Verbeet 8506da62e0 wined3d: Implement WINED3DSIH_SQRT in the GLSL shader backend. 2015-02-11 23:05:08 +09:00
Henri Verbeet 1dfea3a4ba wined3d: Do not validate format restrictions for buffers.
Buffers don't have a format as such, and are created with either
WINED3DFMT_UNKNOWN or WINED3DFMT_VERTEXDATA.
2015-02-11 23:05:04 +09:00
Henri Verbeet 5045ca639d wined3d: Add some warnings when resource_init() fails due to format restrictions. 2015-02-11 23:04:59 +09:00
Matteo Bruni ac3df5e1f1 wined3d: Use the proper pitch in read_from_framebuffer().
This function is only used in the non-default "backbuffer" ORM.
2015-02-11 22:21:36 +09:00
Matteo Bruni 20e61b396e wined3d: Use unsigned short for the bitfields in struct color_fixup_desc. 2015-02-11 22:21:28 +09:00
Matteo Bruni b875a4a44a wined3d: Use GL_CLAMP_TO_EDGE instead of GL_CLAMP.
GL_CLAMP was removed from core profile and probably GL_CLAMP_TO_EDGE was
intended to be used here anyway.
2015-02-10 16:21:55 +09:00
Matteo Bruni f4da723151 wined3d: Call glReadBuffer() through the appropriate function pointer. 2015-02-10 16:21:41 +09:00
Matteo Bruni 1612dc4dc9 wined3d: Refuse pixel shaders declaring POSITION0 inputs. 2015-02-09 22:05:43 +09:00
Matteo Bruni 74b4516bfa wined3d: Only consider POSITION0 PS inputs as vpos. 2015-02-09 22:05:41 +09:00
Matteo Bruni 96b48191c0 wined3d: Only copy POSITION0 output semantics into gl_Position. 2015-02-09 22:05:35 +09:00
Matteo Bruni 1aa5015467 wined3d: Directly use the core version of glTex[Sub]Image3D. 2015-02-09 22:05:32 +09:00
Stefan Dösinger da5041eb4b wined3d: Check the d3d buffer to find converted attributes.
This fixes some tests with ARB shaders that were broken since
1360af6adc. When buffer_internal_preload
is called by context_update_stream_info, si->elements[i].data is not yet
set.
2015-02-06 22:20:26 +09:00
Stefan Dösinger e178b7ec9a wined3d: Don't use TXP for rectangle P8 textures.
This was probably taken from the YUV shaders, incorrectly and in reverse
logic. It did happen to work though because fragment.texcoord[0].w is 1.0.
2015-02-04 23:15:03 +09:00
Stefan Dösinger 3d49060fdf wined3d: Fix the color keyed P8 alpha ref value. 2015-02-04 23:14:59 +09:00
Matteo Bruni 9defaa53a1 wined3d: Use the core version of the asynchronous queries functions. 2015-02-02 22:39:05 +09:00
Stefan Dösinger 3ef1d6bcd9 wined3d: Pass WM_SYSCOMMAND(SC_RESTORE) to DefWindowProc. 2015-01-28 11:06:48 +01:00
Andrew Eikum 7b45103c4a wined3d: Fix spec file entry for wined3d_texture_create. 2015-01-23 17:28:40 +01:00
Matteo Bruni d360a51f3c wined3d: Use the core version of the shader object functions. 2015-01-23 12:02:37 +01:00
Matteo Bruni e192939652 wined3d: Use the core version of GL vertex attribute functions where possible. 2015-01-23 12:02:33 +01:00
Matteo Bruni 584892b692 wined3d: Properly initialize the last two components of R16G16_SINT attributes. 2015-01-23 12:02:28 +01:00
Matteo Bruni 270431c220 wined3d: Don't normalize R8G8B8A8_UINT attributes. 2015-01-22 13:37:55 +01:00
Matteo Bruni 8ddb7e32f8 wined3d: Add separate stencil state setup via GL 2.0+ core functions. 2015-01-22 13:37:53 +01:00
Matteo Bruni 915e0ef0cf wined3d: Always use the core version of the glPointParameteri function.
The state function depends on GL 2.0+ so it's unnecessary to
check for NV_POINT_SPRITE.
2015-01-20 16:09:01 +01:00
Matteo Bruni aff0c389cc wined3d: Use the core version of glDrawElementsInstanced. 2015-01-20 16:08:58 +01:00
Matteo Bruni 75b96768e5 wined3d: Use the core version of glDrawBuffers. 2015-01-20 16:08:56 +01:00
Matteo Bruni 6bb32e47ff wined3d: Use the core gl*CompressedTex* functions. 2015-01-20 16:08:54 +01:00
Henri Verbeet 525696fe6c wined3d: Properly cleanup samplers on wined3d_device_reset() / wined3d_device_uninit_3d(). 2015-01-19 14:31:53 +01:00
Henri Verbeet ca06f960ed wined3d: Use the same flags for wined3d_texture_set_color_key() and the "color_key_flags" field it sets.
This fixes a regression introduced by commit a8ab569415.
2015-01-19 14:31:51 +01:00
Henri Verbeet 2912e2938e wined3d: Handle the SM4 SV_POSITION pixel shader input semantic in the GLSL shader backend.
This is (mostly) equivalent to the vPos register in SM3.
2015-01-19 14:31:38 +01:00
Henri Verbeet 2e5abc156a wined3d: Implement WINED3DSIH_SAMPLE in the GLSL shader backend. 2015-01-19 14:31:32 +01:00
Henri Verbeet 60d44af34e wined3d: Merge shader_glsl_load_vsamplers() and shader_glsl_load_psamplers(). 2015-01-15 17:24:45 +01:00
Henri Verbeet c6232e1d11 wined3d: Create GL sampler objects for wined3d sampler objects. 2015-01-15 17:24:43 +01:00
Henri Verbeet 5231113fc7 wined3d: Replace wined3d_texture_apply_state_changes() with wined3d_texture_apply_sampler_desc(). 2015-01-15 17:24:38 +01:00
Henri Verbeet 86e99abb12 wined3d: Store a struct wined3d_sampler_desc in struct gl_texture.
Instead of a enum wined3d_texture_state array.
2015-01-15 17:24:35 +01:00