File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -7910,15 +7910,17 @@ static void VULKAN_BeginRenderPass(
7910
7910
7911
7911
clearValues = SDL_stack_alloc (VkClearValue , clearCount );
7912
7912
7913
- for (i = 0 ; i < totalColorAttachmentCount ; i += 1 ) {
7914
- clearValues [i ].color .float32 [0 ] = colorTargetInfos [i ].clear_color .r ;
7915
- clearValues [i ].color .float32 [1 ] = colorTargetInfos [i ].clear_color .g ;
7916
- clearValues [i ].color .float32 [2 ] = colorTargetInfos [i ].clear_color .b ;
7917
- clearValues [i ].color .float32 [3 ] = colorTargetInfos [i ].clear_color .a ;
7913
+ int clearIndex = 0 ;
7914
+ for (i = 0 ; i < numColorTargets ; i += 1 ) {
7915
+ clearValues [clearIndex ].color .float32 [0 ] = colorTargetInfos [i ].clear_color .r ;
7916
+ clearValues [clearIndex ].color .float32 [1 ] = colorTargetInfos [i ].clear_color .g ;
7917
+ clearValues [clearIndex ].color .float32 [2 ] = colorTargetInfos [i ].clear_color .b ;
7918
+ clearValues [clearIndex ].color .float32 [3 ] = colorTargetInfos [i ].clear_color .a ;
7919
+ clearIndex += 1 ;
7918
7920
7919
7921
if (colorTargetInfos [i ].store_op == SDL_GPU_STOREOP_RESOLVE || colorTargetInfos [i ].store_op == SDL_GPU_STOREOP_RESOLVE_AND_STORE ) {
7920
7922
// Skip over the resolve texture, we're not clearing it
7921
- i += 1 ;
7923
+ clearIndex += 1 ;
7922
7924
}
7923
7925
}
7924
7926
You can’t perform that action at this time.
0 commit comments