pan/bi: Move bi_constant_field to bifrost.h
It's a hardware invariant, and useful for the scheduler (not just packing). Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>
This commit is contained in:
parent
ee78628f78
commit
649e45234f
|
@ -86,17 +86,6 @@ bi_lookup_constant(bi_clause *clause, uint32_t cons, bool *hi)
|
||||||
unreachable("Invalid constant accessed");
|
unreachable("Invalid constant accessed");
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned
|
|
||||||
bi_constant_field(unsigned idx)
|
|
||||||
{
|
|
||||||
assert(idx <= 5);
|
|
||||||
|
|
||||||
const unsigned values[] = {
|
|
||||||
4, 5, 6, 7, 2, 3
|
|
||||||
};
|
|
||||||
|
|
||||||
return values[idx] << 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
bi_assign_fau_idx_single(bi_registers *regs,
|
bi_assign_fau_idx_single(bi_registers *regs,
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#define BIFROST_DBG_MSGS 0x0001
|
#define BIFROST_DBG_MSGS 0x0001
|
||||||
#define BIFROST_DBG_SHADERS 0x0002
|
#define BIFROST_DBG_SHADERS 0x0002
|
||||||
|
@ -602,4 +603,18 @@ struct bi_constants {
|
||||||
enum bi_constmod mods[6];
|
enum bi_constmod mods[6];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* FAU selectors for constants are out-of-order, construct the top bits
|
||||||
|
* here given a embedded constant index in a clause */
|
||||||
|
|
||||||
|
static inline unsigned
|
||||||
|
bi_constant_field(unsigned idx)
|
||||||
|
{
|
||||||
|
const unsigned values[] = {
|
||||||
|
4, 5, 6, 7, 2, 3
|
||||||
|
};
|
||||||
|
|
||||||
|
assert(idx <= 5);
|
||||||
|
return values[idx] << 4;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue