Stefan Dösinger
dc45657f2c
wined3d: Fix vs_2_0 sgn.
...
vs_2_0's sgn has two extra parameters - temporary registers for the
instruction. This patch fixes the crash of the d3d9:visual test on windows and
properly handles the vs_2_0 version of sgn.
2009-10-02 12:36:59 +02:00
Henri Verbeet
f88c6e5ce5
wined3d: Move common shader fields to IWineD3DBaseShaderClass.
2009-09-25 15:14:35 +02:00
Rico Schüller
8a890d399a
wined3d: Fix shader spam.
2009-09-18 10:47:17 -05:00
Henri Verbeet
ab8523931a
wined3d: Only warn about using Lod sample functions in fragment shaders is ARB_shader_texture_lod isn't supported.
2009-09-01 14:05:51 +02:00
Henri Verbeet
560d63548d
wined3d: Remove trailing spaces.
2009-08-27 11:45:37 +02:00
Henri Verbeet
dc8b1bdc0f
wined3d: Rename some GLSL instruction handlers.
...
The pshader_glsl_* names are a leftover from when we had separate code for
vertex and fragment shaders.
2009-08-19 14:45:23 +02:00
Henri Verbeet
e205973915
wined3d: Remove the redundant vs_nv_version and ps_nv_version fields from struct wined3d_gl_info.
2009-08-13 11:45:36 +02:00
Henri Verbeet
f7918b978f
wined3d: Make the "luminanceparams" shader_reg_maps member a bitmap.
2009-08-12 13:22:50 +02:00
Henri Verbeet
95bb4c0486
wined3d: Make the "bumpmat" shader_reg_maps member a bitmap.
2009-08-12 13:22:44 +02:00
Henri Verbeet
3d718d6414
wined3d: Make the "labels" shader_reg_maps member a bitmap.
2009-08-12 13:22:37 +02:00
Henri Verbeet
270f57e755
wined3d: Make the "address" shader_reg_maps member a bitmap.
2009-08-12 13:22:30 +02:00
Henri Verbeet
6fa9fa15da
wined3d: Make the "temporary" shader_reg_maps member a bitmap.
2009-08-11 12:36:20 +02:00
Henri Verbeet
50853e295b
wined3d: Make the "texcoord" shader_reg_maps member a bitmap.
2009-08-11 12:36:16 +02:00
Henri Verbeet
b2ace3b1ab
wined3d: Correctly check for luminance bumpmap parameters in shader_generate_glsl_declarations().
2009-08-11 12:35:49 +02:00
Francois Gouget
e74efb5487
Assorted spelling fixes.
2009-08-11 12:35:38 +02:00
Henri Verbeet
8d746c31ba
wined3d: Properly handle negative loop step in shader_glsl_loop().
2009-08-10 13:52:37 +02:00
Henri Verbeet
3bf0ad4528
wined3d: Explicitly pass the context to the shader_select() handler.
2009-08-07 12:11:06 +02:00
Henri Verbeet
4c1b3de936
wined3d: Call the shader_load_np2fixup_constants() handler directly from inside the shader backend.
2009-08-06 17:26:30 +02:00
Henri Verbeet
03686cb6bd
wined3d: Explicitly pass the context to the shader_load_constants() handlers.
2009-08-06 17:26:30 +02:00
Henri Verbeet
a7251f0f4e
wined3d: Track render_offscreen in the context.
...
This makes sure the relevant states in FindContext() are actually marked dirty
when needed.
2009-08-06 17:26:30 +02:00
Henri Verbeet
ee4d18cc83
wined3d: Pass NULL to ActivateContext() when we don't need a specific target.
...
Once we keep track of the wined3d context for each thread,
lastActiveRenderTarget won't do what we want here.
2009-07-21 14:22:44 +02:00
Stefan Dösinger
cd7f43b00d
wined3d: Don't activate a context unless we need one.
2009-07-20 12:23:07 +02:00
Henri Verbeet
43e6686a78
wined3d: Rename _WineD3D_GL_Info to struct wined3d_gl_info.
2009-07-17 11:22:07 +02:00
Henri Verbeet
38cb9d02b1
wined3d: Take geometry shaders into account in shader_glsl_load_constantsB().
2009-07-10 12:13:29 +02:00
Henri Verbeet
60e0997c79
wined3d: Simplify the GLSL sRGB write code.
2009-07-10 12:13:03 +02:00
Henri Verbeet
9cf7888002
wined3d: Fix some cast-qual warnings.
2009-07-09 11:38:07 +02:00
Henri Verbeet
95d9b1271f
wined3d: Get rid of the useless "fragcolor" variable in shader_glsl_generate_pshader().
2009-07-09 11:38:05 +02:00
Henri Verbeet
483d552e21
wined3d: Allow shader_buffer_init() to fail.
2009-07-09 11:38:02 +02:00
Henri Verbeet
40b411958b
wined3d: Rename "SHADER_BUFFER" to something sane.
2009-07-09 11:37:58 +02:00
Henri Verbeet
bddc4d3f0d
wined3d: Reuse the shader buffer between shaders.
2009-07-09 11:37:53 +02:00
Henri Verbeet
e41831990d
wined3d: Fix a sign compare warning in glsl_shader.c.
2009-07-08 20:14:35 +02:00
Henri Verbeet
949cd089d5
wined3d: Trace the D3D shader in find_glsl_vshader() / find_glsl_pshader().
...
It's quite useful to know to which D3D shader a GLSL shader corresponds.
2009-07-08 20:14:32 +02:00
Henri Verbeet
32fd8f2130
wined3d: checkGLcall() doesn't need a \n.
2009-07-07 11:50:22 +02:00
Henri Verbeet
2ac34bf231
wined3d: Add some missing float suffixes.
...
The compiler should be smart enough to fix most of these, but it looks sloppy.
2009-07-07 11:50:05 +02:00
Henri Verbeet
40bc47901c
wined3d: Use flags for driver quirks.
2009-07-01 11:41:44 +02:00
Stefan Dösinger
d5e2c14225
wined3d: Add a NOP ret handler to GLSL.
2009-06-29 12:28:49 +02:00
Francois Gouget
5aac7fe783
wined3d: Add a trailing '\n' to a FIXME() trace.
2009-06-26 14:40:21 +02:00
Henri Verbeet
7363b6e2e3
wined3d: Document GL context dependencies.
2009-06-26 12:05:07 +02:00
Tobias Jakobi
a9f912466b
wined3d: Force NP2 fixup constant reloading in shader_glsl_select.
2009-06-25 14:34:13 +02:00
Tobias Jakobi
ef7f769be6
wined3d: Enable constant packing for NP2 texcoord fixup.
...
Previously every texture that was flagged for NP2 fixup used a vec2
uniform in the shader to store texture dimensions. Turns out that the
GLSL compilers just maps vec2 to vec4, so essentially wasting 2
floats. The new code only uses vec4 uniforms but packs dimensions info
of 2 textures into a single uniform.
2009-06-25 14:34:13 +02:00
Tobias Jakobi
7906774339
wined3d: Add ps_np2fixup_info structure.
2009-06-25 14:34:13 +02:00
Stefan Dösinger
95788401af
wined3d: GLSL 1.20 includes gl_FragData[] syntax.
...
This means we don't have to enable ARB_draw_buffers explicitly.
2009-06-22 11:27:20 +02:00
Henri Verbeet
2c009e4d87
wined3d: Only initialize unused components of varyings that are read.
2009-06-17 12:13:07 +02:00
Stefan Dösinger
298bd3c50d
wined3d: Store the bumpmap ARB constants in ARB structures.
2009-06-10 11:51:49 +02:00
Henri Verbeet
fcf6a27a9b
wined3d: Simplify some code in set_glsl_shader_program().
2009-06-09 17:01:14 +02:00
Henri Verbeet
a6dc31e442
wined3d: Avoid comparing shader compile args if the relevant shader isn't present.
2009-06-09 17:01:14 +02:00
Henri Verbeet
daeb86d620
wined3d: Don't use the vertex/pixel shader when we're not supposed to.
...
This also avoids removing programs from lists they're not in in
delete_glsl_program_entry().
2009-06-05 14:43:25 +02:00
Henri Verbeet
cae6a32b08
wined3d: Check the result from wine_rb_get() before using it in WINE_RB_ENTRY_VALUE.
2009-06-05 14:43:25 +02:00
Henri Verbeet
37bdcd6b9b
wined3d: Free priv->stack in shader_glsl_free().
2009-06-04 12:18:27 +02:00
Henri Verbeet
ad6279de9f
wined3d: Replace the wined3d hash table with the generic red-black tree.
2009-06-03 11:40:14 +02:00
Henri Verbeet
812ee5208c
wined3d: Partially revert 7433eb76b5
.
...
The write mask sizes for the input and output semantics can be different,
resulting in compilation failure.
2009-06-02 11:57:22 +02:00
Henri Verbeet
7433eb76b5
wined3d: Use the proper OUT swizzle in handle_ps3_input().
2009-05-29 11:26:54 +02:00
Henri Verbeet
d37472f27b
wined3d: Add missing ActivateContext calls to shader_destroy() implementations.
2009-05-29 11:26:32 +02:00
Stefan Dösinger
e492dd858e
wined3d: Add a function around the handler table.
...
This reduces the number of methods in the shader backend(the instr
modifiers can be handled in that wrapper) and it will help flow
control emulation in the ARB backend.
2009-05-28 12:45:45 +02:00
Stefan Dösinger
aad92c0780
wined3d: Manage vs_compile_args in the backends.
2009-05-28 12:45:32 +02:00
Stefan Dösinger
814dd42f25
wined3d: Manage ps_compiled_shader in the backends.
2009-05-28 12:45:21 +02:00
Stefan Dösinger
8763f6eac5
wined3d: Make find_gl_vshader backend specific.
2009-05-28 12:45:10 +02:00
Stefan Dösinger
732a9a15d5
wined3d: Remove the forward declaration added in the last patch.
2009-05-28 12:44:59 +02:00
Stefan Dösinger
d0d681c81e
wined3d: Make find_gl_pshader backend private.
2009-05-28 12:44:43 +02:00
Stefan Dösinger
5865d9c01b
wined3d: Store the compile args in the compile context, not the shader.
2009-05-28 12:44:22 +02:00
Henri Verbeet
2ee0d47a49
wined3d: Use strings for shader input/output semantics.
2009-05-27 11:12:12 +02:00
Henri Verbeet
e6efb797c3
wined3d: Make "packed_output" a bitmap.
2009-05-27 11:11:57 +02:00
Henri Verbeet
10fadadc54
wined3d: Use the "input_registers" bitmap for vertex shader attributes as well.
2009-05-27 11:11:53 +02:00
Henri Verbeet
664b17b9ee
wined3d: Make "packed_input" a bitmap.
2009-05-27 11:11:48 +02:00
Henri Verbeet
2153b4d998
wined3d: Split the info log into separate lines.
2009-05-26 13:49:50 +02:00
Stefan Dösinger
7b1d48721d
wined3d: Emulate the 4 component address register in ARB.
2009-05-20 10:55:17 +02:00
Stefan Dösinger
2cb8f42168
wined3d: Support clipplanes with GLSL.
...
This is the Nth attemt to make clipping work with GLSL shaders. The patch now
uses the GLSL quirk table to handle cards that need a custom varying for
gl_ClipPos, and the code is adapted to the changed state table and shader
backend system.
2009-05-18 13:59:16 +02:00
Henri Verbeet
b35e469d9d
wined3d: Document functions that depend on the caller to do GL locking.
2009-05-15 10:25:41 +02:00
Henri Verbeet
12c4af8dd8
wined3d: Add missing GL locking to delete_glsl_program_entry() calls.
2009-05-14 11:12:30 +02:00
Henri Verbeet
b7ac22004f
wined3d: Add missing GL locking to shader_backend_t.shader_select() calls.
2009-05-13 12:01:57 +02:00
Henri Verbeet
59689262e7
wined3d: Add missing GL locking to shader_backend_t.shader_free_private() implementations.
2009-05-13 12:01:48 +02:00
Henri Verbeet
cad271f13d
wined3d: Print the correct limit in a WARN().
2009-05-12 11:18:08 +02:00
Stefan Dösinger
2fd485ae31
winedd: Move shader_*_add_instruction_modifiers into the shader backend.
2009-05-08 12:20:18 +02:00
Henri Verbeet
69cbb57bfd
wined3d: Add support for immediate constants to the GLSL backend.
2009-05-08 12:13:49 +02:00
Henri Verbeet
96005c0fca
wined3d: Pass a struct wined3d_shader_register to shader_is_scalar().
2009-05-08 12:13:46 +02:00
Henri Verbeet
4a18697246
wined3d: Pass a struct wined3d_shader_register to shader_glsl_get_register_name().
2009-05-08 12:13:40 +02:00
Henri Verbeet
448dc84b6e
wined3d: Fix shader_glsl_get_register_name() indentation.
2009-05-08 12:13:33 +02:00
Henri Verbeet
5e473cb17f
wined3d: Group register information into struct wined3d_shader_register.
2009-05-08 12:13:17 +02:00
Henri Verbeet
69861b8fed
wined3d: Increase the size of glsl_src_param_t.param_str.
...
It constains the register name plus potential modifiers, so it should be
larger than reg_name instead of smaller.
2009-05-07 14:44:22 +02:00
Henri Verbeet
65622a052c
wined3d: Create a struct wined3d_shader_version to store version information.
...
The version tokens in SM1-3 and SM4 are similar, but not the same.
2009-05-07 14:44:21 +02:00
Stefan Dösinger
f5e24f7a85
wined3d: Implement texldd.
...
GL_ARB_shader_texture is supported on dx9 ATI cards(and probably dx10
ones too). For Nvidia cards I included a fallback to normal texld.
GL_EXT_gpu_shader4 supports similar texture*Grad GLSL functions, just
with an EXT prefix instead of ARB. For dx9 NV cards we'd have to use
GL_NV_fragment_program2, which supports a texldd equivalent on those
cards.
2009-05-05 14:12:52 +02:00
Henri Verbeet
2a5a6a3439
wined3d: Store the SM 1-3 opcode information tables in the SM 1-3 frontend.
2009-05-05 11:34:28 +02:00
Henri Verbeet
2378108eb9
wined3d: Create a frontend for parsing shaders.
2009-05-04 12:53:08 +02:00
Stefan Dösinger
10ad2e8e03
wined3d: Hardcode local loop control ints into the code in reps.
...
This helps the compiler to unroll the loop and dodges a crash on OSX. It is
similar to what we do in "loop aL, iX" already.
2009-04-29 13:35:54 +02:00
Henri Verbeet
8d4c90496f
wined3d: Store the sampler type in struct shader_reg_maps.
...
Instead of the usage token.
2009-04-29 13:08:01 +02:00
Henri Verbeet
b8b12d2dc2
wined3d: Mask set bool/int constants with bool/int constants read.
2009-04-28 13:10:02 +02:00
Henri Verbeet
e001876163
wined3d: Create a separate function to record register usage.
2009-04-28 13:10:02 +02:00
Stefan Dösinger
7ab6c22f5a
wined3d: Support the full amount of constants in GLSL.
...
This patch advertises all GL reported float uniforms to the D3D app to
reach the 256 constants required by Shader Model 3.0 on dx9 cards. If
the shader does not use indirect addressing, all 256 constants are
declared. The compiler can then figure out which constants are
actually used. This makes shaders work that use high constant indices,
but don't use all 256 constants.
2009-04-27 13:24:00 +02:00
Henri Verbeet
35499d0c3c
wined3d: Handle the opcode specific control shift in the frontend rather than the backend.
2009-04-24 11:52:28 +02:00
Henri Verbeet
fec1fa93cf
wined3d: Handle the swizzle shift in the frontend rather than the backend.
2009-04-22 13:14:14 +02:00
Henri Verbeet
baf2f94b76
wined3d: Get rid of the WINED3DVS_* swizzle constants.
...
They're redundant.
2009-04-22 13:14:09 +02:00
Henri Verbeet
629801bccb
wined3d: Get rid of the token field from struct wined3d_shader_src_param.
2009-04-22 13:14:03 +02:00
Henri Verbeet
88c80635c2
wined3d: Pass a struct wined3d_shader_src_param to shader_glsl_get_swizzle().
2009-04-21 14:00:11 +02:00
Henri Verbeet
612c32ea08
wined3d: Add a separate function for converting swizzles to strings.
2009-04-21 14:00:06 +02:00
Henri Verbeet
db5ab97125
wined3d: Store the source swizzle in struct wined3d_shader_src_param.
2009-04-21 14:00:02 +02:00
Henri Verbeet
7f58b906dd
wined3d: Explicitly pass the source modifier to shader_glsl_gen_modifier().
2009-04-21 13:57:04 +02:00
Francois Gouget
5ef481922f
Assorted spelling fixes.
2009-04-20 15:25:26 +02:00
Henri Verbeet
48a096a638
wined3d: Pass a struct wined3d_shader_src_param to shader_glsl_add_src_param().
2009-04-20 14:13:20 +02:00
Henri Verbeet
c7660c57a0
wined3d: Pass a struct wined3d_shader_src_param to shader_glsl_get_register_name() for the relative addressing token.
2009-04-20 14:13:12 +02:00
Henri Verbeet
915b91757f
wined3d: Store the destination relative addressing token as a struct wined3d_shader_src_param.
2009-04-20 14:13:08 +02:00