Commit Graph

919 Commits

Author SHA1 Message Date
Józef Kucia 05cf63b30f wined3d: Recognize SM4 imax opcode.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-03 20:03:57 +01:00
Alex Henrie 32d73eab5c wined3d: Avoid double initialization.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-03 20:03:41 +01:00
Matteo Bruni d2d8d8f13e wined3d: Regenerate FFP replacement VS on changes to the normal attribute in the vertex declaration.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-03 19:45:31 +01:00
Józef Kucia 2e00982a61 wined3d: Use correct initial color for FFP texture blending in GLSL backend.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-10 00:12:43 +09:00
Matteo Bruni 0985606be4 wined3d: Flat shading emulation for core contexts.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-13 22:54:23 +09:00
Matteo Bruni d6c8146633 wined3d: Enforce a stable texture units mapping.
The GLSL shader backend hardcodes the sampler uniforms at program link
time, it can't handle a change in the mapping between draws with the
same shader program.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-13 22:53:58 +09:00
Matteo Bruni 905261ab40 wined3d: Cleanup extension check for shader model 4 support.
This essentially enables shader model 4 support with Mesa or OS X when
using core profile.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-01 22:53:51 +09:00
Matteo Bruni 245e06d9e3 wined3d: Use non-deprecated texture sample builtins also in the fragment pipeline replacement shaders.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-21 22:41:48 +09:00
Matteo Bruni 78bd9c9811 wined3d: Use non-deprecated texture sample builtins in shaders on core profile.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-16 19:56:56 +09:00
Matteo Bruni 9be8d0a9f4 wined3d: Avoid the builtin color varyings on core profile.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-16 19:56:54 +09:00
Matteo Bruni ad2fc9397e wined3d: Avoid the builtin texture coordinate varyings on core profile.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-16 19:56:51 +09:00
Matteo Bruni 5b8be5550e wined3d: Don't output the fogcoord varying when not necessary.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-16 19:56:48 +09:00
Matteo Bruni f4d9f8c212 wined3d: Fully initialize partially written varyings in SM3 shaders.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-13 22:23:59 +09:00
Matteo Bruni 97ee9451ed wined3d: Initialize unwritten color varyings.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2015-10-07 21:28:54 +09:00
Matteo Bruni 09eda02b68 wined3d: Output all the texture coordinates in the FFP replacement VS when there are enough varyings.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2015-10-07 21:28:54 +09:00
Matteo Bruni 08b21528ed wined3d: Avoid reading uninitialized texcoord varyings in pixel shaders.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2015-10-07 21:28:54 +09:00
Matteo Bruni f511787423 wined3d: Avoid reading uninitialized texcoord varyings in FFP replacement fragment shaders.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2015-10-07 21:28:53 +09:00
Matteo Bruni 93db8e97da wined3d: Store supported varyings count in d3d_limits.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2015-10-07 21:28:53 +09:00
Matteo Bruni b90b61aa68 wined3d: Initialize unwritten texcoord varyings in the VS.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
2015-10-06 19:23:16 +09:00
Matteo Bruni 47bf62962a wined3d: Initialize unwritten texcoord varyings in the FFP replacement vertex shader.
Only when the GPU supports enough varyings.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
2015-10-06 19:23:07 +09:00
Matteo Bruni eb58fef698 wined3d: Avoid the builtin fog coordinate varying on core profile.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
2015-10-05 19:24:34 +09:00
Matteo Bruni 0c84d8dd91 wined3d: Avoid the deprecated syntax for SM3 varyings on core profile.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
2015-10-05 19:24:31 +09:00
Henri Verbeet 2773b27bb1 wined3d: Use unsigned mask constants in shifts. 2015-08-26 23:53:22 +09:00
Stefan Dösinger 1a965811f6 wined3d: Add a slop for color keying. 2015-08-24 20:42:20 +09: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 f2989a2522 wined3d: Only install emulation wrappers when required. 2015-07-28 13:41:48 +02:00
Matteo Bruni 53d1527945 wined3d: Avoid glBegin() / glEnd() in check_fbo_compat() when possible. 2015-07-28 13:41:46 +02:00
Matteo Bruni 4c0b1a5038 wined3d: Use GLSL 1.50 on core contexts. 2015-07-09 17:18:22 +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
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 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 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
Matteo Bruni 4189d29776 wined3d: Avoid the builtin GLSL vertex attributes. 2015-06-12 21:23:12 +09:00
Stefan Dösinger dc7cb59c3a wined3d: Keep track of renderbuffer capabilities. 2015-06-08 18:51:30 +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 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
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 409cda0ac2 wined3d: Dirtify vertex shader on transformed <-> untransformed transitions. 2015-05-20 17:29:05 +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 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 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 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
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
Francois Gouget 6f6dfe91d6 wined3d: Make glsl_vertex_pipe_view() static. 2015-04-23 20:43:19 +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 aad0ab8101 wined3d: Properly handle WINED3DSIH_DP2 in the GLSL shader backend. 2015-04-15 22:21:59 +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 5d51c97d07 wined3d: Implement color keying in the glsl fragment pipeline. 2015-04-10 21:43:31 +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
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 239e8cad7c wined3d: Add per-context private data for fragment pipelines. 2015-03-24 20:06:15 +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
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 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 ba396e4212 wined3d: Simplify the wined3d_matrix structure. 2015-03-20 21:32:46 +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 38e4cb29e7 wined3d: Depend on the vertex shader state instead of the vertex declaration state where appropriate. 2015-03-18 21:02:55 +09:00
Stefan Dösinger 406cfefc2f wined3d: Initialize WINED3DTA_TEMP. 2015-03-11 22:09:42 +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
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
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 d360a51f3c wined3d: Use the core version of the shader object functions. 2015-01-23 12:02:37 +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