|
395 | 395 | if(ptDesc->ptSwapchain) |
396 | 396 | { |
397 | 397 | uCount = ptDesc->ptSwapchain->uImageCount; |
| 398 | + pl_sb_reset(gptGraphics->sbtMainRenderPassHandles); |
398 | 399 | pl_sb_push(gptGraphics->sbtMainRenderPassHandles, tHandle); |
399 | 400 | } |
400 | 401 |
|
|
1765 | 1766 |
|
1766 | 1767 | bool bMSAAChange = ptSwap->tInfo.tSampleCount != ptInit->tSampleCount; |
1767 | 1768 |
|
1768 | | - gptGraphics->uCurrentFrameIndex = 0; |
| 1769 | + // gptGraphics->uCurrentFrameIndex = 0; |
1769 | 1770 | ptSwap->tInfo.bVSync = ptInit->bVSync; |
1770 | 1771 | ptSwap->tInfo.uWidth = ptInit->uWidth; |
1771 | 1772 | ptSwap->tInfo.uHeight = ptInit->uHeight; |
|
1775 | 1776 |
|
1776 | 1777 | if(bMSAAChange) |
1777 | 1778 | { |
1778 | | - uint32_t uNextFrameIndex = (gptGraphics->uCurrentFrameIndex + 1) % gptGraphics->uFramesInFlight; |
1779 | | - plFrameContext* ptFrame1 = &ptSwap->ptDevice->sbtFrames[uNextFrameIndex]; |
| 1779 | + // uint32_t uNextFrameIndex = (gptGraphics->uCurrentFrameIndex + 1) % gptGraphics->uFramesInFlight; |
| 1780 | + // plFrameContext* ptFrame1 = &ptSwap->ptDevice->sbtFrames[uNextFrameIndex]; |
1780 | 1781 | plFrameContext* ptFrame0 = pl__get_frame_resources(ptSwap->ptDevice); |
1781 | 1782 | // dispatch_semaphore_wait(ptFrame->tFrameBoundarySemaphore, DISPATCH_TIME_FOREVER); |
1782 | 1783 |
|
1783 | 1784 | dispatch_semaphore_signal(ptFrame0->tFrameBoundarySemaphore); |
1784 | | - dispatch_semaphore_signal(ptFrame1->tFrameBoundarySemaphore); |
| 1785 | + // // dispatch_semaphore_signal(ptFrame1->tFrameBoundarySemaphore); |
1785 | 1786 | } |
1786 | 1787 | } |
1787 | 1788 |
|
|
1860 | 1861 |
|
1861 | 1862 | // Wait until the inflight command buffer has completed its work |
1862 | 1863 | // gptGraphics->tSwapchain.uCurrentImageIndex = gptGraphics->uCurrentFrameIndex; |
| 1864 | + gptGraphics->uCurrentFrameIndex = (gptGraphics->uCurrentFrameIndex + 1) % gptGraphics->uFramesInFlight; |
1863 | 1865 | plFrameContext* ptFrame = pl__get_frame_resources(ptDevice); |
1864 | 1866 |
|
1865 | 1867 | dispatch_semaphore_wait(ptFrame->tFrameBoundarySemaphore, DISPATCH_TIME_FOREVER); |
|
1971 | 1973 |
|
1972 | 1974 | [ptCommandBuffer->tCmdBuffer commit]; |
1973 | 1975 |
|
1974 | | - gptGraphics->uCurrentFrameIndex = (gptGraphics->uCurrentFrameIndex + 1) % gptGraphics->uFramesInFlight; |
1975 | 1976 | return true; |
1976 | 1977 | } |
1977 | 1978 |
|
|
3346 | 3347 | pl_sb_push(ptDevice->sbtSamplerFreeIndices, iResourceIndex); |
3347 | 3348 | } |
3348 | 3349 |
|
3349 | | - for(uint32_t i = 0; i < pl_sb_size(ptGarbage->sbtTextures); i++) |
| 3350 | + |
| 3351 | + const uint32_t uTextureCount = pl_sb_size(ptGarbage->sbtTextures); |
| 3352 | + for(uint32_t i = 0; i < uTextureCount; i++) |
3350 | 3353 | { |
3351 | 3354 | const uint16_t uTextureIndex = ptGarbage->sbtTextures[i].uIndex; |
3352 | 3355 | plMetalTexture* ptMetalTexture = &ptDevice->sbtTexturesHot[uTextureIndex]; |
|
0 commit comments