File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -1756,7 +1756,11 @@ void SDL_BindGPUVertexSamplers(
1756
1756
1757
1757
if (RENDERPASS_DEVICE -> debug_mode ) {
1758
1758
CHECK_RENDERPASS
1759
- CHECK_SAMPLER_TEXTURES
1759
+
1760
+ if (!((CommandBufferCommonHeader * )RENDERPASS_COMMAND_BUFFER )-> ignore_render_pass_texture_validation )
1761
+ {
1762
+ CHECK_SAMPLER_TEXTURES
1763
+ }
1760
1764
}
1761
1765
1762
1766
RENDERPASS_DEVICE -> BindVertexSamplers (
@@ -1836,7 +1840,11 @@ void SDL_BindGPUFragmentSamplers(
1836
1840
1837
1841
if (RENDERPASS_DEVICE -> debug_mode ) {
1838
1842
CHECK_RENDERPASS
1839
- CHECK_SAMPLER_TEXTURES
1843
+
1844
+ if (!((CommandBufferCommonHeader * )RENDERPASS_COMMAND_BUFFER )-> ignore_render_pass_texture_validation )
1845
+ {
1846
+ CHECK_SAMPLER_TEXTURES
1847
+ }
1840
1848
}
1841
1849
1842
1850
RENDERPASS_DEVICE -> BindFragmentSamplers (
@@ -2605,11 +2613,19 @@ void SDL_GenerateMipmapsForGPUTexture(
2605
2613
SDL_assert_release (!"GenerateMipmaps texture must be created with SAMPLER and COLOR_TARGET usage flags!" );
2606
2614
return ;
2607
2615
}
2616
+
2617
+ CommandBufferCommonHeader * commandBufferHeader = (CommandBufferCommonHeader * )command_buffer ;
2618
+ commandBufferHeader -> ignore_render_pass_texture_validation = true;
2608
2619
}
2609
2620
2610
2621
COMMAND_BUFFER_DEVICE -> GenerateMipmaps (
2611
2622
command_buffer ,
2612
2623
texture );
2624
+
2625
+ if (COMMAND_BUFFER_DEVICE -> debug_mode ) {
2626
+ CommandBufferCommonHeader * commandBufferHeader = (CommandBufferCommonHeader * )command_buffer ;
2627
+ commandBufferHeader -> ignore_render_pass_texture_validation = false;
2628
+ }
2613
2629
}
2614
2630
2615
2631
void SDL_BlitGPUTexture (
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ typedef struct CommandBufferCommonHeader
66
66
Pass copy_pass ;
67
67
bool swapchain_texture_acquired ;
68
68
bool submitted ;
69
+ // used to avoid tripping assert on GenerateMipmaps
70
+ bool ignore_render_pass_texture_validation ;
69
71
} CommandBufferCommonHeader ;
70
72
71
73
typedef struct TextureCommonHeader
You can’t perform that action at this time.
0 commit comments