panfrost: Take into account a index_bias for glDrawElementsBaseVertex calls
authorRohan Garg <rohan.garg@collabora.com>
Wed, 17 Jul 2019 16:50:13 +0000 (18:50 +0200)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 7 Aug 2019 00:18:19 +0000 (17:18 -0700)
commit16edd56fccad7ba0e1b938a60f0f5e927a104585
tree76dd9dcc3475b4883bfb295a5fef8f8f9020d937
parent4bb17c08ae5d734894de0fcefe6a9645b443bf34
panfrost: Take into account a index_bias for glDrawElementsBaseVertex calls

Midgard does not accept a index_bias directly and relies instead on a
bias correction offset (offset_bias_correction) in order to calculate
the unbiased vertex index.

We need to make sure we adjust offset_start and vertex_count in order to
take into account the index_bias as required by a
glDrawElementsBaseVertex call and then supply a additional
offset_bias_correction to the hardware.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/decode.c