diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-10-19 21:31:56 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-10-19 21:31:56 +0000 |
| commit | af5a3688c57f0f0a9406fb1ea488e093d5822aea (patch) | |
| tree | 3780348ac277ab1df447c0b5d2bed6eef3b074f4 /Tests/TestApp | |
| parent | Fixed UWP build error (diff) | |
| download | DiligentEngine-af5a3688c57f0f0a9406fb1ea488e093d5822aea.tar.gz DiligentEngine-af5a3688c57f0f0a9406fb1ea488e093d5822aea.zip | |
Updated submodules (API version 240033);
Enabled bindless mode in Asteroid demo
Diffstat (limited to 'Tests/TestApp')
| -rw-r--r-- | Tests/TestApp/assets/LuaTest.lua | 6 | ||||
| -rw-r--r-- | Tests/TestApp/assets/TestComputeShaders.lua | 1 | ||||
| -rw-r--r-- | Tests/TestApp/src/RenderScriptTest.cpp | 20 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestApp.cpp | 24 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestDrawCommands.cpp | 159 |
5 files changed, 88 insertions, 122 deletions
diff --git a/Tests/TestApp/assets/LuaTest.lua b/Tests/TestApp/assets/LuaTest.lua index 92c61ea..b4ffc48 100644 --- a/Tests/TestApp/assets/LuaTest.lua +++ b/Tests/TestApp/assets/LuaTest.lua @@ -613,7 +613,6 @@ end TestDrawAttribs = DrawAttribs.Create{ NumIndices = 128, IndexType = "VT_UINT16", - IsIndexed = true, NumInstances = 32, BaseVertex = 48, IndirectDrawArgsOffset = 1024, @@ -625,7 +624,6 @@ TestDrawAttribs = DrawAttribs.Create{ } assert( TestDrawAttribs.NumIndices == 128 ) assert( TestDrawAttribs.IndexType == "VT_UINT16" ) -assert( TestDrawAttribs.IsIndexed == true ) assert( TestDrawAttribs.NumInstances == 32 ) assert( TestDrawAttribs.BaseVertex == 48 ) assert( TestDrawAttribs.IndirectDrawArgsOffset == 1024 ) @@ -636,7 +634,6 @@ assert( TestDrawAttribs.FirstInstanceLocation == 96 ) TestDrawAttribs.NumVertices = 92 TestDrawAttribs.IndexType = "VT_UINT32" -TestDrawAttribs.IsIndexed = false TestDrawAttribs.NumInstances = 19 TestDrawAttribs.BaseVertex = 498 TestDrawAttribs.IndirectDrawArgsOffset = 234 @@ -653,7 +650,6 @@ assert( TestDrawAttribs.pIndirectDrawAttribs.Name == TestDrawAttribs2.pIndirectD assert( TestDrawAttribs.NumIndices == 92 ) assert( TestDrawAttribs.NumVertices == 92 ) assert( TestDrawAttribs.IndexType == "VT_UINT32" ) -assert( TestDrawAttribs.IsIndexed == false ) assert( TestDrawAttribs.NumInstances == 19 ) assert( TestDrawAttribs.BaseVertex == 498 ) assert( TestDrawAttribs.IndirectDrawArgsOffset == 234 ) @@ -667,7 +663,6 @@ assert( TestDrawAttribs.IndirectAttribsBufferStateTransitionMode == "RESOURCE_ST assert( TestGlobalDrawAttribs.NumVertices == 123 ); assert( TestGlobalDrawAttribs.NumIndices == 123 ); assert( TestGlobalDrawAttribs.IndexType == "VT_UINT16" ); -assert( TestGlobalDrawAttribs.IsIndexed == true ); assert( TestGlobalDrawAttribs.NumInstances == 19 ); assert( TestGlobalDrawAttribs.BaseVertex == 97 ); assert( TestGlobalDrawAttribs.IndirectDrawArgsOffset == 120 ); @@ -678,7 +673,6 @@ function TestDrawAttribsArg(DrawAttrs) assert( DrawAttrs.NumVertices == 34 ); assert( DrawAttrs.NumIndices == 34 ); assert( DrawAttrs.IndexType == "VT_UINT16" ); - assert( DrawAttrs.IsIndexed == true ); assert( DrawAttrs.NumInstances == 139 ); assert( DrawAttrs.BaseVertex == 937 ); assert( DrawAttrs.IndirectDrawArgsOffset == 1205 ); diff --git a/Tests/TestApp/assets/TestComputeShaders.lua b/Tests/TestApp/assets/TestComputeShaders.lua index f69805d..863c8a5 100644 --- a/Tests/TestApp/assets/TestComputeShaders.lua +++ b/Tests/TestApp/assets/TestComputeShaders.lua @@ -312,7 +312,6 @@ UpdateDispatchArgsBuffSRB:InitializeStaticResources() RenderSRB:InitializeStaticResources() DrawAttrs = DrawAttribs.Create{ - IsIndexed = true, IndexType = "VT_UINT32", pIndirectDrawAttribs = IndirectDrawArgsBuffer, IndirectAttribsBufferStateTransitionMode = "RESOURCE_STATE_TRANSITION_MODE_TRANSITION", diff --git a/Tests/TestApp/src/RenderScriptTest.cpp b/Tests/TestApp/src/RenderScriptTest.cpp index 00000bd..270be4a 100644 --- a/Tests/TestApp/src/RenderScriptTest.cpp +++ b/Tests/TestApp/src/RenderScriptTest.cpp @@ -119,10 +119,9 @@ RenderScriptTest::RenderScriptTest( IRenderDevice *pRenderDevice, IDeviceContext } { - DrawAttribs GlobalDrawAttribs; + ScriptParser::CombinedDrawAttribs GlobalDrawAttribs; GlobalDrawAttribs.NumVertices = 123; GlobalDrawAttribs.IndexType = VT_UINT16; - GlobalDrawAttribs.IsIndexed = True; GlobalDrawAttribs.NumInstances = 19; GlobalDrawAttribs.BaseVertex = 97; GlobalDrawAttribs.IndirectDrawArgsOffset = 120; @@ -330,15 +329,14 @@ RenderScriptTest::RenderScriptTest( IRenderDevice *pRenderDevice, IDeviceContext } { - DrawAttribs DrawAttribs; - DrawAttribs.NumVertices = 34; - DrawAttribs.IndexType = VT_UINT16; - DrawAttribs.IsIndexed = True; - DrawAttribs.NumInstances = 139; - DrawAttribs.BaseVertex = 937; - DrawAttribs.IndirectDrawArgsOffset = 1205; - DrawAttribs.StartVertexLocation = 198; - pScript->Run( "TestDrawAttribsArg", DrawAttribs ); + ScriptParser::CombinedDrawAttribs Attribs; + Attribs.NumVertices = 34; + Attribs.IndexType = VT_UINT16; + Attribs.NumInstances = 139; + Attribs.BaseVertex = 937; + Attribs.IndirectDrawArgsOffset = 1205; + Attribs.StartVertexLocation = 198; + pScript->Run( "TestDrawAttribsArg", Attribs ); } { diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index 9f6fc27..0a5e738 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -691,17 +691,19 @@ void TestApp::Render() UniformData[3] = 0; } - DrawAttribs DrawAttrs; - DrawAttrs.NumVertices = 3; - DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pRenderScript->Run(m_pImmediateContext, "DrawTris", DrawAttrs); - - DrawAttrs.IsIndexed = true; - DrawAttrs.NumIndices = 3; - DrawAttrs.IndexType = VT_UINT32; - DrawAttrs.NumInstances = 3; - DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pRenderScript->Run(m_pImmediateContext, "DrawTris", DrawAttrs); + { + DrawAttribs DrawAttrs{3, DRAW_FLAG_VERIFY_ALL}; + m_pRenderScript->Run(m_pImmediateContext, "DrawTris", DrawAttrs); + } + + { + DrawIndexedAttribs DrawAttrs{}; + DrawAttrs.NumIndices = 3; + DrawAttrs.IndexType = VT_UINT32; + DrawAttrs.NumInstances = 3; + DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; + m_pRenderScript->Run(m_pImmediateContext, "DrawTris", DrawAttrs); + } m_pTestDrawCommands->Draw(); m_pTestBufferAccess->Draw((float)dCurrTime); diff --git a/Tests/TestApp/src/TestDrawCommands.cpp b/Tests/TestApp/src/TestDrawCommands.cpp index 75919c8..a4641a6 100644 --- a/Tests/TestApp/src/TestDrawCommands.cpp +++ b/Tests/TestApp/src/TestDrawCommands.cpp @@ -348,16 +348,16 @@ void TestDrawCommands::Draw() // 0,1 { - DrawAttribs DrawAttrs(2*3, VT_UINT32, DRAW_FLAG_VERIFY_ALL);// Draw 2 triangles - m_pDeviceContext->Draw(DrawAttrs); + DrawIndexedAttribs DrawAttrs(2*3, VT_UINT32, DRAW_FLAG_VERIFY_ALL);// Draw 2 triangles + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 2,3: test index buffer offset m_pDeviceContext->SetIndexBuffer( m_pIndexBuff, 2 * 3 * sizeof( Uint32 ), RESOURCE_STATE_TRANSITION_MODE_VERIFY ); { - DrawAttribs DrawAttrs(2*3, VT_UINT32, DRAW_FLAG_VERIFY_ALL);// Draw 2 triangles - m_pDeviceContext->Draw(DrawAttrs); + DrawIndexedAttribs DrawAttrs(2*3, VT_UINT32, DRAW_FLAG_VERIFY_ALL);// Draw 2 triangles + m_pDeviceContext->DrawIndexed(DrawAttrs); } NumTestTrianglesInRow[1] = 4; @@ -371,18 +371,18 @@ void TestDrawCommands::Draw() // 0,1 { - DrawAttribs DrawAttrs(2*3, VT_UINT32, DRAW_FLAG_VERIFY_ALL);// Draw 2 triangles + DrawIndexedAttribs DrawAttrs(2*3, VT_UINT32, DRAW_FLAG_VERIFY_ALL);// Draw 2 triangles DrawAttrs.BaseVertex = 10; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 2,3: index buffer offset & Base Vertex m_pDeviceContext->SetIndexBuffer( m_pIndexBuff, 2 * 3 * sizeof( Uint32 ), RESOURCE_STATE_TRANSITION_MODE_VERIFY ); { - DrawAttribs DrawAttrs(2*3, VT_UINT32, DRAW_FLAG_VERIFY_ALL);// Draw 2 triangles + DrawIndexedAttribs DrawAttrs(2*3, VT_UINT32, DRAW_FLAG_VERIFY_ALL);// Draw 2 triangles DrawAttrs.BaseVertex = 10; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } NumTestTrianglesInRow[2] = 4; @@ -444,7 +444,7 @@ void TestDrawCommands::Draw() // 0,1 { DrawAttribs DrawAttrs; - DrawAttrs.NumIndices = 3; // Draw 1 triangle + DrawAttrs.NumVertices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.FirstInstanceLocation = 0; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; @@ -454,7 +454,7 @@ void TestDrawCommands::Draw() // 2,3 { DrawAttribs DrawAttrs; - DrawAttrs.NumIndices = 3; // Draw 1 triangle + DrawAttrs.NumVertices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.FirstInstanceLocation = 2; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; @@ -466,7 +466,7 @@ void TestDrawCommands::Draw() m_pDeviceContext->SetVertexBuffers(0, 2, pBuffs, Offsets, RESOURCE_STATE_TRANSITION_MODE_VERIFY, SET_VERTEX_BUFFERS_FLAG_RESET); { DrawAttribs DrawAttrs; - DrawAttrs.NumIndices = 3; // Draw 1 triangle + DrawAttrs.NumVertices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.FirstInstanceLocation = 2; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; @@ -478,7 +478,7 @@ void TestDrawCommands::Draw() m_pDeviceContext->SetVertexBuffers(0, 2, pBuffs, Offsets, RESOURCE_STATE_TRANSITION_MODE_VERIFY, SET_VERTEX_BUFFERS_FLAG_RESET); { DrawAttribs DrawAttrs; - DrawAttrs.NumIndices = 3; // Draw 1 triangle + DrawAttrs.NumVertices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.FirstInstanceLocation = 2; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; @@ -496,63 +496,58 @@ void TestDrawCommands::Draw() m_pDeviceContext->SetIndexBuffer(m_pIndexBuff, 0, RESOURCE_STATE_TRANSITION_MODE_VERIFY); // 0,1 { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 2,3: test index buffer offset m_pDeviceContext->SetIndexBuffer( m_pIndexBuff, 2 * 3 * sizeof( Uint32 ), RESOURCE_STATE_TRANSITION_MODE_VERIFY ); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 4,5: test vertex buffer offset Offsets[0] += 2*3 * Strides[0]; m_pDeviceContext->SetVertexBuffers(0, 2, pBuffs, Offsets, RESOURCE_STATE_TRANSITION_MODE_VERIFY, SET_VERTEX_BUFFERS_FLAG_RESET); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 6,7: test instance buffer offset Offsets[1] += 2 * Strides[1]; m_pDeviceContext->SetVertexBuffers(0, 2, pBuffs, Offsets, RESOURCE_STATE_TRANSITION_MODE_VERIFY, SET_VERTEX_BUFFERS_FLAG_RESET); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 8,9: test first index location { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.FirstIndexLocation = 2*3; - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } NumTestTrianglesInRow[5] = 10; @@ -567,64 +562,59 @@ void TestDrawCommands::Draw() m_pDeviceContext->SetIndexBuffer(m_pIndexBuff, 0, RESOURCE_STATE_TRANSITION_MODE_VERIFY); // 0,1 { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 2,3 { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.FirstInstanceLocation = 2; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 4,5: test index buffer offset m_pDeviceContext->SetIndexBuffer( m_pIndexBuff, 2 * 3 * sizeof( Uint32 ), RESOURCE_STATE_TRANSITION_MODE_VERIFY ); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.FirstInstanceLocation = 2; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 6,7: test instance buffer offset Offsets[1] += Strides[1] * 2; m_pDeviceContext->SetVertexBuffers(0, 2, pBuffs, Offsets, RESOURCE_STATE_TRANSITION_MODE_VERIFY, SET_VERTEX_BUFFERS_FLAG_RESET); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.FirstInstanceLocation = 2; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 8,9: test first index location { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.FirstInstanceLocation = 2; DrawAttrs.FirstIndexLocation = 2*3; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } NumTestTrianglesInRow[6] = 10; @@ -638,65 +628,60 @@ void TestDrawCommands::Draw() m_pDeviceContext->SetIndexBuffer(m_pIndexBuff, 0, RESOURCE_STATE_TRANSITION_MODE_VERIFY); // 0,1 { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 2,3 { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.BaseVertex = 2*3; - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 4,5: test index buffer offset m_pDeviceContext->SetIndexBuffer( m_pIndexBuff, 2 * 3 * sizeof( Uint32 ), RESOURCE_STATE_TRANSITION_MODE_VERIFY ); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.BaseVertex = 2*3; - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 6,7: test instance buffer offset Offsets[1] += Strides[1] * 2; m_pDeviceContext->SetVertexBuffers(0, 2, pBuffs, Offsets, RESOURCE_STATE_TRANSITION_MODE_VERIFY, SET_VERTEX_BUFFERS_FLAG_RESET); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.BaseVertex = 2*3; - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 8,9: Test first index location { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances DrawAttrs.BaseVertex = 2*3; - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.FirstIndexLocation = 2*3; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } NumTestTrianglesInRow[7] = 10; @@ -710,69 +695,64 @@ void TestDrawCommands::Draw() m_pDeviceContext->SetIndexBuffer(m_pIndexBuff, 0, RESOURCE_STATE_TRANSITION_MODE_VERIFY); // 0,1 { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 2,3 { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.BaseVertex = 3; DrawAttrs.FirstInstanceLocation = 1; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 4,5: test index buffer offset m_pDeviceContext->SetIndexBuffer( m_pIndexBuff, 2 * 3 * sizeof( Uint32 ), RESOURCE_STATE_TRANSITION_MODE_VERIFY ); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.BaseVertex = 3; DrawAttrs.FirstInstanceLocation = 1; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 6,7: test instance buffer offset Offsets[1] += Strides[1] * 2; m_pDeviceContext->SetVertexBuffers(0, 2, pBuffs, Offsets, RESOURCE_STATE_TRANSITION_MODE_VERIFY, SET_VERTEX_BUFFERS_FLAG_RESET); { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.BaseVertex = 3; DrawAttrs.FirstInstanceLocation = 1; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } // 8,9: test first index location { - DrawAttribs DrawAttrs; + DrawIndexedAttribs DrawAttrs; DrawAttrs.NumIndices = 3; // Draw 1 triangle DrawAttrs.NumInstances = 2; // Draw 2 instances - DrawAttrs.IsIndexed = true; DrawAttrs.BaseVertex = 3; DrawAttrs.FirstInstanceLocation = 1; DrawAttrs.IndexType = VT_UINT32; DrawAttrs.FirstIndexLocation = 2*3; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexed(DrawAttrs); } NumTestTrianglesInRow[8] = 10; @@ -796,8 +776,8 @@ void TestDrawCommands::Draw() MappedData[3] = 0; // Start instance MappedData.Unmap(); - DrawAttribs DrawAttrs(m_pIndirectDrawArgs, DRAW_FLAG_VERIFY_ALL, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); - m_pDeviceContext->Draw(DrawAttrs); + DrawIndirectAttribs DrawAttrs(DRAW_FLAG_VERIFY_ALL, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); + m_pDeviceContext->DrawIndirect(DrawAttrs, m_pIndirectDrawArgs); } // 2,3: test first vertex location @@ -808,8 +788,8 @@ void TestDrawCommands::Draw() MappedData[2] = 3*2; // Start vertex MappedData[3] = 0; // Start instance MappedData.Unmap(); - DrawAttribs DrawAttrs(m_pIndirectDrawArgs, DRAW_FLAG_VERIFY_ALL, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); - m_pDeviceContext->Draw(DrawAttrs); + DrawIndirectAttribs DrawAttrs(DRAW_FLAG_VERIFY_ALL, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); + m_pDeviceContext->DrawIndirect(DrawAttrs, m_pIndirectDrawArgs); } // 4,5: test first instance location @@ -820,11 +800,10 @@ void TestDrawCommands::Draw() MappedData[2] = 3*2; // Start vertex MappedData[3] = 2; // Start instance MappedData.Unmap(); - DrawAttribs DrawAttrs; - DrawAttrs.pIndirectDrawAttribs = m_pIndirectDrawArgs; + DrawIndirectAttribs DrawAttrs; DrawAttrs.IndirectAttribsBufferStateTransitionMode = RESOURCE_STATE_TRANSITION_MODE_VERIFY; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndirect(DrawAttrs, m_pIndirectDrawArgs); } NumTestTrianglesInRow[9] = 6; @@ -849,8 +828,8 @@ void TestDrawCommands::Draw() MappedData[4] = 0; // Start instance MappedData.Unmap(); - DrawAttribs DrawAttrs(m_pIndexedIndirectDrawArgs, VT_UINT32, DRAW_FLAG_VERIFY_ALL, RESOURCE_STATE_TRANSITION_MODE_VERIFY); - m_pDeviceContext->Draw(DrawAttrs); + DrawIndexedIndirectAttribs DrawAttrs(VT_UINT32, DRAW_FLAG_VERIFY_ALL, RESOURCE_STATE_TRANSITION_MODE_VERIFY); + m_pDeviceContext->DrawIndexedIndirect(DrawAttrs, m_pIndexedIndirectDrawArgs); } // 2,3: test start index location @@ -863,13 +842,11 @@ void TestDrawCommands::Draw() MappedData[4] = 0; // Start instance MappedData.Unmap(); - DrawAttribs DrawAttrs; - DrawAttrs.IsIndexed = true; + DrawIndexedIndirectAttribs DrawAttrs; DrawAttrs.IndexType = VT_UINT32; - DrawAttrs.pIndirectDrawAttribs = m_pIndexedIndirectDrawArgs; DrawAttrs.IndirectAttribsBufferStateTransitionMode = RESOURCE_STATE_TRANSITION_MODE_VERIFY; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexedIndirect(DrawAttrs, m_pIndexedIndirectDrawArgs); } // 4,5: test base vertex @@ -882,13 +859,11 @@ void TestDrawCommands::Draw() MappedData[4] = 0; // Start instance MappedData.Unmap(); - DrawAttribs DrawAttrs; - DrawAttrs.IsIndexed = true; + DrawIndexedIndirectAttribs DrawAttrs; DrawAttrs.IndexType = VT_UINT32; - DrawAttrs.pIndirectDrawAttribs = m_pIndexedIndirectDrawArgs; DrawAttrs.IndirectAttribsBufferStateTransitionMode = RESOURCE_STATE_TRANSITION_MODE_VERIFY; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexedIndirect(DrawAttrs, m_pIndexedIndirectDrawArgs); } // 6,7: test start instance @@ -901,13 +876,11 @@ void TestDrawCommands::Draw() MappedData[4] = 2; // Start instance MappedData.Unmap(); - DrawAttribs DrawAttrs; - DrawAttrs.IsIndexed = true; + DrawIndexedIndirectAttribs DrawAttrs; DrawAttrs.IndexType = VT_UINT32; - DrawAttrs.pIndirectDrawAttribs = m_pIndexedIndirectDrawArgs; DrawAttrs.IndirectAttribsBufferStateTransitionMode = RESOURCE_STATE_TRANSITION_MODE_VERIFY; DrawAttrs.Flags = DRAW_FLAG_VERIFY_ALL; - m_pDeviceContext->Draw(DrawAttrs); + m_pDeviceContext->DrawIndexedIndirect(DrawAttrs, m_pIndexedIndirectDrawArgs); } NumTestTrianglesInRow[10] = 8; } |
