summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-08-08 15:07:51 -0400
committerMarek Olšák <[email protected]>2018-08-23 16:56:17 -0400
commit8c71b70f07a3efea713c27d058fba32ce1b84374 (patch)
tree953e29d29b3a406bbd588fdb45973458e2beedb9 /src
parent80aecad0ca95c39d37a9a8003074dc9a2789bc52 (diff)
tgsi/ureg: don't call tgsi_sanity when it's too slow
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 92c98c763eb..c1c8851486e 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -2106,7 +2106,18 @@ const struct tgsi_token *ureg_finalize( struct ureg_program *ureg )
}
#if DEBUG
- if (tokens && !tgsi_sanity_check(tokens)) {
+ /* tgsi_sanity doesn't seem to return if there are too many constants. */
+ bool too_many_constants = false;
+ for (unsigned i = 0; i < ARRAY_SIZE(ureg->const_decls); i++) {
+ for (unsigned j = 0; j < ureg->const_decls[i].nr_constant_ranges; j++) {
+ if (ureg->const_decls[i].constant_range[j].last > 4096) {
+ too_many_constants = true;
+ break;
+ }
+ }
+ }
+
+ if (tokens && !too_many_constants && !tgsi_sanity_check(tokens)) {
debug_printf("tgsi_ureg.c, sanity check failed on generated tokens:\n");
tgsi_dump(tokens, 0);
assert(0);