I don't remember exactly the conditions of the crash,
but I had a trace which was crashing in the gallium driver
before doing any rendering (something about viewports being not initialized).
It's not the first time we hit such a problem, so rather than investigating
that crash, I chose to just initialize every states at device creation.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
     nine_state_init_sw(This);
 
     ID3DPresentGroup_Release(This->present);
+    nine_context_update_state(This); /* Some drivers needs states to be initialized */
     nine_csmt_process(This);
 
     return D3D_OK;
 
     }
 }
 
+void
+nine_context_update_state(struct NineDevice9 *device)
+{
+    nine_update_state(device);
+}
+
 void
 nine_state_init_sw(struct NineDevice9 *device)
 {
 
                              boolean is_reset);
 void nine_device_state_clear(struct NineDevice9 *);
 void nine_context_clear(struct NineDevice9 *);
+void nine_context_update_state(struct NineDevice9 *);
 
 void nine_state_init_sw(struct NineDevice9 *device);
 void nine_state_prepare_draw_sw(struct NineDevice9 *device,