diff options
author | Iago Toral Quiroga <[email protected]> | 2019-10-28 13:24:44 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-12-16 08:42:37 +0100 |
commit | 5d578c27cecb4682074778b90b3e4d57a5cc0ebe (patch) | |
tree | ca20b5f252aafc91e82b63553904c27e8a445911 /src/broadcom/common/v3d_limits.h | |
parent | f63750accf99ff0f8503f7196399ad4e0e11befa (diff) |
v3d: add initial compiler plumbing for geometry shaders
Most of the relevant work happens in the v3d_nir_lower_io. Since
geometry shaders can write any number of output vertices, this pass
injects a few variables into the shader code to keep track of things
like the number of vertices emitted or the offsets into the VPM
of the current vertex output, etc. This is also where we handle
EmitVertex() and EmitPrimitive() intrinsics.
The geometry shader VPM output layout has a specific structure
with a 32-bit general header, then another 32-bit header slot for
each output vertex, and finally the actual vertex data.
When vertex shaders are paired with geometry shaders we also need
to consider the following:
- Only geometry shaders emit fixed function outputs.
- The coordinate shader used for the vertex stage during binning must
not drop varyings other than those used by transform feedback, since
these may be read by the binning GS.
v2:
- Use MAX3 instead of a chain of MAX2 (Alejandro).
- Make all loop variables unsigned in ntq_setup_gs_inputs (Alejandro)
- Update comment in IO owering so it includes the GS stage (Alejandro)
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/broadcom/common/v3d_limits.h')
-rw-r--r-- | src/broadcom/common/v3d_limits.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/broadcom/common/v3d_limits.h b/src/broadcom/common/v3d_limits.h index d65edddab74..e02582035f1 100644 --- a/src/broadcom/common/v3d_limits.h +++ b/src/broadcom/common/v3d_limits.h @@ -30,8 +30,11 @@ #define V3D_CHANNELS 16 #define V3D_MAX_FS_INPUTS 64 +#define V3D_MAX_GS_INPUTS 64 #define V3D_MAX_VS_INPUTS 64 -#define V3D_MAX_ANY_STAGE_INPUTS MAX2(V3D_MAX_VS_INPUTS, V3D_MAX_FS_INPUTS) +#define V3D_MAX_ANY_STAGE_INPUTS MAX3(V3D_MAX_VS_INPUTS, \ + V3D_MAX_GS_INPUTS, \ + V3D_MAX_FS_INPUTS) /* Not specifically a hardware limit, just coordination between compiler and * driver. |