wined3d: Initialize the various backends in wined3d_adapter_init_nogl() as well.

This commit is contained in:
Henri Verbeet 2013-01-16 08:51:47 +01:00 committed by Alexandre Julliard
parent 1bb17316ff
commit f3dbbba48e
4 changed files with 52 additions and 22 deletions

View File

@ -5654,32 +5654,27 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
select_shader_mode(&adapter->gl_info, &device->ps_selected_mode, &device->vs_selected_mode);
device->shader_backend = adapter->shader_backend;
device->shader_backend->shader_get_caps(&adapter->gl_info, &shader_caps);
device->vs_version = shader_caps.vs_version;
device->gs_version = shader_caps.gs_version;
device->ps_version = shader_caps.ps_version;
device->d3d_vshader_constantF = shader_caps.vs_uniform_count;
device->d3d_pshader_constantF = shader_caps.ps_uniform_count;
device->vs_clipping = shader_caps.vs_clipping;
if (device->shader_backend)
{
device->shader_backend->shader_get_caps(&adapter->gl_info, &shader_caps);
device->vs_version = shader_caps.vs_version;
device->gs_version = shader_caps.gs_version;
device->ps_version = shader_caps.ps_version;
device->d3d_vshader_constantF = shader_caps.vs_uniform_count;
device->d3d_pshader_constantF = shader_caps.ps_uniform_count;
device->vs_clipping = shader_caps.vs_clipping;
}
fragment_pipeline = adapter->fragment_pipe;
if (fragment_pipeline)
{
fragment_pipeline->get_caps(&adapter->gl_info, &ffp_caps);
device->max_ffp_textures = ffp_caps.MaxSimultaneousTextures;
fragment_pipeline->get_caps(&adapter->gl_info, &ffp_caps);
device->max_ffp_textures = ffp_caps.MaxSimultaneousTextures;
hr = compile_state_table(device->StateTable, device->multistate_funcs, &adapter->gl_info,
ffp_vertexstate_template, fragment_pipeline, misc_state_template);
if (FAILED(hr))
{
ERR("Failed to compile state table, hr %#x.\n", hr);
wined3d_decref(device->wined3d);
return hr;
}
if (fragment_pipeline->states
&& FAILED(hr = compile_state_table(device->StateTable, device->multistate_funcs,
&adapter->gl_info, ffp_vertexstate_template, fragment_pipeline, misc_state_template)))
{
ERR("Failed to compile state table, hr %#x.\n", hr);
wined3d_decref(device->wined3d);
return hr;
}
device->blitter = adapter->blitter;
hr = wined3d_stateblock_create(device, WINED3D_SBT_INIT, &device->stateBlock);

View File

@ -5626,6 +5626,10 @@ static void wined3d_adapter_init_nogl(struct wined3d_adapter *adapter, UINT ordi
adapter->TextureRam = 128 * 1024 * 1024;
initPixelFormatsNoGL(&adapter->gl_info);
adapter->fragment_pipe = &none_fragment_pipe;
adapter->shader_backend = &none_shader_backend;
adapter->blitter = &cpu_blit;
}
static void STDMETHODCALLTYPE wined3d_null_wined3d_object_destroyed(void *parent) {}

View File

@ -5735,6 +5735,36 @@ const struct fragment_pipeline ffp_fragment_pipeline = {
FALSE /* we cannot disable projected textures. The vertex pipe has to do it */
};
static void fp_none_enable(const struct wined3d_gl_info *gl_info, BOOL enable) {}
static void fp_none_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
{
memset(caps, 0, sizeof(*caps));
}
static void *fp_none_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
{
return shader_priv;
}
static void fp_none_free(struct wined3d_device *device) {}
static BOOL fp_none_color_fixup_supported(struct color_fixup_desc fixup)
{
return is_identity_fixup(fixup);
}
const struct fragment_pipeline none_fragment_pipe =
{
fp_none_enable,
fp_none_get_caps,
fp_none_alloc,
fp_none_free,
fp_none_color_fixup_supported,
NULL,
FALSE,
};
static unsigned int num_handlers(const APPLYSTATEFUNC *funcs)
{
unsigned int i;

View File

@ -1193,6 +1193,7 @@ struct fragment_pipeline
extern const struct StateEntryTemplate misc_state_template[] DECLSPEC_HIDDEN;
extern const struct StateEntryTemplate ffp_vertexstate_template[] DECLSPEC_HIDDEN;
extern const struct fragment_pipeline none_fragment_pipe DECLSPEC_HIDDEN;
extern const struct fragment_pipeline ffp_fragment_pipeline DECLSPEC_HIDDEN;
extern const struct fragment_pipeline atifs_fragment_pipeline DECLSPEC_HIDDEN;
extern const struct fragment_pipeline arbfp_fragment_pipeline DECLSPEC_HIDDEN;