<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Apr 3, 2017 4:04 PM, "Brian Paul" <<a href="mailto:brian.e.paul@gmail.com">brian.e.paul@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I need to test this series on Windows and with MinGW first.  I'm worried about enums with bitfields.<br></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Hopefully it'll work. Enums without bitfields always occupy 4 bytes. If bitfields don't work with those, we'll have to stop using enums in these cases.</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div>-Brian<br><br><div><div><div class="gmail_extra"><br><div class="gmail_quote"><div class="elided-text">On Mon, Apr 3, 2017 at 2:46 AM, Nicolai Hähnle <span dir="ltr"><<a href="mailto:nhaehnle@gmail.com" target="_blank">nhaehnle@gmail.com</a>></span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">Some of these are a bit subtle, but I think they're fine. Series is:<br>
<br>
Reviewed-by: Nicolai Hähnle <<a href="mailto:nicolai.haehnle@amd.com" target="_blank">nicolai.haehnle@amd.com</a>><div><div class="m_3137366361728975687h5"><br>
<br>
On 02.04.2017 20:00, Marek Olšák wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
<br>
---<br>
 src/gallium/auxiliary/indices<wbr>/u_primconvert.c | 10 ++++++++--<br>
 src/gallium/include/pipe/p_st<wbr>ate.h            |  2 +-<br>
 2 files changed, 9 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/gallium/auxiliary/indice<wbr>s/u_primconvert.c b/src/gallium/auxiliary/indice<wbr>s/u_primconvert.c<br>
index 2bdfade..1ffca4b 100644<br>
--- a/src/gallium/auxiliary/indice<wbr>s/u_primconvert.c<br>
+++ b/src/gallium/auxiliary/indice<wbr>s/u_primconvert.c<br>
@@ -121,39 +121,45 @@ util_primconvert_draw_vbo(stru<wbr>ct primconvert_context *pc,<br>
    util_draw_init_info(&new_info)<wbr>;<br>
    new_info.indexed = true;<br>
    new_info.min_index = info->min_index;<br>
    new_info.max_index = info->max_index;<br>
    new_info.index_bias = info->index_bias;<br>
    new_info.start_instance = info->start_instance;<br>
    new_info.instance_count = info->instance_count;<br>
    new_info.primitive_restart = info->primitive_restart;<br>
    new_info.restart_index = info->restart_index;<br>
    if (info->indexed) {<br>
+      enum pipe_prim_type mode = 0;<br>
+<br>
       u_index_translator(pc->primty<wbr>pes_mask,<br>
                          info->mode, pc->saved_ib.index_size, info->count,<br>
                          pc->api_pv, pc->api_pv,<br>
                          info->primitive_restart ? PR_ENABLE : PR_DISABLE,<br>
-                         &new_info.mode, &new_ib.index_size, &new_info.count,<br>
+                         &mode, &new_ib.index_size, &new_info.count,<br>
                          &trans_func);<br>
+      new_info.mode = mode;<br>
       src = ib->user_buffer;<br>
       if (!src) {<br>
          src = pipe_buffer_map(pc->pipe, ib->buffer,<br>
                                PIPE_TRANSFER_READ, &src_transfer);<br>
       }<br>
       src = (const uint8_t *)src + ib->offset;<br>
    }<br>
    else {<br>
+      enum pipe_prim_type mode = 0;<br>
+<br>
       u_index_generator(pc->primtyp<wbr>es_mask,<br>
                         info->mode, info->start, info->count,<br>
                         pc->api_pv, pc->api_pv,<br>
-                        &new_info.mode, &new_ib.index_size, &new_info.count,<br>
+                        &mode, &new_ib.index_size, &new_info.count,<br>
                         &gen_func);<br>
+      new_info.mode = mode;<br>
    }<br>
<br>
    u_upload_alloc(pc->pipe->strea<wbr>m_uploader, 0, new_ib.index_size * new_info.count, 4,<br>
                   &new_ib.offset, &new_ib.buffer, &dst);<br>
<br>
    if (info->indexed) {<br>
       trans_func(src, info->start, info->count, new_info.count, info->restart_index, dst);<br>
    }<br>
    else {<br>
       gen_func(info->start, new_info.count, dst);<br>
diff --git a/src/gallium/include/pipe/p_s<wbr>tate.h b/src/gallium/include/pipe/p_s<wbr>tate.h<br>
index d68a4d4..eeabf8b 100644<br>
--- a/src/gallium/include/pipe/p_s<wbr>tate.h<br>
+++ b/src/gallium/include/pipe/p_s<wbr>tate.h<br>
@@ -634,21 +634,21 @@ struct pipe_index_buffer<br>
    const void *user_buffer;  /**< pointer to a user buffer if buffer == NULL */<br>
 };<br>
<br>
<br>
 /**<br>
  * Information to describe a draw_vbo call.<br>
  */<br>
 struct pipe_draw_info<br>
 {<br>
    boolean indexed;  /**< use index buffer */<br>
-   enum pipe_prim_type mode;  /**< the mode of the primitive */<br>
+   enum pipe_prim_type mode:8;  /**< the mode of the primitive */<br>
    boolean primitive_restart;<br>
    ubyte vertices_per_patch; /**< the number of vertices per patch */<br>
<br>
    unsigned start;  /**< the index of the first vertex */<br>
    unsigned count;  /**< number of vertices */<br>
<br>
    unsigned start_instance; /**< first instance id */<br>
    unsigned instance_count; /**< number of instances */<br>
<br>
    unsigned drawid; /**< id of this draw in a multidraw */<br>
<br>
</blockquote>
<br>
<br>
-- <br></div></div>
Lerne, wie die Welt wirklich ist,<br>
Aber vergiss niemals, wie sie sein sollte.</div><div class="m_3137366361728975687HOEnZb"><div class="m_3137366361728975687h5"><br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>