Skip to content

Improved parsing of MBS2 structure#2

Merged
BiOpenly merged 4 commits intoPanfrost:masterfrom
cwabbott0:master
Aug 2, 2017
Merged

Improved parsing of MBS2 structure#2
BiOpenly merged 4 commits intoPanfrost:masterfrom
cwabbott0:master

Conversation

@cwabbott0
Copy link
Contributor

As it turns out, every block always starts with a cookie followed by the length of the block. This lets us make the parsing much more robust without having to fully understand everything. I also fixed up a few other things along the way, so now it can handle most things you would throw at it using the offline compiler.

cwabbott0 added 4 commits June 3, 2017 23:04
A lot of blocks seem to be "container blocks" that have nothing more
than a size followed by a bunch of other blocks. Thus, blocks have a
tree structure where blocks can contain other blocks. Represent that by
increasing the indentation for sub-blocks of a given block, and
restructure the code to make parsing these blocks easier. Make the MBS2
block the first container block.
Now we always use the size in the header instead of guessing (often
incorrectly) the block size. I've also added some more details, and
removed some assertions that were tripping. Altogether, this is enough
to be able to parse a simple fragment shader from the malisc offline
shader compiler.
Seems like part of the EBIN block is a list of uniform relocations.
This should make the disassembly of get_program_binary output reasonable
again.
@BiOpenly BiOpenly merged commit 26fd183 into Panfrost:master Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants