etnaviv: Add static_assert(..) to catch memory corruption
When we start to support GPUs with more then 16 varyings the code base tells us that there is some work to do. Cc: mesa-stable Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26662>
This commit is contained in:
parent
11ffb20b70
commit
2f205caea4
1 changed files with 1 additions and 0 deletions
|
|
@ -147,6 +147,7 @@ etna_link_shaders(struct etna_context *ctx, struct compiled_shader_state *cs,
|
|||
COND(last_varying_2x, VIVS_RA_CONTROL_LAST_VARYING_2X);
|
||||
|
||||
cs->PA_ATTRIBUTE_ELEMENT_COUNT = VIVS_PA_ATTRIBUTE_ELEMENT_COUNT_COUNT(link.num_varyings);
|
||||
STATIC_ASSERT(VIVS_PA_SHADER_ATTRIBUTES__LEN >= ETNA_NUM_VARYINGS);
|
||||
for (int idx = 0; idx < link.num_varyings; ++idx)
|
||||
cs->PA_SHADER_ATTRIBUTES[idx] = link.varyings[idx].pa_attributes;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue