aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-03-22 16:40:32 -0400
committerMarek Olšák <[email protected]>2020-04-06 10:29:16 -0400
commite6bc1702f484be1ecb592295c4877281075798be (patch)
tree9f6482f91c3b22a30eb9d70ce573bd30d24f7df2 /src/mesa/state_tracker
parent10beee8a7757e956ab0e02ec8402ec1273d8edce (diff)
mesa: precompute _mesa_primitive_restart_index during state changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_draw.c3
-rw-r--r--src/mesa/state_tracker/st_draw_feedback.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index a8ff306e00a..10374746734 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -85,8 +85,7 @@ setup_primitive_restart(struct gl_context *ctx, struct pipe_draw_info *info)
if (ctx->Array._PrimitiveRestart) {
unsigned index_size = info->index_size;
- info->restart_index =
- _mesa_primitive_restart_index(ctx, index_size);
+ info->restart_index = ctx->Array._RestartIndex[index_size - 1];
/* Enable primitive restart only when the restart index can have an
* effect. This is required for correctness in radeonsi GFX8 support.
diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c
index 8d82884ba8d..a4a38556199 100644
--- a/src/mesa/state_tracker/st_draw_feedback.c
+++ b/src/mesa/state_tracker/st_draw_feedback.c
@@ -216,7 +216,7 @@ st_feedback_draw_vbo(struct gl_context *ctx,
if (ctx->Array._PrimitiveRestart) {
info.primitive_restart = true;
- info.restart_index = _mesa_primitive_restart_index(ctx, info.index_size);
+ info.restart_index = ctx->Array._RestartIndex[index_size - 1];
}
} else {
info.index_size = 0;