panfrost: Rewrite varying assembly
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 15 Mar 2019 23:25:55 +0000 (23:25 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 19 Mar 2019 03:55:10 +0000 (03:55 +0000)
commitb98955e128ca3470d89c925f58567f2369f8072a
tree0f77c7c7a6c36fc6f597dace179b4c3fb0f80c98
parent5e6d33a7b6cf7a9753fc8de167341da7f542b7cc
panfrost: Rewrite varying assembly

There are two stages to varying assembly in the command stream: creating
the varying buffers in the command stream, and creating the varying meta
descriptors (also in the command stream) linked to the aforementioned
buffers. The previous code for this was ad hoc and brittle, making some
invalid assumptions causing unmaintainable workarounds to pile up across
the driver (both compiler and command stream side).

This patch completely rewrites the varying assembly code. There's a
trivial performance penalty (we now memcpy the varying meta to the
command stream on draw, rather than on compile). That said, the
improvement in flexibility and clarity is well-worth it.

The motivator for these changes was support for gl_PointCoord (and
eventually point sprites for legacy GL), which was impossible to
implement with the old varying assembly code.  With the new refactor,
it's super easy; support for gl_PointCoord is included with this patch.

All in all, I'm quite happy with how this turned out.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/include/panfrost-job.h
src/gallium/drivers/panfrost/midgard/midgard_compile.c
src/gallium/drivers/panfrost/midgard/midgard_compile.h
src/gallium/drivers/panfrost/pan_assemble.c
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h