<div dir="ltr"><div>Thanks. I'm amending this:<br></div><div><br>diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c<br>index 5dc24d6..f26552c 100644<br>--- a/src/gallium/state_trackers/nine/device9.c<br>+++ b/src/gallium/state_trackers/nine/device9.c<br>@@ -2913,6 +2913,7 @@ NineDevice9_DrawIndexedPrimitiveUP( struct NineDevice9 *This,<br> PrimitiveCount,<br> &vbuf,<br> ibuf,<br>+ ibuf ? NULL : pIndexData,<br> index_offset,<br> index_size);<br> NineAfterDraw(This);<br>diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c<br>index 8bfa7fc..0fc4c83 100644<br>--- a/src/gallium/state_trackers/nine/nine_state.c<br>+++ b/src/gallium/state_trackers/nine/nine_state.c<br>@@ -2580,7 +2580,7 @@ CSMT_ITEM_NO_WAIT(nine_context_draw_indexed_primitive,<br> <br> init_draw_info(&info, device, PrimitiveType, PrimitiveCount);<br> info.index_size = context->index_size;<br>- info.start = StartIndex;<br>+ info.start = context->index_offset / context->index_size + StartIndex;<br> info.index_bias = BaseVertexIndex;<br> /* These don't include index bias: */<br> info.min_index = MinVertexIndex;<br>@@ -2619,6 +2619,7 @@ CSMT_ITEM_NO_WAIT(nine_context_draw_indexed_primitive_from_vtxbuf_idxbuf,<br> ARG_VAL(UINT, PrimitiveCount),<br> ARG_BIND_VBUF(struct pipe_vertex_buffer, vbuf),<br> ARG_BIND_RES(struct pipe_resource, ibuf),<br>+ ARG_VAL(void *, user_ibuf),<br> ARG_VAL(UINT, index_offset),<br> ARG_VAL(UINT, index_size))<br> {<br>@@ -2633,8 +2634,12 @@ CSMT_ITEM_NO_WAIT(nine_context_draw_indexed_primitive_from_vtxbuf_idxbuf,<br> info.index_bias = 0;<br> info.min_index = MinVertexIndex;<br> info.max_index = MinVertexIndex + NumVertices - 1;<br>- info.has_user_indices = false;<br>- info.index.resource = ibuf;<br>+ info.has_user_indices = ibuf == NULL;<br>+ if (ibuf)<br>+ info.index.resource = ibuf;<br>+ else<br>+ info.index.user = user_ibuf;<br>+<br> context->pipe->set_vertex_buffers(context->pipe, 0, 1, vbuf);<br> <br> context->pipe->draw_vbo(context->pipe, &info);<br>diff --git a/src/gallium/state_trackers/nine/nine_state.h b/src/gallium/state_trackers/nine/nine_state.h<br>index 9eb04f6..f5fd1ef 100644<br>--- a/src/gallium/state_trackers/nine/nine_state.h<br>+++ b/src/gallium/state_trackers/nine/nine_state.h<br>@@ -518,6 +518,7 @@ nine_context_draw_indexed_primitive_from_vtxbuf_idxbuf(struct NineDevice9 *devic<br> UINT PrimitiveCount,<br> struct pipe_vertex_buffer *vbuf,<br> struct pipe_resource *ibuf,<br>+ void *user_ibuf,<br> unsigned index_offset,<br> unsigned index_size);<br> <br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 30, 2017 at 10:23 AM, Axel Davy <span dir="ltr"><<a href="mailto:axel.davy@normalesup.org" target="_blank">axel.davy@normalesup.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Marek,<br>
<br>
Here is probably the second mistake:<br>
I guess you should change info.start to take into account the offset of the index buffer.<span class=""><br>
<br>
Yours,<br>
<br>
Axel Davy<br>
<br>
On 29/04/2017 01:12, Marek Olšák wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
CSMT_ITEM_NO_WAIT(nine_context<wbr>_draw_indexed_primitive,<br>
ARG_VAL(D3DPRIMITIVETYPE, PrimitiveType),<br>
@@ -2588,73 +2572,77 @@ CSMT_ITEM_NO_WAIT(nine_context<wbr>_draw_indexed_primitive,<br>
ARG_VAL(UINT, NumVertices),<br>
ARG_VAL(UINT, StartIndex),<br>
ARG_VAL(UINT, PrimitiveCount))<br>
{<br>
struct nine_context *context = &device->context;<br>
struct pipe_draw_info info;<br>
nine_update_state(device);<br>
init_draw_info(&info, device, PrimitiveType, PrimitiveCount);<br>
- info.indexed = TRUE;<br>
+ info.index_size = context->index_size;<br>
info.start = StartIndex;<br>
info.index_bias = BaseVertexIndex;<br>
/* These don't include index bias: */<br>
info.min_index = MinVertexIndex;<br>
info.max_index = MinVertexIndex + NumVertices - 1;<br>
+ info.index.resource = context->idxbuf;<br>
context->pipe->draw_vbo(contex<wbr>t->pipe, &info);<br>
}<br>
</blockquote>
<br>
<br>
</blockquote></div><br></div>