<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 08/08/18 21:55, Rafael Antognolli
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20180808205549.xga3v57vcya7lnb4@rantogno-mobl4.amr.corp.intel.com">
<blockquote type="cite" style="color: #000000;">
<pre wrap="">t
@@ -790,6 +892,7 @@ aub_viewer_render_batch(struct aub_viewer_decode_ctx *ctx,
for (unsigned i = 0; i < ARRAY_SIZE(info_decoders); i++) {
if (strcmp(inst_name, info_decoders[i].cmd_name) == 0) {
+ ctx->stage = info_decoders[i].stage;
info_decoders[i].decode(ctx, inst, p);
break;
</pre>
</blockquote>
<pre wrap="">Looks like you run the info_decoders before the display decoders (even
though some of them decode the same type of instructions) because you
want to first do a pass storing all the information required for the
display_decoders, right?
And in this case, you also want to store the stage we are at, so when we
run the info_decoders that information is available.
Also, is there a chance we use these same info decoders for storing
other information than urb related stuff? If so, maybe we should just
call them handle_3ds_gs, handle_3ds_constant_vs, etc... Or something
along those lines. But of course we could just rename them in the
future.
</pre>
</blockquote>
<p>The UI code (decode_* functions) run conditionally to the
instruction having their fields visible (expanded by clicking on
them).</p>
<p>info_decoders runs unconditionally so that we can have a
consistent accumulated state that doesn't depend on the UI state.</p>
<p>For example, you might not want to display urb instructions &
their content. Yet you still need to parse their content so that
URB state can be displayed on a latter instruction (like
3DPRIMITIVE).</p>
<p><br>
</p>
<p>This is poorly named indeed and could be done more efficiently.
This can be done later (once you get the hang of ImGui. It's
really fun!).</p>
<p><br>
</p>
<p>-</p>
<p>Lionel<br>
</p>
</body>
</html>