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:
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
|
||||
|
|
|
@ -139,6 +139,8 @@ extern void
|
|||
_mesa_load_state_parameters(struct gl_context *ctx,
|
||||
struct gl_program_parameter_list *paramList);
|
||||
|
||||
extern unsigned
|
||||
_mesa_program_state_value_size(const gl_state_index16 state[STATE_LENGTH]);
|
||||
|
||||
extern GLbitfield
|
||||
_mesa_program_state_flags(const gl_state_index16 state[STATE_LENGTH]);
|
||||
|
|
Loading…
Reference in New Issue