projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vc4: Split the coordinate shader to its own vc4_compiled_shader.
[mesa.git]
/
src
/
gallium
/
drivers
/
vc4
/
vc4_opt_cse.c
diff --git
a/src/gallium/drivers/vc4/vc4_opt_cse.c
b/src/gallium/drivers/vc4/vc4_opt_cse.c
index 511e3b94f07c67b25ebf366389d19d1c519f1289..d3ef91083c61322d962d7dac33f182001a420c15 100644
(file)
--- a/
src/gallium/drivers/vc4/vc4_opt_cse.c
+++ b/
src/gallium/drivers/vc4/vc4_opt_cse.c
@@
-62,7
+62,8
@@
inst_key_equals(const void *a, const void *b)
}
static struct qinst *
}
static struct qinst *
-vc4_find_cse(struct hash_table *ht, struct qinst *inst, uint32_t sf_count,
+vc4_find_cse(struct vc4_compile *c, struct hash_table *ht,
+ struct qinst *inst, uint32_t sf_count,
uint32_t r4_count)
{
if (inst->dst.file != QFILE_TEMP ||
uint32_t r4_count)
{
if (inst->dst.file != QFILE_TEMP ||
@@
-90,11
+91,11
@@
vc4_find_cse(struct hash_table *ht, struct qinst *inst, uint32_t sf_count,
fprintf(stderr, "CSE found match:\n");
fprintf(stderr, " Original inst: ");
fprintf(stderr, "CSE found match:\n");
fprintf(stderr, " Original inst: ");
- qir_dump_inst(entry->data);
+ qir_dump_inst(
c,
entry->data);
fprintf(stderr, "\n");
fprintf(stderr, " Our inst: ");
fprintf(stderr, "\n");
fprintf(stderr, " Our inst: ");
- qir_dump_inst(inst);
+ qir_dump_inst(
c,
inst);
fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
@@
-109,7
+110,7
@@
vc4_find_cse(struct hash_table *ht, struct qinst *inst, uint32_t sf_count,
if (debug) {
fprintf(stderr, "Added to CSE HT: ");
if (debug) {
fprintf(stderr, "Added to CSE HT: ");
- qir_dump_inst(inst);
+ qir_dump_inst(
c,
inst);
fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
@@
-117,14
+118,13
@@
vc4_find_cse(struct hash_table *ht, struct qinst *inst, uint32_t sf_count,
}
bool
}
bool
-qir_opt_cse(struct
q
compile *c)
+qir_opt_cse(struct
vc4_
compile *c)
{
bool progress = false;
struct simple_node *node, *t;
struct qinst *last_sf = NULL;
uint32_t sf_count = 0, r4_count = 0;
{
bool progress = false;
struct simple_node *node, *t;
struct qinst *last_sf = NULL;
uint32_t sf_count = 0, r4_count = 0;
- return false;
struct hash_table *ht = _mesa_hash_table_create(NULL, inst_key_equals);
if (!ht)
return false;
struct hash_table *ht = _mesa_hash_table_create(NULL, inst_key_equals);
if (!ht)
return false;
@@
-144,10
+144,10
@@
qir_opt_cse(struct qcompile *c)
if (debug) {
fprintf(stderr,
"Removing redundant SF: ");
if (debug) {
fprintf(stderr,
"Removing redundant SF: ");
- qir_dump_inst(inst);
+ qir_dump_inst(
c,
inst);
fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
-
remove_from_list(&inst->link
);
+
qir_remove_instruction(inst
);
progress = true;
continue;
} else {
progress = true;
continue;
} else {
@@
-155,7
+155,7
@@
qir_opt_cse(struct qcompile *c)
sf_count++;
}
} else {
sf_count++;
}
} else {
- struct qinst *cse = vc4_find_cse(ht, inst,
+ struct qinst *cse = vc4_find_cse(
c,
ht, inst,
sf_count, r4_count);
if (cse) {
inst->src[0] = cse->dst;
sf_count, r4_count);
if (cse) {
inst->src[0] = cse->dst;
@@
-167,13
+167,13
@@
qir_opt_cse(struct qcompile *c)
if (debug) {
fprintf(stderr, " Turned into: ");
if (debug) {
fprintf(stderr, " Turned into: ");
- qir_dump_inst(inst);
+ qir_dump_inst(
c,
inst);
fprintf(stderr, "\n");
}
}
}
fprintf(stderr, "\n");
}
}
}
- if (qir_
read
s_r4(inst))
+ if (qir_
write
s_r4(inst))
r4_count++;
}
r4_count++;
}