Stefan Dösinger : wined3d: Use the correct texture limit.

Alexandre Julliard julliard at winehq.org
Tue Aug 26 07:06:54 CDT 2008


Module: wine
Branch: master
Commit: 9a6bc683e11bf508a37769640d56f201462b935a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9a6bc683e11bf508a37769640d56f201462b935a

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun Aug 17 23:46:47 2008 +0200

wined3d: Use the correct texture limit.

We have to use the texture limit of the fragment pipeline in use here,
not the fixed function GL texture limit.

---

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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4ff206d..92c3f75 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3750,7 +3750,7 @@ static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) {
 
     device_update_fixed_function_usage_map(This);
 
-    if (!GL_SUPPORT(NV_REGISTER_COMBINERS) || This->stateBlock->lowest_disabled_stage <= GL_LIMITS(textures)) {
+    if (!GL_SUPPORT(NV_REGISTER_COMBINERS) || This->stateBlock->lowest_disabled_stage <= This->max_ffp_textures) {
         for (i = 0; i < This->stateBlock->lowest_disabled_stage; ++i) {
             if (!This->fixed_function_usage_map[i]) continue;
 
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 2cf89e7..356dd52 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3545,6 +3545,7 @@ static HRESULT  WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
     WINED3DDISPLAYMODE  mode;
     const struct fragment_pipeline *frag_pipeline = NULL;
     int i;
+    struct fragment_caps ffp_caps;
 
     /* Validate the adapter number. If no adapters are available(no GL), ignore the adapter
      * number and create a device without a 3D adapter for 2D only operation.
@@ -3597,10 +3598,14 @@ static HRESULT  WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
     select_shader_mode(&GLINFO_LOCATION, DeviceType, &object->ps_selected_mode, &object->vs_selected_mode);
     object->shader_backend = select_shader_backend(Adapter, DeviceType);
 
+    memset(&ffp_caps, 0, sizeof(ffp_caps));
     frag_pipeline = select_fragment_implementation(Adapter, DeviceType);
     object->frag_pipe = frag_pipeline;
+    frag_pipeline->get_caps(DeviceType, &GLINFO_LOCATION, &ffp_caps);
+    object->max_ffp_textures = ffp_caps.MaxSimultaneousTextures;
     compile_state_table(object->StateTable, object->multistate_funcs, &GLINFO_LOCATION,
                         ffp_vertexstate_template, frag_pipeline, misc_state_template);
+
     object->blitter = select_blit_implementation(Adapter, DeviceType);
 
     /* Prefer the vtable with functions optimized for single dirtifyable objects if the shader
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c00300d..8daee2d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -859,6 +859,8 @@ struct IWineD3DDeviceImpl
     const struct fragment_pipeline *frag_pipe;
     const struct blit_shader *blitter;
 
+    unsigned int max_ffp_textures;
+
     /* To store */
     BOOL                    view_ident;        /* true iff view matrix is identity                */
     BOOL                    untransformed;




More information about the wine-cvs mailing list