lima: add natively supported vertex buffer formats
With a simple perf profiling session with supertuxkart, I noticed that it was spending something on the order of ~10% of the time on u_vbuf_translate_begin
.
With some additional debugs, I noticed that it happens because it uses a "non-native" vertex format while drawing, which causes a translate to a native format.
After some more digging, the root of it comes from the fact that until now lima supported only PIPE_FORMAT_R32G32B32_FLOAT
for PIPE_BIND_VERTEX_BUFFER
, but supertuxkart uses PIPE_FORMAT_R8G8B8A8_UNORM
for drawing.
Listing that format as supported for PIPE_BIND_VERTEX_BUFFER
removes the u_vbuf_translate_begin
usage and the application still works.
I found piglit test gl-2.0-vertexattribpointer
which seems to stress multiple formats, and tried all formats listed in vbuf_format_fallbacks
.
Some seem to be indeed unsupported (32bit integer ones or 64bit ones) but many previously unlisted seem to be natively supported.
With the list enabled in this patch, I don't get any regressions on gl-2.0-vertexattribpointer
or deqp/piglit or any applications I tried.
This helps performance on supertuxkart. I noticed even Xorg was triggering many format translations, so this probably helps other applications too.