summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-03-27 02:22:33 +0000
committerAlyssa Rosenzweig <[email protected]>2019-03-31 02:36:37 +0000
commit28b234a092f79eb517f43f5fce852b68127e16f4 (patch)
treeae3f84570d11d51a3199ee728031b1041ac346b4 /src
parentb2d651b86267f7511e3c4c35d92c0ff72e174bc7 (diff)
panfrost: Fix vertex buffer corruption
Fixes crash in dEQP-GLES2.functional.buffer.* Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index c513791615e..8fed5270f50 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -773,12 +773,14 @@ panfrost_emit_vertex_data(struct panfrost_context *ctx)
* rsrc->gpu. However, attribute buffers must be 64 aligned. If
* it is not, for now we have to duplicate the buffer. */
- mali_ptr effective_address = (rsrc->bo->gpu + buf->buffer_offset);
+ mali_ptr effective_address = rsrc ? (rsrc->bo->gpu + buf->buffer_offset) : 0;
- if (effective_address & 0x3F) {
- attrs[i].elements = panfrost_upload_transient(ctx, rsrc->bo->cpu + buf->buffer_offset, attrs[i].size) | 1;
+ if (effective_address) {
+ attrs[i].elements = panfrost_upload_transient(ctx, rsrc->bo->cpu + buf->buffer_offset, attrs[i].size) | MALI_ATTR_LINEAR;
+ } else if (effective_address) {
+ attrs[i].elements = effective_address | MALI_ATTR_LINEAR;
} else {
- attrs[i].elements = effective_address | 1;
+ /* Leave unset? */
}
}