mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
vc4: Reuse uniform_data/contents indices when making uniforms.
This allows vc4_opt_cse.c to CSE-away operations involving the same uniform values. total instructions in shared programs: 37341 -> 36906 (-1.16%) instructions in affected programs: 10233 -> 9798 (-4.25%) total uniforms in shared programs: 10523 -> 10320 (-1.93%) uniforms in affected programs: 2467 -> 2264 (-8.23%)
This commit is contained in:
parent
18ccda7b86
commit
8c7ac377b7
1 changed files with 7 additions and 0 deletions
|
|
@ -114,6 +114,13 @@ add_uniform(struct vc4_compile *c,
|
|||
enum quniform_contents contents,
|
||||
uint32_t data)
|
||||
{
|
||||
for (int i = 0; i < c->num_uniforms; i++) {
|
||||
if (c->uniform_contents[i] == contents &&
|
||||
c->uniform_data[i] == data) {
|
||||
return (struct qreg) { QFILE_UNIF, i };
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t uniform = c->num_uniforms++;
|
||||
struct qreg u = { QFILE_UNIF, uniform };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue