summaryrefslogtreecommitdiff
path: root/src/egl/main/eglapi.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2019-09-18 20:32:36 -0700
committerKenneth Graunke <kenneth@whitecape.org>2019-09-18 22:50:52 -0700
commita16975e615e6a0ce91a4d2cb936cdaa46e8cfbe8 (patch)
tree62b58b2e34b7a21a58d0300f12318fd28884f4cc /src/egl/main/eglapi.c
parent6841f11d1417c15f96276aaf53b92d0f5c998865 (diff)
downloadmesa-a16975e615e6a0ce91a4d2cb936cdaa46e8cfbe8.tar.gz
iris: Rework iris_update_draw_parameters to be more efficient
This improves a couple of things: 1. We now only update anything if the shader actually cares. Previously, is_indexed_draw was causing us to flag dirty vertex buffers, elements, and SGVs every time the shader switched between indexed and non-indexed draws. This is a very common situation, but we only need that information if the shader uses gl_BaseVertex. We were also flagging things when switching between indirect/direct draws as well, and now we only bother if it matters. 2. We upload new draw parameters only when necessary. When we detect that the draw parameters have changed, we upload a new copy, and use that. Previously we were uploading it every time the vertex buffers were dirty (for possibly unrelated reasons) and the shader needed that info. Tying these together also makes the code a bit easier to follow. In Civilization VI's benchmark, this code was flagging dirty state many times per frame (49 average, 16 median, 614 maximum). Now it occurs exactly once for the entire run.
Diffstat (limited to 'src/egl/main/eglapi.c')
0 files changed, 0 insertions, 0 deletions