diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 4ff206d5222..92c3f75a447 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 2cf89e7ea96..356dd5288c3 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 c00300dd1b3..8daee2d45b5 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;