소스 검색

vulkan: fix vkResetDescriptorPool validation error

Sasha Szpakowski 7 달 전
부모
커밋
0d21908b7e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/modules/graphics/vulkan/Shader.cpp

+ 1 - 1
src/modules/graphics/vulkan/Shader.cpp

@@ -107,7 +107,7 @@ void SharedDescriptorPools::newFrame(uint64 frameIndex)
 	if (!lastFrameIndex.hasValue || lastFrameIndex.value != frameIndex)
 	{
 		lastFrameIndex.set(frameIndex);
-		currentFrame = (size_t)(frameIndex % MAX_FRAMES_IN_FLIGHT);
+		currentFrame = (size_t)((currentFrame + 1) % MAX_FRAMES_IN_FLIGHT);
 		currentPool = 0;
 		for (VkDescriptorPool pool : pools[currentFrame])
 			vkResetDescriptorPool(device, pool, 0);