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(
1546
1546
}
1547
1547
}
1548
1548
}
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
+ }
1549
1557
}
1550
1558
1551
1559
if (depth_stencil_target_info != NULL ) {
@@ -2082,6 +2090,14 @@ SDL_GPUComputePass *SDL_BeginGPUComputePass(
2082
2090
SDL_assert_release (!"Texture must be created with COMPUTE_STORAGE_WRITE or COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE flag" );
2083
2091
return NULL ;
2084
2092
}
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
+ }
2085
2101
}
2086
2102
2087
2103
// TODO: validate buffer usage?
You can’t perform that action at this time.
0 commit comments