nv50: allocate more offset space for occlusion queries
PATCH 1/1 nv50: allocate more offset space for occlusion queries
Commit 1a170980a09 started writing to q->data[4]/[5] but kept the per-query space at 16, which meant that in some cases we would write past the end of the buffer. Rotate by 32, like nvc0 does.
--- src/gallium/drivers/nouveau/nv50/nv50_query.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
src/gallium/drivers/nouveau/nv50/nv50_query.c +4 -4
@@ -116,8 +116,8 @@ nv50_query_create(struct pipe_context *pipe, unsigned type, unsigned index) q->type = type;if (q->type ==PIPE_QUERY_OCCLUSION_COUNTER ) { - q->offset -=16 ; - q->data -=16 /sizeof (*q->data);/* we advance before query_begin ! */ + q->offset -=32 ; + q->data -=32 /sizeof (*q->data);/* we advance before query_begin ! */ }return (struct pipe_query *)q;
@@ -150,8 +150,8 @@ nv50_query_begin(struct pipe_context *pipe, struct pipe_query *pq)* initialized it to TRUE. */ if (q->type ==PIPE_QUERY_OCCLUSION_COUNTER ) { - q->offset +=16 ; - q->data +=16 /sizeof (*q->data); + q->offset +=32 ; + q->data +=32 /sizeof (*q->data);if (q->offset - q->base ==NV50_QUERY_ALLOC_SPACE )nv50_query_allocate (nv50, q,NV50_QUERY_ALLOC_SPACE );
Signature · 6 lines
2.0.5 _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
A message that is not in the archive (sent off-list or not yet received): 1428120023-9598-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]
Samuel Pitoiset
Reviewed-byBut please, fix the comment in the nv50_query struct, now it is "/* base + i * 32 */".
Quoted 27 lines · Ilia Mirkin
Commit
1a170980a09started writing to q->data[4]/[5] but kept the per-query space at 16, which meant that in some cases we would write past the end of the buffer. Rotate by 32, like nvc0 does.Signed-off-by Ilia Mirkin <[email protected]>Tested-by Nick Tenney <[email protected]>Cc "10.4 10.5" <[email protected]>--- src/gallium/drivers/nouveau/nv50/nv50_query.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)src/gallium/drivers/nouveau/nv50/nv50_query.c +2
-2@@ -116,8 +116,8 @@ nv50_query_create(struct pipe_context *pipe, unsigned type, unsigned index) q->type = type;if (q->type ==PIPE_QUERY_OCCLUSION_COUNTER ) { - q->offset -=16 ; - q->data -=16 /sizeof (*q->data);/* we advance before query_begin ! */ + q->offset -=32 ; + q->data -=32 /sizeof (*q->data);/* we advance before query_begin ! */ }return (struct pipe_query *)q;
src/gallium/drivers/nouveau/nv50/nv50_query.c nv50_query_begin(struct pipe_context *pipe, struct pipe_query *pq) · line 157
Quoted 10 lines
src/gallium/drivers/nouveau/nv50/nv50_query.c +2
-2@@ -150,8 +150,8 @@ nv50_query_begin(struct pipe_context *pipe, struct pipe_query *pq)* initialized it to TRUE. */ if (q->type ==PIPE_QUERY_OCCLUSION_COUNTER ) { - q->offset +=16 ; - q->data +=16 /sizeof (*q->data); + q->offset +=32 ; + q->data +=32 /sizeof (*q->data);if (q->offset - q->base ==NV50_QUERY_ALLOC_SPACE )nv50_query_allocate (nv50, q,NV50_QUERY_ALLOC_SPACE );
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau