File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1546,6 +1546,14 @@ SDL_GPURenderPass *SDL_BeginGPURenderPass(
15461546 }
15471547 }
15481548 }
1549+
1550+ if (color_target_infos [i ].layer_or_depth_plane >= textureHeader -> info .layer_count_or_depth ) {
1551+ SDL_assert_release (!"Color target layer index must be less than the texture's layer count!" );
1552+ }
1553+
1554+ if (color_target_infos [i ].mip_level >= textureHeader -> info .num_levels ) {
1555+ SDL_assert_release (!"Color target mip level must be less than the texture's level count!" );
1556+ }
15491557 }
15501558
15511559 if (depth_stencil_target_info != NULL ) {
@@ -2082,6 +2090,14 @@ SDL_GPUComputePass *SDL_BeginGPUComputePass(
20822090 SDL_assert_release (!"Texture must be created with COMPUTE_STORAGE_WRITE or COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE flag" );
20832091 return NULL ;
20842092 }
2093+
2094+ if (storage_texture_bindings [i ].layer >= header -> info .layer_count_or_depth ) {
2095+ SDL_assert_release (!"Storage texture layer index must be less than the texture's layer count!" );
2096+ }
2097+
2098+ if (storage_texture_bindings [i ].mip_level >= header -> info .num_levels ) {
2099+ SDL_assert_release (!"Storage texture mip level must be less than the texture's level count!" );
2100+ }
20852101 }
20862102
20872103 // TODO: validate buffer usage?
You can’t perform that action at this time.
0 commit comments