aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/frontends/nine
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2020-01-26 20:40:00 +0100
committerMarge Bot <[email protected]>2020-05-15 15:43:57 +0000
commit725ebc4657d27349ed586e5c178d5b1a971587cd (patch)
tree3bf73c6fafa036c4ef427effc9f51f2fae4aef70 /src/gallium/frontends/nine
parent0222c550c726f0b80d083681d749e2891b11a318 (diff)
st/nine: Fix a crash if the state is not initialized
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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
Diffstat (limited to 'src/gallium/frontends/nine')
-rw-r--r--src/gallium/frontends/nine/device9.c1
-rw-r--r--src/gallium/frontends/nine/nine_state.c6
-rw-r--r--src/gallium/frontends/nine/nine_state.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/frontends/nine/device9.c b/src/gallium/frontends/nine/device9.c
index fd8e9274327..b18695deadc 100644
--- a/src/gallium/frontends/nine/device9.c
+++ b/src/gallium/frontends/nine/device9.c
@@ -517,6 +517,7 @@ NineDevice9_ctor( struct NineDevice9 *This,
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;
diff --git a/src/gallium/frontends/nine/nine_state.c b/src/gallium/frontends/nine/nine_state.c
index 8724ec87c81..90de3dd80f3 100644
--- a/src/gallium/frontends/nine/nine_state.c
+++ b/src/gallium/frontends/nine/nine_state.c
@@ -2936,6 +2936,12 @@ nine_context_clear(struct NineDevice9 *device)
}
void
+nine_context_update_state(struct NineDevice9 *device)
+{
+ nine_update_state(device);
+}
+
+void
nine_state_init_sw(struct NineDevice9 *device)
{
struct pipe_context *pipe_sw = device->pipe_sw;
diff --git a/src/gallium/frontends/nine/nine_state.h b/src/gallium/frontends/nine/nine_state.h
index d8fa2f80c4d..d497a79c49d 100644
--- a/src/gallium/frontends/nine/nine_state.h
+++ b/src/gallium/frontends/nine/nine_state.h
@@ -606,6 +606,7 @@ void nine_state_set_defaults(struct NineDevice9 *, const D3DCAPS9 *,
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,