wined3d: Move max_ffp_textures to wined3d_d3d_info.

This commit is contained in:
Stefan Dösinger 2013-04-25 15:20:28 +02:00 committed by Alexandre Julliard
parent 768e8c098c
commit cb01fb27b1
3 changed files with 8 additions and 8 deletions

View File

@ -2714,7 +2714,8 @@ static void device_update_fixed_function_usage_map(struct wined3d_device *device
} }
} }
static void device_map_fixed_function_samplers(struct wined3d_device *device, const struct wined3d_gl_info *gl_info) static void device_map_fixed_function_samplers(struct wined3d_device *device, const struct wined3d_gl_info *gl_info,
const struct wined3d_d3d_info *d3d_info)
{ {
unsigned int i, tex; unsigned int i, tex;
WORD ffu_map; WORD ffu_map;
@ -2722,8 +2723,8 @@ static void device_map_fixed_function_samplers(struct wined3d_device *device, co
device_update_fixed_function_usage_map(device); device_update_fixed_function_usage_map(device);
ffu_map = device->fixed_function_usage_map; ffu_map = device->fixed_function_usage_map;
if (device->max_ffp_textures == gl_info->limits.texture_stages if (d3d_info->limits.ffp_textures == gl_info->limits.texture_stages
|| device->stateBlock->state.lowest_disabled_stage <= device->max_ffp_textures) || device->stateBlock->state.lowest_disabled_stage <= d3d_info->limits.ffp_textures)
{ {
for (i = 0; ffu_map; ffu_map >>= 1, ++i) for (i = 0; ffu_map; ffu_map >>= 1, ++i)
{ {
@ -2844,6 +2845,7 @@ static void device_map_vsamplers(struct wined3d_device *device, BOOL ps, const s
void device_update_tex_unit_map(struct wined3d_device *device) void device_update_tex_unit_map(struct wined3d_device *device)
{ {
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
const struct wined3d_state *state = &device->stateBlock->state; const struct wined3d_state *state = &device->stateBlock->state;
BOOL vs = use_vs(state); BOOL vs = use_vs(state);
BOOL ps = use_ps(state); BOOL ps = use_ps(state);
@ -2857,7 +2859,7 @@ void device_update_tex_unit_map(struct wined3d_device *device)
if (ps) if (ps)
device_map_psamplers(device, gl_info); device_map_psamplers(device, gl_info);
else else
device_map_fixed_function_samplers(device, gl_info); device_map_fixed_function_samplers(device, gl_info, d3d_info);
if (vs) if (vs)
device_map_vsamplers(device, ps, gl_info); device_map_vsamplers(device, ps, gl_info);
@ -5412,7 +5414,6 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx]; struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx];
const struct fragment_pipeline *fragment_pipeline; const struct fragment_pipeline *fragment_pipeline;
const struct wined3d_vertex_pipe_ops *vertex_pipeline; const struct wined3d_vertex_pipe_ops *vertex_pipeline;
struct fragment_caps ffp_caps;
unsigned int i; unsigned int i;
HRESULT hr; HRESULT hr;
@ -5436,8 +5437,6 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
vertex_pipeline = adapter->vertex_pipe; vertex_pipeline = adapter->vertex_pipe;
fragment_pipeline = adapter->fragment_pipe; fragment_pipeline = adapter->fragment_pipe;
fragment_pipeline->get_caps(&adapter->gl_info, &ffp_caps);
device->max_ffp_textures = ffp_caps.MaxSimultaneousTextures;
if (vertex_pipeline->vp_states && fragment_pipeline->states if (vertex_pipeline->vp_states && fragment_pipeline->states
&& FAILED(hr = compile_state_table(device->StateTable, device->multistate_funcs, && FAILED(hr = compile_state_table(device->StateTable, device->multistate_funcs,

View File

@ -2854,6 +2854,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
adapter->fragment_pipe->get_caps(gl_info, &fragment_caps); adapter->fragment_pipe->get_caps(gl_info, &fragment_caps);
gl_info->limits.texture_stages = fragment_caps.MaxTextureBlendStages; gl_info->limits.texture_stages = fragment_caps.MaxTextureBlendStages;
adapter->d3d_info.limits.ffp_textures = fragment_caps.MaxSimultaneousTextures;
TRACE("Max texture stages: %u.\n", gl_info->limits.texture_stages); TRACE("Max texture stages: %u.\n", gl_info->limits.texture_stages);
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]) if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT])

View File

@ -1592,6 +1592,7 @@ struct wined3d_d3d_limits
UINT vs_version, gs_version, ps_version; UINT vs_version, gs_version, ps_version;
DWORD vs_uniform_count; DWORD vs_uniform_count;
DWORD ps_uniform_count; DWORD ps_uniform_count;
UINT ffp_textures;
}; };
struct wined3d_d3d_info struct wined3d_d3d_info
@ -1736,7 +1737,6 @@ struct wined3d_device
APPLYSTATEFUNC *multistate_funcs[STATE_HIGHEST + 1]; APPLYSTATEFUNC *multistate_funcs[STATE_HIGHEST + 1];
const struct blit_shader *blitter; const struct blit_shader *blitter;
unsigned int max_ffp_textures;
UINT instance_count; UINT instance_count;
WORD vertexBlendUsed : 1; /* To avoid needless setting of the blend matrices */ WORD vertexBlendUsed : 1; /* To avoid needless setting of the blend matrices */