mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 23:10:28 +01:00
nvk: Do not increment instance id across draws
In cases of multiple draws (i.e. indirect draws) instance id should not increment across draw boundaries. Use a local copy of "begin" to modify the instance id inside the instances loop only. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
parent
ff30b05917
commit
0de4083544
1 changed files with 10 additions and 0 deletions
|
|
@ -1436,6 +1436,11 @@ nvk_build_mme_draw(struct mme_builder *b, struct mme_value begin)
|
|||
mme_mthd(b, NV9097_SET_GLOBAL_BASE_INSTANCE_INDEX);
|
||||
mme_emit(b, first_instance);
|
||||
|
||||
/* Make a copy of begin because this helper may be called inside an MME loop
|
||||
* (i.e. indirect draws) and we're going to modify the value of begin below.
|
||||
*/
|
||||
begin = mme_mov(b, begin);
|
||||
|
||||
mme_loop(b, instance_count) {
|
||||
mme_mthd(b, NV9097_BEGIN);
|
||||
mme_emit(b, begin);
|
||||
|
|
@ -1509,6 +1514,11 @@ nvk_mme_build_draw_indexed(struct mme_builder *b,
|
|||
mme_mthd(b, NV9097_SET_GLOBAL_BASE_INSTANCE_INDEX);
|
||||
mme_emit(b, first_instance);
|
||||
|
||||
/* Make a copy of begin because this helper may be called inside an MME loop
|
||||
* (i.e. indirect draws) and we're going to modify the value of begin below.
|
||||
*/
|
||||
begin = mme_mov(b, begin);
|
||||
|
||||
mme_loop(b, instance_count) {
|
||||
mme_mthd(b, NV9097_BEGIN);
|
||||
mme_emit(b, begin);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue