st/nine: Don't update unused world matrices
authorAxel Davy <davyaxel0@gmail.com>
Sun, 23 Sep 2018 20:28:07 +0000 (22:28 +0200)
committerAxel Davy <davyaxel0@gmail.com>
Fri, 26 Oct 2018 20:16:16 +0000 (22:16 +0200)
While to the application we have to track
accurately all 256 world matrices (including
in stateblocks), hw vertex processing enables
to set a limit to the number of world matrices
the hardware can access to in the advertised caps,
which is 8 for nine.

Thus don't bother in the stateblock code to send
the updated values for the unreachable matrices.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
src/gallium/state_trackers/nine/nine_state.c

index c9901209189be662b5b0aa5de2fc29b8726953bf..f4d9b4235103bb590f3ad30268e9d24da1eea826 100644 (file)
@@ -2059,6 +2059,12 @@ nine_context_apply_stateblock(struct NineDevice9 *device,
             for (s = i * 32; s < (i * 32 + 32); ++s) {
                 if (!(src->ff.changed.transform[i] & (1 << (s % 32))))
                     continue;
+                /* MaxVertexBlendMatrixIndex is 8, which means
+                 * we don't read past index D3DTS_WORLDMATRIX(8).
+                 * swvp is supposed to allow all 256, but we don't
+                 * implement it for now. */
+                if (s > D3DTS_WORLDMATRIX(8))
+                    break;
                 nine_context_set_transform(device, s,
                                            nine_state_access_transform(
                                                (struct nine_ff_state *)&src->ff,