summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2017-03-03 00:46:53 +0200
committerTimothy Arceri <tarceri@itsqueeze.com>2017-03-03 12:11:55 +1100
commit4dc42ae792352c808e79de299d89a85ea87ecc7e (patch)
tree707a8045c1666ee30f6418a929e17ffc497989ca /src/gallium/auxiliary/tgsi
parent60848555289d2e757aff2f6c53d40c23d46c4489 (diff)
tgsi/ureg: return correct token count in ureg_get_tokens
Valgrind reports that the shader cache writes uninitialized data to disk. Turns out ureg_get_tokens() is returning the count of allocated tokens instead of how many are actually used, so the cache writes out unused space at the end. Use the real count instead. This change should not cause regressions elsewhere because the only ureg_get_tokens() user that cares about token count is the shader cache. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 8d1b6cc7da4..ab0a3ebe1a5 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -2141,7 +2141,7 @@ const struct tgsi_token *ureg_get_tokens( struct ureg_program *ureg,
tokens = &ureg->domain[DOMAIN_DECL].tokens[0].token;
if (nr_tokens)
- *nr_tokens = ureg->domain[DOMAIN_DECL].size;
+ *nr_tokens = ureg->domain[DOMAIN_DECL].count;
ureg->domain[DOMAIN_DECL].tokens = 0;
ureg->domain[DOMAIN_DECL].size = 0;