Henri Verbeet
5f581975dc
wined3d: Introduce surface_init() to handle most of the surface initialization.
2009-06-15 13:42:28 +02:00
Henri Verbeet
bbfdfb2f1f
wined3d: Introduce surface_gdi_cleanup().
2009-06-15 13:42:28 +02:00
Henri Verbeet
32613eb628
wined3d: Introduce surface_cleanup().
2009-06-15 13:42:28 +02:00
Henri Verbeet
7599520321
wined3d: Avoid checking depth/stencil and compressed formats in init_format_fbo_compat_info().
...
Checking these is somewhat pointless since they should never be
color-renderable according to the FBO spec. This patch also happens to avoid
dereferencing a NULL pointer inside fglrx.
2009-06-12 17:33:15 +02:00
Henri Verbeet
669891c817
wined3d: Respect the "srgb" parameter to IWineD3DSurfaceImpl_BindTexture().
...
This is mostly for consistency, standalone surfaces can't be used for
texturing, so in practice "srgb" should always be FALSE in this path.
2009-06-12 17:33:15 +02:00
Henri Verbeet
4bc6b376e0
wined3d: Remove the useless "resource_type" parameter from IWineD3DDevice::CreateSurface().
2009-06-12 17:33:15 +02:00
Henri Verbeet
8f67918f1d
wined3d: Use WINED3DFMT_FLAG_COMPRESSED instead of checking for specific formats.
2009-06-12 17:33:15 +02:00
Henri Verbeet
71e12ae936
wined3d: Use the compressed format info in IWineD3DBaseSurfaceImpl_LockRect().
2009-06-12 17:33:15 +02:00
Rico Schüller
3ea66d6026
wined3d: Don't allow a negative lock_count in buffer_Unmap.
2009-06-11 13:23:25 +02:00
Henri Verbeet
5fbf895da6
wined3d: Use the format info to calculate compressed surface pitch in IWineD3DBaseSurfaceImpl_GetPitch().
2009-06-11 11:53:55 +02:00
Henri Verbeet
da12ac05a4
wined3d: Use the format info to calculate compressed surface size in IWineD3DBaseSurfaceImpl_SetFormat().
2009-06-11 11:53:55 +02:00
Henri Verbeet
e255f971e4
wined3d: Use the format info to calculate compressed surface size in IWineD3DDeviceImpl_CreateSurface().
2009-06-11 11:53:55 +02:00
Henri Verbeet
1ad485ff83
wined3d: Improve some TRACEs in init_format_fbo_compat_info().
2009-06-11 11:53:54 +02:00
Henri Verbeet
b052c6e8aa
wined3d: Remove some redundant s3tc extension checks.
...
If the extension isn't available to surface shouldn't have been created. We
don't do extension checks for all the other formats either.
2009-06-11 11:53:54 +02:00
Stefan Dösinger
3f5936f6f7
wined3d: Don't set unloaded arrays to zero.
...
This causes memory corruption on MacOS, even if the app does not
reference undeclared arrays. Trying to avoid potential breakage in
broken apps which provoke undefined behavior is pointless if it causes
actual breakage in well-behaved apps (on ill-behaved drivers).
2009-06-10 11:52:58 +02:00
Stefan Dösinger
8e259d9fcd
wined3d: A small atifs bump map improvement.
...
Thanks to Roland Scheidegger from Tungsten Graphics for the suggestion to
replace the 2 movs + dp2add with two MADs, where one can conveniently be
coissued with the other dp2add.
2009-06-10 11:52:24 +02:00
Stefan Dösinger
258d99d289
wined3d: Implement dsy in ARB.
2009-06-10 11:52:15 +02:00
Stefan Dösinger
51cdc9d361
wined3d: Implement loops with the NV extensions.
2009-06-10 11:52:01 +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
e83fa982ca
wined3d: Use the format info for doing compressed surface blits in BltFast().
2009-06-10 11:51:12 +02:00
Henri Verbeet
61fd875bb4
wined3d: Store compression information about compressed formats.
2009-06-10 11:51:04 +02:00
Henri Verbeet
9d71a5f1e0
wined3d: Round rows up to whole blocks for compressed surface blits in BltFast().
2009-06-10 11:50:57 +02:00
Henri Verbeet
a25e63c62d
wined3d: Check the correct extensions in d3dfmt_get_conv().
...
According to Stefan these are either typos or leftovers from using GL_HILO8_NV.
2009-06-10 11:50:44 +02:00
Henri Verbeet
5ac8a7b054
wined3d: Set explicitly sized internal formats for color key conversion in d3dfmt_get_conv().
2009-06-10 11:50:31 +02:00
Henri Verbeet
910455e435
wined3d: Add some FIXMEs about blitting with unsupported fixups.
2009-06-09 17:01:14 +02:00
Henri Verbeet
621da64245
wined3d: Get rid of the silly pointers in WINED3DVOLUME_DESC.
2009-06-09 17:01:14 +02:00
Henri Verbeet
08d95233e3
wined3d: Don't modify the internal format in d3dfmt_get_conv().
...
For most conversions the internal format is irrelevant. Color key conversions
are an exception, because they need to ensure an alpha channel is present.
2009-06-09 17:01:14 +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
Frank Richter
6136884120
d3d9: Fix bitmask for A2R10G10B10 format.
2009-06-08 16:22:18 +02:00
Gerald Pfeifer
6d1a76fb10
wined3d: Fix (and simplify) the ATI case in IWineD3DImpl_FillGLCaps.
2009-06-08 14:29:01 +02:00
Gerald Pfeifer
7856ac3c19
wined3d: Use & instead of && for bit test in IWineD3DDeviceImpl_CreateSurface().
2009-06-08 14:28:54 +02:00
Henri Verbeet
7422babd88
wined3d: Set FBO stencil attachments for relevant depth stencil formats.
2009-06-08 12:44:27 +02:00
Henri Verbeet
a2244051ef
wined3d: Use context_attach_depth_stencil_fbo() to clear FBO depth attachments.
2009-06-08 12:44:22 +02:00
Henri Verbeet
13aea3a131
wined3d: Use GL_DEPTH32F_STENCIL8 for WINED3DFMT_D24FS8.
2009-06-08 12:44:17 +02:00
Henri Verbeet
4bc2180821
wined3d: Use GL_DEPTH_COMPONENT32F for WINED3DFMT_D32F_LOCKABLE.
2009-06-08 12:44:13 +02:00
Henri Verbeet
d3bc045f26
wined3d: Add support for the ARB_depth_buffer_float extension.
2009-06-08 12:44:08 +02:00
Henri Verbeet
f8c4832276
wined3d: Use GL_DEPTH24_STENCIL8_EXT for depth stencil formats.
2009-06-05 15:19:56 +02:00
Henri Verbeet
d08f4fb5f5
wined3d: Add support for EXT_packed_depth_stencil.
2009-06-05 15:19:56 +02:00
Henri Verbeet
a5876bb91e
wined3d: Use FBOs for offscreen rendering by default.
2009-06-05 15:19:40 +02:00
Henri Verbeet
fb7531599f
wined3d: Only use stretch_rect_fbo() on surfaces that are FBO attachable.
2009-06-05 15:19:35 +02:00
Henri Verbeet
786408fb95
wined3d: Check FBO compatibility on all formats with a GL format.
...
Instead of just the ones that have a fallback specified.
2009-06-05 14:43:25 +02:00
Henri Verbeet
b93c3b3253
wined3d: Set texture filtering to NEAREST in check_fbo_compat().
2009-06-05 14:43:25 +02:00
Henri Verbeet
0571ebcee3
wined3d: Add extension detection to the GL format template table.
2009-06-05 14:43:25 +02:00
Henri Verbeet
a2440aed7e
wined3d: Add extension detection for ARB_depth_texture.
2009-06-05 14:43:25 +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
a44f84fdf7
wined3d: Add a proper enum value for "no extension".
...
This would allow an extension check for ARB_COLOR_BUFFER_FLOAT to work.
2009-06-04 12:19:02 +02:00
Henri Verbeet
0a059aafbe
wined3d: Check FBO compatibility after the fixups are applied.
2009-06-04 12:18:47 +02:00
Henri Verbeet
faaea93573
wined3d: Remove WINED3DFMT_R16G16B16A16_SNORM from the GL formats template.
...
This entry obviously can't work correctly.
2009-06-04 12:18:42 +02:00
Henri Verbeet
0cf49767ad
wined3d: Remove entries without an internal format from the GL formats template.
2009-06-04 12:18:33 +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
97f320a77b
wined3d: Introduce volumetexture_init() to handle most of the volume texture initialization.
2009-06-03 11:39:16 +02:00
Henri Verbeet
9e69b86a03
wined3d: Introduce volumetexture_cleanup().
2009-06-03 11:39:09 +02:00
Henri Verbeet
b0ba731bd5
wined3d: Introduce cubetexture_init() to handle most of the cube texture initialization.
2009-06-03 11:39:04 +02:00
Henri Verbeet
aabb51286d
wined3d: Introduce cubetexture_cleanup().
2009-06-03 11:38:55 +02:00
Henri Verbeet
5171a65d81
wined3d: Introduce texture_init() to handle most of the 2D texture initialization.
2009-06-03 11:38:50 +02:00
Stefan Dösinger
2afcb794f2
wined3d: Implement clipplanes in the ARB backend.
...
Using GL_NV_vertex_program2_option so far. If we're really desparate we can
handle some cases without the extension by using a custom varying and texkill
in the fragment program.
2009-06-02 12:09:54 +02:00
Stefan Dösinger
1276b090b4
wined3d: Update clipplanes on a shader-fixed function switch.
...
The view matrix that was set at the time the clipplane was applied is
hardcoded into the clipplane. With vertex shaders clip planes ignore
the view matrix in d3d. We implement that, but this also means that
the clip planes potentially change when we switch between vs and fixed
func.
2009-06-02 12:09:46 +02:00
Stefan Dösinger
dfc9141458
wined3d: Use condition code for sRGB write correction if available.
...
This gives a small performance improvement. Don't enable NVfp for it though,
because the NVfp penalty is bigger than the gain from this patch. But if NVfp
is enabled anyway, make use of it.
2009-06-02 12:09:38 +02:00
Stefan Dösinger
7e1100d0e4
wined3d: Handle LRP in vertex shaders.
...
The ARB "LRP" instruction is a fragment program only instruction. It is
however valid in vs_2_0+ vertex shaders, so we have to emulate it.
2009-06-02 12:09:26 +02:00
Henri Verbeet
22022cf8b3
wined3d: Create a texture_cleanup() function.
2009-06-02 11:57:22 +02:00
Henri Verbeet
451a416fcf
wined3d: Call resource_init() from basetexture_init().
2009-06-02 11:57:22 +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
Stefan Dösinger
38076e08ca
wined3d: Add a comment about texbem and X2D.
2009-06-01 16:16:00 +02:00
Stefan Dösinger
de12f880ce
wined3d: Don't enable the NV frag extensions if we don't need them.
...
Enabling the NV extensions occupies a temp register for some reason. Avoid
needlessly enabling it.
2009-06-01 16:16:00 +02:00
Stefan Dösinger
5a07bacd36
wined3d: Write result.color in one mov.
...
Otherwise the Nvidia assembler needs one temp reg.
2009-06-01 16:16:00 +02:00
Stefan Dösinger
050735be79
wined3d: Revert "WineD3D: use CMP instead of SLT and SGE in sRGB correction".
...
This reverts patch ba35760f9f
.
The original patch did not achive its goal, because CMP is a macro that is
expanded to SLT, SGE, MUL, MAD, at least on nvidia hardware. To make matters
worse, it uses a temporary register, and the assembler usually is not clever
enough to find a free temporary from the shader code. If we generate the code
outselves we can pick one of our temps for this job.
2009-06-01 16:16:00 +02:00
Stefan Dösinger
8665ee5906
wined3d: Use Rx registers for sRGB correction if possible.
...
This removes another reason to declare TA, TB and TC.
2009-06-01 16:16:00 +02:00
Stefan Dösinger
7168b62323
wined3d: Use NRM from GL_NV_fragment_program2 if available.
2009-05-29 11:27:51 +02:00
Stefan Dösinger
d8e219be75
wined3d: Avoid the TMP_COLOR mov in some cases.
...
Many 2.0 and 3.0 shaders end with a "mov oC0, rx". If sRGB writing is enabled,
the ARB backend writes to a TMP_COLOR temporary, and at the end of the shader
writes the sRGB corrected color to result.color. If oC0 is not partially
rewritten after the mov, we can ignore the mov, not declare TMP_COLOR at all,
and just use the rx register as input for the sRGB correction code. This saves
a temporary and an instruction.
2009-05-29 11:27:44 +02:00
Stefan Dösinger
da7176be2a
wined3d: Use DP2A or X2D for dp2add if available.
2009-05-29 11:27:29 +02:00
Stefan Dösinger
e2be741bc0
wined3d: Remove a MESA hack.
2009-05-29 11:27:23 +02:00
Stefan Dösinger
5f723bc44a
wined3d: Allocate the proper size for the lconst map.
2009-05-29 11:27:14 +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
5654544725
wined3d: Add device resources from resource_init().
...
This is consistent with removing them from resource_cleanup().
2009-05-29 11:26:44 +02:00
Henri Verbeet
5e0f541621
wined3d: Remove ResourceReleased() from the public device interface.
2009-05-29 11:26:38 +02:00
Henri Verbeet
d37472f27b
wined3d: Add missing ActivateContext calls to shader_destroy() implementations.
2009-05-29 11:26:32 +02:00
Louis Lenders
06936f04c0
wined3d: Fix CheckDeviceMultiSampleType when queried with D3DMULTISAMPLE_NONE.
2009-05-28 15:02:08 +02:00
Stefan Dösinger
e70c80add9
wined3d: Emulate if(bool) in ARB shaders.
2009-05-28 12:46:01 +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
13a05caa97
wined3d: Remove the "declaration" parameter to IWineD3DDeviceImpl_CreateVertexShader().
...
Once upon a time this was used for creating fake vertex shader
attribute semantics for d3d8 shaders. We don't need this anymore since
device_stream_info_from_declaration() will use the vertex
declaration's output slot to load the data, if present. That also
avoids the potentially expensive matching of attribute semantics
between vertex shader and declaration for d3d8.
2009-05-28 12:42:18 +02:00
Henri Verbeet
fcf7844653
wined3d: Match the d3d10 name for WINED3DDECLUSAGE_POSITION.
...
I.e., make sure that if a SM4 shader uses SV_POSITION it ends up as position
data.
2009-05-28 12:42:18 +02:00
Henri Verbeet
3925cd5f15
wined3d: Use the output signature to setup SM4 vertex shader output semantics.
2009-05-28 12:42:18 +02:00
Stefan Dösinger
0629585c24
wined3d: Work around an ARBFP vs GLSL bug in Mac OS.
2009-05-27 11:57:54 +02:00
Stefan Dösinger
6492622350
wined3d: sincos for vertex shaders.
...
SCS is unfortunately a fragment program only instruction. If we have the NV
extensions we can use SIN and COS. Otherwise we have to approximate sine and
cosine with a taylor series. Luckily we're provided with the necessary
constants by the application.
2009-05-27 11:56:53 +02:00
Stefan Dösinger
2f3faf4526
wined3d: Put some ARB declarations in the right place.
...
TMP_POS is only used in vertex shaders, declare it in the vshader
specific code. The sRGB constants are only used by pixel shaders, so
move them to the ps specific code, and avoid reading the stateblock.
2009-05-27 11:56:29 +02:00
Stefan Dösinger
f484cbbf91
wined3d: Get rid of Tx hardcoding in texbem.
2009-05-27 11:56:07 +02:00
Stefan Dösinger
da1b8d0c8e
wined3d: Replace a few hardcoded Tx registers with proper name getters.
2009-05-27 11:56:01 +02:00
Stefan Dösinger
7fc4279cb8
wined3d: Implement DSX in ARB.
...
DSY is not that easy because we have to deal with the inverted coordinate
system in onscreen(!) rendering - see GLSL dsy.
2009-05-27 11:55:52 +02:00
Henri Verbeet
2ee0d47a49
wined3d: Use strings for shader input/output semantics.
2009-05-27 11:12:12 +02:00
Henri Verbeet
19cb4594e3
wined3d: Use a separate structure for vertex shader attributes.
...
In D3D10 shaders input/output semantics are strings rather than predefined
types. Unfortunately, the code in vshader_get_input() can be performance
critical, depending on application behaviour. Since vshader_get_input() is
only relevant for d3d9 shaders anyway, just store the usage and usage_idx for
these shaders.
2009-05-27 11:12:07 +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
1ccfab171f
wined3d: Use SM3 shader limits for SM4.
...
This isn't completely right, since as far as I'm aware SM4 doesn't have shader
limits in the same sense as previous shader models, but this should do for now.
2009-05-26 13:50:08 +02:00
Henri Verbeet
f0e303b0f2
wined3d: Add the output signature to IWineD3DDevice_CreateVertexShader().
2009-05-26 13:49:55 +02:00
Henri Verbeet
2153b4d998
wined3d: Split the info log into separate lines.
2009-05-26 13:49:50 +02:00
Henri Verbeet
1d7845dd33
wined3d: Pass a proper format desc to resource_init() in IWineD3DDeviceImpl_CreateBuffer().
2009-05-26 13:49:37 +02:00
Louis Lenders
f55522ab6b
wined3d: Match device name string to windows one.
2009-05-25 14:21:56 +02:00
Henri Verbeet
6a9212a1b2
wined3d: Fix debug_d3dusagequery() to handle combinations of flags.
2009-05-25 11:23:53 +02:00
Henri Verbeet
7c2e91c592
wined3d: Fix debug_d3dusage() to handle combinations of flags.
2009-05-25 11:23:47 +02:00
Henri Verbeet
f347374470
wined3d: Remove some apparently leftover debug code.
2009-05-25 11:23:39 +02:00
Henri Verbeet
85107d81f4
wined3d: Remove some unnecessary forward declarations.
2009-05-25 11:23:32 +02:00
Chris Robinson
12799db349
wined3d: Decrement fbo_entry_count when one is removed from the list.
2009-05-25 11:22:25 +02:00
Chris Robinson
1d757fd6da
wined3d: Prevent erroneous FIXMEs on newer cards.
...
Cards that have 12 or more combined samplers can trigger a fixme if they have
the same amount of vertex samplers, even though it's plenty enough.
2009-05-25 11:22:13 +02:00
Stefan Dösinger
122af07a30
wined3d: Implement SGN in ARB.
2009-05-21 16:17:52 +02:00
Stefan Dösinger
8e45e48b0c
wined3d: Support vec4 A0 with NV_vertex_program2_option.
2009-05-21 16:17:52 +02:00
Stefan Dösinger
d0756ee537
wined3d: Support ABS and ABSNEG with NV extensions if available.
2009-05-21 16:17:52 +02:00
Stefan Dösinger
01ec5068e2
wined3d: Add NV asm extension support to the ARB backend.
2009-05-21 16:17:51 +02:00
Stefan Dösinger
60f20a2f39
wined3d: Support ABS and ABSNEG in ARB.
2009-05-21 16:17:51 +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
72e9e80f6e
wined3d: Prepare for vec4 address registers in ARB.
2009-05-20 10:55:09 +02:00
Stefan Dösinger
c7ca3793cc
wined3d: Implement mova rounding in arb.
2009-05-20 10:55:03 +02:00
Stefan Dösinger
bffb89101f
wined3d: Fix srgb correction.
2009-05-20 10:54:56 +02:00
Stefan Dösinger
e6cc81d287
wined3d: Get rid of the TMP register in fragment shaders.
...
To be able keep the temporary register in the type independent NRM
instruction, the vertex temporary register is renamed to TA to match
the name of a pixel shader register.
2009-05-20 10:54:50 +02:00
Stefan Dösinger
ba35760f9f
wined3d: Use CMP instead of SLT and SGE in sRGB correction.
...
This shortens the code and reduces the amount of temp regs used by 1.
2009-05-19 15:24:48 +02:00
Stefan Dösinger
ad217029b0
wined3d: Get rid of TMP accesses in texm3x3* instructions.
2009-05-19 15:24:39 +02:00
Stefan Dösinger
ced325f816
wined3d: Get rid of TMP access in texm3x2*.
...
texm3x2pad knows which register the following texm3x2depth or tex instruction
will use, and it knows that this register is uninitialized. So use it for
temporary storage instead of TMP.
2009-05-19 15:24:31 +02:00
Stefan Dösinger
17b001788f
wined3d: Get rid of TMP2 and some easy TMP register uses.
...
We have 5 temporary registers declared for private use. We can get rid of two
of them.
2009-05-19 15:24:21 +02:00
Stefan Dösinger
4bf980962a
wined3d: Only declare TMP_OUT in vertex shaders.
2009-05-19 15:24:13 +02:00
Stefan Dösinger
d7f282f241
WineD3D: Support more constants in ARB shaders.
...
GL_LIMIT - 1 for vertex programs and the GL limit in fragment programs. The
indirect addressing limitation in GLSL applies here as well.
2009-05-18 13:59:31 +02:00
Stefan Dösinger
c7839112c9
wined3d: Avoid declaring helper_const in vertex programs if possible.
2009-05-18 13:59:24 +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
Stefan Dösinger
45563979bd
wined3d: Update the bump constants after a shader change.
...
Since we're using local constants now, we have to update the constants after a
shader change.
2009-05-18 13:58:57 +02:00
Stefan Dösinger
3372846aa6
wined3d: Use local constants for bump parameters.
...
This simplifies the loading code a bit. The constants were never
designed to be at the same location in all shaders, so there's no
point in using program.env. This way we don't collide with the d3d
shader constants and its easier to work together with NP2 fixups and
other shaders.
2009-05-18 13:58:47 +02:00
Robert Key
0cea80708f
wined3d: Remove HD 4800 "2048MB for X2 versions" comment.
2009-05-18 13:36:23 +02:00
Robert Key
cce62569df
wined3d: Fix ATI HD4800 being reported as ATI 9500.
2009-05-15 11:55:20 +02:00
Stefan Dösinger
6fe1a5daa5
wined3d: Don't use TMP_COLOR unless srgb is enabled.
...
This was needed unconditionally in the past to apply fog, but since we're
using the ARBfp fog defines it is only needed if an sRGB correction is done
at the end of the shader.
2009-05-15 11:45:18 +02:00
Henri Verbeet
5d63179404
wined3d: Remove some unused defines.
2009-05-15 10:25:48 +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
3022a4a73c
wined3d: Add missing GL locking to check_fbo_compat().
2009-05-15 10:25:32 +02:00
Henri Verbeet
177d883d95
wined3d: Add missing GL locking to ffp_blit_set() and ffp_blit_unset().
2009-05-15 10:25:27 +02:00
Henri Verbeet
5bc449553b
wined3d: Add missing GL locking to d3dfmt_p8_upload_palette().
2009-05-15 10:25:22 +02:00
Stefan Dösinger
0123f81ce5
wined3d: Centralize WINED3DSPDM_SATURATE handling.
...
Besides the cleanup this patch will help to implement D3DSPDM_PARTIALPRECISION
with GL_NV_vertex_program2_option / GL_NV_fragment_program_option.
2009-05-14 14:27:33 +02:00
Stefan Dösinger
aeddd2da63
wined3d: Fix remaining incorrect dst register getters.
2009-05-14 14:27:25 +02:00
Stefan Dösinger
bcb20ae96c
wined3d: Fix a few more hardcoded pixel shader registers.
2009-05-14 14:27:19 +02:00
Stefan Dösinger
2327e316a2
wined3d: Tidy up pshader_hw_texreg2rgb and friends.
2009-05-14 14:27:14 +02:00
Stefan Dösinger
05cc344e7d
wined3d: Tidy up pshader_hw_dp2add.
2009-05-14 14:27:07 +02:00
Henri Verbeet
318fb7036b
wined3d: Add missing GL locking to test_pbo_functionality().
2009-05-14 11:12:57 +02:00
Henri Verbeet
639b258200
wined3d: Add missing GL locking to IWineD3DDeviceImpl_Uninit3D().
2009-05-14 11:12:52 +02:00
Henri Verbeet
e260132701
wined3d: Add missing GL locking to set_blit_dimension() calls.
2009-05-14 11:12:46 +02:00
Henri Verbeet
1070e075e4
wined3d: Add missing GL locking to calls to FBO functions.
2009-05-14 11:12:38 +02:00
Henri Verbeet
12c4af8dd8
wined3d: Add missing GL locking to delete_glsl_program_entry() calls.
2009-05-14 11:12:30 +02:00
Stefan Dösinger
ca1a979c69
wined3d: Tidy up pshader_hw_cmp.
2009-05-13 13:22:16 +02:00
Stefan Dösinger
c06aa361e0
wined3d: Tidy up pshader_hw_cnd.
2009-05-13 13:22:11 +02:00
Stefan Dösinger
90526ce761
wined3d: Separate Tx tempregs from Tx varyings in ARB.
...
ps_1_3 uses Tx to pass in texture coordinates, but also as temporary
registers. ps_1_4 and ps_2_0 only use them for texture coordinates. This patch
gets rid of the Tx = fragment.texcoord[x] assign in all shader versions, and
doesn't even declare Tx in ps_1_4 and ps_2_0.
The <=ps_1_3 instructions know which kind of input they expect from the Tx
register, so the instruction handlers now know if they have to read the
tempreg Tx or the varying fragment.texcoord[x].
2009-05-13 13:22:04 +02:00
Stefan Dösinger
fc5e511dda
wined3d: Fix 1.4 pshader projection in ARB.
...
shader_arb_add_src_param handled DW and TXP undid it again. Remove DZ DW from
the modifiers and handle it in the instruction. DZ cannot be handled by TXP as
is, so move the .z component to .w and make it DW-like. Using SZW+TXP is
likely more efficient than the RCP, MUL, TEX we'd get if we let
shader_arb_add_src_param do the job.
2009-05-13 13:21:43 +02:00
Stefan Dösinger
45799fdc4e
wined3d: Tidy up pshader_hw_tex.
...
Fix the indentation and replace the get_register_name with
shader_arb_get_dst_param.
2009-05-13 13:21:29 +02:00
Francois Gouget
514c5f2648
wined3d: Make surface_force_reload() static.
2009-05-13 12:45:36 +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
7f14ea01c6
wined3d: Add missing GL locking to state table calls.
2009-05-13 12:01:52 +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
b5aee04023
wined3d: Add missing GL locking to fragment_pipeline.enable_extension() implementations.
2009-05-13 12:01:43 +02:00
Henri Verbeet
91c3a5eac1
wined3d: Directly call basetexture_apply_state_changes().
...
All the implementations of IWineD3DBaseTexture::ApplyStateChanges() forward to
basetexture_apply_state_changes().
2009-05-13 11:55:01 +02:00
Rico Schüller
2ef751883d
wined3d: Add UnregisterClass() on DLL_PROCESS_DETACH.
2009-05-12 12:33:57 +02:00
Henri Verbeet
0d446053da
wined3d: Don't create more than WINED3D_MAX_FBO_ENTRIES FBO entries.
...
This essentially turns the FBO entry list into an LRU cache.
2009-05-12 11:18:15 +02:00
Henri Verbeet
cad271f13d
wined3d: Print the correct limit in a WARN().
2009-05-12 11:18:08 +02:00
Henri Verbeet
adc9bfe3fd
wined3d: Pass a struct wined3d_shader_register to shader_record_register_usage().
2009-05-12 11:18:02 +02:00
Henri Verbeet
2039702035
wined3d: Pass a struct wined3d_shader_register to shader_dump_register().
2009-05-12 11:17:56 +02:00
Henri Verbeet
fef4253171
wined3d: Pass a struct wined3d_shader_register to shader_arb_get_register_name().
2009-05-12 11:17:45 +02:00
Stefan Dösinger
601030cfa9
wined3d: Standardize pshader_hw_texkill.
...
Use shader_arb_get_dst_param instead of get_register_name to find the register
name. Even though this adds support for modifiers(which aren't allowed by
native), this shouldn't hurt. If an app passes in an incorrect shader it
should be caught in the frontend.
2009-05-11 12:50:37 +02:00
Stefan Dösinger
5cfbfbc8b3
wined3d: Tidy up shader_hw_rsq_rcp.
2009-05-11 12:50:22 +02:00
Stefan Dösinger
da47f68522
wined3d: Simplify shader_hw_map2gl.
...
Most of the extra work done in the pixel shader code was not needed or
redundant. This patch unifies the two paths.
2009-05-11 12:50:01 +02:00
Stefan Dösinger
7a1f9c84f1
wined3d: Get rid of the strcat in shader_arb_add_dst_param and make it shader_arb_get_dst_param.
2009-05-11 12:49:54 +02:00
Stefan Dösinger
48c2b0d669
wined3d: Merge shader_arb_add_src_param and pshader_gen_input_modifier_line.
...
Mostly based on the code of pshader_gen_input_modifier_line. The space-adding
behavior of shader_arb_add_src_param was removed because the plurality of
instruction handlers passes an uninitialized buffer in and expects a register
name written to its start, and only map2gl and rcp_rsq use the space-adding
stuff. I'll change rcp_rsq in a later patch anyway. I changed the name to
shader_arb_get_src_param to reflect this behavior.
2009-05-11 12:48:35 +02:00
Henri Verbeet
9a579a43b1
wined3d: Use the output signature to map SM4 pixel shader outputs to the appropriate register.
2009-05-11 12:43:00 +02:00
Henri Verbeet
d2409581e0
wined3d: Record register usage only once.
2009-05-08 18:16:48 +02:00
Stefan Dösinger
7a1f305d42
wined3d: Get rid of pshader_gen_output_modifier_line.
...
Use shader_arb_add_instruction_modifiers instead. This avoids calling the
fixup function from each single instruction handler to handle shifts. It does
not yet get rid of the modifier handler in each instruction because we don't
want a separate line if we can just append _SAT to the instruction name.
2009-05-08 12:20:37 +02:00
Stefan Dösinger
f025829449
wined3d: Pass the instr to pshader_gen_output_modifier_line.
2009-05-08 12:20:25 +02:00
Stefan Dösinger
2fd485ae31
winedd: Move shader_*_add_instruction_modifiers into the shader backend.
2009-05-08 12:20:18 +02:00
Stefan Dösinger
668328a697
wined3d: Work around a bad crash in fglrx.
2009-05-08 12:16:50 +02:00
Stefan Dösinger
4daa3e5320
wined3d: Always declare single constants in ARB if rel addr is not used.
...
This is needed to raise the number of advertised constants to the GL
limit. The ARB assembler ususally does not optimize away unused
constants, so we have to do this.
2009-05-08 12:15:26 +02:00
Stefan Dösinger
f9276a6429
wined3d: Keep track of used float constants.
2009-05-08 12:15:15 +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
690d666de5
wined3d: Add support for immediate constants to shader_dump_register().
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
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
Tobias Jakobi
9657e81429
wined3d: Add newline to fixme.
2009-04-13 17:32:03 -05:00
Tobias Jakobi
6e970c5d95
wined3d: glsl: Enable load_np2fixup_constants.
2009-04-10 14:00:58 +02:00
Tobias Jakobi
9b067a6ca5
wined3d: Add load_np2fixup_constants function to shader backend.
2009-04-10 14:00:50 +02:00
Stefan Dösinger
754b5cf2ad
wined3d: Deal with reserved shader constants in the backend.
...
This moves the GLSL and ARB specific reserved constants out of directx.c into
the get_caps methods of the shader backends. That way the number of reserved
constants remains in the backend.
GL_LIMITS({v/p}shader_constantsF) now contains the real number of constants as
advertised by GL instead of some mixture of GL info and backend implementation
specifics. This makes it easier for backends to decide how many constants to
use.
2009-04-10 11:22:55 +02:00
Stefan Dösinger
99d88c15ea
wined3d: Fix the drawRectPatch vertex count.
...
DrawPrimitive now accepts the number of vertices, not the number of
primitives. This code was forgotten in the patch that changed this.
We're drawing triangles, so we are drawing num_primitives * 3 vertices.
2009-04-10 11:14:45 +02:00
Stefan Dösinger
014c4bfc70
wined3d: Save some memory in vertex buffers.
...
In most cases we're fine with the vbo and glMapBuffer and never use the actual
heap memory copy. Try to stick to just the vbo copy and avoid allocating the
extra heap memory. In case it is needed(emulation or vertex conversion), fall
back to the old double buffering mode.
2009-04-10 11:14:32 +02:00
Henri Verbeet
3a5bbe6a0c
wined3d: Split vshader_program_add_param() in shader_arb_add_src_param() and shader_arb_add_dst_param().
2009-04-10 10:23:38 +02:00
Henri Verbeet
e6031afdfa
wined3d: Merge pshader_get_register_name() and part of vshader_program_add_param().
2009-04-10 10:23:33 +02:00
Henri Verbeet
9a28d273bc
wined3d: Explicitly pass the register type and index to pshader_get_register_name().
2009-04-10 10:23:24 +02:00
Henri Verbeet
62d9dc2177
wined3d: Store the relative addressing mode in struct wined3d_shader_dst_param.
2009-04-10 10:23:20 +02:00
Henri Verbeet
22e57d025c
wined3d: Store the destination shift in struct wined3d_shader_dst_param.
2009-04-10 10:23:15 +02:00
Stefan Dösinger
cb1c9dcda9
d3d: Remove the format from index buffers.
2009-04-09 16:28:25 +02:00
Stefan Dösinger
f0efa97413
wined3d: Remove the buffer fvf.
2009-04-09 16:28:10 +02:00
Henri Verbeet
3a0eb81cea
wined3d: Get rid of a redundant strcat in shader_glsl_get_register_name().
2009-04-09 11:27:29 +02:00
Henri Verbeet
ff58255f4e
wined3d: Explicitly pass parameter properties to shader_glsl_get_register_name().
2009-04-09 11:27:25 +02:00
Henri Verbeet
f3e5e92a18
wined3d: Pass a struct wined3d_shader_dst_param to shader_glsl_get_write_mask().
2009-04-09 11:27:21 +02:00
Henri Verbeet
d299f865f7
wined3d: Add a separate function for converting write masks to strings.
2009-04-09 11:27:17 +02:00
Henri Verbeet
877e252681
wined3d: Only update the swizzle and use map for streams that are actually used in device_stream_info_from_strided().
...
This fixes a regression introduced by d7c7c76850
and exposed by ef2d704183
. Unfortunately having
EXT_vertex_array_bgra support masks the problem, which is why the regression
tests didn't catch it.
2009-04-09 11:27:10 +02:00
Henri Verbeet
2df49ea8ef
wined3d: Eliminate a useless local variable.
2009-04-08 11:42:24 +02:00
Henri Verbeet
9ec0b09d35
wined3d: Store usage and usage_idx in struct wined3d_shader_semantic.
...
Instead of the usage token.
2009-04-08 11:42:19 +02:00
Henri Verbeet
a1dedbdf58
wined3d: Properly check if input/output varyings are used.
2009-04-08 11:42:12 +02:00
Henri Verbeet
375780a5a8
wined3d: Fix some more 3 space indentation.
2009-04-08 11:42:05 +02:00
Henri Verbeet
d12e489272
wined3d: Store a struct wined3d_shader_dst_param in struct wined3d_shader_semantic.
2009-04-08 11:41:59 +02:00
Stefan Dösinger
513a493f00
wined3d: Merge IWineD3DIndexBuffer and IWineD3DBuffer.
2009-04-08 11:37:29 +02:00
Stefan Dösinger
2a7a237170
wined3d: Merge indexbuffer and buffer implementations.
2009-04-08 11:37:24 +02:00
Stefan Dösinger
3ed94329a3
wined3d: Use Map and Unmap for index buffers.
...
Just a change in name to prepare for the next patch
2009-04-08 11:36:18 +02:00
Stefan Dösinger
dc80a3ede5
d3d: Unify WINED3DVERTEXBUFFER_DESC and WINED3DINDEXBUFFER_DESC.
2009-04-08 11:36:02 +02:00
Stefan Dösinger
bc07ad0579
d3d8, d3d9: Don't rely on the wined3d buffer type.
2009-04-08 11:35:29 +02:00
Henri Verbeet
a4c942f606
wined3d: Simplify shader_glsl_cmp() and shader_glsl_cnd().
2009-04-07 14:22:00 +02:00
Henri Verbeet
a374ba54e5
wined3d: Simplify shader_glsl_color_correction().
2009-04-07 14:21:54 +02:00
Henri Verbeet
0f92bbc6bc
wined3d: Store the register type in struct wined3d_shader_dst_param.
2009-04-07 14:21:49 +02:00
Henri Verbeet
f7f61a58f4
wined3d: Explicitly pass register type and index to shader_is_scalar().
2009-04-07 14:21:44 +02:00
Henri Verbeet
6f66c1ddbd
wined3d: Store the write mask in struct wined3d_shader_dst_param.
2009-04-07 14:21:37 +02:00
Henri Verbeet
f0de1622d0
wined3d: Store the destination modifiers in struct wined3d_shader_dst_param.
2009-04-06 12:57:52 +02:00
Henri Verbeet
decc1cec9d
wined3d: Pass a pointer to struct wined3d_shader_dst_param to shader_glsl_add_dst_param().
2009-04-06 12:57:44 +02:00
Henri Verbeet
72aff27e0e
wined3d: Pass a pointer to struct wined3d_shader_dst_param to shader_glsl_append_dst_ext().
2009-04-06 12:57:37 +02:00
Henri Verbeet
91305b1f49
wined3d: Use a more appropriate mask for masking out the write mask.
2009-04-06 12:57:32 +02:00
Henri Verbeet
1120f0f585
wined3d: Unset the current GLSL program when it's destroyed.
2009-04-06 12:57:27 +02:00
Roderick Colenbrander
a932fdcb2f
wined3d: Update NVidia pci ids.
2009-04-06 11:16:24 +02:00
Henri Verbeet
6660978b44
wined3d: Use register_idx in the ARB shader backend.
2009-04-03 13:01:50 +02:00
Henri Verbeet
7b62165546
wined3d: Store the register index in struct wined3d_shader_dst_param.
2009-04-03 13:01:44 +02:00
Henri Verbeet
7245cd2b81
wined3d: Add a struct wined3d_shader_dst_param for storing destination parameter information.
2009-04-03 13:01:38 +02:00
Henri Verbeet
04b2e0b19b
wined3d: Remove the opcode field from struct wined3d_shader_instruction.
2009-04-03 13:01:30 +02:00
Henri Verbeet
29c9dc989d
wined3d: Use the source and destination parameter count in the ARB shader backend.
2009-04-03 13:01:20 +02:00
Henri Verbeet
7bde2792c2
wined3d: Store the source and destination parameter count in struct wined3d_shader_instruction.
2009-04-02 16:28:29 +02:00
Henri Verbeet
d633b6d47e
wined3d: Avoid comparing against WINED3DSIO_* in the ARB shader backend.
2009-04-02 16:28:29 +02:00
Henri Verbeet
44648b2b91
wined3d: Store the instruction handler index in struct wined3d_shader_instruction.
...
This allows us to avoid comparing against WINED3DSIO_*, which is specific to
the bytecode.
2009-04-02 16:28:29 +02:00
Henri Verbeet
fb6547a3e1
wined3d: Compare num_params against 1 in shader_glsl_map2gl().
...
num_params includes the destination parameter, while we're only interested in
source parameters. This doesn't cause problems for any of the instrctions
currently handled by shader_glsl_map2gl() though, since they all happen to
have at least 1 source parameter.
2009-04-02 16:28:29 +02:00
Henri Verbeet
c697bdc3a1
wined3d: Remove some code that doesn't make a whole lot of sense.
...
The "instr" parameter to shader_glsl_gen_modifier() is actually a source
parameter, so comparing against WINED3DSIO_TEXKILL is just silly.
2009-04-02 16:28:29 +02:00
Henri Verbeet
c3a01b315e
wined3d: Use a more reasonable name for "SHADER_OPCODE_ARG".
2009-04-01 14:24:19 +02:00
Henri Verbeet
de4e8cf0f9
wined3d: Avoid a forward declaration.
2009-04-01 14:24:11 +02:00
Henri Verbeet
e44335585e
wined3d: Don't use the opcode_token field in the ARB backend.
2009-04-01 14:24:02 +02:00
Henri Verbeet
ec43489e10
wined3d: Don't use the opcode_token field in the GLSL backend.
...
The idea is that we want to prevent backends from parsing the tokens
themselves, which is pretty much a requirement for adding SM4 support.
2009-04-01 14:23:56 +02:00
Henri Verbeet
7f740f2a51
wined3d: Don't leak the swapchain in IWineD3DDeviceImpl_Reset() if the display mode is unsupported.
2009-03-31 12:42:20 +02:00
Henri Verbeet
4ccbc948a1
d3d10core: Set the initial buffer data, when present.
2009-03-31 12:42:07 +02:00
Henri Verbeet
0591442469
wined3d: Care for things like pitch and blocksize when copying DXT surfaces.
2009-03-31 12:42:00 +02:00
Tobias Jakobi
94a7cd42ed
wined3d: Simplify sampler_texmatrix using pow2Matrix_identity.
2009-03-31 12:40:30 +02:00
Tobias Jakobi
38239be58c
wined3d: GLSL: Implement texrect coord fixup.
2009-03-31 12:40:21 +02:00
Tobias Jakobi
1b335dfaaa
wined3d: Add texrect_fixup bitfield to ps_compile_args struct.
...
Initialization of the bitfield done in find_ps_compile_args
based on the previously introduced pow2Matrix_identity flag.
2009-03-31 12:40:10 +02:00
Tobias Jakobi
31f8cd9621
wined3d: Add pow2Matrix_identity flag to BaseTextureClass struct.
...
New flag helps to quickly find out whether the pow2Matrix is a
identity matrix (no texcoord fixup needed) or not.
2009-03-31 12:39:27 +02:00
Henri Verbeet
1205c33c90
wined3d: Use the output slot when we have one.
2009-03-30 15:11:29 +02:00
Henri Verbeet
ef2d704183
wined3d: Store the format_desc itself in struct wined3d_stream_info_element.
2009-03-30 15:11:24 +02:00