Commit 59bcd74c authored by Lyude Paul's avatar Lyude Paul
Browse files

bifrost: Update clause header based on notes in disassembler

parent 6cd900f4
......@@ -208,18 +208,31 @@ For any remaining constants, we simply add quadwords with two constants each, pa
The clause header mainly contains information about "variable-latency" instructions like SSBO loads/stores/atomics, texture sampling, etc. that use separate functional units. There can be at most one variable-latency instruction per clause. It also indicates when execution should stop, and has some information about branching. The format of the header is as follows:
[options="header"]
|============================
|====================================
| Field | Bits
| unknown | 17
| Data Register Write Barrier | 1
| Data Register | 6
| Scoreboard dependencies | 8
| Scoreboard entry | 3
| Instruction type | 4
| unknown | 1
| Next clause instruction type | 4
| unknown | 1
|============================
| Unknown | 11
| Back to back | 1
| Not end of shader | 1
| Unknown | 2
| Elide writes | 1
| Branch conditional | 1
| Data Register Write Barrier | 1
| Data Register | 6
| Scoreboard dependencies | 8
| Scoreboard entry | 3
| Instruction type | 4
| Unknown | 1
| Next clause instruction type | 4
| Unknown | 1
|====================================
The "Back to Back" field is set to true if the execution mask of the next clause is the same as the mask of the current clause and there is no branch instruction in this clause.
The "Elide Writes" field is set to true for fragment shaders, and is intended to implement section 7.1.5 of the GLSL ES spec: "Stores to image and buffer variables performed by helper invocations have no effect on the underlying image or buffer memory.". Helper invocations are threads (invocations) corresponding to pixels in a quad that aren't actually part of the triangle, but are included to make derivatives work correctly. They're usually turned on, but they need to be masked off for GLSL-level stores.
The "Branch Conditional" bit is always set if the "Back to Back" field is set to one. Otherwise, it's either set to one to indicate that this clause is either a conditional branch or a fallthrough branch, or zero to indicate that this clause is unconditionally executed.
The "Data Register Write Barrier" is set when the next clause writes to the data register of some previous clause.
=== Register field
......
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