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
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
5c3d52468c
wined3d: Take the resource data type into account in shader_glsl_gen_sample_code().
2014-12-03 11:14:27 +01:00
Henri Verbeet
3aa9fe6bef
wined3d: Record the data type of shader resources.
2014-12-03 11:14:25 +01:00
Henri Verbeet
f5cef43738
wined3d: Store resource types instead of sampler types in struct wined3d_shader_reg_maps.
...
The difference doesn't really matter for SM1-3 since resources and samplers
are always tied together, but in SM4 they're separate.
2014-12-03 11:14:21 +01:00
Stefan Dösinger
c9b10beb36
wined3d: Vertex fog uses the absolute eye position z.
2014-11-27 13:27:13 +01:00
Henri Verbeet
8c18ebf66a
wined3d: Recognize the SM4 uge opcode.
2014-11-17 19:30:37 +09:00
Henri Verbeet
8681999eee
wined3d: Explicitly convert the condition to bool shader_glsl_if().
...
In SM4 shaders the condition is likely to be an integer instead of a bool
uniform like in SM3.
2014-11-17 19:30:35 +09:00
Matteo Bruni
e789fadd56
wined3d: Don't replicate shader limits values for each shader.
2014-10-16 21:23:26 +09:00
Matteo Bruni
33627f02aa
wined3d: Store bool uniforms location in the GLSL shader structures.
2014-08-28 15:30:26 +02:00
Henri Verbeet
b005ad6f90
wined3d: Use rendertarget views for color output instead of surfaces.
2014-08-21 12:24:42 +02:00
Henri Verbeet
80bca9bc9c
wined3d: Add constant buffer support to the GLSL shader backend.
2014-08-04 14:23:29 +02:00
Henri Verbeet
fa312a32b2
wined3d: Add format information for WINED3DFMT_R8_UNORM.
2014-06-13 10:11:59 +02:00
Henri Verbeet
7b8aa8606c
wined3d: Recognize the SM4 ishl opcode.
2014-05-20 09:44:25 +02:00
Henri Verbeet
3555eab8b9
wined3d: Recognize the SM4 dp2 opcode.
2014-05-20 09:44:21 +02:00
Henri Verbeet
c81d3b7336
wined3d: Recognize the SM4 discard opcode.
2014-05-20 09:44:17 +02:00
Henri Verbeet
0eebe0515f
wined3d: Fix a couple of string declarations.
2014-05-02 13:45:10 +02:00
Henri Verbeet
14e3f71c75
wined3d: Bump ps_1x_max_value.
...
Shader model 4 hardware should generally have real floats for everything, and
FLT_MAX matches the value from the Windows drivers for that kind of hardware.
OpenGL requires at least 2^10 for colors, and 2^32 for other floats.
2014-05-02 13:45:04 +02:00
Henri Verbeet
23eed88fde
wined3d: Implement support for per-stage texture stage constants.
...
This patch is loosely based on an earlier patch by Christian Costa.
2014-04-23 15:00:43 +02:00
Jonathan Liu
91c5cf33ad
wined3d: Avoid wined3d_ftoa buffer overflow.
2014-01-14 12:31:37 +01:00
Henri Verbeet
d412eb568e
wined3d: Introduce a common GLSL handler for scalar instructions.
2014-01-09 15:50:30 +01:00
Henri Verbeet
27dc41d0dc
wined3d: Fix the source swizzle for WINED3DSIH_LOG and WINED3DSIH_LOGP.
2013-12-12 12:08:09 +01:00
Henri Verbeet
c8852c3ee3
wined3d: Fix the source swizzle for WINED3DSIH_EXPP.
2013-12-11 15:15:01 +01:00
Henri Verbeet
6e9acca1f4
wined3d: Fix the source swizzle for WINED3DSIH_EXP.
2013-12-11 15:14:58 +01:00