@@ -354,7 +354,7 @@ struct AssignValsFromLayoutContext
354
354
if (field.name .getLength () == 0 )
355
355
{
356
356
// If no name was given, assume by-indexing matching is requested
357
- auto fieldCursor = dstCursor.getElement ((GfxIndex )fieldIndex);
357
+ auto fieldCursor = dstCursor.getElement ((uint32_t )fieldIndex);
358
358
if (!fieldCursor.isValid ())
359
359
{
360
360
StdWriters::getError ().print (
@@ -969,15 +969,9 @@ Result RenderTestApp::update()
969
969
auto encoder = m_queue->createCommandEncoder ();
970
970
if (m_options.shaderType == Options::ShaderProgramType::Compute)
971
971
{
972
- auto rootObject = m_device->createRootShaderObject (m_pipeline);
973
- applyBinding (rootObject);
974
- rootObject->finalize ();
975
-
976
972
auto passEncoder = encoder->beginComputePass ();
977
- ComputeState state;
978
- state.pipeline = static_cast <IComputePipeline*>(m_pipeline.get ());
979
- state.rootObject = rootObject;
980
- passEncoder->setComputeState (state);
973
+ auto rootObject = passEncoder->bindPipeline (static_cast <IComputePipeline*>(m_pipeline.get ()));
974
+ applyBinding (rootObject);
981
975
passEncoder->dispatchCompute (
982
976
m_options.computeDispatchSize [0 ],
983
977
m_options.computeDispatchSize [1 ],
@@ -986,11 +980,6 @@ Result RenderTestApp::update()
986
980
}
987
981
else
988
982
{
989
- auto rootObject = m_device->createRootShaderObject (m_pipeline);
990
- applyBinding (rootObject);
991
- setProjectionMatrix (rootObject);
992
- rootObject->finalize ();
993
-
994
983
RenderPassColorAttachment colorAttachment = {};
995
984
colorAttachment.view = m_colorBufferView;
996
985
colorAttachment.loadOp = LoadOp::Clear;
@@ -1005,10 +994,11 @@ Result RenderTestApp::update()
1005
994
renderPass.depthStencilAttachment = &depthStencilAttachment;
1006
995
1007
996
auto passEncoder = encoder->beginRenderPass (renderPass);
997
+ auto rootObject = passEncoder->bindPipeline (static_cast <IRenderPipeline*>(m_pipeline.get ()));
998
+ applyBinding (rootObject);
999
+ setProjectionMatrix (rootObject);
1008
1000
1009
1001
RenderState state;
1010
- state.pipeline = static_cast <IRenderPipeline*>(m_pipeline.get ());
1011
- state.rootObject = rootObject;
1012
1002
state.viewports [0 ] = Viewport ((float )gWindowWidth , (float )gWindowHeight );
1013
1003
state.viewportCount = 1 ;
1014
1004
state.scissorRects [0 ] = ScissorRect (gWindowWidth , gWindowHeight );
0 commit comments