<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 13/10/2018 14:09, Jason Ekstrand
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20181013131000.29394-9-jason.ekstrand@intel.com">
      <pre class="moz-quote-pre" wrap="">---
 src/intel/vulkan/anv_cmd_buffer.c  |  29 +++++++
 src/intel/vulkan/anv_device.c      |  24 ++++++
 src/intel/vulkan/anv_extensions.py |   2 +-
 src/intel/vulkan/anv_pipeline.c    |  10 ++-
 src/intel/vulkan/anv_private.h     |  13 +++
 src/intel/vulkan/genX_cmd_buffer.c | 125 +++++++++++++++++++++++++++++
 src/intel/vulkan/genX_pipeline.c   | 122 ++++++++++++++++++++++++++++
 7 files changed, 323 insertions(+), 2 deletions(-)

</pre>
    </blockquote>
    <p><br>
    </p>
    <p>...</p>
    <p><br>
    </p>
    <blockquote type="cite"
      cite="mid:20181013131000.29394-9-jason.ekstrand@intel.com">
      <pre class="moz-quote-pre" wrap="">
+
+      int max_decls = 0;
+      for (unsigned s = 0; s < MAX_XFB_STREAMS; s++)
+         max_decls = MAX2(max_decls, decls[s]);
+
+      uint8_t sbs[MAX_XFB_STREAMS] = { };
+      for (unsigned b = 0; b < MAX_XFB_BUFFERS; b++) {
+         if (xfb_info->buffers_written & (1 << b))
+            sbs[xfb_info->buffer_to_stream[b]] |= 1 << b;
+      }
+
+      uint32_t *dw = anv_batch_emitn(&pipeline->batch, 3 + 2 * max_decls,
+                                     GENX(3DSTATE_SO_DECL_LIST),
+                                     .StreamtoBufferSelects0 = sbs[0],
+                                     .StreamtoBufferSelects1 = sbs[1],
+                                     .StreamtoBufferSelects2 = sbs[2],
+                                     .StreamtoBufferSelects3 = sbs[3],
+                                     .NumEntries0 = decls[0],
+                                     .NumEntries1 = decls[1],
+                                     .NumEntries2 = decls[2],
+                                     .NumEntries3 = decls[3]);
+
+      for (int i = 0; i < max_decls; i++) {
+         GENX(SO_DECL_ENTRY_pack)(NULL, dw + 3 + i * 2,
+            &(struct GENX(SO_DECL_ENTRY)) {
+               .Stream0Decl = so_decl[0][i],
+               .Stream1Decl = so_decl[1][i],
+               .Stream2Decl = so_decl[2][i],
+               .Stream3Decl = so_decl[3][i],
+            });
+      }</pre>
    </blockquote>
    <p><br>
    </p>
    <p>Documentation of 3DSTATE_SO_DECL_LIST Gen10+ says : <br>
    </p>
    <p>"<br>
    </p>
    <div class="SubNode BSpecFilter"
      data-spec-projects="GEN10:BUG:1939080" data-spec-security=""
data-spec-expanded-projects="CNL,ICLLP,ICLHP,JSL,LKF1,TGLLP,RYF,DG1,ATS,RKLC,RKLGM,ADL"
      style="border-bottom: 1px solid black; border-left: 1px solid
      black; border-image: initial; border-right: none; margin-left:
      -1px; margin-bottom: -1px; border-top: none; color: rgb(35, 35,
      35); font-family: Arial, sans-serif; font-size: 13.3333px;
      font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; orphans: 2; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); text-decoration-style:
      initial; text-decoration-color: initial;">
      <div>
        <div class="XMLContent" style="margin: 2px; display:
          inline-block;">This command must be followed by a PIPE_CONTROL
          with CS Stall bit set.,</div>
      </div>
    </div>
    <div class="SubNode" data-spec-projects="" data-spec-security=""
      style="border-bottom: 1px solid black; border-left: 1px solid
      black; border-image: initial; border-right: none; margin-left:
      -1px; margin-bottom: -1px; border-top: none; color: rgb(35, 35,
      35); font-family: Arial, sans-serif; font-size: 13.3333px;
      font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; orphans: 2; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); text-decoration-style:
      initial; text-decoration-color: initial;">"<br
        class="Apple-interchange-newline">
    </div>
    <p><br>
    </p>
    <blockquote type="cite"
      cite="mid:20181013131000.29394-9-jason.ekstrand@intel.com">
      <pre class="moz-quote-pre" wrap="">
    }
+#endif /* GEN_GEN >= 8 */
 }
 
 static uint32_t
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>