[PATCH 6/7] wined3d: Move max_ffp_textures into the adapter

Stefan Dösinger stefan at codeweavers.com
Fri Apr 19 04:20:56 CDT 2013


---
 dlls/wined3d/device.c          | 7 ++-----
 dlls/wined3d/directx.c         | 1 +
 dlls/wined3d/wined3d_private.h | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 59b8e94..448881c 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2734,8 +2734,8 @@ static void device_map_fixed_function_samplers(struct wined3d_device *device, co
     device_update_fixed_function_usage_map(device);
     ffu_map = device->fixed_function_usage_map;
 
-    if (device->max_ffp_textures == gl_info->limits.texture_stages
-            || device->stateBlock->state.lowest_disabled_stage <= device->max_ffp_textures)
+    if (device->adapter->max_ffp_textures == gl_info->limits.texture_stages
+            || device->stateBlock->state.lowest_disabled_stage <= device->adapter->max_ffp_textures)
     {
         for (i = 0; ffu_map; ffu_map >>= 1, ++i)
         {
@@ -5420,7 +5420,6 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
 {
     struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx];
     const struct fragment_pipeline *fragment_pipeline;
-    struct fragment_caps ffp_caps;
     unsigned int i;
     HRESULT hr;
 
@@ -5442,8 +5441,6 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
     device->shader_backend = adapter->shader_backend;
 
     fragment_pipeline = adapter->fragment_pipe;
-    fragment_pipeline->get_caps(&adapter->gl_info, &ffp_caps);
-    device->max_ffp_textures = ffp_caps.MaxSimultaneousTextures;
 
     if (fragment_pipeline->states
             && FAILED(hr = compile_state_table(device->StateTable, device->multistate_funcs,
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index d0bda3a..75f14fc 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2813,6 +2813,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
 
     adapter->fragment_pipe->get_caps(gl_info, &fragment_caps);
     gl_info->limits.texture_stages = fragment_caps.MaxTextureBlendStages;
+    adapter->max_ffp_textures = fragment_caps.MaxSimultaneousTextures;
     TRACE("Max texture stages: %u.\n", gl_info->limits.texture_stages);
 
     if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT])
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index fbb0026..e7f033b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1594,6 +1594,7 @@ struct wined3d_adapter
     DWORD vs_clipping;
     UINT vs_version, gs_version, ps_version;
     DWORD d3d_vshader_constantF, d3d_pshader_constantF; /* Advertised d3d caps, not GL ones */
+    unsigned int max_ffp_textures;
 };
 
 BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter) DECLSPEC_HIDDEN;
@@ -1708,7 +1709,6 @@ struct wined3d_device
     APPLYSTATEFUNC *multistate_funcs[STATE_HIGHEST + 1];
     const struct blit_shader *blitter;
 
-    unsigned int max_ffp_textures;
     UINT instance_count;
 
     WORD vertexBlendUsed : 1;           /* To avoid needless setting of the blend matrices */
-- 
1.8.1.5




More information about the wine-patches mailing list