Commit 13d00577 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

src_offset field

parent dbe220af
......@@ -330,7 +330,9 @@ enum mali_attr_type {
};
struct mali_attr_meta {
/* Vertex buffer index */
u8 index;
u64 unknown1 :14;
/* Part of the type specifier, anyway:
......@@ -358,7 +360,11 @@ struct mali_attr_meta {
/* if `normalized` passed to VertexAttribPointer is clear */
unsigned not_normalised : 1;
u64 unknown3 :34;
/* Always observed to be zero at the moment */
unsigned unknown3 : 2;
/* When packing multiple attributes in a buffer, offset addresses by this value */
uint32_t src_offset;
} __attribute__((packed));
ASSERT_SIZEOF_TYPE(struct mali_attr_meta,
sizeof(u64), sizeof(u64));
......
......@@ -504,6 +504,7 @@ panwrap_replay_attribute_meta(int job_no, int count, const struct mali_payload_v
panwrap_prop("unknown1 = 0x%" PRIx64, (u64) attr_meta->unknown1);
panwrap_prop("unknown2 = 0x%" PRIx64, (u64) attr_meta->unknown2);
panwrap_prop("unknown3 = 0x%" PRIx64, (u64) attr_meta->unknown3);
panwrap_prop("src_offset = 0x%" PRIx64, (u64) attr_meta->src_offset);
panwrap_indent--;
panwrap_log("},\n");
......
......@@ -931,6 +931,8 @@ trans_emit_for_draw(struct panfrost_context *ctx)
}
/* Workaround maybe-errata (?) with non-mipmaps */
int s = ctx->sampler_views[t][i]->hw.nr_mipmap_levels;
if (!rsrc->is_mipmap) {
ctx->sampler_views[t][i]->hw.swizzled_bitmaps[1] = rsrc->gpu[0];
ctx->sampler_views[t][i]->hw.unknown3A = 1;
......@@ -938,6 +940,10 @@ trans_emit_for_draw(struct panfrost_context *ctx)
}
trampolines[i] = panfrost_upload(&ctx->cmdstream, &ctx->sampler_views[t][0]->hw, sizeof(struct mali_texture_descriptor), false);
/* Restore */
ctx->sampler_views[t][i]->hw.nr_mipmap_levels = s;
ctx->sampler_views[t][i]->hw.unknown3A = 0;
}
mali_ptr trampoline = panfrost_upload(&ctx->cmdstream, trampolines, sizeof(uint64_t) * ctx->sampler_view_count[t], false);
......@@ -1343,7 +1349,7 @@ panfrost_create_vertex_elements_state(
so->hw[i].unknown2 = 0x1;
/* The field itself should probably be shifted over */
so->hw[i].unknown3 = elements[i].src_offset << 2;
so->hw[i].src_offset = elements[i].src_offset;
}
return so;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment