Henri Verbeet : wined3d: Make sure all fields of the fragment pipe caps are always initialized.
Alexandre Julliard
julliard at winehq.org
Mon May 3 11:54:05 CDT 2010
Module: wine
Branch: master
Commit: d5b68e7640adb890d9913dac46d0a9d6011f5ae6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d5b68e7640adb890d9913dac46d0a9d6011f5ae6
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Apr 29 23:41:28 2010 +0200
wined3d: Make sure all fields of the fragment pipe caps are always initialized.
---
dlls/wined3d/arb_program_shader.c | 3 +--
dlls/wined3d/ati_fragment_shader.c | 3 +--
dlls/wined3d/device.c | 1 -
dlls/wined3d/directx.c | 2 --
dlls/wined3d/nvidia_texture_shader.c | 17 +++++++++--------
dlls/wined3d/state.c | 1 +
6 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index f0db9cf..5529f92 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5332,6 +5332,7 @@ static void arbfp_free(IWineD3DDevice *iface) {
static void arbfp_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
{
+ caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP;
caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE |
WINED3DTEXOPCAPS_SELECTARG1 |
WINED3DTEXOPCAPS_SELECTARG2 |
@@ -5362,8 +5363,6 @@ static void arbfp_get_caps(const struct wined3d_gl_info *gl_info, struct fragmen
caps->MaxTextureBlendStages = 8;
caps->MaxSimultaneousTextures = min(gl_info->limits.fragment_samplers, 8);
-
- caps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_TSSARGTEMP;
}
#undef GLINFO_LOCATION
diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c
index 51b3ad7..62be40d 100644
--- a/dlls/wined3d/ati_fragment_shader.c
+++ b/dlls/wined3d/ati_fragment_shader.c
@@ -1062,6 +1062,7 @@ static void atifs_enable(IWineD3DDevice *iface, BOOL enable) {
static void atifs_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
{
+ caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP;
caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE |
WINED3DTEXOPCAPS_SELECTARG1 |
WINED3DTEXOPCAPS_SELECTARG2 |
@@ -1104,8 +1105,6 @@ static void atifs_get_caps(const struct wined3d_gl_info *gl_info, struct fragmen
*/
caps->MaxTextureBlendStages = 8;
caps->MaxSimultaneousTextures = 6;
-
- caps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_TSSARGTEMP;
}
static HRESULT atifs_alloc(IWineD3DDevice *iface) {
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 20c509d..463ccbf 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -7092,7 +7092,6 @@ HRESULT device_init(IWineD3DDeviceImpl *device, IWineD3DImpl *wined3d,
device->d3d_pshader_constantF = shader_caps.MaxPixelShaderConst;
device->vs_clipping = shader_caps.VSClipping;
- memset(&ffp_caps, 0, sizeof(ffp_caps));
fragment_pipeline = adapter->fragment_pipe;
device->frag_pipe = fragment_pipeline;
fragment_pipeline->get_caps(&adapter->gl_info, &ffp_caps);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index baabda8..a0f1c7c 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4544,8 +4544,6 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
memset(&shader_caps, 0, sizeof(shader_caps));
adapter->shader_backend->shader_get_caps(&adapter->gl_info, &shader_caps);
-
- memset(&fragment_caps, 0, sizeof(fragment_caps));
adapter->fragment_pipe->get_caps(&adapter->gl_info, &fragment_caps);
/* Add shader misc caps. Only some of them belong to the shader parts of the pipeline */
diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c
index 48ce864..3587db9 100644
--- a/dlls/wined3d/nvidia_texture_shader.c
+++ b/dlls/wined3d/nvidia_texture_shader.c
@@ -629,6 +629,15 @@ static void nvts_enable(IWineD3DDevice *iface, BOOL enable) {
static void nvrc_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *pCaps)
{
+ pCaps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP;
+
+ /* The caps below can be supported but aren't handled yet in utils.c
+ * 'd3dta_to_combiner_input', disable them until support is fixed */
+#if 0
+ if (gl_info->supported[NV_REGISTER_COMBINERS2])
+ pCaps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_PERSTAGECONSTANT;
+#endif
+
pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD |
WINED3DTEXOPCAPS_ADDSIGNED |
WINED3DTEXOPCAPS_ADDSIGNED2X |
@@ -672,14 +681,6 @@ static void nvrc_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct
pCaps->MaxTextureBlendStages = min(MAX_TEXTURES, gl_info->limits.general_combiners);
pCaps->MaxSimultaneousTextures = gl_info->limits.textures;
-
- pCaps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_TSSARGTEMP;
-
- /* The caps below can be supported but aren't handled yet in utils.c 'd3dta_to_combiner_input', disable them until support is fixed */
-#if 0
- if (gl_info->supported[NV_REGISTER_COMBINERS2])
- pCaps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_PERSTAGECONSTANT;
-#endif
}
static HRESULT nvrc_fragment_alloc(IWineD3DDevice *iface) { return WINED3D_OK; }
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index eb6025d..28de4ea 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -5538,6 +5538,7 @@ static void ffp_enable(IWineD3DDevice *iface, BOOL enable) { }
static void ffp_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *pCaps)
{
+ pCaps->PrimitiveMiscCaps = 0;
pCaps->TextureOpCaps = WINED3DTEXOPCAPS_ADD |
WINED3DTEXOPCAPS_ADDSIGNED |
WINED3DTEXOPCAPS_ADDSIGNED2X |
More information about the wine-cvs
mailing list