wined3d: Initialize the fb state pointer in state_init().

This commit is contained in:
Henri Verbeet 2013-09-26 09:31:54 +02:00 committed by Alexandre Julliard
parent 6793fa7157
commit abbc595fc1
3 changed files with 9 additions and 7 deletions

View File

@ -4708,7 +4708,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (device->d3d_initialized)
delete_opengl_contexts(device, swapchain);
if (FAILED(hr = state_init(&device->state, &device->adapter->d3d_info)))
if (FAILED(hr = state_init(&device->state, &device->fb, &device->adapter->d3d_info)))
ERR("Failed to initialize device state, hr %#x.\n", hr);
state_init_default(&device->state, device);
device->update_state = &device->state;
@ -4972,7 +4972,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
device->blitter = adapter->blitter;
if (FAILED(hr = state_init(&device->state, &adapter->d3d_info)))
if (FAILED(hr = state_init(&device->state, &device->fb, &adapter->d3d_info)))
{
ERR("Failed to initialize device state, hr %#x.\n", hr);
for (i = 0; i < sizeof(device->multistate_funcs) / sizeof(device->multistate_funcs[0]); ++i)

View File

@ -598,10 +598,13 @@ void state_cleanup(struct wined3d_state *state)
HeapFree(GetProcessHeap(), 0, state->ps_consts_f);
}
HRESULT state_init(struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)
HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
const struct wined3d_d3d_info *d3d_info)
{
unsigned int i;
state->fb = fb;
for (i = 0; i < LIGHTMAP_SIZE; i++)
{
list_init(&state->light_map[i]);
@ -1199,8 +1202,6 @@ void state_init_default(struct wined3d_state *state, struct wined3d_device *devi
state->transforms[WINED3D_TS_WORLD_MATRIX(i)] = identity;
}
state->fb = &device->fb;
TRACE("Render states\n");
/* Render states: */
state->render_states[WINED3D_RS_ZENABLE] = WINED3D_ZB_TRUE;
@ -1386,7 +1387,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
stateblock->ref = 1;
stateblock->device = device;
if (FAILED(hr = state_init(&stateblock->state, d3d_info)))
if (FAILED(hr = state_init(&stateblock->state, NULL, d3d_info)))
return hr;
if (FAILED(hr = stateblock_allocate_shader_constants(stateblock)))

View File

@ -2447,7 +2447,8 @@ struct wined3d_stateblock
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
HRESULT state_init(struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info) DECLSPEC_HIDDEN;
HRESULT state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
const struct wined3d_d3d_info *d3d_info) DECLSPEC_HIDDEN;
void state_init_default(struct wined3d_state *state, struct wined3d_device *device) DECLSPEC_HIDDEN;
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;