@@ -1522,37 +1522,46 @@ SDL_GPURenderPass *SDL_BeginGPURenderPass(
1522
1522
1523
1523
if (color_target_infos [i ].cycle && color_target_infos [i ].load_op == SDL_GPU_LOADOP_LOAD ) {
1524
1524
SDL_assert_release (!"Cannot cycle color target when load op is LOAD!" );
1525
+ return NULL ;
1525
1526
}
1526
1527
1527
1528
if (color_target_infos [i ].store_op == SDL_GPU_STOREOP_RESOLVE || color_target_infos [i ].store_op == SDL_GPU_STOREOP_RESOLVE_AND_STORE ) {
1528
1529
if (color_target_infos [i ].resolve_texture == NULL ) {
1529
1530
SDL_assert_release (!"Store op is RESOLVE or RESOLVE_AND_STORE but resolve_texture is NULL!" );
1531
+ return NULL ;
1530
1532
} else {
1531
1533
TextureCommonHeader * resolveTextureHeader = (TextureCommonHeader * )color_target_infos [i ].resolve_texture ;
1532
1534
if (textureHeader -> info .sample_count == SDL_GPU_SAMPLECOUNT_1 ) {
1533
1535
SDL_assert_release (!"Store op is RESOLVE or RESOLVE_AND_STORE but texture is not multisample!" );
1536
+ return NULL ;
1534
1537
}
1535
1538
if (resolveTextureHeader -> info .sample_count != SDL_GPU_SAMPLECOUNT_1 ) {
1536
1539
SDL_assert_release (!"Resolve texture must have a sample count of 1!" );
1540
+ return NULL ;
1537
1541
}
1538
1542
if (resolveTextureHeader -> info .format != textureHeader -> info .format ) {
1539
1543
SDL_assert_release (!"Resolve texture must have the same format as its corresponding color target!" );
1544
+ return NULL ;
1540
1545
}
1541
1546
if (resolveTextureHeader -> info .type == SDL_GPU_TEXTURETYPE_3D ) {
1542
1547
SDL_assert_release (!"Resolve texture must not be of TEXTURETYPE_3D!" );
1548
+ return NULL ;
1543
1549
}
1544
1550
if (!(resolveTextureHeader -> info .usage & SDL_GPU_TEXTUREUSAGE_COLOR_TARGET )) {
1545
1551
SDL_assert_release (!"Resolve texture usage must include COLOR_TARGET!" );
1552
+ return NULL ;
1546
1553
}
1547
1554
}
1548
1555
}
1549
1556
1550
1557
if (color_target_infos [i ].layer_or_depth_plane >= textureHeader -> info .layer_count_or_depth ) {
1551
1558
SDL_assert_release (!"Color target layer index must be less than the texture's layer count!" );
1559
+ return NULL ;
1552
1560
}
1553
1561
1554
1562
if (color_target_infos [i ].mip_level >= textureHeader -> info .num_levels ) {
1555
1563
SDL_assert_release (!"Color target mip level must be less than the texture's level count!" );
1564
+ return NULL ;
1556
1565
}
1557
1566
}
1558
1567
@@ -1561,17 +1570,20 @@ SDL_GPURenderPass *SDL_BeginGPURenderPass(
1561
1570
TextureCommonHeader * textureHeader = (TextureCommonHeader * )depth_stencil_target_info -> texture ;
1562
1571
if (!(textureHeader -> info .usage & SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET )) {
1563
1572
SDL_assert_release (!"Depth target must have been created with the DEPTH_STENCIL_TARGET usage flag!" );
1573
+ return NULL ;
1564
1574
}
1565
1575
1566
1576
if (depth_stencil_target_info -> cycle && (depth_stencil_target_info -> load_op == SDL_GPU_LOADOP_LOAD || depth_stencil_target_info -> stencil_load_op == SDL_GPU_LOADOP_LOAD )) {
1567
1577
SDL_assert_release (!"Cannot cycle depth target when load op or stencil load op is LOAD!" );
1578
+ return NULL ;
1568
1579
}
1569
1580
1570
1581
if (depth_stencil_target_info -> store_op == SDL_GPU_STOREOP_RESOLVE ||
1571
1582
depth_stencil_target_info -> stencil_store_op == SDL_GPU_STOREOP_RESOLVE ||
1572
1583
depth_stencil_target_info -> store_op == SDL_GPU_STOREOP_RESOLVE_AND_STORE ||
1573
1584
depth_stencil_target_info -> stencil_store_op == SDL_GPU_STOREOP_RESOLVE_AND_STORE ) {
1574
1585
SDL_assert_release (!"RESOLVE store ops are not supported for depth-stencil targets!" );
1586
+ return NULL ;
1575
1587
}
1576
1588
}
1577
1589
}
@@ -2093,10 +2105,12 @@ SDL_GPUComputePass *SDL_BeginGPUComputePass(
2093
2105
2094
2106
if (storage_texture_bindings [i ].layer >= header -> info .layer_count_or_depth ) {
2095
2107
SDL_assert_release (!"Storage texture layer index must be less than the texture's layer count!" );
2108
+ return NULL ;
2096
2109
}
2097
2110
2098
2111
if (storage_texture_bindings [i ].mip_level >= header -> info .num_levels ) {
2099
2112
SDL_assert_release (!"Storage texture mip level must be less than the texture's level count!" );
2113
+ return NULL ;
2100
2114
}
2101
2115
}
2102
2116
0 commit comments