Mesa (master): st/nine: Do not return invalidcall on getrenderstate

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 15 15:58:37 UTC 2020


Module: Mesa
Branch: master
Commit: edff31c0d902cd83495a1e49f306d8f031cf118b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=edff31c0d902cd83495a1e49f306d8f031cf118b

Author: Axel Davy <davyaxel0 at gmail.com>
Date:   Mon Jun  3 22:22:59 2019 +0200

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 <davyaxel0 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>

---

 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;



More information about the mesa-commit mailing list