mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
nir/inline_uniforms: Allow possibility of uni_offsets and num_offsets being NULL
This is step 3 in an attempt to unify a bunch of nir_inline_uniforms.c and lvp_inline_uniforms.c code. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
This commit is contained in:
parent
0c0fb216dd
commit
edb89b71c5
1 changed files with 9 additions and 0 deletions
|
|
@ -113,6 +113,15 @@ src_only_uses_uniforms(const nir_src *src, int component,
|
|||
nir_src_as_uint(intr->src[1]) <= max_offset &&
|
||||
/* TODO: Can't handle other bit sizes for now. */
|
||||
intr->dest.ssa.bit_size == 32) {
|
||||
/* num_offsets can be NULL if-and-only-if uni_offsets is NULL. */
|
||||
assert((num_offsets == NULL) == (uni_offsets == NULL));
|
||||
|
||||
/* If we're just checking that it's a uniform load, don't check (or
|
||||
* add to) the table.
|
||||
*/
|
||||
if (uni_offsets == NULL)
|
||||
return true;
|
||||
|
||||
uint32_t offset = nir_src_as_uint(intr->src[1]) + component * 4;
|
||||
assert(offset < MAX_OFFSET);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue