v3d: compute appropriate VPM memory configuration for geometry shader workloads

Geometry shaders can output many vertices and thus have higher VPM memory
pressure as a result. It is possible that too wide geometry shader dispatches
exceed the maximum available VPM output allocated, in which case we need
to reduce the dispatch width until we can fit the VPM memory requirements.
Supported dispatch widths for geometry shaders are 16, 8, 4, 1.

There is a limit in the number of VPM output sectors that can be used by a
geometry shader that we can meet by lowering the dispatch width at compile
time, however, at draw time we need to revisit this number and, together with
other elements that can contribute to total VPM memory requirements, decide
on a configuration that can fit the program into the available VPM memory.
Ideally, we also want to aim for not using more than half of the available
memory so we that we can run a pair of bin and render programs in parallel.

v2: fixed language in comment and typo in commit log. (Alejandro)

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
This commit is contained in:
Iago Toral Quiroga
2019-11-07 15:40:45 +01:00
parent 76f4c83815
commit 76fc8c8bb1
3 changed files with 257 additions and 22 deletions

View File

@@ -716,6 +716,13 @@ struct v3d_gs_prog_data {
/* Total number of components written, for the shader state record. */
uint32_t vpm_output_size;
/* Maximum SIMD dispatch width to not exceed VPM output size limits
* in the geometry shader. Notice that the final dispatch width has to
* be decided at draw time and could be lower based on the VPM pressure
* added by other shader stages.
*/
uint8_t simd_width;
/* Output primitive type */
uint8_t out_prim_type;