[PATCH] WineD3D: use the correct texture limit=0A=

unknown (none) stefan at .
Sun Aug 17 23:46:47 CDT 2008


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

------=_NextPart_000_0017_01C90695.9E3D6FD0--




More information about the wine-patches mailing list