Closed Amatsugu closed 6 years ago
The indices array in your post differs from that in your code. Which one are you using?
The ones I posted, the ones in my code is the reversed order to try to make sense of what may be happening, but I was only able to get one triangle rendered with that method.
I think the problem is in this line:
commandBuffers[i].CmdBindIndexBuffer(indexBuffer, 0, IndexType.Uint16);
You are using an int array for indices. The IndexType should be Int32 in this case. You could also change the array to ushort[].
Thanks. That was infact the issue. Guess a validation layer won't catch an issue like this. I'll have to be more careful.
I've been following the Vulkan Tutorial and I implemented an index buffer and noticed that it does not draw my vertices correctly. It seems to be drawing in the reverse order. My vertices
My indices
Everything draws correctly when using
CmdDraw
, but it wont draw properly (with the correct front face) when I useCmdDrawIndexed
unless i reverse my indices.Here is the full code: Command Buffers Initialize Pipeline Creation Vertex/Index Buffer Creation
I'm not sure why it's not working, I couldn't find any obvious errors with my code, so I decided to post here.