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