Commit Graph

3164 Commits

Author SHA1 Message Date
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
Henri Verbeet 5c63d93e18 wined3d: Store the shader version in the frontend's private data. 2009-05-07 14:44:21 +02:00
Henri Verbeet 94cf618658 wined3d: Improve shader_sm4_read_opcode() to handle some simple opcodes. 2009-05-07 14:44:21 +02:00
Stefan Dösinger 4c29105cb2 wined3d: Pack hardcoded local constants in ARB.
This makes the location of used program.local parameters more
predictable and eases sharing this space with other private constants.
2009-05-06 13:12:45 +02:00
Henri Verbeet 9381a41681 wined3d: Add an initial shader_sm4_read_src_param() implementation. 2009-05-06 12:21:05 +02:00
Henri Verbeet 7f9cde5a31 wined3d: Add an initial shader_sm4_read_dst_param() implementation. 2009-05-06 12:21:02 +02:00
Henri Verbeet 699eae0cf7 wined3d: Shift the writemask in the frontend. 2009-05-06 12:20:57 +02:00
Henri Verbeet 2576bf3ddd wined3d: Fix some more indentation. 2009-05-06 12:20:50 +02:00
Henri Verbeet 46b4c15a31 wined3d: Remove some redundant code. 2009-05-06 12:20:39 +02:00
Stefan Dösinger df5d82dd5b wined3d: Pack ARB srgb constants better.
There's no need to waste constants for repeatedly loading the same value.
2009-05-05 14:13:20 +02:00
Stefan Dösinger d2e12a19ca wined3d: Make use of GL_ARB_half_float_vertex.
This extension is a subset of GL_NV_half_float that defines support
for the stream format(same constant), but doesn't define texture
formats or immediate mode entrypoints.
2009-05-05 14:13:02 +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 454dd2ed07 wined3d: Implement shader_sm4_is_end(). 2009-05-05 11:34:39 +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 15a2a5eea6 wined3d: Add a minimal implementation of shader_sm4_read_opcode(). 2009-05-05 11:34:21 +02:00
Henri Verbeet 868f5bfc7c wined3d: Handle reading the shader header in the frontend.
In SM 1-3 this is just the version, in SM4 this also includes the token count.
2009-05-05 11:34:15 +02:00
Henri Verbeet ef074cdde1 wined3d: Introduce a stubbed SM4 shader frontend. 2009-05-05 11:34:07 +02:00
Henri Verbeet dddd1f0211 wined3d: Select the frontend based on the version token. 2009-05-04 12:53:16 +02:00
Henri Verbeet 5f96c0083a wined3d: Add a frontend function to determine if there are any tokens left. 2009-05-04 12:53:12 +02:00
Henri Verbeet 2378108eb9 wined3d: Create a frontend for parsing shaders. 2009-05-04 12:53:08 +02:00
Henri Verbeet 5a7afd9b2a wined3d: Move SM 1-3 parsing functions to their own file. 2009-05-04 12:53:04 +02:00
Henri Verbeet 6eb43e35c9 wined3d: Get rid of the remaining WINED3DSP_REGNUM_MASK usage. 2009-05-04 12:52:59 +02:00
Henri Verbeet 5e072395b4 wined3d: Avoid using WINED3DSP_REGNUM_MASK in the def/defi/defb handlers. 2009-05-01 13:12:08 +02:00
Henri Verbeet a605fcd2fd wined3d: Introduce shader_sm1_read_comment() to read shader comments. 2009-05-01 13:12:04 +02:00
Henri Verbeet 7420a96736 wined3d: Merge wined3d_private_types.h into wined3d_private.h. 2009-05-01 13:11:57 +02:00
Henri Verbeet 59705b9c20 wined3d: Use the shader_sm1_read_*() functions in shader_trace_init(). 2009-05-01 13:11:42 +02:00
Henri Verbeet 752d80400d wined3d: Merge shader_dump_arr_entry() into shader_dump_register(). 2009-05-01 13:11:37 +02:00
Henri Verbeet 53169b98d2 wined3d: Define GL_FENCE_APPLE to the correct value. 2009-04-30 12:48:03 +02:00
Henri Verbeet bf4f7bf34a wined3d: Split shader_dump_param() in shader_dump_src_param() and shader_dump_dst_param(). 2009-04-30 12:47:59 +02:00
Henri Verbeet 54a3054e5a wined3d: Pass a struct wined3d_shader_semantic to shader_dump_decl_usage(). 2009-04-30 12:47:56 +02:00
Henri Verbeet 032b8d4c02 wined3d: Explicitly pass register type, index, etc. to shader_dump_param(). 2009-04-30 12:47:52 +02:00
Henri Verbeet 18df05eb34 wined3d: Explicitly pass the register type and index to shader_get_float_offset(). 2009-04-30 12:47:44 +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 88b6d5eb0b wined3d: Relative addressing tokens are always source parameters.
So the "is_src" argument to shader_dump_arr_entry() is redundant (and wrong).
2009-04-29 13:08:29 +02:00
Henri Verbeet 52644ab053 wined3d: The "input" parameter to shader_dump_param() should be a BOOL.
It's used to determine if the token is a source or destination parameter. A
subsequent patch will split shader_dump_param() in two different functions.
2009-04-29 13:08:22 +02:00
Henri Verbeet 42a8041cb8 wined3d: Handle the sampler type shift in the frontend. 2009-04-29 13:08:14 +02:00
Henri Verbeet 65321dd1ce wined3d: Introduce shader_sm1_read_semantic(). 2009-04-29 13:08:08 +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
Stefan Dösinger 25a59fe71b wined3d: Set the max mipmap level in the pbo test.
fglrx refuses to use PBOs on not mipmap complete textures. The texture code
already takes care of this, do the same in the test.
2009-04-28 13:10:03 +02:00
Stefan Dösinger 8513f64a01 wined3d: Emulate R16G16F and R32G32F if GL_ARB_texture_rg is not supported.
Nvidia doesn't offer it on geforce 7 and earlier cards, but some games need
it. This is surprising because the extension was made specifically for
compatibility purposes for older cards.
2009-04-28 13:10:03 +02:00
Stefan Dösinger 1fbc6e560d wined3d: Fix an issue in buffer_get_sysmem.
Checking for the doublebuffer flag can cause confusion if no VBO has
been allocated for the buffer. Checking for allocatedMemory is the
more direct approach.
2009-04-28 13:10:03 +02:00
Stefan Dösinger 926fe798c5 wined3d: Activate a thread before mapping a buffer.
This fixes a regression in EverQuest 2.
2009-04-28 13:10:02 +02:00
Stefan Dösinger 3dc55010ea wined3d: Fix a few more direct buffer accesses. 2009-04-28 13:10:02 +02:00
Henri Verbeet d32d308798 wined3d: Remove some redundant defines. 2009-04-28 13:10:02 +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 9db67a5971 wined3d: Clear reg_maps in shader_get_registers_used() instead of the callers. 2009-04-28 13:10:02 +02:00
Henri Verbeet 0df4514894 wined3d: Use shader_sm1_read_dst_param() and shader_sm1_read_src_param() in shader_get_registers_used(). 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
Henri Verbeet abc253f52f wined3d: Add a function to read a destination parameter from SM1-3 bytecode. 2009-04-27 13:25:26 +02:00
Henri Verbeet 4e97e430d9 wined3d: Add a function to read a source parameter from SM1-3 bytecode. 2009-04-27 13:25:21 +02:00
Henri Verbeet 15953b94b6 wined3d: Use shader_sm1_read_opcode() in shader_trace_init(). 2009-04-27 13:25:16 +02:00
Henri Verbeet 2b07565d6e wined3d: Store D3D shader opcode names in a separate table. 2009-04-27 13:25:09 +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
Stefan Dösinger 9f1731edb6 d3d: Limit d3d8 and d3d9 vshader constants to 256.
DX10 cards support 512(ATI) or 1024(Nvidia) vertex shader constants in
GL. The dx9 DXCapsViewer shows that dx10 windows drivers only claim
256 constants on Windows, so we can and should do the same.
2009-04-27 13:23:36 +02:00
Henri Verbeet 19b84ffda1 wined3d: Use shader_sm1_read_opcode() in shader_get_registers_used(). 2009-04-24 11:53:18 +02:00
Henri Verbeet 521fcf11db wined3d: Add a function to read an opcode from SM1-3 bytecode. 2009-04-24 11:53:12 +02:00
Henri Verbeet e63bd2ce21 wined3d: The first shader token should be the version token. 2009-04-24 11:53:00 +02:00
Henri Verbeet 2dcfdd5b55 wined3d: Use a more reasonable limit for the number of mipmap levels.
256 is quite ridiculous, considering the dimensions are only UINTs. Perhaps
these arrays should be dynamically allocated in the first place though.
2009-04-24 11:52:51 +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
David Adam 33eb939390 wined3d: SetDepthStencilSurface is always called when AutoDepthStencil is enabled. 2009-04-24 11:51:27 +02:00
Francois Gouget 6376941266 wined3d: Avoid using an implicit value to set fogcoord to 0.0. 2009-04-23 18:14:27 +02:00
Henri Verbeet 6f33b97c94 wined3d: Get rid of the shared_handle parameter.
I don't expect us to support this in the near future, and right now it's just
dead code.
2009-04-23 14:22:06 +02:00
Henri Verbeet f88bd17ef6 wined3d: Downgrade an ERR to a WARN. 2009-04-23 14:22:06 +02:00
Henri Verbeet fba6f871cf wined3d: Move frontend specfic constants to baseshader.c. 2009-04-23 14:22:06 +02:00
Henri Verbeet d6494ad00c wined3d: Move some frontend specfic code to baseshader.c. 2009-04-23 14:22:06 +02:00
Henri Verbeet fc60083ed2 wined3d: Handle the destination modifier shift in the frontend rather than the backend. 2009-04-23 14:22:06 +02:00
Henri Verbeet cf1bfc8c68 wined3d: Handle the source modifier shift in the frontend rather than the backend. 2009-04-22 13:14:26 +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 7a3d4ce76f wined3d: Pass a struct wined3d_shader_src_param to shader_arb_get_swizzle(). 2009-04-22 13:13:57 +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
Henri Verbeet 644439ff0d wined3d: Pass a struct wined3d_shader_src_param to pshader_gen_input_modifier_line(). 2009-04-21 13:56:58 +02:00
Stefan Dösinger de4f3dc8e8 wined3d: Merge match_apple and implementation_is_apple. 2009-04-20 16:39:55 +02:00
Stefan Dösinger 39877a2ad2 wined3d: Reserve additional GLSL constants on some drivers.
Some drivers apparently need private constants, or don't have an efficient
immval packing. For example, MacOS seems to need 1 float for each different
relative addressing offset. fglrx has the same issue, although it is more
efficient in general

Previously this worked on most drivers because the 16 + 4 reserved int and
bool constants kept the problem hidden. Now that we are more aggressive with
uniforms we have to keep free room for some drivers.
2009-04-20 16:38:39 +02:00
Stefan Dösinger 78d26a659d wined3d: Move the remaining quirks into the quirk table. 2009-04-20 16:38:07 +02:00
Stefan Dösinger 50e91f8d84 wined3d: Move the generic mac glsl uniform fixup to the quirk table. 2009-04-20 16:37:46 +02:00
Stefan Dösinger 7b7f027221 wined3d: Add a more formal framework for driver quirks.
This allows better defining of driver desc fixups without adding extra if
lines for each card.

For starters, there's a fixup for the advertised GLSL constants in ATI cards.
fglrx advertises 512 GLSL uniforms instead of the supported 1024(means 128
instead of 256 vec4's). This bug was confirmed by ATI.
2009-04-20 16:37:31 +02:00
Francois Gouget 5ef481922f Assorted spelling fixes. 2009-04-20 15:25:26 +02:00
Henri Verbeet ea0b3b42eb wined3d: Pass a struct wined3d_shader_src_param to shader_arb_add_src_param(). 2009-04-20 14:13:33 +02:00
Henri Verbeet 1ae060be4a wined3d: Simplify replicating the .x swizzle in shader_hw_mov().
It becomes even simpler once the swizzle shift and token field are eliminated.
2009-04-20 14:13:28 +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
Henri Verbeet 0663eb9323 wined3d: Store the source relative addressing token as a struct wined3d_shader_src_param. 2009-04-20 14:13:00 +02:00
Henri Verbeet d6ee7d59a8 wined3d: Create a relative addressing token for 1.x shaders in the frontend.
Rather than handling this in the backends. Note that the ARB backend always
assumes 1.x shaders.
2009-04-20 14:12:52 +02:00
Henri Verbeet 8ac4c98be2 wined3d: Store the source modifiers in struct wined3d_shader_src_param. 2009-04-15 15:57:35 -05:00
Henri Verbeet b6668b0296 wined3d: Store the register index in struct wined3d_shader_src_param. 2009-04-15 15:57:30 -05:00
Henri Verbeet 4de1dba2c5 wined3d: Store the register type in struct wined3d_shader_src_param. 2009-04-15 15:57:25 -05:00
Henri Verbeet ff62cab537 wined3d: Introduce struct wined3d_shader_src_param. 2009-04-15 15:57:19 -05:00
Henri Verbeet 463de24e7b wined3d: Group instruction context information together in struct wined3d_shader_context. 2009-04-15 15:57:13 -05:00
Henri Verbeet a7e2c2d70c wined3d: Don't die if a vertex shader has samplers.
This fixes a regression introduced by 38239be58c.
2009-04-15 15:57:00 -05:00
Henri Verbeet d3fc7dca99 wined3d: Get rid of the "token" field from struct wined3d_shader_dst_param. 2009-04-14 15:25:07 -05:00
Henri Verbeet 18cdcc0b7e wined3d: Pass a struct wined3d_shader_dst_param to shader_arb_get_write_mask(). 2009-04-14 15:25:01 -05:00
Roderick Colenbrander f2e2e3e499 wined3d: Report the driver description as reported by the Windows drivers when a device string is entered in our device table. 2009-04-13 17:35:44 -05:00
Roderick Colenbrander c238541656 wined3d: Update Nvidia driver version information. 2009-04-13 17:35:25 -05:00
Tobias Jakobi 0c2514bd8f wined3d: Rename some NP2 fixup variables and update comments. 2009-04-13 17:32:11 -05:00