Unverified Commit f2240fdc authored by Connor Abbott's avatar Connor Abbott Committed by GitHub
Browse files

bifrost: Document special uniform/const port arguments

parent 083b1a11
......@@ -338,7 +338,7 @@ Before we get to the actual format of the Control field, though, we need to desc
Unlike the other ports, the uniform/const port always loads 64 bits at a time. If an FMA or ADD instruction only needs 32 bits of data, the high 32 bits or low 32 bits are selected later in the source field, described below.
The uniform/const bits describe what the uniform/const port should load. If the high bit is set, then the low 7 bits describe which pair of 32-bit uniform registers to load. For example, 10000001 would load from uniform registers 2 and 3. If the high bit isn't set, then the next-highest 3 bits indicate what 64-bit constant to load, while the low 4 bits contain the low 4 bits of the constant. The mapping from from bits to constants is a little strange:
The uniform/const bits describe what the uniform/const port should load. If the high bit is set, then the low 7 bits describe which pair of 32-bit uniform registers to load. For example, 10000001 would load from uniform registers 2 and 3. If the high bit isn't set, then the next-highest 3 bits indicate what 64-bit immediate to load, while the low 4 bits contain the low 4 bits of the constant. The mapping from from bits to constants is a little strange:
[options="header"]
|============================
......@@ -349,10 +349,21 @@ The uniform/const bits describe what the uniform/const port should load. If the
| 7 | 3
| 2 | 4
| 3 | 5
| 0 | disable?
| 1 | unused?
| 0 | special (see below)
| 1 | unknown (also special?)
|============================
The uniform/const port also supports loading a few "special" 64-bit constants that aren't inline immediates, or loaded through the normal uniform mechanism. These usually have to do with fixed-function hardware like blending, alpha testing, etc. The known ones are listed below:
[options="header"]
|============================
| Field value | Special constant
| 05 | Alpha-test data (used with ATEST)
| 06 | gl_FragCoord pointer
| 08-0f | Blend descriptors 0-7 (used with BLEND to indicate which output to blend with)
The gl_FragCoord pointer is a pointer to an array, indexed by gl_SampleID in R61 (see the varying interpolation section), of 16-bit vec2's that when loaded with a normal LOAD instruction, gives the sample (xy) position used for calculating gl_FragCoord.
== Source fields
When the FMA and ADD stages want to use the result of the register stage, they do so through a 3-bit source field in the instruction word. There are as many source fields are there are sources for each operation. The following table shows the meaning of this 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