Commit 9a6bc683 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

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.
parent 8fc2cfe4
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment