asahi: eliminate troublesome empty uniforms
these don't do what you expect and are wasteful. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29179>
This commit is contained in:
committed by
Marge Bot
parent
0e845e38f9
commit
6d518609e3
@@ -76,6 +76,7 @@ agx_usc_uniform(struct agx_usc_builder *b, unsigned start_halfs,
|
||||
{
|
||||
assert((start_halfs + size_halfs) <= (1 << 9) && "uniform file overflow");
|
||||
assert(size_halfs <= 64 && "caller's responsibility to split");
|
||||
assert(size_halfs > 0 && "no empty uniforms");
|
||||
|
||||
if (start_halfs & BITFIELD_BIT(8)) {
|
||||
agx_usc_pack(b, UNIFORM_HIGH, cfg) {
|
||||
|
||||
@@ -375,19 +375,22 @@ lay_out_uniforms(struct agx_compiled_shader *shader, struct state *state)
|
||||
DIV_ROUND_UP(BITSET_LAST_BIT(shader->attrib_components_read), 4);
|
||||
|
||||
struct agx_draw_uniforms *u = NULL;
|
||||
shader->push[shader->push_range_count++] = (struct agx_push_range){
|
||||
.uniform = 0,
|
||||
.table = AGX_SYSVAL_TABLE_ROOT,
|
||||
.offset = (uintptr_t)&u->attrib_base,
|
||||
.length = 4 * count,
|
||||
};
|
||||
|
||||
shader->push[shader->push_range_count++] = (struct agx_push_range){
|
||||
.uniform = 4 * count,
|
||||
.table = AGX_SYSVAL_TABLE_ROOT,
|
||||
.offset = (uintptr_t)&u->attrib_clamp,
|
||||
.length = 2 * count,
|
||||
};
|
||||
if (count) {
|
||||
shader->push[shader->push_range_count++] = (struct agx_push_range){
|
||||
.uniform = 0,
|
||||
.table = AGX_SYSVAL_TABLE_ROOT,
|
||||
.offset = (uintptr_t)&u->attrib_base,
|
||||
.length = 4 * count,
|
||||
};
|
||||
|
||||
shader->push[shader->push_range_count++] = (struct agx_push_range){
|
||||
.uniform = 4 * count,
|
||||
.table = AGX_SYSVAL_TABLE_ROOT,
|
||||
.offset = (uintptr_t)&u->attrib_clamp,
|
||||
.length = 2 * count,
|
||||
};
|
||||
}
|
||||
|
||||
shader->push[shader->push_range_count++] = (struct agx_push_range){
|
||||
.uniform = 6 * count,
|
||||
|
||||
Reference in New Issue
Block a user