pan/decode: Cleanup sample locations decode

We know what this is now. I opted to leave it in ~fixed-point format to
avoid bikeshedding over precision.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
This commit is contained in:
Alyssa Rosenzweig
2021-01-29 16:52:45 -05:00
parent 2afdcc187b
commit b27d0164ee

View File

@@ -254,34 +254,21 @@ pandecode_render_target(uint64_t gpu_va, unsigned job_no, bool is_bifrost, unsig
} }
static void static void
pandecode_mfbd_bifrost_deps(const void *fb, int job_no) pandecode_sample_locations(const void *fb, int job_no)
{ {
pan_section_unpack(fb, MULTI_TARGET_FRAMEBUFFER, BIFROST_PARAMETERS, params); pan_section_unpack(fb, MULTI_TARGET_FRAMEBUFFER, BIFROST_PARAMETERS, params);
/* The blob stores all possible sample locations in a single buffer
* allocated on startup, and just switches the pointer when switching
* MSAA state. For now, we just put the data into the cmdstream, but we
* should do something like what the blob does with a real driver.
*
* There seem to be 32 slots for sample locations, followed by another
* 16. The second 16 is just the center location followed by 15 zeros
* in all the cases I've identified (maybe shader vs. depth/color
* samples?).
*/
struct pandecode_mapped_memory *smem = struct pandecode_mapped_memory *smem =
pandecode_find_mapped_gpu_mem_containing(params.sample_locations); pandecode_find_mapped_gpu_mem_containing(params.sample_locations);
const u16 *PANDECODE_PTR_VAR(samples, smem, params.sample_locations); const u16 *PANDECODE_PTR_VAR(samples, smem, params.sample_locations);
pandecode_log("uint16_t sample_locations_%d[] = {\n", job_no); pandecode_log("Sample locations:\n");
pandecode_indent++; for (int i = 0; i < 33; i++) {
for (int i = 0; i < 32 + 16; i++) { pandecode_log(" (%d, %d),\n",
pandecode_log("%d, %d,\n", samples[2 * i], samples[2 * i + 1]); samples[2 * i] - 128,
samples[2 * i + 1] - 128);
} }
pandecode_indent--;
pandecode_log("};\n");
} }
static struct pandecode_fbd static struct pandecode_fbd
@@ -294,7 +281,7 @@ pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_comput
struct pandecode_fbd info; struct pandecode_fbd info;
if (is_bifrost) if (is_bifrost)
pandecode_mfbd_bifrost_deps(fb, job_no); pandecode_sample_locations(fb, job_no);
pandecode_log("Multi-Target Framebuffer:\n"); pandecode_log("Multi-Target Framebuffer:\n");
pandecode_indent++; pandecode_indent++;