Make the index format part of the pipeline state.

This commit is contained in:
Corentin Wallez
2017-09-19 13:38:05 -04:00
committed by Corentin Wallez
parent 715ac712c6
commit 405dcd636a
15 changed files with 56 additions and 28 deletions

View File

@@ -222,6 +222,7 @@ void init() {
.SetLayout(pl)
.SetStage(nxt::ShaderStage::Vertex, vsModule, "main")
.SetStage(nxt::ShaderStage::Fragment, fsModule, "main")
.SetIndexFormat(nxt::IndexFormat::Uint32)
.SetInputState(inputState)
.SetDepthStencilState(depthStencilState)
.GetResult();
@@ -286,7 +287,7 @@ void frame() {
.TransitionBufferUsage(cameraBuffer, nxt::BufferUsageBit::Uniform)
.SetBindGroup(0, bindGroup[0])
.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets)
.SetIndexBuffer(indexBuffer, 0, nxt::IndexFormat::Uint32)
.SetIndexBuffer(indexBuffer, 0)
.DrawElements(36, 1, 0, 0)
.SetStencilReference(0x1)