summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-02-12 18:02:24 -0500
committerMarek Olšák <marek.olsak@amd.com>2020-03-04 19:54:42 -0500
commit87085c673d593e6332ca2f3fb6737b77f7087f66 (patch)
treec54fb454a368b7c309e5f6266ee23a16a66ff57f /src/mesa/tnl
parentf38ffa4659aa985f5d1c78bdd5be5064b792b819 (diff)
mesa: add index_size_shift = log2(index_size) into _mesa_index_buffer
for faster division Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Ian Romanick <ian.d.romanic@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_rebase.c1
-rw-r--r--src/mesa/tnl/t_split_copy.c1
-rw-r--r--src/mesa/tnl/t_split_inplace.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_rebase.c b/src/mesa/tnl/t_rebase.c
index 06d67620f63..3c2a0e0afcc 100644
--- a/src/mesa/tnl/t_rebase.c
+++ b/src/mesa/tnl/t_rebase.c
@@ -188,6 +188,7 @@ void t_rebase_prims( struct gl_context *ctx,
tmp_ib.ptr = tmp_indices;
tmp_ib.count = ib->count;
tmp_ib.index_size = ib->index_size;
+ tmp_ib.index_size_shift = ib->index_size_shift;
ib = &tmp_ib;
}
diff --git a/src/mesa/tnl/t_split_copy.c b/src/mesa/tnl/t_split_copy.c
index 45b20fbd49c..f20a97755cb 100644
--- a/src/mesa/tnl/t_split_copy.c
+++ b/src/mesa/tnl/t_split_copy.c
@@ -551,6 +551,7 @@ replay_init(struct copy_context *copy)
*/
copy->dstib.count = 0; /* duplicates dstelt_nr */
copy->dstib.index_size = 4;
+ copy->dstib.index_size_shift = 2;
copy->dstib.obj = ctx->Shared->NullBufferObj;
copy->dstib.ptr = copy->dstelt;
}
diff --git a/src/mesa/tnl/t_split_inplace.c b/src/mesa/tnl/t_split_inplace.c
index d9ea52dfaf1..ee229b6a97f 100644
--- a/src/mesa/tnl/t_split_inplace.c
+++ b/src/mesa/tnl/t_split_inplace.c
@@ -228,6 +228,7 @@ split_prims(struct split_context *split)
ib.count = count;
ib.index_size = 4;
+ ib.index_size_shift = 2;
ib.obj = split->ctx->Shared->NullBufferObj;
ib.ptr = elts;