General protection and prevents us from smashing the stack
on the first clear state validation (
a7b8d50bcb). Fixes crash
using icc.
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
backendState.numAttributes =
((ctx->gs ? ctx->gs->info.base.num_outputs : ctx->vs->info.base.num_outputs) - 1) +
(ctx->rasterizer->sprite_coord_enable ? 1 : 0);
+ backendState.numAttributes = std::min((size_t)backendState.numAttributes,
+ sizeof(backendState.numComponents));
for (unsigned i = 0; i < backendState.numAttributes; i++)
backendState.numComponents[i] = 4;
backendState.constantInterpolationMask = ctx->fs->constantMask |