tu: Decouple program state from the pipeline
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 8 Sep 2023 11:41:18 +0000 (13:41 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 25 Sep 2023 19:03:56 +0000 (19:03 +0000)
commit419c4b8ecec05288401fe9d167c46aad72801aa0
tree767f2031616bac71bd91ee7f267d2c999a835c1e
parent26352d26bfca364017bc71c07a7ef44070357481
tu: Decouple program state from the pipeline

There are a couple pieces of state that we can't calculate until we know
all of the shaders:

- The actual variants to use (i.e. whether to use safe-const variants)
- Program config and VPC draw states
- Const layout, which depends on the variants
- Whether per-view viewports should be enabled

Now that these are all combined in tu_pipeline::program, move these into
a separate struct that can be referenced directly without a pipeline.
The next step is to refactor the code filling it out so that it can be
called at draw time when given just the shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
src/freedreno/vulkan/tu_cmd_buffer.cc
src/freedreno/vulkan/tu_cmd_buffer.h
src/freedreno/vulkan/tu_pipeline.cc
src/freedreno/vulkan/tu_pipeline.h