mesa: add _mesa_program_state_value_size() helper
This allows us to query the uniform size required to store the state value. CC: <stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5656>
This commit is contained in:

committed by
Marge Bot

parent
0e7b1a6b1a
commit
5ddab654d9
@@ -630,6 +630,15 @@ fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
|
||||
}
|
||||
}
|
||||
|
||||
unsigned
|
||||
_mesa_program_state_value_size(const gl_state_index16 state[STATE_LENGTH])
|
||||
{
|
||||
if (state[0] == STATE_LIGHT && state[2] == STATE_SPOT_CUTOFF)
|
||||
return 1;
|
||||
|
||||
/* Everything else is packed into vec4s */
|
||||
return 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a bitmask of the Mesa state flags (_NEW_* values) which would
|
||||
|
Reference in New Issue
Block a user