Mesa (master): mesa: simplify handling OPCODE_CONTINUE for display lists

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 21 00:30:50 UTC 2021


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Dec 23 16:42:39 2020 -0500

mesa: simplify handling OPCODE_CONTINUE for display lists

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>

---

 src/mesa/main/dlist.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 64d470b9a5e..1b8a03a7630 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1380,7 +1380,7 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
             n = (Node *) get_pointer(&n[1]);
             free(block);
             block = n;
-            break;
+            continue;
          case OPCODE_END_OF_LIST:
             free(block);
             done = GL_TRUE;
@@ -1390,10 +1390,8 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
             ;
          }
 
-         if (opcode != OPCODE_CONTINUE) {
-            assert(InstSize[opcode] > 0);
-            n += InstSize[opcode];
-         }
+         assert(InstSize[opcode] > 0);
+         n += InstSize[opcode];
       }
    }
 
@@ -13459,7 +13457,7 @@ execute_list(struct gl_context *ctx, GLuint list)
 
          case OPCODE_CONTINUE:
             n = (Node *) get_pointer(&n[1]);
-            break;
+            continue;
          case OPCODE_NOP:
             /* no-op */
             break;
@@ -13477,10 +13475,8 @@ execute_list(struct gl_context *ctx, GLuint list)
          }
 
          /* increment n to point to next compiled command */
-         if (opcode != OPCODE_CONTINUE) {
-            assert(InstSize[opcode] > 0);
-            n += InstSize[opcode];
-         }
+         assert(InstSize[opcode] > 0);
+         n += InstSize[opcode];
       }
    }
 
@@ -14882,7 +14878,7 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
          case OPCODE_CONTINUE:
             fprintf(f, "DISPLAY-LIST-CONTINUE\n");
             n = (Node *) get_pointer(&n[1]);
-            break;
+            continue;
          case OPCODE_NOP:
             fprintf(f, "NOP\n");
             break;
@@ -14903,10 +14899,8 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
             }
          }
          /* increment n to point to next compiled command */
-         if (opcode != OPCODE_CONTINUE) {
-            assert(InstSize[opcode] > 0);
-            n += InstSize[opcode];
-         }
+         assert(InstSize[opcode] > 0);
+         n += InstSize[opcode];
       }
    }
 



More information about the mesa-commit mailing list