@@ -371,7 +371,7 @@ class MTLDevice : public offloadtest::Device {
371371 if (TableSize > 0 ) {
372372 IS.ArgBuffer =
373373 Device->newBuffer (TableSize, MTL::ResourceStorageModeManaged);
374- const uint32_t HeapIndex = 0 ;
374+ uint32_t HeapIndex = 0 ;
375375 for (auto &D : P.Sets ) {
376376 for (auto &R : D.Resources ) {
377377 if (auto Err = createDescriptor (R, IS, HeapIndex++))
@@ -506,8 +506,8 @@ class MTLDevice : public offloadtest::Device {
506506 MTL::RenderPassDescriptor *Desc =
507507 MTL::RenderPassDescriptor::alloc ()->init ();
508508
509- const uint64_t Width = P. Bindings . RTargetBufferPtr -> OutputProps .Width ;
510- const uint64_t Height = P. Bindings . RTargetBufferPtr -> OutputProps .Height ;
509+ const uint64_t Width = IS. FrameBufferTexture -> Desc .Width ;
510+ const uint64_t Height = IS. FrameBufferTexture -> Desc .Height ;
511511
512512 // Color attachment.
513513 auto *CADesc = MTL::RenderPassColorAttachmentDescriptor::alloc ()->init ();
@@ -576,7 +576,7 @@ class MTLDevice : public offloadtest::Device {
576576
577577 // Blit the render target into the readback buffer for CPU access.
578578 MTL::BlitCommandEncoder *Blit = IS.CmdBuffer ->blitCommandEncoder ();
579- const size_t ElemSize = RTarget-> getElementSize ( );
579+ const size_t ElemSize = getFormatSize (IS. FrameBufferTexture -> Desc . Format );
580580 const size_t RowBytes = Width * ElemSize;
581581 Blit->copyFromTexture (IS.FrameBufferTexture ->Tex , 0 , 0 ,
582582 MTL::Origin (0 , 0 , 0 ), MTL::Size (Width, Height, 1 ),
@@ -599,8 +599,8 @@ class MTLDevice : public offloadtest::Device {
599599 }
600600
601601 llvm::Error copyBack (Pipeline &P, InvocationState &IS) {
602- const uint32_t TextureIndex = 0 ;
603- const uint32_t BufferIndex = 0 ;
602+ uint32_t TextureIndex = 0 ;
603+ uint32_t BufferIndex = 0 ;
604604 for (auto &D : P.Sets ) {
605605 for (auto &R : D.Resources ) {
606606 assert (R.BufferPtr ->ArraySize == 1 &&
0 commit comments