From edff31c0d902cd83495a1e49f306d8f031cf118b Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Mon, 3 Jun 2019 22:22:59 +0200 Subject: [PATCH] st/nine: Do not return invalidcall on getrenderstate To be fair I don't remember why I wrote this patch, but it seems reasonable. Signed-off-by: Axel Davy Part-of: --- src/gallium/frontends/nine/device9.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/nine/device9.c b/src/gallium/frontends/nine/device9.c index 841d62bc6ce..fd8e9274327 100644 --- a/src/gallium/frontends/nine/device9.c +++ b/src/gallium/frontends/nine/device9.c @@ -2283,7 +2283,7 @@ NineDevice9_SetRenderState( struct NineDevice9 *This, DBG("This=%p State=%u(%s) Value=%08x\n", This, State, nine_d3drs_to_string(State), Value); - user_assert(State < D3DRS_COUNT, D3DERR_INVALIDCALL); + user_assert(State < D3DRS_COUNT, D3D_OK); if (unlikely(This->is_recording)) { state->rs_advertised[State] = Value; @@ -2307,7 +2307,11 @@ NineDevice9_GetRenderState( struct NineDevice9 *This, DWORD *pValue ) { user_assert(!This->pure, D3DERR_INVALIDCALL); - user_assert(State < D3DRS_COUNT, D3DERR_INVALIDCALL); + /* TODO: This needs tests */ + if (State >= D3DRS_COUNT) { + *pValue = 0; + return D3D_OK; + } *pValue = This->state.rs_advertised[State]; return D3D_OK; -- 2.30.2